Skip to main content

Module parser

Module parser 

Source
Expand description

LaTeX math → MathNode AST. LaTeX math → MathNode AST.

Pipeline: preprocesstokenize → typed parse. Unknown or unsupported input is ParseError, never a silent partial tree.

Enums§

AccentKind
Accent or decoration applied to a nucleus.
AtomKind
TeX math atom class (Appendix G).
ColSpec
One column of an {array} preamble (l, c, r, |).
DelimSize
\big / \Big / \bigg / \Bigg (and l/r/m siblings).
Delimiter
A \left / \right delimiter (or . for empty).
EnvRow
One row of a matrix / alignment environment.
EqNumber
Per-row equation number in numbered environments.
IntegralKind
Which integral glyph.
MathNode
Typed math-mode syntax tree.
MatrixStyle
Matrix / alignment environment.
PhantomKind
\phantom / \vphantom / \hphantom.
SpaceKind
Horizontal skip.
TextStyle
Font / text style for a run of characters.
Token
A single TeX-style math token.

Functions§

format_tokens
Format a token stream as a gold-stable string.
parse
Parse a LaTeX math string into a MathNode using a fresh color table.
parse_with_colors
Parse a math string, returning the AST and the color table after \definecolor.
preprocess
Normalize raw math input for the tokenizer.
tokenize
Tokenize a LaTeX math string. Whitespace and % line comments are skipped.