Excalidraw LaTeX
Draw diagrams in VS Code with Excalidraw — and drop LaTeX math formulas straight onto the canvas, rendered live and fully editable afterwards.
This is a fork of pomdtr/excalidraw-vscode. It adds LaTeX formula support on top; everything else — file formats, themes, libraries, sharing — works exactly like the base extension. See README.md for that documentation; this page only covers what this fork adds.
Try the LaTeX editor online — no VS Code or install required, a static build of the same webview runs entirely in your browser.
Features
- Insert LaTeX formulas — a "Σ" button next to the shapes toolbar (or in the lock/hand/pen-mode row on mobile) opens a modal where you type LaTeX, pick which MathJax extension packages to enable (
physics, mhchem, braket, and 20 others — see the toggle list in the modal), and preview the rendered formula live before inserting it.
- Inline or display mode — toggle between inline math and centered display-style rendering, matching how the formula will actually read in context.
- Fully editable afterwards — a formula is inserted as a normal Excalidraw image element (an SVG rendered by MathJax), so it resizes, moves, and exports exactly like any other image. The original LaTeX source, display-mode flag, and enabled extensions are preserved in the element's
customData, so double-clicking a formula reopens the same modal for editing — including after saving and reopening the file.
.excalidraw schema stays compatible — formulas don't introduce a new element type; tools that don't know about this fork just see a regular image.
- Rebranded package — published as
xiupos.excalidraw-vscode-latex rather than the upstream pomdtr.excalidraw-editor, so it can be installed side by side with the original extension.
Installation
Install Excalidraw LaTeX from the VS Code Extensions view (Ctrl+Shift+X / Cmd+Shift+X, search "Excalidraw LaTeX"), or from the Marketplace listing / with:
code --install-extension xiupos.excalidraw-vscode-latex
Create an empty file with a .excalidraw, .excalidraw.svg, or .excalidraw.png extension and open it — that's it.
Prefer installing a specific version, or without going through the Marketplace? Every release also publishes a .vsix on the Releases page: download it, then use the Extensions view's Install from VSIX... (in the ... menu), or code --install-extension path/to/excalidraw-vscode-latex-4.0.0.vsix.
Using the LaTeX editor
- Open the shapes toolbar's "Σ" button.
- Type LaTeX in the source box; the preview updates as you type.
- Turn on any extension packages your formula needs (e.g.
physics for \pdv/\bra/\ket, mhchem for chemistry notation) — most formulas only need base TeX, so nothing is enabled by default.
- Toggle display mode if you want centered display-style rendering instead of inline.
- Insert. The formula lands on the canvas as a regular image; resize, move, and restyle it like any other Excalidraw element.
- To edit it later, double-click it — the same modal reopens with your original source, display mode, and enabled extensions restored.
Links
Only report issues specific to this fork's LaTeX feature or VS Code integration here. Issues with Excalidraw itself belong upstream, at pomdtr/excalidraw-vscode or excalidraw/excalidraw.
Versioning
Versions are plain semver (X.Y.Z), bumped independently of upstream — each CHANGELOG_LATEX.md entry states which upstream release it's based on. See AGENTS.md for the full rationale and release process.
Building from source
npm install # also installs webview/ dependencies
npm run package # builds the extension host and the webview into a production bundle
npm run vsce:package
This produces an excalidraw-vscode-latex-4.0.0.vsix in the repository root, installable the same way as a downloaded release. vsce:package passes --readme-path README_LATEX.md so the packaged extension shows this document (rather than upstream's README.md) as its main page — the same flag vsce:publish uses when publishing to the Marketplace.