Skip to main content

Crate mdwright_latex

Crate mdwright_latex 

Source
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§

CommandInfo
Public, copyable view of one command registry entry.
LatexError
Typed TeX math-body error with source coordinates.
RenderedLatex
Unicode layout output for a TeX math body.
SourceSpan
Byte span in the original math body.
Translation
Source translation output.
TranslationLoss
Loss marker recorded when a source translation cannot be exact.

Enums§

ArgumentShape
Argument shape for a command or environment.
CommandCategory
MathJax-style command category.
CommandEvent
One event from a left-to-right walk of math-body source.
LatexErrorKind
Category of TeX math-body failure.
SupportStatus
Whether mdwright can currently interpret a known command.
TranslationStatus
Coarse translation outcome.

Functions§

inspect_math_body
Walk source as 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.