DJ Chase’s Blog

Replies

In reply to: Curiouser

Math formulas are especially challenging, not only because they can have so many symbols (such as sigma 'Σ'), but those symbols must be rendered in a certain layout (e.g. Σ used to sum a series has the variable and its starting value, as well as the value its going to, arranged in 2 different rows to the right of the Σ).

As a further example, sigma notation only behaves that way when it’s inline. ‘Block-level’ sigma notation places one row above the sigma and the other below, and makes the sigma like twice as large as the rest of the text. This holds true for a lot of other operations as well, such as integrals (∫), sequential products (∏), and sometimes unions (∪). Limits also follow the same rules, except they’re not extra-large because they don’t have their own symbol.

In fact, text layout of formulas and symbols is such a complicate domain that Donald Knuth literally created TeX, an entire digital typesetting system, while he was writing “The Art of Computer Programming.”

Given all this complexity, I didn't even try to represent math formulas in gemtext.

This is what made me reply to this post. You see, I quite like math, so I envision writing some here at times. So as part of working on the back-end, I needed to think about how to typeset math in Gemtext, and I think I’ve come up with a workable solution.

Basically, we can use preformatted blocks to approximate block-level mathematics and put plaintext math using unicode’s extensive set of math symbols in the alt-text as a accessible fallback.

Examples

Read more...