-
Notifications
You must be signed in to change notification settings - Fork 14
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
Native MathML rendering problems #229
Comments
@MurrayIII can you clarify if you are speaking about a particular implementation? I assume you mean chromium? |
Yes, chromium since Edge uses chromium for rendering. You can see the problems using Chrome too. Try running https://murrayiii.github.io/UnicodeMathML/playground/ and type in some equations. In the settings ensure that MathJax isn't the default rendering agent. Or look at the attached docx.
|
Another issue is that a hat (^) accent over a math-italic f (π) is displayed too far to the left. It's placed correctly for a math-italic x (π₯), although it would be nice to use a smaller hat for the x. |
I have created a codepen for these. I rearranged the examples to group them a bit based on similarities. Here's my take on them:
I don't see this in the codepen. @MurrayIII can you come up with a reproducible example and create a codepen for it? Maybe font related issues -- for these I created a table that uses Cambria Math and STIX Two Math (if you have them installed). Both should have good Open Type math tables, so any poor quality display is because of the spec or a bug in the implementation...
TeX uses a superscript shift that is a based on at least two conditions as does the spec. TeX's values were chosen so that in simple cases such as this, the scripts are aligned vertically. I haven't compared the spec to TeX, so I can't say whether the spec should be fixed or it is an implementation bug.
I added ()s to the example and they do the same thing. Firefox displays them well. I suspect this happens because
I believe this is not correct. If the
This might be another case of the non-stretched version being drawn wrong. Or it could be that the implementation is prioritizing the drawing so that the
This is the subject of #238 and would be solved by changing to using 90% of the content size.
For both of these, I think the spec and implementation are correct. There should be U+2061 or U+2062 used (I added them to the codepen). On these characters, the
I couldn't reproduce this. There is another issues: the interline spacing is too tight in Chrome. Here is a rendering in chrome that shows the interline gap is bad (seems to be 0): |
I agree with what you say about what happens in TeX, but in MathML The markup (as in the codepen) should be something like:
I haven't thought through the consequences, but maybe the default for U+2061 (invisible function application) is wrong and should be to have a |
I was experiencing similar issues with the mathup authoring tool. I decided against inferring function application and invisible times when authors write e.g. https://github.com/runarberg/mathup/blob/main/src/stylesheets/core.css#L1-L68 β : The reason being I cannot guarantee what authors mean so I would rather users of assistive technology not be lied to by bad inference. I still offer authors a way to be explicit by providing zero-width operators |
Native MathML rendering differs from TeX/MathJax/Word in a number of ways. Here's a short list of differences.
<βmath display="block"> often doesn't center the equation
πΒ²+πΒ² displays the superscript Β² for the π too high (should be at the same height as for the π)
Adjacent fractions need to be separated by a small space instead of being contiguous
π sin π needs a space between the π and the sin π and between the sin and the π
|x| displays the vertical bars too high
βπ displays the square root too low
Parentheses around matrices are too large
Displaying a fraction in block mode is centered, but the fraction bar length equals the display width instead of the width of the larger argument
Here's a link to a document that illustrates the differences:
Native MathML Display Bugs.docx
The text was updated successfully, but these errors were encountered: