# \tfrac

Text-style fractions, often used inside displayed equations or tighter layouts where a smaller fraction form is desired.

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

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

Text-style fractions, often used inside displayed equations or tighter layouts where a smaller fraction form is desired.

## Common tasks

### How to write a compact fraction in display math

```latex
\tfrac{1}{2}mv^2
```

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

### How to write a small fraction coefficient

\tfrac stays text-sized even in display style.

```latex
\tfrac{n}{2}\pi
```

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

### How to nest a compact fraction

```latex
e^{\tfrac{i\pi}{2}}
```

[Open in Playground](https://play.texform.dev/?input=e%5E%7B%5Ctfrac%7Bi%5Cpi%7D%7B2%7D%7D)

## Examples

```latex
\tfrac{a}{b}
```

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

## Renderer support

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

## Usage frequency

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

## In TeXForm

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

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

Rewrite the AMS text-style fraction command to frac.

Level: equiv. Fidelity: reading.

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

→

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

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

→

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

## Equivalent forms

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

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

```latex
{\textstyle \frac{x}{y}}
```

exact. 

## 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)
- [\\genfrac](https://texform.dev/latex/commands/genfrac)
- [\\tbinom](https://texform.dev/latex/commands/tbinom)

## Test cases

### ams

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