# Math expressions

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/writerside/llms.txt).

Mathematical expressions are an important part of technical documentation, especially in fields like mathematics, physics, data science, and engineering.

Writerside supports rendering mathematical expressions as block elements using Tex syntax, which can include Greek letters, operators, trigonometric functions, and other mathematical symbols. For more information about the syntax, see [Wikibooks: LaTeX/Mathematics](https://en.wikibooks.org/wiki/LaTeX/Mathematics).

To add a math expression, use a [code block](code.html) and set the language to `tex`. For example, the following code defines the [quadratic formula](https://en.wikipedia.org/wiki/Quadratic_formula):

Semantic markup:

```XML
<code-block lang="tex">
    \begin{equation}
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
    \end{equation}
</code-block>
```

Markdown code block:

```PLAINTEXT
```tex
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}
```
```

Markdown $$ notation:

```PLAINTEXT
$$
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}
$$
```

The result will look like this:

```TEX
\begin{equation}
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}
```

## Inline math expressions

Use the `<math>` element to insert math equations in a paragraph, not as a separate block. In a Markdown topic, use dollar characters `$...$`.

Semantic markup:

```XML
Pythagorean theorem: <math>x^2 + y^2 = z^2</math>
```

Markdown:

```PLAINTEXT
Pythagorean theorem: $x^2 + y^2 = z^2$
```

Pythagorean theorem: $x^2 + y^2 = z^2$

