# TeX Math Inline math goes between `$` characters, and display math goes between `$$`: ```````````````````````````````` example Let $x$ and $y$ be integers such that $$x=y + 2$$ .

Let \(x\) and \(y\) be integers such that \[x=y + 2\]

```````````````````````````````` In inline math, the opening `$` must not be followed by a whitespace, and the closing `$` must not be preceeded by whitespace. ```````````````````````````````` example This is not math: 2000$. And neither is this $ 4 $. .

This is not math: 2000$. And neither is this $ 4 $.

```````````````````````````````` Display math delimiters can be surrounded by whitespace: ```````````````````````````````` example This is display math: $$ e=mc^2 $$ .

This is display math: \[ e=mc^2 \]

```````````````````````````````` Note that math can contain embedded math. In scanning for a closing delimiter, we skip material in balanced curly braces: ```````````````````````````````` example This is display math: $$ \text{Hello $x^2$} $$ And this is inline math: $\text{Hello $x$ there!}$ .

This is display math: \[ \text{Hello $x^2$} \] And this is inline math: \(\text{Hello $x$ there!}\)

```````````````````````````````` To avoid treating currency signs as math delimiters, one may occasionally have to backslash-escape them: ```````````````````````````````` example The cost is between \$10 and 30$. .

The cost is between $10 and 30$.

```````````````````````````````` Dollar signs must also be backslash-escaped if they occur within math: ```````````````````````````````` example $\text{\$}$ .

\(\text{\$}\)

```````````````````````````````` Everthing inside the math construction is treated as math, and not given its normal commonmark meaning. ```````````````````````````````` example $bc$ .

\(b<a>c\)

````````````````````````````````