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

Handle variant forms for pseudo-scripts better. (mathjax/MathJax#2519) #604

Merged
merged 6 commits into from
Mar 29, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 2, 2021

This PR improves the handling of pseudo scripts so that both the superscript version (using msup) and the non-superscript versions will render properly (with a font that has the proper glyphs available, like STIX2). In the past, MathJax used the larger sized primes in the normal mathvariant, and this lead to incorrect sizes being used when the primes were not in msup. This PR now expects the regular size to be in the normal variant and the larger size in the -tex-variant font, and the mo element sets the correct variant for the position it is used in. It also remaps common characters that might be used for primes to their appropriate prime character (e.g., ' maps to U+2032 (prime)).

That means <msup><mi>x</mi><mo>'</mo></msup>, <mi>x</mi><mo>'</mo> and <mtext>x&#x2032</mtext> will all render properly (when the font contains the right characters, which the MathJax TeX fonts don't, but the STIX2 fonts do).

This is intended as a step toward making MathJax work better with STIX2, as well as setting the stage for modifications to the MathJax fonts later this summer.

@dpvc dpvc requested a review from zorkow March 2, 2021 16:03
@dpvc dpvc added this to the 3.1.3 milestone Mar 3, 2021
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remembered the discussion we had on that:
We wanted to handle pseudoprimes in core and giving the resulting node a pseudoprime property instead.
Firstly, we could expose the property (e.g., for SRE). And secondly, it would not need to be handled explicitly in the Wrapper.

@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

Right you are! Thanks for coming up with it again. It had totally slipped my mind.

@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

OK, I've moved the pseudo-script and prime checking to the MmlMo class and marked them with properties. The pseudo-prime is exposed on the serialized MathML output for your convenience in SRE.

@dpvc dpvc requested a review from zorkow March 19, 2021 21:58
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some minor things.

@dpvc dpvc merged commit 1be4ddc into develop Mar 29, 2021
@dpvc dpvc deleted the issue2519 branch March 29, 2021 15:42
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