# \dfrac

Display-style fractions forced in contexts such as inline math or nested formulas when a larger fraction layout is wanted.

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

## Metadata

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

## Syntax

### ams

Argument specification: `m m`

Display-style fractions forced in contexts such as inline math or nested formulas when a larger fraction layout is wanted.

## Common tasks

### How to force a display-sized fraction

\dfrac stays large even in inline or nested positions.

```latex
\dfrac{a}{b}
```

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

### How to write a continued fraction with large pieces

```latex
a_0+\dfrac{1}{a_1+\dfrac{1}{a_2}}
```

[Open in Playground](https://play.texform.dev/?input=a_0%2B%5Cdfrac%7B1%7D%7Ba_1%2B%5Cdfrac%7B1%7D%7Ba_2%7D%7D)

### How to write a display fraction in a coefficient

```latex
\dfrac{1}{2\pi}\int f(\theta)\,d\theta
```

[Open in Playground](https://play.texform.dev/?input=%5Cdfrac%7B1%7D%7B2%5Cpi%7D%5Cint+f%28%5Ctheta%29%5C%2Cd%5Ctheta)

## Examples

```latex
\dfrac{a}{b}
```

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

## Renderer support

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

## Usage frequency

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

## In TeXForm

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

### [ams/dfrac-to-frac](https://texform.dev/rules/ams/dfrac-to-frac)

Rewrite the AMS display-style fraction command to frac.

Level: equiv. Fidelity: reading.

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

→

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

```latex
x+\dfrac{1}{2}
```

→

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

## Equivalent forms

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

exact. This AMS mapping fixes the first four \genfrac parameters to empty delimiters, empty thickness, and style 0.

```latex
{\displaystyle \frac{p}{q}}
```

exact. 

## See also

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

## Test cases

### ams

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \dfrac{a}{b} | Positive: baseline | Pass | Pass | Pass |
| \dfrac a{b} | Positive: bare[0] | Pass | Pass | Pass |
| \dfrac{a}b | Positive: bare[1] | Pass | Pass | Pass |
