# base/above-to-genfrac

Rewrite above to a thickness-preserving genfrac form.

https://texform.dev/rules/base/above-to-genfrac

## Metadata

| Field | Value |
| --- | --- |
| Key | base/above-to-genfrac |
| Level | authoring |
| Fidelity | render |
| Enabled by packages | base |
| Profiles | Authoring, Faithful, Corpus, Equiv |

## Rewrite patterns

From:

```latex
#1 \above #2 #3
```

To:

```latex
\genfrac{}{}{#2}{}{#1}{#3}
```

## Examples

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

### Rule thickness genfrac

Before:

```latex
\sum_{i=1}^{m} a_i x^i \above 1.2pt \prod_{j=1}^{n}(1+y_j)
```

After this rule:

```latex
\genfrac{}{}{1.2pt}{}{\sum_{i=1}^{m} a_i x^i}{\prod_{j=1}^{n}(1+y_j)}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Zero thickness genfrac

Before:

```latex
A+B \above 0pt C+D
```

After this rule:

```latex
\genfrac{}{}{0pt}{}{A+B}{C+D}
```

Packages: base, ams.

Rendering verified with the declared packages.

## Triggers

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

## Eliminates

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

## Produces

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

## Same family

- [ams/cfrac-to-frac](https://texform.dev/rules/ams/cfrac-to-frac): Drop continued-fraction styling from centered AMS cfrac forms.
- [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/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.

## Disable this rule

```python
TransformEngine(profile="corpus", disable_rules=["base/above-to-genfrac"])
```

```javascript
new TransformEngine({ profile: 'corpus', disableRules: ['base/above-to-genfrac'] })
```

[Open in Playground](https://play.texform.dev/?input=%5Csum_%7Bi%3D1%7D%5E%7Bm%7D+a_i+x%5Ei+%5Cabove+1.2pt+%5Cprod_%7Bj%3D1%7D%5E%7Bn%7D%281%2By_j%29)
