tui-math 0.1.1

Render LaTeX math beautifully in terminal UIs with ratatui
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Debug MathML output

use latex2mathml::{latex_to_mathml, DisplayStyle};

fn main() {
    let formulas = [
        ("derivative", r"\frac{d}{dx} x^n = nx^{n-1}"),
        ("sum", r"\sum_{n=1}^{\infty} \frac{1}{n^2}"),
    ];

    for (name, latex) in formulas {
        println!("=== {} ===", name);
        println!("LaTeX: {}", latex);
        let mathml = latex_to_mathml(latex, DisplayStyle::Inline).unwrap();
        println!("MathML:\n{}\n", mathml);
    }
}