This would be an alternative to KaTeX; see https://ctan.org/pkg/luamml?lang=en, which can convert LaTeX math to MathML. I am envisioning a pipeline that is kind of similar to how we generate SVGs for diagrams, but where instead we are calling luatex to produce MathML snippets. It seems viable, assuming a good caching regime.
I am interested in this because it would make it so that I can include mathematics in my Atom feed. Depending on browser support, users may or may not wish to use this for the actual online view, but some may prefer it.
Comments
did:plc:4gj3ihsdh6fn3aqq5bdnw5w3
I added Latin Modern math to the fonts shipped in the theme. Unlike the fonts that KaTeX uses, it is a font that ships an OpenType math table, so the mathml output looks quite nice:
did:plc:jjiv56ot7d6sgethto3jr3r5
I was thinking about this and I think basically the main obstacle is that in the current architecture, we don't really have a way to run an external transduction task at evaluation-time — and I think that might be a good thing, since it is nice if evaluation is pure. The reason LaTeX-to-SVG is fine is that we content-address the artefact; with MathML, and other possible transduction tasks that we might consider (e.g. as a lightweight plugin system!), the result is supposed to be inlined into the output rather than addressed.
One possible approach would be to still content-address it and store the address in the IR, and look it up in the in-memory database during rendering. Curious what you think.
did:plc:jjiv56ot7d6sgethto3jr3r5
By the way, that font does indeed look nice. It is seeming to. me like 2026-2027 is going to be the year of being able to use MathML directly in modern web browsers.
did:plc:4gj3ihsdh6fn3aqq5bdnw5w3
FYI, I am doing a larger writeup of my thoughts on this
did:plc:4gj3ihsdh6fn3aqq5bdnw5w3
I am thinking that the thing I am writing could serve as the foundation for our next grant proposal
did:plc:jjiv56ot7d6sgethto3jr3r5
Ooo. That sounds great :)