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 rulesreads “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#
Fractions & roots#
16infix \over and friends, fraction styles, root formsams/cfrac-to-fracDrop continued-fraction styling from centered AMS cfrac forms.mathams/dbinom-and-tbinom-to-binomRewrite AMS display-style and text-style binomial commands to binom.readingams/dfrac-to-fracRewrite the AMS display-style fraction command to frac.readingams/tfrac-to-fracRewrite the AMS text-style fraction command to frac.readingbase/above-to-genfracRewrite above to a thickness-preserving genfrac form.render
Symbols & relations#
39one spelling per glyphams/Doteq-to-doteqdotCollapse Doteq to the descriptive doteqdot character.renderams/doublecap-to-CapCollapse doublecap to the more common Cap character.renderams/gggtr-to-gggCollapse gggtr to the shorter ggg character.renderams/llless-to-lllCollapse llless to the shorter lll character.renderams/trianglerighteq-to-unrhdCollapse trianglerighteq to the more common unrhd character.render
Spacing & breaks#
25aliases merged, layout hints droppedams/nobreakspace-to-tildeCollapse nobreakspace to the canonical nonbreaking space token.renderbase/break-to-linebreakCollapse break to the explicit linebreak command.readingbase/newline-to-linebreakCollapse newline to the explicit linebreak command.readingbase/control-space-to-tildeRewrite math-mode control space to the canonical active space token.renderbase/gt-space-to-colon-spaceCollapse \> to the canonical medium math space command \:render
Delimiters & sizing#
17fences and fixed sizesbase/Big-class-variants-to-BigCollapse \Bigl, \Bigr, \Bigm to \Big.readingbase/Bigg-class-variants-to-BiggCollapse \Biggl, \Biggr, \Biggm to \Bigg.readingbase/big-class-variants-to-bigCollapse \bigl, \bigr, \bigm to \big.readingbase/bigg-class-variants-to-biggCollapse \biggl, \biggr, \biggm to \bigg.readingbase/Big-delimiter-size-dropDrop the fixed delimiter size imposed by \Big.reading
Matrices & environments#
17plain-TeX matrices, fenced environmentsams/Bmatrix-env-to-brace-matrixRewrite the fenced Bmatrix environment to explicit braces around a core matrix environment.renderams/Vmatrix-env-to-Vert-matrixRewrite the fenced Vmatrix environment to explicit double bars around a core matrix environment.renderams/bmatrix-env-to-bracket-matrixRewrite the fenced bmatrix environment to explicit brackets around a core matrix environment.renderams/pmatrix-env-to-paren-matrixRewrite the fenced pmatrix environment to explicit parens around a core matrix environment.renderams/vmatrix-env-to-vert-matrixRewrite the fenced vmatrix environment to explicit vertical bars around a core matrix environment.render
Operators & functions#
14named functions, limitsams/operatorname-to-named-functionRewrite plain operatorname arguments to equivalent base named-function or named-operator commands.renderams/idotsint-expandExpand idotsint to explicit repeated integral surfaces.renderbase/limits-dropDrop explicit limits from an audited operator while preserving attached scripts.readingbase/nolimits-dropDrop explicit nolimits from an audited operator while preserving attached scripts.readingphysics/cosine-to-cosCollapse a bare cosine helper to the standard cos operator.render
Derivatives & vectors#
12physics shorthandsphysics/derivative-to-dvCollapse derivative to the compact dv command.renderphysics/functional-derivative-to-fdvCollapse long functional derivative names to the fdv command.renderphysics/partial-derivative-to-pdvCollapse long partial derivative names to the pdv command.renderphysics/vectorarrow-to-vaCollapse vectorarrow to the short va helper.renderphysics/vectorbold-to-vbCollapse vectorbold to the short vb helper.render
Stacks, accents & classes#
7stacked operators, wide accentsams/substack-expandExpand substack directly to the explicit centered subarray environment.renderbase/buildrel-to-stackrelRewrite plain TeX buildrel syntax to stackrel.renderbase/duplicate-mathrel-wrapper-dropDrop one directly nested duplicate mathrel wrapper.renderbase/widehat-to-hatDrop stretchiness from \widehat by rewriting it to \hat.mathbase/widetilde-to-tildeDrop stretchiness from \widetilde by rewriting it to \tilde.math
Dirac & commutators#
7bra–ket and bracketsphysics/expectation-expandExpand expectation-value helpers to explicit angle brackets.renderphysics/matrixel-expandExpand matrix elements to explicit angle-bracket and bar fences.renderphysics/physics-bra-expandExpand bra to an explicit angle-bracket and bar fence form.renderphysics/physics-braket-expandExpand braket to an explicit angle-bracket form with a middle bar.renderphysics/physics-ket-expandExpand ket to an explicit bar and angle-bracket fence form.render