Center large math operators on axis#1735
Conversation
|
I'm not sure ignoring the font properties like *TeX does is a good idea. My guess is that it's done primarily for historical reasons. This is really something that should be fixed in the font itself. There might be a good reason for why a font author would like an opinionated baseline for their symbols. cc: @alerque |
|
Here's MathML rendered by Firefox (same expression, same Libertinus Math font): Symbols in MathML are represented by the For something like The upshot is that, by default, MathML makes every large operator symmetric about the axis. This can be overridden by the content author by setting the In summary: TeX's layout algorithm bakes in centering large operators on the axis (and hence its offspring do as well), MS Word appears to do the same, and it's the default behaviour in MathML. A math font designer working in this environment would know all of this, and whatever might motivate the choice of baseline for a large operator, it wouldn't be to affect default math layout because the standard of the major engines is to center the glyph on the axis. Maybe in the future Typst will allow a |
|
Oh, and this is a two-fer! Closes #1272
|
|
I'm convinced. Thank you! |



Closes #1620
The large integral sign in Libertinus Math, glyph

/integral.size1, has an abnormally low baseline.If used as-is, this leads to the suboptimal layout reported in #1620. Nevertheless, LaTeX does a fine job typesetting with it. From the TeXbook, page 155 (see also Appendix G, rule 13, page 444):
"A character of class 1, i.e. a large operator like
\sum, will be vertically centered with respect to the axis when it is typeset. <snip> This vertical adjustment is not made for any of the other classes."That is, the glyph baseline is simply ignored if the character is a large operator (like
\sum,\int,\prod, etc), and it is centered nicely instead. This PR implements this same policy for Typst. Only one test image needed updating after this change; there were minusucle pixel variations (<1%) associated with a single inline integral sign. This means that fonts used the test suite are already setting baselines to follow this policy.Before
After