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§
- Canvas
Math Widget - 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).
- Math
Renderer - Math renderer that converts LaTeX/MathML to Unicode terminal output
- Math
Widget - A ratatui widget for rendering LaTeX math expressions
- Math
Widget State - A stateful version of MathWidget that caches the rendered output
- Stateful
Math Widget - Stateful math widget that uses cached rendering
Enums§
- Render
Error - 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