Require latex/mathjax packages
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.
7 Replies
Someone will reply to you shortly. In the meantime, this might help:
-# This post was marked as solved by @Myles Scolnick. View answer.
marimo
Require latex/mathjax packages
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...
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 :
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
For the record, the PR is https://github.com/marimo-team/marimo/pull/3311
GitHub
Add mhchem by LioSergent · Pull Request #3311 · marimo-team/marimo
📝 Summary
I would like to be able to write chemical equations conveniently in marimo.
This pull request is an attempt at including katex' mhchem extension, which allows for convenient chemi...