Rewrite Rulesbase/over-to-frac

base/over-to-frac

Rewrite infix over to an explicit frac command.

Rewrite patterns#

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

Examples#

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

Stacked over fraction#

Before

(x_1+\cdots+x_m)^2 \over \sum_{j=1}^{n}(y_j^2+1)

After this rule

\frac{(x_1+\cdots+x_m)^2}{\sum_{j=1}^{n}(y_j^2+1)}

Rendering verified with the declared packages.

Braced over in expression#

Before

1+{a+b \over c+d}

After this rule

1+\frac{a+b}{c+d}

Rendering verified with the declared packages.

Same family#

Disable this rule#

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

Open in Playground