[FEATURE] LaTeX rendering in "Claude Code for VS Code" plugin

Status Open
Maintainer reply None cached
Activity 43 comments · opened Jan 6, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Currently "Claude Code for VS Code" plugin does not render LaTeX.

Proposed Solution

It would be great to support LaTeX rendering in "Claude Code for VS Code" plugin. Thanks! ☺️

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

Other

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

43 Comments

Ethan-Arrowood · 6 months ago

Here is an example screenshot:

<img width="739" height="614" alt="Image" src="https://github.com/user-attachments/assets/4a2317f7-451a-4128-b4af-e499857d329b" />

I've wound up just copy-pasting the output latex into my markdown file so it renders automatically.

aarontrowbridge · 6 months ago

we really need this!

manideepmamindlapally · 6 months ago

This would be fantastic!

ihrke · 6 months ago

yes, sorely missing that!

MahammadNuriyev62 · 6 months ago

++++

liyimengwork · 6 months ago

definitely need this

mthan160 · 6 months ago

I back this, currently VS Code Github Copilot with Opus 4.6 can render math correctly, but not Claude Code VS Code extension

josephDuque · 5 months ago

Just noticed this issue myself, this would be great to have on VS code!

Sloudis · 5 months ago

This would be really useful for me!!

CiaranHaines · 5 months ago

This please

AI1379 · 5 months ago

Need this please🥺🥺

25d-228 · 5 months ago

how could every software, claude code, codex failed to support latex rendering and text select-response.

ductai199x · 5 months ago

BUMP THIS PLEASE!!!!!

GeorgeWang26 · 5 months ago

bump

gcordova0309 · 5 months ago

Pleaseee!!!

DuoLife-QNL · 5 months ago

Please!!!

ductai199x · 5 months ago
temporary fix https://marketplace.visualstudio.com/items?itemName=nuriyev.claude-code-katex

Do you have a screenshot by chance? And how's the rendering peformance like?

MahammadNuriyev62 · 5 months ago
> temporary fix https://marketplace.visualstudio.com/items?itemName=nuriyev.claude-code-katex Do you have a screenshot by chance? And how's the rendering peformance like?

| Before | After |
|--------|-------|
| <img width="505" alt="Image" src="https://github.com/user-attachments/assets/4813f18c-fcaa-419f-a636-a8c3651f8ec4" /> | <img width="503" alt="Image" src="https://github.com/user-attachments/assets/a26b6b99-9e0c-4643-8467-549134068ee4" /> |

performance seems to be fine

@ductai199x

ductai199x · 5 months ago
> > temporary fix https://marketplace.visualstudio.com/items?itemName=nuriyev.claude-code-katex > > Do you have a screenshot by chance? And how's the rendering peformance like? | Before | After | |--------|-------| | <img width="505" alt="Image" src="https://github.com/user-attachments/assets/4813f18c-fcaa-419f-a636-a8c3651f8ec4" /> | <img width="503" alt="Image" src="https://github.com/user-attachments/assets/a26b6b99-9e0c-4643-8467-549134068ee4" /> | performance seems to be fine @ductai199x

that's prettt good! thank you for the share!! 🎉🎉🎉

MuriloChianfa · 5 months ago

this would be very appreciated, up vote ⬆️⬆️⬆️

ricitron · 5 months ago

Upvote!

The temporary fix from @MahammadNuriyev62 works great in the meantime!

Remilia-Kirisame · 5 months ago
KaiHangYang · 4 months ago
Chesterhuang1999 · 4 months ago
syned13 · 4 months ago

Upvotting this. We need this 🙏🙏

andrewboldi · 3 months ago

Yes, we need this please. Especially in the terminal.

aquaresima · 3 months ago

yes!! Please do this!

MahammadNuriyev62 · 3 months ago
dyed-eye · 3 months ago

For folks running Claude Code in a terminal rather than the VS Code extension (Windows Terminal, conhost, WezTerm, etc.) — claude-code-katex is a great fit if you're in VS Code, but it doesn't help terminal-only setups. @andrewboldi mentioned the gap above.

I built texpop to scratch that exact itch on Windows: a hotkey (Ctrl+Alt+V) opens a popup that overlays the focused terminal exactly, picks the focused chat across multi-tab sessions, and renders the last assistant message with KaTeX + Markdown + custom callouts. Reads the JSONL transcripts on disk; fully offline; MIT.

Not a replacement for first-party rendering inside Claude Code — that's the right long-term fix and what this issue is asking for. Just a stop-gap for the terminal cohort.

OscarBarreraGithub · 3 months ago

I made a VS Code extension called ClaudeTex to take care of this

I was having trouble with other implementations either failing on more complicated physics equations/matrices or opening separate preview tabs, so ClaudeTex renders inline in the existing Claude Code chat and includes extra handling for arrays, matrices, and safer $...$ parsing

haochengxi · 3 months ago

Please add this support! This will be very helpful!

bitons · 2 months ago

Please

canyuchen · 1 month ago

This issue remains for Version 2.1.186

MahammadNuriyev62 · 1 month ago
This issue remains for Version 2.1.186

feel free to use https://marketplace.visualstudio.com/items?itemName=nuriyev.claude-code-katex for now 😇

Fir-lat · 1 month ago

my temporary workaround: https://marketplace.visualstudio.com/items?itemName=lihengzhuang.vibe-latex, supporting copy and paste

aswin-polyenergetics · 1 month ago

+1, need this support natively

muhammadessam · 20 days ago

+1, need this support natively

PedroMilanezAlmeida · 12 days ago

+1, need this support natively

Irratzo · 12 days ago

I mostly have an issue with LaTeX rendering being absent in plans, only in the approval presentation view. Afterwards, I can use any Markdown previewer such as MPE on the approved plan and it's fine. But during the plan, for LaTeX, I always have to sidestep to Claude Code remote control, where most of the LaTeX is adequately rendered. It would be really helpful if it would also be rendered in the VSCode extension plan approval view.

nelsbuhrley · 11 days ago

VS Code chat does not render LaTeX math — remark-math / rehype-katex are absent from the webview bundle

Summary

Claude regularly emits LaTeX in its replies, both inline ($w_r = 2n^2$) and as fenced `math blocks. The same markdown renders correctly on github.com and in VS Code's own built-in markdown preview, but in the Claude Code chat panel it is displayed as literal LaTeX source.

This makes any maths-heavy conversation hard to read. It comes up constantly for scientific and numerical work — I am documenting a reconstruction algorithm, so most of what I ask about is equations, and every reply has to be either squinted at or re-requested in Unicode.

Environment

| | |
|---|---|
| Extension | anthropic.claude-code 2.1.234 and 2.1.235 (both affected) |
| VS Code | 1.134.0 stable (110a328ea54b) |
| Platform | Linux x64, Remote-SSH (.vscode-server) |

Reproduction

  1. Ask Claude anything that elicits maths, e.g. "write the Poisson negative log-likelihood and its gradient"
  2. The reply contains $\lambda_r = n^2|F_r|^2$ and `math blocks
  3. Expected: typeset equations, as on github.com: $\lambda_r = n^2|F_r|^2$
  4. Actual: literal $\lambda_r = n^2|F_r|^2$; the fenced block renders as a monospace code box containing LaTeX source

Root cause

webview/index.js is a react-markdown bundle, and it contains no math plugin or math renderer. Grep counts over the shipped bundle, identical in both versions:

katex=0  KaTeX=0  MathJax=0  remark-math=0  texmath=0  displayMath=0

Without remark-math, $…$ is never parsed as maths, so there is no inlineMath/math node for any renderer to consume — the text passes through as literal characters. The `math fence is treated as a code block with an unrecognised language, which is why it renders as monospace source.

Two details suggest this is a missing dependency rather than a deliberate omission:

  • The plugin array already exists. The react-markdown call site in the bundle passes plugins:

``js
b(QQ, { remarkPlugins: [XA], components: { a: ({href, children}) => … } })
``

  • The AST layer already knows the node type. inlineMath appears in the bundled mdast utility's list of known phrasing types — the serialisation side is aware of maths nodes; only the parser and the renderer are absent.

Suggested fix

The standard two-plugin recipe for react-markdown:

import remarkMath from 'remark-math'
import rehypeKatex from 'rehype-katex'
import 'katex/dist/katex.min.css'

<Markdown
  remarkPlugins={[XA, remarkMath]}
  rehypePlugins={[rehypeKatex]}
  … />

Notes that may reduce the cost:

  • KaTeX already ships inside VS Code, for the built-in markdown preview — ~/.vscode-server/cli/servers/Stable-*/server/node_modules/katex, currently 0.16.22. So the dependency is already present in the environment, and matching that version would keep rendering consistent between the chat panel and the markdown preview.
  • KaTeX adds roughly 270 KB to a bundle that is already ~4.9 MB, i.e. about 5%.
  • rehype-katex needs KaTeX's stylesheet in the webview; the panel already sets a Content-Security-Policy, so the CSS needs to be served with the webview's existing asset/nonce mechanism rather than from a CDN.
  • remark-math treats $ as significant, so a currency-heavy message could render oddly. singleDollarTextMath: false restricts inline maths to $$…$$ if that is a concern.

Why this cannot be worked around

  • Plugins cannot help. The plugin API has no renderer, webview, or display contribution point.
  • MessageDisplay cannot help. It is documented observe-only — on exit 2 "the original text is displayed" — so a hook cannot transliterate the maths on the way out.
  • A separate VS Code extension cannot help. Webviews are isolated and CSP-protected; there is no cross-extension API to modify another extension's webview.
  • Patching the bundle works until the next update overwrites it, and there are no source maps.

The only user-side option is to instruct Claude to emit Unicode instead (wᵣ = 2n²(1 − Iᵣ/λᵣ)), which loses fractions, integrals, matrices, and anything that needs two dimensions — and has to be re-established every session.

Impact

Small, self-contained change; removes a papercut that affects every scientific, mathematical, or ML conversation. Claude already emits correct, GitHub-compatible maths markdown — this is only about the renderer catching up with what the model is already producing.

cylindrical2002 · 8 days ago

Still unfixed in 2.1.239 (and 2.1.238), confirming @nelsbuhrley's analysis above on a newer build. Same environment: Linux x64, VS Code Remote (.vscode-server).

Re-ran the same grep over the shipped bundle in anthropic.claude-code-2.1.239-linux-x64 (webview/index.js, 4.9 MB; webview/index.css, 389 KB):

katex=0  KaTeX=0  MathJax=0  remark-math=0  rehype-katex=0

Two additional checks, in case they help rule out "the renderer is there but mis-wired":

  • No KaTeX stylesheet or fonts. Zero KaTeX CSS classes (.katex, .mord, .mrel, KaTeX_Main) in index.css, and zero .woff/.woff2 files anywhere in the extension directory. Even if a math plugin were present, there would be nothing to style the output with.
  • The MathML hits are a red herring. The only math-adjacent strings in the bundle (MathML, mathMl, teXML) are namespace constants and attribute tables from the bundled hast/DOMPurify code, not a renderer.

Also worth noting for anyone arriving here looking for a workaround: there is no user-side switch. claude-code-settings.schema.json defines 11 claude-code.* settings and none of them relates to math or to markdown plugins.

Given the number of duplicates this has accumulated (#82758, #74027, #84413 open; several more closed), it would help to have this one treated as the canonical thread.

muhammadessam · 3 days ago

One workaround is to use claude desktop code with displaying block latex.