Skip to main content

Crate tui_math

Crate tui_math 

Source
Expand description

§tui-math

Render LaTeX math beautifully in terminal UIs with ratatui.

§Example

use tui_math::{MathWidget, render_latex};

// Render LaTeX to Unicode string
let rendered = render_latex(r"\frac{x^2 + 1}{y}").unwrap();
println!("{}", rendered);

// Or use as a ratatui widget
let widget = MathWidget::new(r"\int_0^\infty e^{-x^2} dx");

Structs§

CanvasMathWidget
A high-resolution math widget using Canvas with Braille markers for lines
MathBox
Represents a box of grapheme clusters for rendering math expressions. Uses a 2D grid with baseline tracking for proper vertical alignment. Each cell holds a grapheme cluster (base char + combining marks).
MathRenderer
Math renderer that converts LaTeX/MathML to Unicode terminal output
MathWidget
A ratatui widget for rendering LaTeX math expressions
MathWidgetState
A stateful version of MathWidget that caches the rendered output
StatefulMathWidget
Stateful math widget that uses cached rendering

Enums§

RenderError
Errors that can occur during math rendering

Functions§

render_latex
Render LaTeX math to a Unicode string for terminal display
render_mathml
Render MathML to a Unicode string for terminal display