# \var

Typesets a variation symbol for variational calculus or functional-variation notation, optionally with an order in brackets and with an attached braced or parenthesized quantity.

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

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Physics: derivatives](https://texform.dev/latex/topics/physics-derivatives) |
| Packages | physics |
| Allowed mode | math |
| Tags |  |
| Commonality | low |
| Kind | prefix |

## Syntax

### physics

Argument specification: `o d<(,)><{,}>`

Typesets a variation symbol for variational calculus or functional-variation notation, optionally with an order in brackets and with an attached braced or parenthesized quantity.

## Examples

```latex
\var
```

[Open in Playground](https://play.texform.dev/?input=%5Cvar)

```latex
\var[n]{q}
```

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

```latex
\var(q)
```

[Open in Playground](https://play.texform.dev/?input=%5Cvar%28q%29)

## Renderer support

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

## In TeXForm

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

## Equivalent forms

```latex
\variation
```

exact. Mapped to the same Differential parse method with the same operator parameter.

## See also

- [\\dd](https://texform.dev/latex/commands/dd)
- [\\differential](https://texform.dev/latex/commands/differential)
- [\\variation](https://texform.dev/latex/commands/variation)

## Test cases

### physics

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \var | Positive: baseline | Pass | Fail | Pass |
| \var[a] | Positive: vary:o[0] | Pass | Fail | Pass |
| \var (a) | Positive: vary:d[1] | Pass | Fail | Pass |
| \var[a](b) | Positive: maximal | Pass | Fail | Pass |
