# \buildrel

Used to build relations by stacking an overscript on top of a relation symbol or operator.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Accents](https://texform.dev/latex/topics/accents) |
| Packages | base |
| Allowed mode | math |
| Tags | discouraged |
| Commonality | medium |
| Kind | prefix |

## Syntax

### base

Argument specification: `u{\over} m`

Used to build relations by stacking an overscript on top of a relation symbol or operator.

## Examples

```latex
\buildrel a+b \over {c+d}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbuildrel+a%2Bb+%5Cover+%7Bc%2Bd%7D)

```latex
\buildrel \rm def\over =
```

[Open in Playground](https://play.texform.dev/?input=%5Cbuildrel+%5Crm+def%5Cover+%3D)

```latex
\buildrel{a\over b}\over=
```

[Open in Playground](https://play.texform.dev/?input=%5Cbuildrel%7Ba%5Cover+b%7D%5Cover%3D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | none | full |

## Usage frequency

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

## In TeXForm

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

### Discouraged in base

Plain TeX macro relying on an unusual unbraced syntax delimited by \over, which breaks standard LaTeX argument conventions.

```latex
\buildrel $1 \over $2 -> \stackrel{$1}{$2}
```

Standard LaTeX2e command that is better integrated with LaTeX math spacing and avoids plain TeX syntax.

### Expands to (base)

```latex
\buildrel #1 \over #2
```

→

```latex
\mathrel{\mathop{#2}\limits^{#1}}
```

MathJax directly constructs an munderover node wrapped in a TeXAtom of class REL.

### [base/buildrel-to-stackrel](https://texform.dev/rules/base/buildrel-to-stackrel)

Rewrite plain TeX buildrel syntax to stackrel.

Level: authoring. Fidelity: render.

```latex
\buildrel #1 \over #2
```

→

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

```latex
A_n \buildrel n\to\infty \over = B_n
```

→

```latex
A_n \stackrel{n\to\infty}{=} B_n
```

## Equivalent forms

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

approximate. Achieves a similar visual stack but produces different MathML structure and uses standard brace-delimited arguments.

```latex
\mathrel{\overset{#1}{#2}}
```

exact. This matches MathJax's output including the surrounding relation-class TeXAtom.

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

approximate. Without an added \mathrel, \overset does not itself force relation spacing/classification.

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| a \buildrel \rm def \over = b | Positive: ctx:basic | Pass | Fail | Pass |
