--- title: Code Math version: 0.1 date: '2024-03-22' license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' based_on: https://docs.gitlab.com/ee/user/markdown.html#math --- # TeX Math Inline math goes between `` $` `` characters, and display math use the code block ``` ```math ````: ```````````````````````````````` example Let $`x`$ and $`y`$ be integers such that ```math x=y + 2 ``` .

Let x and y be integers such that

x=y + 2
```````````````````````````````` In inline math, it behaves just like inline code. ```````````````````````````````` example This is math:$`2000`$. .

This is math:2000.

```````````````````````````````` Note that math can contain embedded math. In scanning for a closing delimiter, we do not need to skip material in balanced curly braces: ```````````````````````````````` example This is display math: ```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!}

```````````````````````````````` Dollar signs not required to be backslashed. It may be required to render the math properly, but it's not required for parsing: ```````````````````````````````` example $`\text{$}`$ .

\text{$}

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

b<a>c

```````````````````````````````` Double dollar signs are not supported ```````````````````````````````` example $$`1 + 2`$$ .

$$1 + 2$$

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