-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(math): Support the MathML operator dictionary and many TeX-like aliases #2167
feat(math): Support the MathML operator dictionary and many TeX-like aliases #2167
Conversation
73d745a
to
91a69bc
Compare
@alerque Good for review, in my opinion. |
Oh wait, on a second thought (when I annotated the "unused" atom types above...) I just realized we can clear it up a bit here, with a good gain: bigOperator is ill-named from the start, it's corresponding to TeX mathop (with respect to spacing rules) and all of a sudden something becomes much clearer. |
Now this is much better, with bonus cakes 🍰 and tests 🧪 |
…erator In TeX, `\%` is a regular ("ord") atom. The test assumed it was a binary ("bin") operator. Let's wrap it into a `<mo atom="bin">` for the same result (i.e. surrounding spacing).
…onary The MathML code was using U29F5 (reverse solidus), and the supposedly identical TeX-like code uses "setminus", which formerly mapped it to the reverse solidus. It was changed in unicode-math in 2023 to correctly map to U2216 - and our new operator dictionary table follows that change. So the test is adapted to use U2216 too now, and the test results also need to be regenerated. On that occasion, the MathML code is also ajusted to use `<mrow>` elements in sub-expressions, so the sizes of parentheses is in line with the TeX-line examples.
Including another small refactor / clarification on our atom types.
We had too many intermediary types (TeX's names mathxxx, our shorthands, internal values). We got rid from the TeX's math-prefixed named in our new table of symbols and operators, but it was still confusing.
0d1a3ea
to
d5b432d
Compare
Force push so far just to fix Lua style (BTW |
16dfe21
to
d1ff17e
Compare
d1ff17e
to
48c2011
Compare
WIP for now, still things to check and fix, but most of the stuff is starting to work well... So it's good "saving checkpoint" to share.Good to go, IMHO 🚀
First commit
Eg.
\coprod
,\bigcupdot
,\intclockwise
and all their friends do the expect magic.\circ
,\pod
, etc. to just mention a few) are supported.Subsequent commits
Ah, the operator table makes many things better, but others are worse...
<mn>0.123</mn>
instead of<mn>0</mn><mo>.</mo><mn>123</mn>
(with period as punctuation in MathML, possibly affecting spacing)Then..
Issues addressed
Closes #1642
Closes #2169
Parts of some other issues are mentioned above. We're getting closer.
Footnotes
The converter/extractor (in XSLT 1.0 i.e. xsltproc-compatible) from unicode.xml to our Lua structures is included too in the PR. ↩