LaTeXML
LaTeXML copied to clipboard
Chemistry packages for the working scientist
Packages requested:
- mhchem.sty
- bpchem.sty
- chemfig.sty
Part of the larger #559 issue for providing packages currently in use by latex-writing scientists.
A chemistry postdoctoral fellow recently requested support for "bpchem.sty" at our Authorea help desk. There is no reason not to support that on our end, safe for it not having a binding in LaTeXML.
I am recording the issue here, and will ideally come back to implement it as time permits, but anyone should feel free to beat me to it.
I was just told that mhchem is even more widely used, so I will tuck it in here, maybe they are similar enough to hit 2 birds with 1 stone.
Hey @dginev - any progress on this? We are setting up a UK-wide chemistry data exchange project.
Hi @csaladenes -- we haven't put any work into this issue since it was filed, it's moving up the priority list, but it helps to know that you're considering latexml for a large project.
Could you let us know the packages you would like to have for your workflow, as compared to the list here?
I can take a fresh look into adding some more support. Thanks!
Awesome! mhchem is the priority for us.
An "feature" of chemistry notation is that all the sup/superscript are horizontally aligned (respectively). This leads MathJaX (or the mchem package in it) to use mphantom and mpadded to get the alignment. It also detaches the scripts from the elements they adorn. Better is what https://chem.libretexts.org/ does. They use mmultiscripts to get the alignment (example page).
This doesn't quite work because adornments can appear on electrons ("e") and they don't have the height of a capital letter. So maybe it is better to use msub/msup/msubsup with the attributes subscriptshift and superscriptshift. Of course, you would need to figure out the proper amount to shift. A big downside with this approach is that those attrs are not in MathML Core.