---
description: "Writing LaTeX in a Jotaid note: single dollars for inline math, double dollars for a display block, rendered by KaTeX."
---
<!--
  Markdown representation of https://docs.jotaid.com/en/guide/insert-math
  Generated by scripts/gen-markdown-variants.mjs — do not edit by hand.
  Served from the canonical URL under `Accept: text/markdown`.
-->

# Insert Math

Jotaid renders LaTeX with **KaTeX**. Two syntaxes, for two positions.

## Inline Math

Wrap it in single `$`, and it sits on the line with your words:

```markdown
Mass and energy are equivalent when $E = mc^2$ holds.
```

Inline math suits a symbol or a short expression mentioned mid-sentence. Leave **no space** between the `$` and the formula — `$ x $` is deliberately not recognised, so that prices in your prose ("$5 and $10") are not mistaken for math.

## Display Math

Two `$$` on their own lines give a centred block of its own:

```markdown
$$
\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}
$$
```

Use it for long derivations and for the central expression you will keep coming back to — it stays out of the running text and renders larger.

## In the Editor

Like tables, math **renders in place** while the cursor is elsewhere and turns back into editable LaTeX source when the cursor enters it. Bad syntax raises no error; it simply fails to render — move the cursor in and look for the missing brace.

## What KaTeX Covers

KaTeX handles the usual mathematical typesetting: fractions, roots, sub- and superscripts, sums and integrals, matrices, Greek letters, operators and delimiters. It is a subset of LaTeX — no `\usepackage`, no document-level commands, no custom macro packages.

## Next Steps

- [Insert Code](https://docs.jotaid.com/en/guide/insert-code) — Code blocks and Mermaid
- [Insert Annotations](https://docs.jotaid.com/en/guide/insert-annotations) — The lightweight way to write a superscript
