Rewrite Rulesams/cfrac-to-frac

ams/cfrac-to-frac

Drop continued-fraction styling from centered AMS cfrac forms.

Rewrite patterns#

  1. default-alignment\cfrac{#1}{#2}\frac{#1}{#2}
  2. empty-alignment\cfrac[]{#1}{#2}\frac{#1}{#2}

Examples#

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

Default alignment#

Before

\cfrac{1}{2}

After this rule

\frac{1}{2}

The rendered result has pixel differences from the input.

Empty alignment#

Before

\cfrac[]{1}{2}

After this rule

\frac{1}{2}

The rendered result has pixel differences from the input.

Left alignment preserved#

Before

\cfrac[l]{1}{2}

After this rule

\cfrac[l]{1}{2}

Rendering verified with the declared packages.

Right alignment preserved#

Before

\cfrac[r]{1}{2}

After this rule

\cfrac[r]{1}{2}

Rendering verified with the declared packages.

Same family#

Notes#

MathJax gives cfrac numerator and denominator explicit struts and textstyle. Only an absent or empty optional alignment is centered and eligible for this projection. The l and r branches carry numerator and denominator alignment and remain unchanged; any other optional value also fails closed. Because the matcher is conditional, cmd:cfrac is touched rather than globally eliminated. Dropping continued-fraction sizing and struts can materially weaken the visible hierarchy even though the mathematical fraction remains, so the rule is Equiv with Math fidelity. Every Applied result replaces one eligible cmd:cfrac node with cmd:frac; aligned and otherwise ineligible branches return Skipped, so the number of eligible cmd:cfrac nodes strictly decreases.

Disable this rule#

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

Open in Playground