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
//! Math-label rendering hook (rpic `texlabels` extension).
//!
//! The core stays free of any typesetting dependency: a renderer is a plain
//! function registered once per process (the CLI and bindings register the
//! RaTeX-backed implementation from `rpic-render`; the wasm build registers
//! nothing and math labels fall back to literal text). The hook is
//! deliberately neutral so an alternative backend — e.g. Typst + mitex, the
//! documented second choice in `docs/tex-labels.md` — can slot in without
//! touching the core.
use OnceLock;
/// A typeset math label: a self-contained SVG fragment (glyph paths only,
/// rasterizable with no font database) plus exact metrics in inches.
/// Typeset `tex` (math mode, no delimiters) at the given font size in points.
pub type MathRenderFn = fn ;
static MATH_RENDERER: = new;
/// Register the process-wide math renderer. The first call wins; later calls
/// are ignored (returns whether this call installed the renderer).
/// The registered renderer, if any.
pub