# ams/cfrac-to-frac

Drop continued-fraction styling from centered AMS cfrac forms.

https://texform.dev/rules/ams/cfrac-to-frac

## Metadata

| Field | Value |
| --- | --- |
| Key | ams/cfrac-to-frac |
| Level | equiv |
| Fidelity | math |
| Enabled by packages | ams |
| Profiles | Equiv |

## Rewrite patterns

### default-alignment

From:

```latex
\cfrac{#1}{#2}
```

To:

```latex
\frac{#1}{#2}
```

### empty-alignment

From:

```latex
\cfrac[]{#1}{#2}
```

To:

```latex
\frac{#1}{#2}
```

## Examples

Examples show the rule in isolation, not a complete normalization profile.

### Default alignment

Before:

```latex
\cfrac{1}{2}
```

After this rule:

```latex
\frac{1}{2}
```

Packages: base, ams.

The rendered result has pixel differences from the input.

### Empty alignment

Before:

```latex
\cfrac[]{1}{2}
```

After this rule:

```latex
\frac{1}{2}
```

Packages: base, ams.

The rendered result has pixel differences from the input.

### Left alignment preserved

Before:

```latex
\cfrac[l]{1}{2}
```

After this rule:

```latex
\cfrac[l]{1}{2}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Right alignment preserved

Before:

```latex
\cfrac[r]{1}{2}
```

After this rule:

```latex
\cfrac[r]{1}{2}
```

Packages: base, ams.

Rendering verified with the declared packages.

## Triggers

- [\\cfrac](https://texform.dev/latex/commands/cfrac)

## Produces

- [\\frac](https://texform.dev/latex/commands/frac)

## Touches

- [\\cfrac](https://texform.dev/latex/commands/cfrac)

## Same family

- [ams/dbinom-and-tbinom-to-binom](https://texform.dev/rules/ams/dbinom-and-tbinom-to-binom): Rewrite AMS display-style and text-style binomial commands to binom.
- [ams/dfrac-to-frac](https://texform.dev/rules/ams/dfrac-to-frac): Rewrite the AMS display-style fraction command to frac.
- [ams/tfrac-to-frac](https://texform.dev/rules/ams/tfrac-to-frac): Rewrite the AMS text-style fraction command to frac.
- [base/above-to-genfrac](https://texform.dev/rules/base/above-to-genfrac): Rewrite above to a thickness-preserving genfrac form.
- [base/abovewithdelims-to-genfrac](https://texform.dev/rules/base/abovewithdelims-to-genfrac): Rewrite abovewithdelims to an explicit genfrac with delimiters and thickness.
- [base/atop-to-genfrac](https://texform.dev/rules/base/atop-to-genfrac): Rewrite infix atop to an explicit no-rule genfrac form.
- [base/atopwithdelims-to-genfrac](https://texform.dev/rules/base/atopwithdelims-to-genfrac): Rewrite atopwithdelims to an explicit delimited no-rule genfrac form.
- [base/brace-to-genfrac](https://texform.dev/rules/base/brace-to-genfrac): Rewrite infix brace to an explicit genfrac with brace delimiters.
- [base/brack-to-genfrac](https://texform.dev/rules/base/brack-to-genfrac): Rewrite infix brack to an explicit genfrac with bracket delimiters.
- [base/choose-to-binom](https://texform.dev/rules/base/choose-to-binom): Rewrite infix choose to an explicit binom command.
- [base/over-to-frac](https://texform.dev/rules/base/over-to-frac): Rewrite infix over to an explicit frac command.
- [base/overwithdelims-to-genfrac](https://texform.dev/rules/base/overwithdelims-to-genfrac): Rewrite overwithdelims to an explicit genfrac with delimiters.
- [base/root-of-to-sqrt](https://texform.dev/rules/base/root-of-to-sqrt): Rewrite legacy root-of syntax to bracketed sqrt notation.
- [base/leftroot-drop](https://texform.dev/rules/base/leftroot-drop): Drop the leftroot index-position hint in cleanup-oriented normalization.
- [base/uproot-drop](https://texform.dev/rules/base/uproot-drop): Drop the uproot index-position hint in cleanup-oriented normalization.

## 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

```python
TransformEngine(profile="corpus", disable_rules=["ams/cfrac-to-frac"])
```

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

[Open in Playground](https://play.texform.dev/?input=%5Ccfrac%7B1%7D%7B2%7D)
