Nice! I also made my own static site generate which uses KaTeX instead of hevea to render LaTeX to static HTML:
It’s a bit more heavy-handed (as in: it outputs a lot of HTML elements to format relatively simple formulae), but the math it generates is really beatiful, and since I don’t put all of my posts on one page, my requirements are probably a little bit different.
See also my blog, which is generated with my static site generator:
This blog is a gem, by the way.
The op mentions hevea being quite slow. How is server side rendered KaTeX in this regard?
And I love the overall look of your posts!
To be honest, it’s not terribly fast either. Currently, the blog has 7 posts, none of which are very long. This site takes 5 seconds to generate, which is not very slow. I think KaTeX takes the majority of the time, since there’s not too much else going on. It’s fair when you check the HTML, since the formulae consist of hundreds of DOM nodes.
So, everything comes at a price. For me, this is acceptable since I don’t put all posts on one page. I don’t think it would be an acceptable solution for the blog in this thread since it would likely make loading/rendering the blog very slow.
Somewhat related, I once started working on a frankenstein abomination of a plugin for SILE for typesetting ASCIIMath-formatted equations. It’s a kinda funny pipeline, as it goes:
ASCIIMath → MathML → (partial, text-only) SVG → SILE (i.e. Lua)
Unfortunately, one of the challenges I stumbled upon near the end kinda made my motivation wane in this particular project. Why frankenstein abomination, you may ask? Because it’s Lua code that was semi-manually translated from completely unrelated JS (ASCIIMath.js) and Python (MathML->SVG) codebases! :D yet it actually resulted in fairly regular and idiomatic Lua! :D More high-level details are present in a comment in a different issue #578 in SILE.
this is very impressive.
I wonder if the author thinks this code can compile in into Android library (with Android NDK) and into an IOS library.
If that works, it can be used within React-native (or any other html-aware viewers on a mobile platform).
It would solve, what I, at least think, is a huge problem in mobile: no WebView-free math renderer.
Very cool. After skimming the code he could thread it per post pretty easily or create a Makefile for make -j since it’s super chunkable. Beautiful job.