1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! TeX-quality display math inside scrolling Ratatui interfaces.
//!
//! `ratatex` turns completed Markdown display-math regions into cell-aligned
//! PNGs on a bounded background worker. It parses, lays out, and rasterizes math
//! in-process with embedded fonts—without a system TeX installation or
//! rendering subprocess. The PNGs are cached on disk, uploaded through the
//! Kitty graphics protocol, and placed with Unicode-placeholder cells. Because
//! the placeholders are ordinary terminal cells, equations naturally scroll,
//! clip, and redraw with the rest of a Ratatui buffer.
//!
//! The crate deliberately leaves surrounding Markdown rendering to the
//! application. Use [`display_math`] to find renderable regions, call
//! [`Ratatex::request`] for each expression, reserve [`Formula::rows`] lines,
//! flush terminal commands when the update callback fires, and render a
//! [`FormulaWidget`] over the reserved cells.
//!
//! For a streaming document, pass a temporary
//! [`heal_streaming_display_math`] view to [`display_math`] and retain the
//! latest ready [`Formula`] while a newer prefix renders. When a formula is
//! partially outside the viewport, use [`SignedPosition`] rather than slicing
//! its placeholder grid; this preserves the Kitty source-tile coordinates.
//! [`FormulaWidget::compact_source_fallback`] swaps the same reserved cells
//! back to selectable LaTeX for a native terminal-selection pass.
pub use ;
pub use ;
pub use is_formula_placeholder;
pub use ;
pub use ;