You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow switching the math typesetter (KaTeX / Typst) in settings #428
Currently, math blocks wrapped in $$ $$ always trigger the KaTeX renderer. It would be nice to let users choose Typst as an alternative math typesetter through a settings option.
Current behavior:
Math inside $$ $$ is always rendered with KaTeX, with no way to switch.
Proposed behavior:
Add a settings toggle (e.g. "Math Renderer": KaTeX / Typst) that lets users pick which typesetter is used to render $$ $$ blocks. When set to Typst, math blocks should render using the Typst math renderer instead of KaTeX.
Why:
Some users may prefer Typst's math syntax and output style over KaTeX, and having this as a configurable option makes Zennotes more flexible without breaking existing KaTeX behavior for everyone else.
Scope:
This is a small, self contained change: add a settings field and branch the renderer choice at the point where $$ $$ blocks are processed. No changes needed to note storage format.
Settings ▸ Editor ▸ Math renderer now switches $…$ / $$…$$ typesetting between KaTeX (default) and Typst, applied in both the live editor and the reading view. Typst reads the blocks as Typst markup rather than LaTeX, so $ integral_0^1 x^2 dif x = 1/3 $ and $ mat(1, 2; 3, 4) $ render as expected, and each note's math is written for whichever engine you pick.
A few notes on the implementation:
The whole Typst toolchain (compiler + renderer WASM and the New Computer Modern fonts) is bundled and renders fully offline; nothing is fetched from a CDN.
It is lazily loaded, so users who stay on KaTeX pay nothing at startup.
Output pins New Computer Modern, so it matches KaTeX's classic Computer Modern look. Block equations get the same display card as KaTeX, and clicking a rendered block opens it for editing.
KaTeX stays the default, so existing notes are unaffected.
There's also a 'Prefer Typst?' section in the built-in demo tour showing how to switch and what Typst syntax looks like.
Thanks for the clear, well-scoped request, @satwikShresth!
Activity
Feat(math): add Typst as an alternative math renderer (#428)
adibhanna commentedon Jul 20, 2026
Shipped on the
v2.15.0branch in 80b1691.Settings ▸ Editor ▸ Math renderer now switches
$…$/$$…$$typesetting between KaTeX (default) and Typst, applied in both the live editor and the reading view. Typst reads the blocks as Typst markup rather than LaTeX, so$ integral_0^1 x^2 dif x = 1/3 $and$ mat(1, 2; 3, 4) $render as expected, and each note's math is written for whichever engine you pick.A few notes on the implementation:
There's also a 'Prefer Typst?' section in the built-in demo tour showing how to switch and what Typst syntax looks like.
Thanks for the clear, well-scoped request, @satwikShresth!
Perf(harness): stop the runtime benchmarks failing on facts they only…