The Gold Standard for Math Typesetting on the Internet

Through a wonderful little game called TeXnique, I became aware of the online typesetting system KaTeX. Unlike MathJax, which is immensely finicky, slow, and has limited support for proper LaTeX, the KaTeX system supports scaling of rendered images, automatically detects the text color of my site and adapts as necessary, and has a fuller implementation of LaTeX commands.

Even better, I discovered that some wonderful people have made KaTeX plug-ins for WordPress. I know longer need to reference other math posts, as I can write them on this site without being self-conscious about how atrocious they look.

Let’s do a side-by-side comparison. If I wanted to use LaTeX, it would look something like this: \displaystyle \dfrac{\mathrm d}{\mathrm dx} \int_0^x t^2 \mathrm dt = x^2.

Note that, despite my best efforts, I can’t even match the background and text colors perfectly, and this is what that code looks like:

\displaystyle \dfrac{\mathrm d}{\mathrm dx} \int_0^x t^2 \mathrm dt = x^2. &fg=dadada&bg=000222

with a command to start and end LaTeX as well. This is cumbersome.

Using KaTeX, I get something that looks much better without any need to investigate my theme colors’ hex values: \displaystyle \dfrac{\mathrm d}{\mathrm dx} \int_0^x t^2 \mathrm dt = x^2.

If you zoom in on this post, you’ll also notice that the LaTeX version above is just a static image. It gets blurry as you zoom in (and might be blurry before anyway!) Compare this to the KaTeX snippet, which scales smoothly when you zoom in.

I’m incredibly happy with this find, and you can expect more math-oriented posts in the future.

Leave a Reply