Mathematics (LaTeX / KaTeX)
Render publication-grade math formulas directly inside the editor using LaTeX syntax and KaTeX.
Configuration
The math extension uses @tiptap/extension-mathematics as a wrapper around the super
fast katex renderer. Edra pre-configures standard options and macros (such as \R and \N) globally in extensions.ts:
How to use in Editor
To write math equations, wrap your LaTeX string in dollar signs:
- Inline Math: Wrap with single dollar signs (e.g.
$a^2 + b^2 = c^2$). When you type the closing dollar sign, it compiles immediately. - Block Math: Wrap with double dollar signs (e.g.
$$E = mc^2$$) to render equations on a separate centered line.
Styles
To output rendering properly, make sure KaTeX styles are imported. Edra takes care of standard layout alignments, rendering overlays, and mathematical symbols so that equations look correct in both light and dark modes.