# \tag

Used to override or supply a custom equation tag/number in AMS display math, with an optional starred form for an unparenthesized tag.

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

## Metadata

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

## Syntax

### ams

Argument specification: `s m:T`

Used to override or supply a custom equation tag/number in AMS display math, with an optional starred form for an unparenthesized tag.

## Examples

```latex
\tag{1}
```

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

```latex
\tag*{A}
```

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

## Renderer support

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

## Usage frequency

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

## In TeXForm

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

## Test cases

### ams

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \begin{equation} a = b \tag{1} \end{equation} | Positive: ctx:in-equation | Pass | Fail | Fail |
| \begin{equation} a = b \tag*{eq1} \end{equation} | Positive: ctx:star-in-equation | Pass | Fail | Fail |
