Skip to content
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 stretchy characters needed by mhchem #1174

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jan 13, 2025

This PR adjusts the mhchem package to provide several stretchy characters that it needed but that weren't in the original MathJax TeX fonts (and two that don't have Unicode equivalents). This is done by using a separate mathjax-mhchem font that has the needed arrows and pieces needed for stretchy assemblies for these characters, based on the mathjax-newcm arrows. In order to make the arrows used in mhchem consistent with these, all the arrows uses in mhchem are included in this new font, so that even when mhchem is used in a setting where a different font is selected, the arrows will not change their look between ones that could have been found in the selected font and ones that are in the mathjax-mhchem font.

The new font also includes character used for the bonds that have in the past been constructed from multiple characters.

In order to use these characters and arrows, we end up scanning the TeX string constructed by mhchem and replacing the TeX code that creates the arrows and bonds by new mhchem-specific macros. That is a bit ugly, but gets the job done, without overriding existing macros. After v4.0 is released, I can approach Martin about chaing his code to make this easier, but didn't to do that until everythig was ready for him.

@dpvc dpvc requested a review from zorkow January 13, 2025 16:07
@dpvc dpvc added this to the v4.0 milestone Jan 13, 2025
@dpvc
Copy link
Member Author

dpvc commented Jan 13, 2025

PS, you will need the woff2 branch to test this, since the new mathjax-mhchem font is in that form. For best results, also include chtml-stretchies as the results are much nicer. I still need to push the new versions of all the fonts, including this one, and will make another post when that is done.

@dpvc
Copy link
Member Author

dpvc commented Jan 13, 2025

The mathjax-mhchem font is now in place.

@zorkow
Copy link
Member

zorkow commented Jan 14, 2025

Code looks good. I'll test it once all the other PRs are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants