Skip to content

[Feedback]: Render LaTeX math in assistant messages #163

Open

Description

@152da

What problem are you trying to solve?

Assistant replies that contain LaTeX math are shown as raw source in the chat view. For STEM
conversations this defeats the purpose of the answer: a derivation that should read as stacked
fractions and integrals comes out as literal \int_0^T, \frac{N_0}{2}, $$...$$.

Repro: ask for the proof of Cov(z_I, z_Q) = 0 for white Gaussian noise. The reply contains
integrals, fractions and aligned equations; all of them render as source text.

Workaround today is to ask the model to rewrite every formula in Unicode plain text
(e.g. "∫₀ᵀ", "N₀/2"). That works for simple expressions but loses stacked fractions,
sub/superscripts and aligned derivations, and it wastes tokens on reformatting.

What would improve it?

Render math in the markdown pipeline — remark-math + rehype-katex (or equivalent) — for both
inline $...$ and block $$...$$, with the KaTeX bundle vendored locally so it works offline.
A settings toggle (default on) would be good, since not every user wants it.

For the terminal CLI, a lighter option is acceptable: detect $...$ / $$...$$ and either
render a Unicode fallback or leave the source as-is with a visible hint.

What do you do today?

  1. Rewrite formulas in Unicode plain text via a follow-up prompt.
  2. Export the explanation to a .md file and preview it in VS Code (built-in KaTeX).
  3. Publish a standalone HTML page with KaTeX and read it in the browser.

Product area

None

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions