[FEATURE] Add LaTeX / Math formula rendering support to Claude Code for VS Code using KaTeX

Resolved 💬 3 comments Opened Jan 28, 2026 by Sirius1994 Closed Feb 1, 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

The Claude Code VS Code extension's chat panel (Webview) renders Markdown well (bold, lists, code blocks with highlighting), but does not render LaTeX/Math formulas. Claude frequently outputs formulas using standard delimiters like $...$ (inline) or $$...$$ / \[...\] (display), but they appear as plain text or unparsed code blocks.
This is a significant limitation for users in math-heavy domains (e.g., physics, engineering, data science, ML theory, education), as formulas become hard to read compared to claude.ai web version (which supports LaTeX rendering in preview).

Proposed Solution

Integrate a lightweight KaTeX renderer into the chat Webview:

  • Use KaTeX (preferred over MathJax for performance/size in Webview)
  • Automatically detect and render LaTeX in streamed Markdown responses
  • Support both inline ($...$) and display ($$...$$ or \[...\]) modes
  • Handle common environments (e.g., align, cases, matrix)

Implementation sketch (high-level):

  1. Bundle KaTeX (via CDN or npm in extension build)
  2. In the Webview's HTML/JS (likely in src/webview or similar):
  • After receiving streamed Markdown, use markdown-it + markdown-it-katex plugin (or direct KaTeX render)
  • Or post-process the rendered HTML to find math delimiters and replace with KaTeX output
  1. Respect VS Code Webview CSP: use vscode.Uri for local assets if bundled
  2. Add optional setting: “Claude Code: Enable Math Rendering” (default: true)

This would align the extension experience closer to the web version and greatly improve usability for scientific/STEM users.

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 ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗