Skip to content

Conversation

@faysou
Copy link
Contributor

@faysou faysou commented Jan 24, 2026

📝 Summary

Closes #7935

🔍 Description of Changes

Summary

Enable LaTeX math rendering in the marimo chat pane by integrating the streamdown math plugin and updating AI system prompts.

Changes

Frontend

  • Integrated LaTeX Plugin: Added @streamdown/math dependency and enabled it in the MarkdownRenderer component.
  • Upgraded Streamdown: Upgraded streamdown to ^2.1.0 to support the plugins architecture required for LaTeX.

Backend

  • AI Prompt Update: Modified the system prompt in marimo/_server/ai/prompts.py to instruct the LLM to use double dollar signs ($$) for both inline and block mathematical expressions, ensuring compatibility with the streamdown math plugin.
  • Added Tests: Added a new test case in tests/_server/ai/test_prompts.py to verify that markdown rules correctly include LaTeX instructions, and updated prompt snapshots.

Workspace

  • Dependency Synchronization: Updated pnpm-lock.yaml and pixi.lock after successful workspace-wide dependency installation.

Test plan

  1. Start the development environment with make dev.
  2. Open the Chat sidebar in the marimo notebook.
  3. Ask a question involving math (e.g., "What is the formula for the Rough Heston model?").
  4. Verify that the response contains correctly rendered LaTeX formulas instead of plain text $delimiters$.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.
@vercel
Copy link

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 27, 2026 2:33pm

Request Review

"vega-tooltip": "^1.1.0",
"vscode-jsonrpc": "^8.2.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-types": "^3.17.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this added with the upgrade & install?

Copy link
Contributor Author

@faysou faysou Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I've just updated my PR so dependency changes are minimal. I'm not commiting the lock files as well. I've also tested that the fix still works, it's quite nice to see all equations including inline ones well formatted in the chat pane.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lock files do need to be committed, since the deps have changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@faysou
Copy link
Contributor Author

faysou commented Jan 27, 2026

It seems that there is a test error unrelated to my PR

@mscolnick mscolnick merged commit ebb621e into marimo-team:main Jan 27, 2026
40 of 41 checks passed
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.7-dev16

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

Labels

bug Something isn't working dependencies

3 participants