claude-code-katex
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 10 GitHub stars
Code Fail
- fs.rmSync — Destructive file system operation in extension.js
- fs module — File system access in extension.js
- fs.rmSync — Destructive file system operation in extension.test.js
- os.homedir — User home directory access in extension.test.js
- fs module — File system access in extension.test.js
- rm -rf — Recursive force deletion command in install.sh
- process.env — Environment variable access in package.json
- fs module — File system access in test-ui/fetch-webview-src.js
- network request — Outbound network request in test-ui/fetch-webview-src.js
- process.env — Environment variable access in test-ui/manual-repatch.js
- fs module — File system access in test-ui/manual-repatch.js
- fs module — File system access in test-ui/react-streaming.spec.js
- fs module — File system access in test-ui/real-vscode-new-chat.js
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
VSCode extension that adds LaTeX math rendering to Claude Code using KaTeX
Claude Code LaTeX
Adds LaTeX math rendering to the Claude Code VSCode extension. Rendered with KaTeX.
Temporary workaround for anthropics/claude-code#16446 until native LaTeX rendering is added.
Renders $...$ (inline) and $$...$$ (display) math expressions in Claude's chat responses.
Demo
| Before | After |
|---|---|
Install
From VS Code Marketplace
Search for "Claude Code LaTeX" in the Extensions tab, or:
code --install-extension nuriyev.claude-code-katex
From .vsix file
- Download the latest
.vsixfrom Releases - In VSCode:
Ctrl+Shift+P→Extensions: Install from VSIX... - Reload when prompted
Usage
The extension patches Claude Code automatically on startup. If you need manual control:
Ctrl+Shift+P→ Claude Code LaTeX: EnableCtrl+Shift+P→ Claude Code LaTeX: DisableCtrl+Shift+P→ Claude Code LaTeX: Status
How it works
On activation, the extension appends KaTeX (core + auto-render + a MutationObserver) to Claude Code's webview files. A MutationObserver watches for new chat content and renders any LaTeX expressions it finds. Code blocks are ignored.
When Claude Code updates, the patch is automatically re-applied.
extension.js of Claude Code is never modified. Only the webview bundle (which runs in an isolated browser context) is patched, and originals are backed up.
Disabling / Uninstalling
To temporarily disable LaTeX rendering, use the command:
Ctrl+Shift+P → Claude Code LaTeX: Disable → reload when prompted.
To re-enable, use Claude Code LaTeX: Enable.
Uninstalling the extension from the Extensions panel automatically cleans up the patch.
Why not the Disable button in the Extensions panel? The patch lives in Claude Code's webview files on disk. Claude Code loads its webview before this extension activates, so if we removed the patch on deactivate, the webview would load unpatched files before we could re-apply. Keeping files patched on disk ensures it works reliably across restarts.
Known Limitations
- Backslash spacing commands (
\,\;\!) are stripped by Claude Code's markdown parser before this extension sees them. There is no workaround at this time. - After Claude Code updates, you may need to reload the window once for the re-patch to take effect.
- There may be a brief flash of raw LaTeX during streaming responses (200ms debounce).
- Code blocks are never affected.
$variableinside`code`or code fences is left alone. - This is a temporary workaround until anthropics/claude-code#16446 is resolved. Once Claude Code ships native LaTeX support, this extension can be uninstalled.
Bugs & Feedback
Found a rendering issue? Something not displaying correctly?
Please open an issue with:
- The LaTeX expression that failed
- A screenshot of how it rendered (or didn't)
- Your VS Code and Claude Code extension versions
Every report helps improve the extension for everyone.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found