claude-code - 💡(How to fix) Fix [Feature Request] Add LaTeX/KaTeX math rendering to TUI

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The Claude Code terminal UI does not render LaTeX math. Inline ($...$) and display ($$...$$) expressions appear as raw text with literal dollar signs and backslashes, making any math-heavy conversation unreadable in the CLI.

Current Behavior

When Claude outputs:

The DC component of a half-wave rectifier is $V_{DC} = \frac{V_m}{\pi} \approx 0.318\,V_m$.

$$V_{rms} = \sqrt{\frac{1}{T}\int_0^T v^2(t)\,dt}$$

The TUI displays it verbatim — $V_{DC} = \frac{V_m}{\pi}$ — instead of rendering the formula.

Screenshot of the issue: (attach your screenshot here)

Expected Behavior

Math expressions should render as readable formulas, either:

  • As proper typeset math (via terminal graphics protocols), or
  • As a Unicode fallback (e.g., V_DC = V_m / π ≈ 0.318·V_m).

Use Case

I use Claude Code as a study companion for engineering coursework (electronics, signal processing, control systems). Claude correctly produces well-formatted LaTeX from my lecture notes — but I can't read the output without copying it into an external KaTeX renderer.

This affects anyone using Claude Code for:

  • 📚 STEM coursework and tutoring
  • 📄 Research papers (arXiv ML/CS/physics content)
  • 📊 Math-heavy domains (DSP, finance, statistics, control theory)
  • 🔬 Code review for numerical algorithms and ML loss functions

Current Workarounds (all unsatisfactory)

WorkaroundProblem
Switch to claude.ai webLose project context, CLI tooling, MCP servers
Use VS Code with nuriyev.claude-code-katex extensionForces me out of my preferred terminal workflow
Ask Claude to write formulas in ASCII/UnicodeDegrades fidelity — matrices, integrals, piecewise functions become ugly and
ambiguous
Pipe output to external math rendererBreaks the interactive REPL experience

Proposed Solutions (in order of preference)

1. Native rendering via terminal graphics protocols

Render KaTeX/MathJax to PNG/SVG and display inline using:

  • Kitty graphics protocol
  • Sixel (xterm, foot, WezTerm, etc.)

Many modern terminals support at least one. Gracefully fall back to option 2 on unsupported terminals.

2. Unicode fallback renderer

Auto-convert common LaTeX patterns to Unicode math:

  • \frac{a}{b}a/b (or stacked Unicode where readable)
  • \sqrt{x}√x
  • x_i, x^2xᵢ, (Unicode sub/superscripts)
  • \int, \sum, \alpha, \pi, , α, π
  • \begin{cases}...\end{cases} → ASCII brace + indented lines

3. Opt-in external viewer

A setting like --math-renderer=browser that opens detected formulas in a local KaTeX preview, or copies them to clipboard as PNG.

Related Issues

  • #21433 (existing feature request for LaTeX rendering)

Impact

For technical and scientific users, this is the single biggest blocker preventing adoption of Claude Code over claude.ai. The model produces excellent math output — the rendering gap forces a UX downgrade that doesn't exist on the web.

Environment

  • Claude Code version: <your version, e.g., 1.0.151>
  • Terminal: <e.g., kitty, alacritty, gnome-terminal>
  • OS: <e.g., Arch Linux, macOS 14>
  • Shell: <e.g., fish, zsh, bash>

Root Cause

The Claude Code terminal UI does not render LaTeX math. Inline ($...$) and display ($$...$$) expressions appear as raw text with literal dollar signs and backslashes, making any math-heavy conversation unreadable in the CLI.

Current Behavior

When Claude outputs:

The DC component of a half-wave rectifier is $V_{DC} = \frac{V_m}{\pi} \approx 0.318\,V_m$.

$$V_{rms} = \sqrt{\frac{1}{T}\int_0^T v^2(t)\,dt}$$

The TUI displays it verbatim — $V_{DC} = \frac{V_m}{\pi}$ — instead of rendering the formula.

Screenshot of the issue: (attach your screenshot here)

Expected Behavior

Math expressions should render as readable formulas, either:

  • As proper typeset math (via terminal graphics protocols), or
  • As a Unicode fallback (e.g., V_DC = V_m / π ≈ 0.318·V_m).

Use Case

I use Claude Code as a study companion for engineering coursework (electronics, signal processing, control systems). Claude correctly produces well-formatted LaTeX from my lecture notes — but I can't read the output without copying it into an external KaTeX renderer.

This affects anyone using Claude Code for:

  • 📚 STEM coursework and tutoring
  • 📄 Research papers (arXiv ML/CS/physics content)
  • 📊 Math-heavy domains (DSP, finance, statistics, control theory)
  • 🔬 Code review for numerical algorithms and ML loss functions

Current Workarounds (all unsatisfactory)

WorkaroundProblem
Switch to claude.ai webLose project context, CLI tooling, MCP servers
Use VS Code with nuriyev.claude-code-katex extensionForces me out of my preferred terminal workflow
Ask Claude to write formulas in ASCII/UnicodeDegrades fidelity — matrices, integrals, piecewise functions become ugly and
ambiguous
Pipe output to external math rendererBreaks the interactive REPL experience

Proposed Solutions (in order of preference)

1. Native rendering via terminal graphics protocols

Render KaTeX/MathJax to PNG/SVG and display inline using:

  • Kitty graphics protocol
  • Sixel (xterm, foot, WezTerm, etc.)

Many modern terminals support at least one. Gracefully fall back to option 2 on unsupported terminals.

2. Unicode fallback renderer

Auto-convert common LaTeX patterns to Unicode math:

  • \frac{a}{b}a/b (or stacked Unicode where readable)
  • \sqrt{x}√x
  • x_i, x^2xᵢ, (Unicode sub/superscripts)
  • \int, \sum, \alpha, \pi, , α, π
  • \begin{cases}...\end{cases} → ASCII brace + indented lines

3. Opt-in external viewer

A setting like --math-renderer=browser that opens detected formulas in a local KaTeX preview, or copies them to clipboard as PNG.

Related Issues

  • #21433 (existing feature request for LaTeX rendering)

Impact

For technical and scientific users, this is the single biggest blocker preventing adoption of Claude Code over claude.ai. The model produces excellent math output — the rendering gap forces a UX downgrade that doesn't exist on the web.

Environment

  • Claude Code version: <your version, e.g., 1.0.151>
  • Terminal: <e.g., kitty, alacritty, gnome-terminal>
  • OS: <e.g., Arch Linux, macOS 14>
  • Shell: <e.g., fish, zsh, bash>

Fix Action

Fix / Workaround

Current Workarounds (all unsatisfactory)

WorkaroundProblem
Switch to claude.ai webLose project context, CLI tooling, MCP servers
Use VS Code with nuriyev.claude-code-katex extensionForces me out of my preferred terminal workflow
Ask Claude to write formulas in ASCII/UnicodeDegrades fidelity — matrices, integrals, piecewise functions become ugly and
ambiguous
Pipe output to external math rendererBreaks the interactive REPL experience

Code Example

The DC component of a half-wave rectifier is $V_{DC} = \frac{V_m}{\pi} \approx 0.318\,V_m$.

  $$V_{rms} = \sqrt{\frac{1}{T}\int_0^T v^2(t)\,dt}$$
RAW_BUFFERClick to expand / collapse

Summary

The Claude Code terminal UI does not render LaTeX math. Inline ($...$) and display ($$...$$) expressions appear as raw text with literal dollar signs and backslashes, making any math-heavy conversation unreadable in the CLI.

Current Behavior

When Claude outputs:

The DC component of a half-wave rectifier is $V_{DC} = \frac{V_m}{\pi} \approx 0.318\,V_m$.

$$V_{rms} = \sqrt{\frac{1}{T}\int_0^T v^2(t)\,dt}$$

The TUI displays it verbatim — $V_{DC} = \frac{V_m}{\pi}$ — instead of rendering the formula.

Screenshot of the issue: (attach your screenshot here)

Expected Behavior

Math expressions should render as readable formulas, either:

  • As proper typeset math (via terminal graphics protocols), or
  • As a Unicode fallback (e.g., V_DC = V_m / π ≈ 0.318·V_m).

Use Case

I use Claude Code as a study companion for engineering coursework (electronics, signal processing, control systems). Claude correctly produces well-formatted LaTeX from my lecture notes — but I can't read the output without copying it into an external KaTeX renderer.

This affects anyone using Claude Code for:

  • 📚 STEM coursework and tutoring
  • 📄 Research papers (arXiv ML/CS/physics content)
  • 📊 Math-heavy domains (DSP, finance, statistics, control theory)
  • 🔬 Code review for numerical algorithms and ML loss functions

Current Workarounds (all unsatisfactory)

WorkaroundProblem
Switch to claude.ai webLose project context, CLI tooling, MCP servers
Use VS Code with nuriyev.claude-code-katex extensionForces me out of my preferred terminal workflow
Ask Claude to write formulas in ASCII/UnicodeDegrades fidelity — matrices, integrals, piecewise functions become ugly and
ambiguous
Pipe output to external math rendererBreaks the interactive REPL experience

Proposed Solutions (in order of preference)

1. Native rendering via terminal graphics protocols

Render KaTeX/MathJax to PNG/SVG and display inline using:

  • Kitty graphics protocol
  • Sixel (xterm, foot, WezTerm, etc.)

Many modern terminals support at least one. Gracefully fall back to option 2 on unsupported terminals.

2. Unicode fallback renderer

Auto-convert common LaTeX patterns to Unicode math:

  • \frac{a}{b}a/b (or stacked Unicode where readable)
  • \sqrt{x}√x
  • x_i, x^2xᵢ, (Unicode sub/superscripts)
  • \int, \sum, \alpha, \pi, , α, π
  • \begin{cases}...\end{cases} → ASCII brace + indented lines

3. Opt-in external viewer

A setting like --math-renderer=browser that opens detected formulas in a local KaTeX preview, or copies them to clipboard as PNG.

Related Issues

  • #21433 (existing feature request for LaTeX rendering)

Impact

For technical and scientific users, this is the single biggest blocker preventing adoption of Claude Code over claude.ai. The model produces excellent math output — the rendering gap forces a UX downgrade that doesn't exist on the web.

Environment

  • Claude Code version: <your version, e.g., 1.0.151>
  • Terminal: <e.g., kitty, alacritty, gnome-terminal>
  • OS: <e.g., Arch Linux, macOS 14>
  • Shell: <e.g., fish, zsh, bash>

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING