-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Math more fixes and features #2151
Math more fixes and features #2151
Conversation
4f3d8ec
to
41c662a
Compare
cbdbfbf
to
4f33d97
Compare
Failed regression tests assessment so far:
= All tests failed where expected. |
…ont size I don't really mind us using the (non-Core) rowspacing and columnspacing attributes, but the default values must be a ratio of the current math font size, not some hard-coded value in pt.
Legit MathML elements for which a naive implementation is better than nothing and paves the way to check other more important elements from the MathML test suite.
6b1a9ef
to
488b1d4
Compare
I pushed the fixed test expectations. |
…ike math So that stretching occurs on the relevant spans of content.
One wants `\vec{v}`, `\hat{n}` etc. to result in proper stacking of the corresponding symbol over the argument, instead of the symbol alone and the argument being lost :)
We long did without it, but MathML examples may contain lengths in px. And we'll be happy too with other uses cases such as Markdown etc. This might break some code as SILE.types.length can ignore the unknown unit and the raw number value would thus be regarded as being in pt. But that's rather a parsing bug anyway, and SILE.types.measurement spits an error, so let's not care.
In particular, in most MathML examples, tests, or results from other converters, a zero line thickness is used for binomial coefficients and stacked subscript/superscript on big operators such as sums, etc.
Nothing really complex with mpadded.. Wait some ambiguity if dimensions are in a font-relative unit (see in-code comment), but let's move forward anyway -- and on the same occasion, remove the non-standard approach previously used for (La)TeX's phantom, hphantom and vphantom.
This is not a proper fix, see in-code comment, but one has to move forward and the workaround does the trick until we can do better.
And also override other explicit attributes from the element over those from the default operator table.
The current stretchy "reshaping" picks the closest symbols in the math glyph variants, but when none exist or they are still not close enough (esp. far too small), OpenTypeand MathML Core say we should rely on complex glyph assembly rules from glyph parts. We don't have that yet: Here we fallback on re-scaling the glyph. It might not look always good, but at least it's stretched as it should around the content. It's a dirty compromise until something better can be done.
Presumably a non-general solution here, covering the main use cases only (e.g. braces and vectors) without too much stacking.
Follow MathML Core layout, except when the base is a symbol, in which case use the more finicky TeX approach. Closes sile-typesetter#2122
488b1d4
to
ef249c3
Compare
My force push of rebased commits was only to apply Lua coding style changes created deterministically by running |
Congrats! 🚀 |
On An Adventure1 - Part One
Closes #2122
Closes #1799
Closes #1293
Footnotes
"Grandpa, how did you end up on such an adventure in the perilous Land of Math?"
"Well, it all began with a simple, amusing task involving square roots, nth roots, and the like..."
"And that went smoothly, didn’t it?"
"At first, yes. But then I started picking out random formulas, sure I could typeset anything that came my way. Little did I know, I had wandered into the lair of the Hydra."
"The Hydra? That beast with countless heads that regrows two for every one that's cut off?"
"Exactly. The great monster, relentless devourer of formulas"
"And did you manage to defeat it?"
"I can’t say for sure. But I stopped complaining and making issues. I just drew my sword and kept fighting the beast. Pouring commits into the lair, one after another." ↩
So I'm taking a shortcut here -- one which would likely make math font designers frown, as formerly for the msqrt/mroot support. I'll explain something about it in the booklet I'm also preparing as I progress on this PR... (I haven't counted, but I've assembled over 50 formulas at least, all problematic in an area or another. Frankly, glyph assembly from bits is insane, is the least of the problems, and is far too costly). ↩
Previously unreported... Just a bad confusion between largeop and big operators, a mere coding slip likely... but it's a very funny one, we even show it, unnoticed, on our "demo" examples on the web-site 🤣 - Yes that circled-integral is too high with respect to the baseline, look folks! 🐰
↩
I couldn't make sense of MathML Core §3.4.2.2 so I just made it work for a series of tests. The results seem acceptable for a first try, and one may perhaps understand the implied logic if we ever meet more complex cases:
↩