-
Notifications
You must be signed in to change notification settings - Fork 227
Update Operator Dictionary from MathML 4 spec (mathjax/MathJax#3363) #1352
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1352 +/- ##
========================================
Coverage 86.72% 86.72%
========================================
Files 337 337
Lines 84145 84234 +89
Branches 3140 3134 -6
========================================
+ Hits 72971 73051 +80
- Misses 11174 11183 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I added a commit that updates some of the TeX classes (in particular, the class for a period, which is incorrectly set as PUNC but should be ORD, as in actual TeX). The changes to the tests indicated to me that there was an unneeded TeXAtom node being used around some character that don't need them. This was coming from the |
I realized that I used the wrong issue number with this. It should be mathjax/MathJax#3363. I changed the title, but not the branch name, to reflect the correct issue. |
This PR updates the operator dictionary using the one from the MathML4 specification. The MathML spacing values are different from the ones in the MathML3 specification that was used to create our operator table originally, but these only affect the output when MathML spacing is requested. They are also used to define the TeX class in cases where the TeX class isn't explicitly set, and that only changed the values in some obscure instances (like geometric shapes where we used a fairly coarse approach to setting the class in the past). The characters for which there are macros (like
\blacktriangle
) have their classes set by the TeX input jax, but the change in the operator dictionary may mean they get wrapped in a TeXAtom that overrides the operator dictionary value where it didn't have to before. There are only a few of these.The MathML4 dictionary no longer include
accent
orfence
attributes, and since we use these, I needed to add those back in, so uses some heuristics to do so.the main difference is that the
|
operator is not stretchy when used in infix form, while it used to be stretchy in MathML3. This won't affect the TeX output, as the TeX jax setsstretchy="true"
automatically when needed, but it can affect MathML input. That is, something likewill no longer have stretchy
|
around the fraction. This corresponds to the current MathML-Core output, and MathML4's expected output. On the other hand,will have stretchy
|
as they are in prefix and postfix form. Since SRE adds themrow
even to the MathML, it should not be much of an issue, even for those using MathML input, unless they disable the semantic enrichment.Other changes include making many more character stretchy and some symmetric, and reclassifying some BIN and REL operators. It is a little hard to tell these changes, as the MathML spacing value changes meant that the predefined operator definitions in the
MO
object had to change, and so it appears that there are lots of changes when most are not significant. Ignoring spacing differences helps, but still isn't great. I can provide some better diffs if you want to see them.These changes required updates to 120 tests (mostly adding or removing
stretchy
attributes). I couldn't remember how to get your emacs-based diff tools to work, so I ended up writing some scripts to do the updates for me. They need a little more work to be generally applicable, but I'm hoping they will help with these changes in the future.