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
Aligning mhchem arrows #1491
Comments
The x-arrow constructs produce much more complicated MathML results, so they are slower to process (both for conversion from TeX to MathML and from MathML to HTML-CSS) and less semantic; and phantom elements just make that worse. Since we have been working hard on making MathJax output accessible, we are more aware of the problems that non-semantic MathML can cause for users with assistive needs. Of course, the mhchem MathML results can be pretty non-semantic already, so perhaps it is not necessary to worry about it in this situation.
This is because the MathJax TeX fonts don't include the needed glyphs for stretching them. The STIX fonts do, as shown below, but using those requires the page author to force STIX fonts be used. That is possible, bur rarely done. Also, the stretched versions don't have the different sized arrows. Again, MathJax doesn't have the required glyphs for that. (Indeed, Unicode doesn't have the required glyphs, so that complicates things.)
I'm not sure if you are meaning the long-arrow or the x-arrow versions of these. The long versions are different by design, since that is how they are in actual TeX: The code for these is
with the color extension loaded in MathJax. The background colors help to see the difference in the widths. So these are reproduced in MathJax as they should be. The x-versions are all the same width:
Again, the MathJax TeX fonts don't include the needed glyphs for that. An un-stretched version could be created similar to the harpoon versions, but the MathJax TeX fonts don't have the needed pieces to produce the stretched one, and nether does the STIX font. Because there isn't even a single-character equivalent version in the MathJax TeX font, it is difficult to make an x-arrow version of it as well. I understand that these are limitations for you, and we do hope to improve the situation for stretchy arrows in MathJax version 3, but the current fonts don't support the arrows that you are looking for. |
I now understand why the "long" arrows are sized differently: Because TeX does it that way. However, the "x" arrows are sized differently, as well. For me, I can see a difference with all the renderers.
for the following code.
Maybe I am too pedantic and I should skip the idea of same-length arrows. Concerning the stretchable asymmetric harpoons, that really is a semantic problem with the STIX fonts. I will use the non-stretchable "long" arrows for the while being. Rather non-stretching than semantically wrong. Concerning the missing arrow type.
Yes, could you please help me with that? (Provide the code?) |
Add this below the definition of
Reverse the arrows if that isn't the correct arrangement. Adjust the height of .25em to suit, but try it at a variety of sizes (reloading the page after zooming) to make sure it works OK at different scales. |
@dpvc is this issue tagged correctly? |
Users are asking for strechy |
We will be rebuilding the fonts for version 3.0 of MathJax, and can address the missing glyphs needed for those arrows at that time. |
Hi, is the problem solved or will be solved in 2021? |
I'd like to align the mhchem arrows in length. But I do not know enough about the inner workings of MathJax to touch the arrow definitions.
First of all, is there a reason for using both, long arrows (e.g.
\longrightarrow
) and x-arrows (\xrightarrow
)? We could use x-arrows only, with a phantom argument. This would make the whole task much easier.Further issues: The harpoons do not stretch correctly.
The single-headed arrows are a little bit shorter for the same input as the double headed.
To complete the set, I would also need an arrow similar to the harpoons, but with full arrow heads.
The following test document works with current and new mhchem, as the arrow code stayed untouched.
The text was updated successfully, but these errors were encountered: