otini discovers math typesetting
@otini Wow. That looks very similar to what I did. What did you base it on? I went through many iterations before I figured out some basics with respect to for example how a faction should be aligned with respect to the baseline.
Most of the time I was generating an expression using LaTeX and then checking how it's done there.
I even went to the source code of TeX to see how they did some things.
Is there some documentation somewhere?
otini discovers math typesetting
@loke So this is all based on the work by Rui Xia at https://github.com/simoncozens/sile/pull/578, where he implemented the base typesetting algorithm as described by the TeXbook.
As for me, to style things I read chapters 16 to 18 in the TeXbook for general guidelines, and I use the “math constants” included in my math font. For instance, the height of the fraction rule relatively to the baseline (what Knuth calls “the axis”) is one of the constants.
otini discovers math typesetting
@loke And I found documentation about OpenType math features, such as the constants table, there: https://docs.microsoft.com/en-us/typography/opentype/otspec170/math
But it is not very satisfactory, as I complained in my initial toot.
otini discovers math typesetting
@otini Wow. That's a lot of detail, and certainly not something I've paid attention to. 🙂 I've basically just picked measurements that seems to make sense, and the end result is OK, although not perfect by any definition.
otini discovers math typesetting
otini discovers math typesetting
@otini
I see. Extra opentype information isn't exposed to McCLIM at the moment, and I didn't even know such information was available in opentype.
I guess I'll have to investigate this some more, and perhaps improve the McCLIM interface to it.
However, I've managed to get a decent result even without it so perhaps it's acceptable.
@tfb
otini discovers math typesetting
@tfb
I have read parts of it. But it talks about TeX, and as far as I remember doesn't go into the rules for laying out equations. After all, this knowledge is encoded in TeX itself, so if you're using that tool, there is no need to know all of that.
The place I found that contains all of this is the TeX source code. It's written using literate programming and can be typeset as a book. It's very detailed though and it takes time to find things.
@otini