# \genfrac

Low-level AMS generalized fraction primitive used to build custom fractions or binomial-style forms with chosen delimiters, line thickness, and math style.

https://texform.dev/latex/commands/genfrac

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Fractions and roots](https://texform.dev/latex/topics/fractions-roots) |
| Packages | ams |
| Allowed mode | math |
| Tags |  |
| Commonality | low |
| Kind | prefix |

## Syntax

### ams

Argument specification: `m:D? m:D? m:L? m:I? m m`

Low-level AMS generalized fraction primitive used to build custom fractions or binomial-style forms with chosen delimiters, line thickness, and math style.

## Examples

```latex
\genfrac{}{}{}{}{a}{b}
```

[Open in Playground](https://play.texform.dev/?input=%5Cgenfrac%7B%7D%7B%7D%7B%7D%7B%7D%7Ba%7D%7Bb%7D)

```latex
\genfrac{}{}{0.0pt}{}{a}{b}
```

[Open in Playground](https://play.texform.dev/?input=%5Cgenfrac%7B%7D%7B%7D%7B0.0pt%7D%7B%7D%7Ba%7D%7Bb%7D)

```latex
\genfrac{(}{)}{0}{1}{a}{b}
```

[Open in Playground](https://play.texform.dev/?input=%5Cgenfrac%7B%28%7D%7B%29%7D%7B0%7D%7B1%7D%7Ba%7D%7Bb%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| ams | full | full | full |

## Usage frequency

0.04% of formulas in the measured corpus contain this entry, rank 135 of 263 entries with frequency data.

## In TeXForm

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

## See also

- [\\binom](https://texform.dev/latex/commands/binom)
- [\\dbinom](https://texform.dev/latex/commands/dbinom)
- [\\dfrac](https://texform.dev/latex/commands/dfrac)
- [\\frac](https://texform.dev/latex/commands/frac)
- [\\tbinom](https://texform.dev/latex/commands/tbinom)
- [\\tfrac](https://texform.dev/latex/commands/tfrac)

## Test cases

### ams

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \genfrac (({1pt}{1}{e}{f} | Positive: ctx:basic | Pass | Pass | Pass |
| \genfrac (({1pt}1{e}{f} | Positive: ctx:bare-style | Pass | Pass | Pass |
| \genfrac (({1pt}{1}e{f} | Positive: ctx:bare-numerator | Pass | Pass | Pass |
| \genfrac (({1pt}{1}{e}f | Positive: ctx:bare-denominator | Pass | Pass | Pass |
| \genfrac{}({1pt}{1}{d}{e} | Positive: ctx:null-left | Pass | Pass | Pass |
| \genfrac ({}{1pt}{1}{d}{e} | Positive: ctx:null-right | Pass | Pass | Pass |
| \genfrac (({}{1}{d}{e} | Positive: ctx:null-thick | Pass | Pass | Pass |
