Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
feedback
Discontinued Public feedback discussions for: GitHub for Mobile, GitHub Discussions, GitHub Codespaces, GitHub Sponsors, GitHub Issues and more! [Moved to: https://github.com/github-community/community]
-
KeenWrite
Discontinued Free, open-source, cross-platform desktop Markdown text editor with live preview, string interpolation, and math.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I used to think KaTeX was far superior to MathJax but now I'm not so sure. I made https://mk12.github.io/web-math-demo/ to compare them and other things. They're definitely superior to browser MathML rendering today, which is nonexistent in Chrome (though see https://mathml.igalia.com/), quite bad in Safari, and OK in Firefox. It's true pre-rendering KaTeX produces a lot of markup, but it compresses very well so I don't think it's a big deal. They both have MathML for accessibility, but MathJax is more flexible in letting the user right-click and change the rendering engine, view raw TeX, etc. Rendering KaTeX on the client side is faster than MathJax, but in my experience KaTeX is slightly worse quality, e.g. https://github.com/KaTeX/KaTeX/issues/3400 has gone unfixed for a long time.
(I work at GitHub.) We've started using our Discussions product for feedback. You can post a discussion here:
https://github.com/github/feedback/discussions/categories/ge...
KeenWrite, my desktop editor for Markdown and R Markdown documents, provides real-time rendering of TeX equations:
https://github.com/DaveJarvis/keenwrite/blob/master/docs/scr...
The choice of using TeX over LaTeX is deliberate. Documents written using plain TeX can be rendered by either ConTeXt or LaTeX. I prefer ConTeXt because it makes separating content from presentation easier. One of the benefits of using Markdown, IMO, is to be agnostic as to how the documents are presented. Math could be rendered using ConTeXt, LaTeX, KaTeX, MathJax, JMathTeX, XeTeX, or any other compatible TeX typesetter.
https://wiki.contextgarden.net/Installation
You're being modest. This is clearly the winner, assuming GitHub is fine with the server cycles.
Running the JS client side means blocking the thread. You're either 1. delaying other JS from running, or 2. rendering late, shifting the layout – which is what GitHub has chosen. Refresh this issue and you'll see the jank from the flash of the raw equations: https://github.com/Leland/EquationTest/issues/1
Sending the rendered div's is a non-starter. Large document sizes delay domContentLoaded, slow down browsers, etc.
Your approach, then. On your page there are 178 SVGs. Total gzipped size is 490KB. SVGO[0] gets that down to 311KB – that's 1.74KB transferred per equation.
[0] https://github.com/svg/svgo