[BUG] Inline KaTeX math (`$...$`) no longer renders in chat output — only block `$$...$$` works (regression)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When Claude's reply contains inline math wrapped in single dollar signs ($...$), it doesn't render — the raw source is shown instead, dollar signs included. For example, $q_0$ appears as the literal text "$q_0$" rather than a typeset q-zero.
Block math wrapped in double dollar signs ($$...$$) on its own line still renders correctly as typeset KaTeX. So only inline math is broken; block math is fine.
What Should Happen?
Inline math wrapped in single dollar signs ($...$) should render as typeset KaTeX, the same way block math ($$...$$) does, with the dollar delimiters hidden. For example, the start state is $q_0$ should display a typeset q-zero, not the literal text $q_0$. Inline math should render the way it did in earlier versions and the way block math still does today.
Error Messages/Logs
Steps to Reproduce
- Ask Claude anything whose answer naturally contains inline math, e.g. "explain a Turing machine's transition function".
- Claude replies with a sentence containing inline
$...$, such as: the start state is $q_0$ and the alphabet is $\Sigma = \{0,1\}$. - Observe that each inline
$...$segment shows as raw text with visible dollar signs, not typeset math. - For contrast, note that block math on its own line renders correctly:
$$\delta: Q \times \Gamma \to Q \times \Gamma \times \{L,R\}$$
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.156 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Surface: Claude Code desktop app (macOS). The Terminal/Shell dropdown has no desktop-app option, so it may not reflect the actual surface.
Reproducible 100% of the time this session: every inline $...$ expression shows raw dollar signs, while every $$...$$ block renders correctly. Inline single-$ math rendered fine in earlier versions, so this looks like a regression.
<img width="1049" height="371" alt="Image" src="https://github.com/user-attachments/assets/a62ccbff-f968-4c0f-ad6f-ba3ca994421d" />
18 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Analysis: Inline KaTeX
$...$Rendering RegressionRoot Cause Analysis
This is almost certainly a KaTeX auto-render delimiter configuration regression. When inline
$...$fails to render but block$$...$$works, the most common causes are:1.
renderMathInElementdelimiter config missing inline delimitersThe typical KaTeX auto-render call looks like:
If a recent change removed the
{left: '$', right: '$', display: false}entry (or the entiredelimitersarray was overwritten to only include$$), inline math stops rendering immediately while block math continues to work.2. Escaping conflict in the markdown preprocessor
Some markdown renderers pre-process
$signs (treating them as literal dollar amounts or as part of other syntax). If a new escaping rule was added that consumes or transforms single$before KaTeX sees them (e.g., escaping$to\$or wrapping in<code>), KaTeX would never see the delimiters. Block$$is less susceptible because it is less ambiguous (two consecutive dollars rarely appear outside math).3. Regex change in the math-detection splitter
Many markdown renderers split text into "math" and "non-math" segments using a regex like:
If the inline
$capture group was accidentally removed or the regex was simplified to only match$$, inline math would break.4. Desktop app's webview configuration differs from terminal
The desktop app (macOS) uses an Electron webview. If the KaTeX initialization for the webview was updated separately from the terminal renderer, or if a CSP/content-security change blocks inline KaTeX resources, this could explain why it regressed only on desktop.
Diagnostic Checklist
To diagnose, check the following (in order of likelihood):
renderMathInElementorkatex.rendercalls — verify thedelimitersarray still includes{left: '$', right: '$', display: false}.$, not just$$.$before the KaTeX pass.Suggested Fix
The most targeted fix is to ensure the math rendering configuration includes inline delimiters:
If using a custom markdown parser (like
marked+ KaTeX plugin), check that the plugin'sinlineMathoption is not set tofalseor that inline math rendering was not accidentally disabled via a feature flag.Still reproduces in Claude Code 2.1.167 on macOS 26.5.1 (desktop app, Claude Code tab).
A few additional data points beyond the original report:
\(...\)inline delimiters are also ignored — not just$...$.$$...$$renders, but only as a centered display block on its own line. Placing it mid-sentence forces a line break, so it is not a usable substitute for inline math. Net effect: there is currently no delimiter that produces true inline math in the desktop app.Test snippet (paste into chat, or have Claude emit it):
Observed: lines 1–2 show the raw delimiters with no rendering; line 3 renders but is pulled onto its own centered line, breaking the sentence.
This keeps getting reported and auto-closed without ever being fixed. Every prior report was closed by the stale bot (
github-actions[bot]) on an inactivity timeout — not resolved by a maintainer, and in several cases after an automatedstalelabel — even though the bug is still present:stale, then auto-closed bygithub-actions[bot](not planned)invalid+stale, then auto-closed bygithub-actions[bot](not planned)stale, then auto-closed bygithub-actions[bot](not planned)github-actions[bot], bot-labeled duplicategithub-actions[bot], bot-labeled duplicateSo those closures reflect inactivity timeouts, not fixes — the underlying problem has never been addressed. Related open feature requests: #16446 (VS Code plugin), #44479 (terminal output).
Confirming this is still unresolved in the latest build, and asking that #65632 stay open until it's actually fixed. Inline
$...$(and ideally\(...\)) parsing would bring the desktop app in line with claude.ai, GitHub-Flavored Markdown, Obsidian, and KaTeX/MathJax defaults. In the meantime the only workaround is Unicode (a² + b² = c²) or accepting display blocks — neither produces real inline math.For anyone reading this, please leave a 👍 on the OP so this issue doesn't get auto-closed again by Github bots
Yes, This problem don't be solved now.
Cross-device data point (same account, same messages, 2026-06-10):
| Surface | inline
$...$| inline\(...\)| display$$...$$||---|---|---|---|
| macOS desktop app (Claude Code tab) | ❌ raw source | ❌ raw source | ✅ (own line only) |
| iPad app | ✅ renders | not tested | ✅ |
| iPhone app | ✅ renders | not tested | ✅ |
The identical markdown renders correctly as inline math on the iPad/iPhone apps, so the model/CLI output is fine — the failure is specific to the desktop app's renderer. Consistent with the analysis in #65777 (inline single-
$rule not enabled in the desktop markdown→math pass while block math is), and with the report there that this was fixed in a previous release and then re-broken.still not resolved.
still not resolved.
still not resolved.
Still not resolved. Incredibly annoying and really gets in the way of Claude being useful to my workflow.
Still not resolved
I'm seeing an improvement in this behavior on both web (Safari) and in the latest Mac build (
1.20186.0). Both inline and block equations are rendering _after streaming concludes_.@tylersax can you share a screenshot? which prompt did you use. can get it to render in my end
Here's an example prompt whose answer renders properly for me (both inline and display): https://claude.ai/share/99e9d502-eb1f-4a86-b98a-7e208400cfb3
One thing to note: check whether Claude has learned to produced different formatting based on your instructions. (For example, I had given the instruction to avoid KaTeX while waiting for this bug fix).
<img width="873" height="268" alt="Image" src="https://github.com/user-attachments/assets/558d83ea-6be9-43b7-a656-072a61b6896f" />
@tylersax is that from the claude code or regular claude chat?
Regular chat
@tylersax yea it always seemed to have worked with the regular chat. this issue is Claude Code exclusive
Shoot - I thought this issue was with both. Apologies for the false hope! I tried the same prompt in Code and indeed it still fails.