SageMath show() no longer renders math in Jupyter notebook

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Previously, SageMath’s show() function rendered LaTeX math formulas
correctly in Cursor’s Jupyter notebook. After a recent update, it now
displays raw HTML source instead of rendered math.

Steps to Reproduce

  1. Open a Jupyter notebook with SageMath kernel
  2. Run: %display latex
  3. Run: var(‘x’); show(sqrt(x^2 + 1))

Expected Behavior

Rendered math formula

Operating System

Windows 10/11

Version Information

Version: 2.6.12

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. A couple of things to help us narrow this down:

  1. Does the same notebook with the SageMath kernel render correctly in regular VS Code, not Cursor?
  2. Can you share a screenshot of what you’re seeing, including the raw HTML output?
  3. Which Jupyter-related extensions do you have installed? (Extensions sidebar, then search for “jupyter”)
  4. Do you remember which Cursor version it was working on before the update?

Let me know what you find.

Hi, thanks for following up. Here’s what I found:

  1. The rendering issue occurs in both VS Code and Cursor, not just Cursor.

  2. Screenshots are attached showing the difference:

  3. Using Command + Shift + P → Developer: Reload Window fixes the rendering temporarily, but I’m not sure why it needs to be done every time.

Please let me know if you need further details or additional screenshots.

Thanks for the info. In one case it shows raw LaTeX, and in the other it renders correctly.

Since you can reproduce it in regular VS Code too, this is most likely a bug in Microsoft’s Jupyter extension, not Cursor itself. The fact that Developer: Reload Window fixes it temporarily points to a race condition during renderer startup.

A few things to try:

  1. Update the Jupyter extension to the latest version (or try the pre-release). Sometimes the fix is already there.
  2. Check if it happens with a normal Python kernel (not SageMath), for example:
    from IPython.display import display, Math
    display(Math(r'\sqrt{x^2 + 1}'))
    
  3. Try adding this to settings.json:
    "notebook.output.wordWrap": true,
    "notebook.output.textLineLimit": 30
    

If it only happens with the SageMath kernel and normal Python is fine, then it’s likely a bug in the SageMath + Jupyter extension combo. In that case, it’s worth reporting it in the VS Code Jupyter extension repo: GitHub · Where software is built

Let me know what ends up working.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.