# Extensions Adds support for mathematics spans: ## Math Inline Allows to define a mathematic inline block embraced by `$...$` ```````````````````````````````` example This is a $math inline$ .

This is a \(math inline\)

```````````````````````````````` Or by `$$...$$` embracing it by: ```````````````````````````````` example This is a $$math inline$$ .

This is a \(math inline\)

```````````````````````````````` Newlines inside an inline math are not allowed: ```````````````````````````````` example This is not a $$math inline$$ and? this is a $$math inline$$ .

This is not a $$math inline$$ and? this is a \(math inline\)

```````````````````````````````` ```````````````````````````````` example This is not a $math inline$ and? this is a $math inline$ .

This is not a $math inline$ and? this is a \(math inline\)

```````````````````````````````` An opening `$` can be followed by a space if the closing is also preceded by a space `$`: ```````````````````````````````` example This is a $ math inline $ .

This is a \(math inline\)

```````````````````````````````` ```````````````````````````````` example This is a $ math inline $ after .

This is a \(math inline\) after

```````````````````````````````` ```````````````````````````````` example This is a $$ math inline $$ after .

This is a \(math inline\) after

```````````````````````````````` ```````````````````````````````` example This is a not $ math inline$ because there is not a whitespace before the closing .

This is a not $ math inline$ because there is not a whitespace before the closing

```````````````````````````````` For the opening `$` it requires a space or a punctuation before (but cannot be used within a word): ```````````````````````````````` example This is not a m$ath inline$ .

This is not a m$ath inline$

```````````````````````````````` For the closing `$` it requires a space after or a punctuation (but cannot be preceded by a space and cannot be used within a word): ```````````````````````````````` example This is not a $math inlin$e .

This is not a $math inlin$e

```````````````````````````````` For the closing `$` it requires a space after or a punctuation (but cannot be preceded by a space and cannot be used within a word): ```````````````````````````````` example This is should not match a 16$ or a $15 .

This is should not match a 16$ or a $15

```````````````````````````````` A `$` can be escaped between a math inline block by using the escape `\\` ```````````````````````````````` example This is a $math \$ inline$ .

This is a \(math \$ inline\)

```````````````````````````````` At most, two `$` will be matched for the opening and closing: ```````````````````````````````` example This is a $$$math inline$$$ .

This is a \($math inline$\)

```````````````````````````````` Regular text can come both before and after the math inline ```````````````````````````````` example This is a $math inline$ with text on both sides. .

This is a \(math inline\) with text on both sides.

```````````````````````````````` A mathematic inline block takes precedence over standard emphasis `*` `_`: ```````````````````````````````` example This is *a $math* inline$ .

This is *a \(math* inline\)

```````````````````````````````` An opening $$ at the beginning of a line should not be interpreted as a Math inline: ```````````````````````````````` example $$ math $$ starting at a line .

\(math\) starting at a line

```````````````````````````````` ## Math Block The math block can spawn on multiple lines by having a $$ starting on a line. It is working as a fenced code block. ```````````````````````````````` example $$ \begin{equation} \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15} \label{eq:sample} \end{equation} $$ .
\[ \begin{equation} \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15} \label{eq:sample} \end{equation} \]
````````````````````````````````