# Equation to Typst

Convert LaTeX math, an equation described in words, or an equation image into Typst math.

Equation to Typst turns one expression into Typst math. Use it for a formula you know in LaTeX, one you can only describe in words, or one in a screenshot.

## Pick the right input

- **Type equation** takes LaTeX math such as `\frac{a}{b}`, plain notation such as `e^(iπ) + 1 = 0`, or a description in words.
- **Equation image** takes a PNG, JPEG, or WebP picture of the equation.

Use [Image to Typst](/docs/tools/image-to-typst/) when the picture also holds paragraphs or a table. Use [LaTeX to Image](/docs/tools/latex-to-image/) in its Typst mode to preview Typst math and export it as an image.

## Convert an expression

1. Open **Equation to Typst**, or run `/equation-to-typst`.
2. Type the expression, or switch to **Equation image** and choose an image.
3. Choose **Convert**.
4. Copy the result or save `equation.typ`.
5. Add the delimiters for its destination: `$x$` for inline math, or `$ x $` with a space inside each dollar sign for a display equation.

For example:

```latex
\sqrt{x^2 + y^2} \le r
```

becomes:

```typst
sqrt(x^2 + y^2) <= r
```

## How it converts

Typed LaTeX math goes through Oleafly's own LaTeX-to-Typst math translator, on your device. With a Typst project open, the translator uses the symbol names that project's Typst version understands. If the expression contains a command the translator doesn't know, Oleafly converts the whole expression with the bundled Pandoc instead.

A description in words, or an image, goes to a local Ollama model first. The model writes LaTeX, and that LaTeX is converted the same way. Images need a model that can read pictures.

## Review before inserting

The result is the expression alone, without delimiters or an explanation. Check grouping, fractions, subscripts, limits, and operator names. Commands you defined yourself, such as a `\newcommand` in a preamble, mean nothing to either converter: expand them first, or fix the result by hand.

Images must be under 20 MB. The tool converts notation. It doesn't check the mathematics.

:::tip[Already writing in Typst?]
Paste LaTeX math straight into a `.typ` file and choose **Paste as Typst math** when Oleafly offers it. To convert math that is already in the file, select it, right-click, and choose **Convert LaTeX math to Typst**.
:::
