---
title: TeX equation
slug: docs/tex-equation
docTags: 
createdAt: 2026-06-05T14:27:45.437Z
---

**TeX equation** blocks let you render mathematical expressions and equations directly in your documentation. It is useful for technical content, scientific documentation, and educational materials.

## Syntax

TeX equations use standard fenced code block syntax.

````markdown
```tex
E = mc^2
```
````

The content inside the code block must follow standard TeX notation.

## Example

The following example renders several common mathematical expressions.

````javascript
```tex
\begin{aligned}
\int_{-\infty}^{\infty} e^{-x^2}\,dx &= \sqrt{\pi} \\
\sum_{n=1}^{\infty} \frac{1}{n^2} &= \frac{\pi^2}{6} \\
E &= mc^2
\end{aligned}
```
````

