Math, code, diagrams and callouts
Add LaTeX math, code blocks, Mermaid diagrams, callouts and collapsible blocks to a note.
Applies to Web · Mac · iPhone app · notes you can edit
These are the blocks research notes and technical docs lean on. Math is rendered with KaTeX and diagrams with Mermaid. In both cases the source text is stored in the note, so collaborators see changes live.
Math (LaTeX)
| To add | Do this |
|---|---|
| Math inside a sentence | Click Σ (TeX math) in the toolbar and enter LaTeX, or type it wrapped in two dollar signs, like $$E=mc^2$$. |
| A block equation on its own line | Choose Math block from the / menu and enter the LaTeX, or at the start of an empty line type it wrapped in three dollar signs, like $$$\int_0^1 x\,dx$$$. |
To change an equation, click it. A LaTeX formula box opens with its current LaTeX; edit it and confirm to update the equation. Clear the box and confirm to delete the equation. This only works in notes you can edit. If someone else edits the note while the box is open and the formula can’t be matched with certainty, nothing is changed and you’re asked to click it again.
If the LaTeX has an error, the text you typed is shown instead of the rendered equation. When you export to Markdown, inline math becomes $…$ and block math goes between two $$ lines.
Code blocks
- Press ⇧⌥⌘C, choose Code block from the
/menu, or type```at the start of a line followed by a space or Enter. - Add a language name, as in
```python, to highlight in that language. Without one, the language is detected automatically from about 35 common ones (JavaScript, TypeScript, Python, JSON, Bash, SQL and more). - For a short piece of code in a sentence, use inline code: ⇧⌘C or
`code`. - The
/menu doesn’t open inside a code block.
Mermaid diagrams
- Choose Diagram from the
/menu (type/mermaidor/diagram). A sample flowchart (Start → Condition → Process or End) is inserted. - Click Edit source above the diagram and edit it in Mermaid syntax.
- Click Preview to see the drawing again. If the syntax is wrong, you’ll see “Diagram error: …” with the first line of the error.
Diagrams switch colors with light and dark mode. When you export to Markdown, a diagram becomes a ```mermaid code block.
Callouts
From the / menu, choose Callout (info) (ℹ), Callout (warning) (⚠) or Callout (tip) (★). Inside the box you can use ordinary blocks: paragraphs, lists, checklists. There’s no dedicated shortcut, and to change the type, insert a new callout and move the content into it. In Markdown exports, callouts become > blockquotes.
Collapsible blocks
Insert one with ⌘., Toggle in the / menu, or Collapsible block in the toolbar. Click the arrow beside the heading to fold or unfold it; the folded state is saved with the note. Press ⌘. again inside the block to turn it back into ordinary text.
When you export
| Block | Markdown result |
|---|---|
| Inline math · block math | $…$ · between $$ lines |
| Code block | ```language fence |
| Diagram | ```mermaid fence |
| Callout | > blockquote |
| Collapsible block | A bold ▸ heading line followed by the content |
For how to export, see Export notes and back up everything.