by compumike · 6y ago · 0 comments
You can scroll through https://ultimateelectronicsbook.com/systems-of-equations/ for a particularly formatting-heavy example with lots of matrix equations and augmented matrices, working through Gaussian decomposition and LU factorization examples.
Instead, for performance, I wrote a small Ruby / Jekyll plugin to do MathJax server-side rendering. It calls the mathjax-node npm package, with some caching on top because it's so slow. This outputs static HTML and CSS with a few math fonts.
The mathjax-node-sre npm package even populates aria-label fields for each equation:
<span class="mjx-math" aria-label="y left-parenthesis x right-parenthesis equals StartFraction 1 Over 1 plus x EndFraction">...</span>
If you have the option to consider server-side equation rendering, your users may thank you.I'm developing KeenWrite[0], a desktop-based text editor that provides real-time rendering of TeX. It has two TeX-related HTML export formats: SVG (no rendering for either client or server) or TeX (requires client-side rendering). Behind the scenes it uses a highly-optimized version of JMathTeX[1] that includes a custom renderer to handle translating math font glyphs into SVG paths.
I hope to see more server-side solutions. The customizability and client-side overhead (you only need to render once on the server, possibly with caching) is not something a client-side library can achieve.