Get help from the marimo community

Updated last week

Require latex/mathjax packages

At a glance

A community member inquired about using LaTeX packages like amsmath, mhchem, and siunitx in marimo, similar to how they can be used in Jupyter notebooks. The answer indicated this functionality is not currently possible, but could be implemented by discovering installed packages and automatically adding extensions.

Through the discussion, it was revealed that marimo uses KaTeX instead of MathJax for equation rendering. A community member attempted to implement support for the mhchem extension by modifying TexPlugin.tsx. After receiving guidance on how to properly fork the repository, they successfully submitted a pull request to add this functionality.

Useful resources
To write maths and science more easily, I use some common latex packages, like amsmath, mhchem, siunitx...

These packages have a mathjax version or equivalent.
In jupyter I can require those in mardown cells or use a custom.js.

I must be blind but I couldn't find docs on how to do that with marimo.
Marked as solution
It is not currently possible. We could potentially try to discover this (if they are installed) and try to automatically add the extensions.

We can look into doing this if you'd like to file a ticket. Or if you'd like to make the contribtuion, we'd very much appreciate one!
View full solution
M
L
6 comments
It is not currently possible. We could potentially try to discover this (if they are installed) and try to automatically add the extensions.

We can look into doing this if you'd like to file a ticket. Or if you'd like to make the contribtuion, we'd very much appreciate one!
Thanks for the answer !

I'd love to try and make a contribution, but I'm worried I don't have the skills and not much time. I'll try to have a look during the holidays.

What do you mean by discover ?
I was thinking marimo could look in the packages installed and try to find the additional latex plugins that are installed
@Myles Scolnick It seems to me that currently marimo is using katex for equation rendering.

katex possibilities are relatively limited compared to mathjax, but it happens to have an extension for mhchem, which is the one I personally need (and honestly anyone doing chemistry).

With a couple of new lines in TexPlugin.tsx I could make something that seems to be working. Not sure this is enough, but in case, I can't push my branch to the repo to make a pull request :
Plain Text
(marimo-dev) marimo ➤  git push --set-upstream origin ls/add-mhchem
ERROR: Permission to marimo-team/marimo.git denied to LioSergent.


How can I make a pull request ?
You need to make a fork of marimo in your own user. I would recommend the GitHub cli which does this for you
Add a reply
Sign up and join the conversation on Discord