-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mhchem #3311
Add mhchem #3311
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
All contributors have signed the CLA ✍️ ✅ |
@LioSergent, thanks for the PR! Can you sign the CLA by adding a comment with the following line? I have read the CLA Document and I hereby sign the CLA |
I have read the CLA Document and I hereby sign the CLA |
004be65
to
b66cd4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failing test is unrelated — got unlucky with a test that fails just once a year! Thanks for the change, and happy new year!
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.10.10-dev4 |
📝 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 chemical writing through \ce command, but also clean physical unit typesetting with the \pu command (somewhat similar to siunitx in latex).
Related to https://discordapp.com/channels/1059888774789730424/1318274202507284531
Note : this is the first time I'm trying to contribute to an open-source project, and I honestly don't really know what I am doing, but since the change is very small, I thought I could try. I just tried to make https://katex.org/docs/node#using-mhchem-extension work.
🔍 Description of Changes
📋 Checklist
I have not tested for performance. Not sure how to test for that. In case it bloats the app, maybe it should be set as an option, or marimo could detect if \ce or \pu is written somewhere.
Note: for comparison, Jupyter uses Mathjax which also allows for mhchem functionality through an extension. The extension isn't loaded by default (although it's very easy to load, either in a cell via "$$\require{mhchem}$$" or through the user's ipython config).
However, another example, obsidian.md (the note-taking app I use) also uses Mathjax, and does load mhchem by default.
Not sure why KaTeX chose to put mhchem commands \ce and \pu as an extension. mhchem feels like just a convenient (and thin) wrapper around things like \mathrm.
📜 Reviewers
@mscolnick