Expand description
Math-body language support for mdwright.
mdwright-latex owns the volatile language machinery for both
TeX-like math bodies and parser-backed Unicode mathematical source:
lexing, parsing, command vocabulary, Unicode terminal layout, and
source translation. Markdown delimiter recognition stays in
mdwright-math; command-line delivery stays in mdwright.
The public surface is intentionally narrow. Parser, registry, layout, and translation complexity stays behind result and diagnostic types rather than exposing lexer tokens or AST nodes.
Structs§
- Command
Info - Public, copyable view of one command registry entry.
- Latex
Error - Typed TeX math-body error with source coordinates.
- Rendered
Latex - Unicode layout output for a TeX math body.
- Source
Span - Byte span in the original math body.
- Translation
- Source translation output.
- Translation
Loss - Loss marker recorded when a source translation cannot be exact.
Enums§
- Argument
Shape - Argument shape for a command or environment.
- Command
Category - MathJax-style command category.
- Command
Event - One event from a left-to-right walk of math-body source.
- Latex
Error Kind - Category of TeX math-body failure.
- Support
Status - Whether mdwright can currently interpret a known command.
- Translation
Status - Coarse translation outcome.
Functions§
- inspect_
math_ body - Walk
sourceas a TeX math body and return the command-usage event stream. - is_
known_ unsupported_ command - Return whether a command is known but outside mdwright’s Unicode subset.
- latex_
symbol - Return the Unicode symbol for a direct LaTeX command.
- lookup_
command - Look up a MathJax-style command by name without a leading backslash.
- render_
unicode_ math - Render one TeX math body as terminal-friendly Unicode.
- translate_
latex_ ranges_ to_ unicode - Translate delimiter-excluded LaTeX math body ranges inside a larger source.
- translate_
latex_ to_ unicode - Translate one LaTeX math body to editable Unicode math source.
- translate_
unicode_ ranges_ to_ latex - Translate delimiter-excluded Unicode math body ranges inside a larger source.
- translate_
unicode_ to_ latex - Translate one Unicode math body to preferred LaTeX source.
- unicode_
sub - Unicode subscript for a single ASCII character.
- unicode_
sub_ latex - Preferred ASCII source for one Unicode subscript character.
- unicode_
sub_ str - Render a whole script string as Unicode subscript.
- unicode_
super - Unicode superscript for a single ASCII character.
- unicode_
super_ latex - Preferred ASCII source for one Unicode superscript character.
- unicode_
super_ str - Render a whole script string as Unicode superscript.
- unicode_
symbol_ latex - Return one preferred LaTeX command name for a Unicode symbol.