[FEATURE]:LaTeX / Math Formula Rendering in Chat Panel
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary Add LaTeX math rendering support to the Kilocode VS Code extension's chat/response panel using a library like KaTeX or MathJax.
Problem
When Claude returns responses containing math formulas using standard LaTeX delimiters ($...$ for inline, $$...$$ or \[...\] for display math), they appear as raw unrendered text in the Kilocode Webview. This makes responses in math-heavy domains (ML theory, physics, data science, engineering, education) significantly harder to read.
Other AI interfaces like the opencode desktop app already render LaTeX correctly, so users who switch between tools face a noticeable usability gap.
Expected Behavior
- Inline math like
$E = mc^2$should render as a formatted formula - Display math like
$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$should render as a centered block formula
Suggested Implementation
- Integrate KaTeX into the chat Webview (it's fast, lightweight, and has no external dependencies at runtime)
- Parse standard LaTeX delimiters:
$...$,$$...$$,\(...\),\[...\] - Respect VS Code's light/dark themes for formula rendering
Why KaTeX over MathJax? KaTeX is significantly faster to render, has a smaller bundle size, and works well in Webview environments — making it a better fit for an editor extension.
Use Cases
- Machine learning / deep learning (loss functions, gradients, attention formulas)
- Physics and engineering simulations
- Data science (statistical formulas, probability)
- Education and tutoring use cases
- Research and academic writing
References
- KaTeX: https://katex.org/
- Similar rendering in claude.ai and opencode desktop
Workaround (current) Users must copy output to claude.ai or use a separate Markdown+Math VS Code extension to preview rendered formulas — this breaks the workflow.
Would love to see this added — happy to help test or provide more examples if useful!
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please reopen it or create a fresh new one.
I remade the fix by @jiliounis, but when i checked locally the rendering of sqrt is already fixed, so i think this is now actually resolved
@markijbema on the latest Kilo version in VSCode, v7.3.54, inline LaTeX is still showing up raw in chat responses, e.g. $\dot{m} = \rho A V_i$. Are you certain it's implemented? Block-level LaTeX is working fine.
we dont support single $ because that gives too many false positives, rendering text with money (dollars) unreadable
It would be great to revisit this issue, as LLMs insist on using inline LaTeX despite instructions not to. Many markdown preview tools, including the one built-in to vscode, correctly distinguish between dollar signs and LaTeX, so perhaps existing open source markdown preview implementations could shed some light.
TL;DR Try Kilo Code KB Patch extension on VS Marketplace or Open VSX
Math rendering is an opt-in setting in the KB Patch: $...$ inline and \[...\] display, layered on the $$...$$ and \(...\) Kilo already renders, plus a separate knob for rendered size. Include the following in settings.json:
"kiloCodeKbPatch.chatMathRendering": true,
"kiloCodeKbPatch.chatMathFontSizeEm": 1.0