-
Notifications
You must be signed in to change notification settings - Fork 15
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 |
An issue touched upon above, which I think deserves another mention: <math>
<msub>
<mover accent="true">
<mi>H</mi>
<mo>^</mo>
</mover>
</msub>
</math> Hat symbols (latex \hat{...}) should be rendered as a circumflex. The above renders too wide and too bold. <math>
<msub>
<mover accent="true">
<mi>H</mi>
<mo>̂</mo>
</mover>
</msub>
</math> is better but still too wide. Is it worth having accents like the above as first class citizens? |
<math>
<msub>
<mover accent="true">
<mi>H</mi>
<mo stretchy="false">̂</mo>
</mover>
</msub>
</math> |
The following two items in my original list were the result of my applying incorrect CSS styles to native math rendering:
I marked these items as "resolved" in the table at the start of this issue. The remaining items are still problems. Ideally the native rendering should match MathJax's (and LaTeX's). |
Re accents, the OfficeMath display engine chooses the best accent width for the base. For example, different widths are used for accents over i, m, a+b, etc. That way the user/MathML doesn't have to specify the accent width. |
Update the opening comment to place the rendering problems in a table with a leading column containing the current status, e.g., "resolved". |
Native MathML rendering differs from TeX/MathJax/Word in a number of ways. Here's a short list of differences.
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: