# \label

Labels an equation or displayed math expression so it can be referenced later with commands like \ref.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Labels and tags](https://texform.dev/latex/topics/cross-refs) |
| Packages | base |
| Allowed mode | both |
| Tags | invisible |
| Commonality | high |
| Kind | prefix |

## Syntax

### base

Argument specification: `m:N`

Labels an equation or displayed math expression so it can be referenced later with commands like \ref.

## Examples

```latex
\label{eq1}
```

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

```latex
\label{}
```

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

```latex
\mbox{\label{eq:x}x}
```

[Open in Playground](https://play.texform.dev/?input=%5Cmbox%7B%5Clabel%7Beq%3Ax%7Dx%7D)

## Renderer support

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

## Usage frequency

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

## In TeXForm

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

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \label{a} | Positive: baseline | Pass | Fail | Pass |
| \label a | Positive: bare[0] | Pass | Fail | Pass |
| \label{\alpha} | Negative: neg:N[0] | Pass | Fail | Fail |
