Skip to main content

Crate mdwright_mathrender

Crate mdwright_mathrender 

Source
Expand description

Math-renderer compatibility profiles and math-body checking.

mdwright-latex owns the TeX vocabulary and the math-body lexer; this crate owns the renderer question: given a configured profile, which commands and environments in a body would actually render? The tables and the package-mask machinery stay private; the public surface is a Renderer enum, a RenderProfile builder, a single check_math_body function, and a small RenderIssue enum.

Today MathJax v3 and KaTeX are modeled. Adding a new renderer (MathJax v4, typst, …) happens by adding a Renderer variant, a constructor on RenderProfile, and a new pair of overlay tables in tables.

Structs§

RenderProfile
A configured renderer profile: which renderer, which packages it has loaded, and which user-declared macros are in scope.
SourceSpan
Byte span in the original math body.

Enums§

RenderIssue
One compatibility issue found in a math body. Spans are byte ranges into the math-body source given to check_math_body.
Renderer
Math renderer that consumes the TeX-shaped source.

Functions§

check_math_body
Check source (one math body, no enclosing delimiters) against profile.