Typst-Live

AnkiWeb addon 755902547

Fork of Typst Math in Anki

1 other version of this addon exists. Compare versions ↓

Lets you type Typst math directly in the Anki editor, rendering live, re-editable SVG or MathML equations inline that stay viewable on all clients.
AI-generated summary; may contain mistakes.

card-creationformattingshortcutsfork-or-reuploadmobile-compatible

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
0 (πŸ‘ 0 Β· πŸ‘Ž 0)
Updated
2026-11-09
Anki versions
26.09~
License
CC0-1.0 (from the GitHub repository)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
JavaScript, JSON, TypeScript, Python, HTML, CSV
Description language
en

Maintenance

active

  • Last update or commit: 2026-11-09 (22 days before the snapshot).
  • Test files: 1.
  • Commits in the last year: 13.
  • Issues are turned off.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
24.1126.09+2026-11-09
History across monthly snapshots

Loading…

Compare versions

The original addon and its forks. The best value in each column is in bold.

VersionWorks on Anki 26.09.4MaintenanceLast activity VotesApprovalGitHub starsNotes
Typst Math in Anki original likely active 12 Jul 2026 πŸ‘ 2 Β· πŸ‘Ž 0 34% 22
↳ Typst-Live this addon likely active 9 Nov 2026 πŸ‘ 0 Β· πŸ‘Ž 0 – 0

Forks can add features or work in a different way. Read the description before you change to another version. Fork detection is incomplete, so other versions can exist.

Similar addons

Typst Math in Anki has 1 fork β†’

Converts Typst math code into MathML or SVG for Anki flashcards, offering inline and block editors plus a replace function for $...$ equations.

formattingshortcuts

2 votes 34% approval πŸ‘ 2 Β· πŸ‘Ž 0 ⭐ 22 Anki 26.05~ Updated 2026-07-12
Fix Edit Menu's Shortcut-Tooltips

Adds keyboard shortcut tooltips to the editor's dropdown menu items, including MathJax, LaTeX, and Edit HTML options, by replacing the menu-generating method.

shortcuts

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 Updated 2019-01-05

Description

Typst Math in Anki

This add-on is based on Typst Math in Anki by xkevio. It is a fork hosted at github.com/oivasoidi/typst-anki, reworked around live, re-editable equations: type Typst math directly in the Anki editor and see it rendered inline as you type β€” no dialogs, no finalized renders, just blazing fast typst as you would expect it.

Usage

  • Ctrl+M, T β€” insert an inline equation at the caret (wraps the current selection, if any)
  • Ctrl+M, B β€” insert a block (centered) equation
  • Ctrl+M, R β€” convert raw dollar-delimited math in the current field into re-editable equations: $...$ becomes inline, $$...$$ and $ ... $ become blocks
  • Or pick the Typst Math entries from the editor's Equations menu
  • Optionally enable "dollar-trigger": true in the config: then typing $ in a field inserts an inline equation right at the caret, a leading space in its source ($ ) makes it a block equation, and pressing $ again inside the source editor commits and leaves the field

A small floating source editor opens inside the editor webview just like you would expect for Mathjax and the equation renders live while you type, just much faster and nicer to use. Enter commits, Esc reverts, and the arrow keys at the edges of the source move out of the equation. Brackets and quotes auto-match while you type: (, [, { and " insert their closing partner behind the caret, and Backspace/Delete on a matched pair removes both. Click any equation β€” even after saving and reopening the card β€” to re-edit its source.

Features

  • Portable cards: each equation stores its Typst source together with a baked SVG/MathML render in the note field, so cards display correctly on AnkiDroid, AnkiWeb and desktop Anki without the add-on.
  • Theme-aware everywhere: MathML is colored by the client via currentColor; baked SVGs carry an injected prefers-color-scheme style, so equations render dark-on-light / light-on-dark on any client, even without the add-on (disable via "adaptive-color": false).
  • Instant live preview: the bundled Typst WASM compiler (typst.ts, same Typst 0.15 as the Python binding) answers compiles in milliseconds over a BroadcastChannel from a hidden webview β€” no Python in the compile loop, with automatic fallback to the Python bridge.
  • Configurable: "render-type" ("svg" default / "mathml"), "adaptive-color", "dollar-trigger" (off by default), and a custom "preamble" path for your own functions and macros (editable via Edit preamble… in the Equations menu) β€” preamble file changes are picked up automatically, no Anki restart needed. See Tools β†’ Add-ons β†’ Config.
  • Native integration: works in both the legacy editor and the new editor of Anki 26.08+; the native MathJax/LaTeX chords keep working.

Compatibility

Anki 24.11 through 26.09+ (desktop), including the new SvelteKit editor introduced in Anki 26.08.

Installation

Download the .ankiaddon/.zip file and install it via Tools β†’ Add-ons β†’ Install from file, or build from source:

git clone https://github.com/oivasoidi/typst-anki.git
cd typst-anki
just install   # or: cd src/typst-anki && pip install typst -t ./lib/ && zip -r typst-anki.zip ./*

Then open Anki β†’ Tools β†’ Add-ons β†’ Install from file and select typst-anki.zip.

README

typst-anki

Hosted at github.com/oivasoidi/typst-anki β€” a fork of xkevio/typst-anki.

Type Typst math directly in the Anki editor and get live, re-editable equations β€” no dialogs, no finalized renders. Press Ctrl + M, T (Ctrl+M, B for a block equation) or pick Typst Math from the editor's Equations menu: an equation is inserted at the caret and a small floating source editor opens inside the editor webview. While you type, the equation is rendered live as SVG/MathML inline in the field (as a centered block in block mode). Enter commits, Esc reverts; click the equation any time β€” even after saving the card and reopening Anki β€” to re-open its source.

Add custom functions inside preamble.typ. Note that with the default "adaptive-color": true setting, baked equations follow the viewer's color scheme instead of the preamble's text color β€” set "adaptive-color": false in the addon config to keep the compiled color.

Compatible with Anki 24.11 through 26.09+, including the new editor introduced in Anki 26.08.

Installation

git clone https://github.com/oivasoidi/typst-anki.git
cd typst-anki/src/typst-anki

mkdir lib # <- this stores external dependencies for Anki.
pip install typst -t ./lib/
zip -r typst-anki.zip ./*

Then, open Anki > Tools > Addons > Install from file > typst_anki.zip.

Alternatively, use just from the repo root β€” it runs the same steps via the recipes in justfile:

just install   # install the typst dependency into src/typst-anki/lib and zip the addon
just package   # re-zip only, after you changed addon files

Features

  • [x] Live equations, no dialogs: Ctrl+M, T / Ctrl+M, B insert a <anki-typst> element at the caret (wrapping the current selection, if any). The equation renders inline in the field while its Typst source is edited in a small floating panel inside the editor webview. Click an equation β€” or move the caret into it with the arrow keys β€” to re-edit it; Enter commits, Esc reverts; committing an empty equation β€” or pressing Backspace in one β€” deletes it.
  • [x] Native menu integration: the Typst entries also appear in the editor's "Equations" menu (Mathjax Inline, Mathjax Block, ..., Latex Math Env) and can be clicked there instead of using the shortcuts. In the new editor (26.08+), where all editor shortcuts are handled inside the webview, the Typst shortcuts are registered the same way β€” so the native MathJax/Latex chords keep working.
  • [x] Ctrl+M, R converts raw dollar-delimited math in the current field into the same re-editable equations β€” non-destructively, keeping the Typst source: $...$ becomes an inline equation, while $$...$$ and $ ... $ (space-padded) become block equations. Dollar signs inside HTML attributes and \$ escapes are left alone.
  • [x] Use Typst HTML export to utilize MathML (since Typst v0.15.0 β€” selectable text, colored by the client via currentColor), or Typst SVG export for crisp, identical geometry everywhere. Baked SVGs are theme-aware too: a prefers-color-scheme style is injected into the SVG itself, so equations render dark text on light themes and light text on dark ones on any client β€” AnkiDroid, AnkiWeb and desktop alike, even without the addon (disable via "adaptive-color": false; note this also overrides explicit colors like red in the source).
  • [x] Instant live preview via an embedded incremental compiler: the addon bundles the Typst WASM compiler (typst.ts, same Typst 0.15 as the Python binding) and runs it in a hidden webview that shares the editors' browser profile. Because editor pages' Content-Security-Policy forbids WebAssembly, they send their compiles to that page over a BroadcastChannel, which answers in milliseconds β€” no Python in the compile loop. If the page is unavailable, compiles transparently fall back to the Python bridge (compiled off the main thread); MathML renders always use the bridge, since the WASM compiler does not expose Typst's HTML export. This adds roughly 40 MB to the addon (compiler + fonts, bundled under web/vendor/).

Configuration

Open it via Tools β†’ Add-ons β†’ typst-anki β†’ Config (the same options are described in config.md). Editable keys in config.json:

Key Values Default Effect
"render-type" "svg" or "mathml" "svg" Format used for newly inserted/recompiled equations: SVG (crisp, identical geometry everywhere) or MathML (selectable text, colored by the client via currentColor). Existing equations keep their stored format.
"adaptive-color" true or false true Only relevant for SVG. When true, a prefers-color-scheme style is baked into each SVG, so equations render dark text on light themes and light text on dark ones β€” on AnkiDroid, AnkiWeb and desktop alike, even without the addon. This overrides the preamble's text color and explicit colors in the source (e.g. red). When false, equations keep the color they were compiled with.
"preamble" path relative to the addon folder "user_files/preamble.typ" Custom Typst preamble for your own functions, page dimensions, text size/color. Edit it directly or via the addon's Edit preamble action.

Live equations & portability

The <anki-typst> element stores the Typst source (data-typst, the source of truth) together with a baked render in the note field:

<anki-typst data-typst="x^2 + 1" data-render="svg"><img src="data:image/svg+xml;base64,..."></anki-typst>

Because the render is baked in, cards display identically on AnkiDroid, AnkiWeb and desktop Anki without the addon β€” they simply show the baked SVG/MathML (with SVG/MathML text color adapting to the viewer's light/dark theme). Installing the addon turns the element back into a click-to-edit equation. A data-render-src hash lets the element silently recompile stale renders (e.g. after editing the source via the HTML editor).

Caveats of the prototype: compile requests run on the main thread (~100 ms per equation); cloze deletions inside an equation are not hidden on clients without the addon; deleting an equation is a single Backspace.