# math

Explicit inline math environment. Equivalent to using $ ... $ or \( ... \).

https://texform.dev/latex/environments/math

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Alignment](https://texform.dev/latex/topics/alignment) |
| Packages | base |
| Allowed mode | both |
| Tags | discouraged |
| Commonality | low |
| Body mode | math |

## Syntax

### base

Argument specification: ``

Explicit inline math environment. Equivalent to using $ ... $ or \( ... \).

## Examples

```latex
\begin{math} a^2 + b^2 = c^2 \end{math}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Bmath%7D+a%5E2+%2B+b%5E2+%3D+c%5E2+%5Cend%7Bmath%7D)

```latex
\begin{math} x \end{math}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbegin%7Bmath%7D+x+%5Cend%7Bmath%7D)

```latex
\scalebox{.8}{\begin{math}x^2\end{math}}
```

[Open in Playground](https://play.texform.dev/?input=%5Cscalebox%7B.8%7D%7B%5Cbegin%7Bmath%7Dx%5E2%5Cend%7Bmath%7D%7D)

## Renderer support

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

## Usage frequency

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

## In TeXForm

TeXForm reads the environment body in math mode.

### Discouraged in base

Unnecessarily verbose compared to standard inline delimiters $ ... $ or \( ... \).

```latex
$ $1 $
```

More idiomatic and widely used shorthand for inline math

```latex
\( $1 \)
```

Recommended over $ ... $ by some guides for LaTeX robustness, but both are preferred over the full math environment

## See also

- [displaymath](https://texform.dev/latex/environments/displaymath)
- [equation](https://texform.dev/latex/environments/equation)
- [equation*](https://texform.dev/latex/environments/equation-star)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \begin{math} a \end{math} | Positive: baseline | Pass | Fail | Fail |
