Skip to main content

Crate term_maths

Crate term_maths 

Source
Expand description

§term-maths

Character-grid mathematical notation renderer for terminals.

Accepts LaTeX math input and renders it as 2D Unicode character art suitable for display in a terminal. Targets JuliaMono as the recommended font.

§Quick Start

let block = term_maths::render(r"\frac{a}{b}");
println!("{}", block);
//  a
// ───
//  b

§Output Backends

  • Plain text — always available via render() and Display
  • crossterm — direct terminal output (feature crossterm)
  • ratatui — TUI widget (feature ratatui)
  • LaTeX round-trip — serialise back to LaTeX via to_latex()

Re-exports§

pub use latex_renderer::LatexRenderer;
pub use rendered_block::RenderedBlock;
pub use renderer::MathRenderer;
pub use renderer::TerminalRenderer;

Modules§

latex_renderer
LaTeX renderer — serialises an EqNode AST back to a LaTeX string.
layout
mathfont
Unicode Mathematical Alphanumeric Symbols mapping (U+1D400–U+1D7FF).
rendered_block
renderer
Output backend trait and implementations.

Functions§

render
Parse a LaTeX math string and render it as a 2D character grid.
to_latex
Parse a LaTeX math string and serialise it back to LaTeX (round-trip).