Vibe Latex
Live-render the LaTeX math in your Claude Code conversations, in a side panel — so you can talk to the model in precise mathematical language and actually see the formulas.
中文文档
Why
When you use Claude Code for math, plain-text formulas are often imprecise; asking for LaTeX gives you accurate notation, but the chat UI doesn't render it, so it's hard to read. A third-party extension can't render inside Claude Code's own webview, so Vibe Latex opens its own mirror panel beside it: you chat in Claude Code as usual, and the formulas render live next door.
Features
- Live conversation mirror — mirrors a Claude Code session (user + assistant messages) and renders all LaTeX with KaTeX. Supports
$...$, $$...$$, \(...\), \[...\].
- LaTeX input box — type LaTeX at the bottom, preview it instantly, then copy the source and paste it back into Claude Code.
- Per-formula copy — hover any rendered formula to copy its original LaTeX (without the
$ delimiters).
- History picker — click the clock icon to pick any past session of the current workspace; click outside to cancel.
- Multiple panels — the new-panel icon opens another mirror so you can watch two sessions at once.
- Markdown tables, collapsible long prompts, auto-scroll to new messages.
- Bilingual UI — follows the editor's display language (English / 简体中文), English by default.
How it works
Claude Code writes every turn to ~/.claude/projects/<workspace-slug>/<sessionId>.jsonl in real time (<workspace-slug> = the workspace absolute path with every non-alphanumeric char replaced by -). Vibe Latex watches the selected .jsonl, parses out the user/assistant text blocks, and renders them. This is the same store the CLI and the VS Code extension share, so it works whether you run Claude Code in the terminal or in the editor.
Usage
- Run Vibe Latex: Open Mirror Panel from the Command Palette.
- Click the clock icon and pick a session (newest first).
- Chat in Claude Code — messages with math render live in the panel.
- Use the input box at the bottom to draft and verify a formula, then copy it back.
Settings
vibeLatex.sessionsBaseDir — base directory holding the per-workspace session subfolders. Defaults to ~/.claude/projects. Point it at another tool's session store if it uses the same layout (one subfolder per workspace, named by the workspace path with non-alphanumeric chars replaced by -, containing .jsonl transcripts).
Development
npm install
npm run build # builds the extension + webview bundles, copies KaTeX assets
# open this folder in VS Code, press F5 to launch an Extension Development Host
Package a .vsix:
npm run package # produces vibe-latex-<version>.vsix
Install from VSIX
- Command Palette → Extensions: Install from VSIX…, or
code --install-extension vibe-latex-0.1.0.vsix (Cursor: cursor --install-extension …)
Design notes
Vibe Latex renders individual formula fragments from a conversation, not whole .tex documents — so it uses KaTeX (synchronous, millisecond-fast, self-contained, fonts bundled locally) rather than a full TeX engine like pdfLaTeX. No TeX installation and no CDN required.
License
MIT