Re:Typst: A Possible LaTeX Replacement
by gucci-on-fleek on Saturday September 27, 2025 @06:46AM
(#45394676)
> HTML with MathML may make a decent system as well
HTML is fine to write by hand (especially when you take advantage of tag omission [0]), but I can't imagine handwriting MathML, since even simple equations need lots of tags [1].
[0]: https://html.spec.whatwg.org/multipage/syntax.html#syntax-ta...
[1]: https://en.wikipedia.org/wiki/MathML#Presentation_and_semant...
Re:Typst: A Possible LaTeX Replacement
by defanor on Saturday September 27, 2025 @07:26AM
(#45394858)
It is indeed considerably more verbose, especially the "context" version (the one focusing on semantics, rather than presentation), and I did not write much of it myself, but I can imagine it being fine. It should not be a bottleneck for carefully (and slowly) composed documents, while for more casual and quick notes, even with LaTeX it appears to be common to use both a preview (often inline) and some input assistance, avoiding completely manual handwriting. Besides, as the linked Wikipedia article mentions, it is rather like expressions in Lisp-family programming languages (or pretty much any common ones, if you avoid infix operators), which are not that bad. I imagine it may also be more convenient (and terse) in combination with SXML or KDL, to avoid closing tags.
This is probably not useful for most people, but I wrote a little script for Emacs that lets me write TeX-style math in a comment and then render/update it below in MathML: http://sdf.org/~pkal/src+etc/mathml-from-tex.el. The translation itself is done by LaTeXML, which one must install on your system separately.
Re:Typst: A Possible LaTeX Replacement
by b1c837696ba28b on Saturday September 27, 2025 @10:04AM
(#45395802)
I also had problems with MathML verbosity, and the culprit is the markup for the individual character classes (mi, mn, mo, ms.) I wrote a little filter that pulls apart character sequences and applies the respective character markup tags using a lookup table, so I can write MathML without using character markup. If any character markup is already present then it is skipped, so the automatic behavior can be bypassed by explicitly tagging characters and symbols as needed. This drastically reduces the character markup and makes it quite readable, even to my dyslexic eyes. As a bonus I'm not tied to some other tool that I have to game from time to time to get a particular MathML expression, I can say exactly what I want. BoBW.
HTML with MathML may make a decent system as well; possibly with an XML source and XSLT for templating, which is apparently how OpenStax textbooks are composed (via CNXML, though that also has just a couple of rain frog pictures in its documentation repository -- seems to be a common pattern around typesetting systems).
Then there is troff with eqn(1), which looks simpler, but not sure if there is an actual specification for it around, either.
And then there are Texinfo, org-mode with LaTeX embedding, other TeX-adjacent options, perhaps Markdown with HTML and MathML embedding.