Rewrite Rulesams/dfrac-to-frac

ams/dfrac-to-frac

Rewrite the AMS display-style fraction command to frac.

Rewrite patterns#

  1. \dfrac{#1}{#2}\frac{#1}{#2}

Examples#

Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.

Plain#

Before

x+\dfrac{1}{2}

After this rule

x+\frac{1}{2}

The rendered result has pixel differences from the input.

Script#

Before

x_{\dfrac{1}{2}}

After this rule

x_{\frac{1}{2}}

The rendered result has pixel differences from the input.

Same family#

Notes#

AMS defines dfrac as genfrac style 0, while frac inherits its surrounding style. The rewrite preserves fraction notation, numerator and denominator roles, and reading order, but dropping forced display style can materially change visible size, especially in scripts or under an explicit math-style declaration. This Reading-fidelity projection is enabled only by Equiv; Authoring, Faithful, and Corpus retain the original command.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["ams/dfrac-to-frac"])
new TransformEngine({ profile: 'corpus', disableRules: ['ams/dfrac-to-frac'] })

Open in Playground