# \root

Legacy/plain-TeX nth-root notation such as \root 3 \of x, mainly for compatibility with older TeX sources rather than modern LaTeX style.

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

## Metadata

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

## Syntax

### base

Argument specification: `u{\of} m`

Legacy/plain-TeX nth-root notation such as \root 3 \of x, mainly for compatibility with older TeX sources rather than modern LaTeX style.

## Examples

```latex
\root\of{x}
```

[Open in Playground](https://play.texform.dev/?input=%5Croot%5Cof%7Bx%7D)

```latex
\root n_i\of{x}
```

[Open in Playground](https://play.texform.dev/?input=%5Croot+n_i%5Cof%7Bx%7D)

```latex
\root{n_i}\of{x}
```

[Open in Playground](https://play.texform.dev/?input=%5Croot%7Bn_i%7D%5Cof%7Bx%7D)

## Renderer support

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

## Usage frequency

<0.01% of formulas in the measured corpus contain this entry, rank 216 of 263 entries with frequency data.

## In TeXForm

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

### Discouraged in base

This is legacy plain-TeX root syntax using a literal `\of` separator; in LaTeX, authors generally prefer the standard `\sqrt[...]{...}` form.

```latex
\root $1 \of $2 -> \sqrt[$1]{$2}
```

`\sqrt[...]{...}` is the standard LaTeX nth-root form, with clearer argument boundaries and much more common usage in LaTeX documents.

### [base/root-of-to-sqrt](https://texform.dev/rules/base/root-of-to-sqrt)

Rewrite legacy root-of syntax to bracketed sqrt notation.

Level: authoring. Fidelity: render.

```latex
\root #1 \of #2
```

→

```latex
\sqrt[#1]{#2}
```

```latex
\root 1+2 \of {x+y}
```

→

```latex
\sqrt[1+2]{x+y}
```

## Equivalent forms

```latex
\sqrt[#1]{#2}
```

approximate. For ordinary nth-root usage this matches \sqrt[#1]{#2} semantically, but MathJax's \sqrt has an extra convenience case for an unbraced following \frac that \root does not.

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| a \root 3 \of x | Positive: ctx:basic | Pass | Fail | Pass |
