Math equations & Mermaid diagrams
Turn on KaTeX math and Mermaid diagrams in Settings, then render equations and flowcharts right in the preview.
· · 3 min read
Turn them on
Both are one toggle away — and off by default to keep the editor light:
- Open Settings (gear icon).
- Under Writing tools, switch on Math (LaTeX) and/or Diagrams (Mermaid).
Write math with KaTeX
- Inline math: wrap it in single dollars —
$e = mc^2$ - Block math: wrap it in double dollars:
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$
The preview renders it instantly — no internet needed, KaTeX ships inside the app.
Draw diagrams with Mermaid
Use a fenced code block with the mermaid language tag:
```mermaid
graph TD
A[Idea] --> B{Good?}
B -->|yes| C[Write it]
B -->|no| D[Coffee first]
```
- Flowcharts, sequence diagrams, pie charts, and everything else Mermaid supports.
- Diagrams render in the preview and in HTML exports.
Performance tip: both engines load only when you enable them, so leaving them off keeps startup instant.