Manellana
Manellana2mo ago

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
Hall
Hall2mo ago
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...
Myles Scolnick
Myles Scolnick2mo ago
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!
Manellana
ManellanaOP2mo ago
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 ?
Myles Scolnick
Myles Scolnick2mo ago
I was thinking marimo could look in the packages installed and try to find the additional latex plugins that are installed
Manellana
ManellanaOP4w ago
@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 :
(marimo-dev) marimo ➤ git push --set-upstream origin ls/add-mhchem
ERROR: Permission to marimo-team/marimo.git denied to LioSergent.
(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 ?
Myles Scolnick
You need to make a fork of marimo in your own user. I would recommend the GitHub cli which does this for you
Manellana
ManellanaOP3w ago
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...

Did you find this page helpful?