Overview

Rewrite Rules

154 rewrite rules with declarative rewrite patterns and render-validated examples.

Rewrite rules convert LaTeX math into canonical forms. Each rule declares a level and a fidelity. A profile applies every rule whose level it accepts, so the four profiles form a ladder: authoring ⊂ faithful ⊂ corpus ⊂ equiv.

Rules run in the Rewrite stage. A profile's rule level determines which rules are enabled; use disable_rules to disable individual keys.

Level — the earliest profile that enables a rule

Authoring71 rulesFaithful51 rulesCorpus17 rulesEquiv15 rules

reads “enters at Corpus, stays on in Equiv”.

Fidelity — the weakest equivalence a rule guarantees

render
Preserves rendering under the reference renderer.
reading
Preserves notation, reading order, and structural roles.
math
Preserves mathematical meaning.

All rules#

154 of 154

Fractions & roots#

16infix \over and friends, fraction styles, root forms

Symbols & relations#

39one spelling per glyph

Spacing & breaks#

25aliases merged, layout hints dropped

Delimiters & sizing#

17fences and fixed sizes

Matrices & environments#

17plain-TeX matrices, fenced environments

Operators & functions#

14named functions, limits

Derivatives & vectors#

12physics shorthands

Stacks, accents & classes#

7stacked operators, wide accents

Dirac & commutators#

7bra–ket and brackets