Chat renders LaTeX formula twice: KaTeX block + duplicate plain-text line below

Describe the Bug

When the Agent/Chat outputs mathematical formulas using LaTeX delimiters (\[...\], $$...$$, or \(...\)), each formula appears twice:

  1. First as a properly rendered KaTeX formula
  2. Immediately below as a second plain-text line repeating the same expression (often with corrupted subscripts, e.g. scale02 instead of scale_0)

This makes math-heavy replies hard to read and looks like the model intentionally duplicated output.

Steps to Reproduce

  1. Open Cursor Chat or Agent on Linux (any project)
  2. Ask the model to explain something with a math formula, e.g.:

    “Output one OSQP objective linear term formula for reference tracking.”

  3. Model responds using block math, e.g. \[ q_i = -\frac{2 w_{x,\text{ref},i} l_i^{\text{ref}}}{\text{scale}_0} \]
  4. Observe the rendered formula and an extra plain-text duplicate line directly underneath

Also reproducible when the model uses \(...\) for inline math.

Expected Behavior

Each formula should render once (KaTeX/MathML only). No duplicate plain-text annotation line below.

Screenshots / Screen Recordings

Operating System

Linux

Version Information

3.8.22 (Commit: 46fb7aafe279d7c72346febe68c2e004b7d1de60, x64)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report with the screenshot and steps. I can see the formula with a duplicate plain-text line below it. This is a known KaTeX rendering bug in the chat, not related to the model.

In short, KaTeX renders the formula as a visual block plus a hidden MathML tree for accessibility, and right now that hidden tree is incorrectly showing up as a second line with broken subscripts.

The fix is already merged and is available in the latest Nightly builds after June 23. It will land in stable in the next release, but I can’t share an exact ETA yet. If you want the fix right now, you can switch to Nightly. I’ll post an update in the thread once the fix reaches stable.

Hey @Liu_Shijie quick update on this bug: the duplicate plain-text line under the rendered LaTeX formula is fixed. The fix is already in stable starting from version 3.9.8.

You’re on 3.8.22 right now. Update Cursor to the latest version and the duplicate should be gone. If it still reproduces after updating, let me know and we’ll take a look.