> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autype.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Math (LaTeX)

> Block math expressions with LaTeX syntax, alignment options, and render-as-image for perfect PDF output.

Autype supports LaTeX math expressions as display equations using the `$$` block syntax.

<Note>
  Inline math (`$E=mc^2$`) is not currently supported. Use block math for all equations.
</Note>

## Block math

### Multi-line syntax

Use double dollar signs on separate lines:

```markdown theme={null}
$$
E = mc^2
$$
```

```markdown theme={null}
$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
```

### Single-line syntax

For short equations, put everything on one line:

```markdown theme={null}
$$E = mc^2$$
```

### Alignment

Default alignment is left. There are two syntaxes depending on whether the equation is single-line or multi-line.

**Single-line** — use `:left`, `:center`, or `:right` between `$$` and the content:

```markdown theme={null}
$$:center E = mc^2$$

$$:right \nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}$$
```

**Multi-line** — use `{align=...}` as an attribute on the opening `$$`:

```markdown theme={null}
$${align=center}
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
$$

$${align=right}
\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}
$$
```

### Extended attributes

Use `{attrs}` after `$$` for additional control:

```markdown theme={null}
$${align=center renderAsImage=true spacing=10,20}
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
```

## Attribute reference

| Attribute       | Values                         | Description                                  |
| --------------- | ------------------------------ | -------------------------------------------- |
| `align`         | `left`, `center`, `right`      | Horizontal alignment                         |
| `renderAsImage` | `true`, `false`                | Render as PNG image for pixel-perfect output |
| `spacing`       | `before,after` (e.g., `10,20`) | Spacing before/after in points               |

<Note>
  The `renderAsImage` option is recommended for complex equations in PDF/DOCX exports. It ensures the math renders exactly as displayed, regardless of the viewer's font support.
</Note>

## Common LaTeX examples

### Fractions and roots

```markdown theme={null}
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
```

### Summations and integrals

```markdown theme={null}
$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

$$
\int_a^b f(x)\,dx = F(b) - F(a)
$$
```

### Matrices

```markdown theme={null}
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$
```

### Greek letters

```markdown theme={null}
$\alpha, \beta, \gamma, \delta, \epsilon, \theta, \lambda, \mu, \pi, \sigma, \omega$
```
