# KaTeX vs. MathJax

+ 3 like - 0 dislike
4569 views

I just got to know this math typing library called KaTeX, it seems to be indeed much faster than MathJaX to convert LaTeX codes and display them on webs. Should we consider replace MathJaX with KaTeX? Of course I guess we should somehow test its stability and if it supports as many codes as MathJaX does.

MathJax is always rate limiting on sites like this, it is really annoying that it takes so long to display.

@RonMaimon I have never encountered that the time MathJaX loads is too slow to bear, on firefox (or on chrome when I used to use it before). How much time is "annoyingly long"?

It isn't too slow to bear, but it is noticible. The rendering of tex should be imperceptible on modern hardware, as it is software from the 1980s. The mathjax goes through an image, and the conversion is in stages. For pages with approximately 100 complicated formulas, it can take many seconds to convert.

+ 3 like - 0 dislike

OK I found these discussions. It seems KaTeX is still in its very premature form, e.g. we cannot display matrix using it. Let us at least wait until it matures a bit more to start the discussion.

answered Sep 18, 2014 by (2,640 points)

Neither do they support \mathbf, \mathcal, \mathbb, etc. I think that by the time they make KaTeX as good as MathJaX, it will be as slow, too. The discussions you linked to also say that KaTeX doesn't work on IE < 8. IE7 is still quite commonly used, dropping support for IE 7 doesn't seems like a very good idea, as bad as the browser may be.

I think that by the time they make KaTeX as good as MathJaX, it will be as slow, too.

That doesn't sound very plausible. Wouldn't it be silly for the developers to develop something that will only be as good/bad as what already exists, even when matured?

A big difference is that KaTeX can run on the server side while MathJax usually runs on the client side. Although MathJax takes much more time to display, it loads the content much faster. Both these two libraries have their disadvantages. A better solution is to use MathML instead, but only Firefox and Safari support it natively.

@JiaYiyang Actually, you're right: they wouldn't really just make something that does exactly the same as MathJaX does. But I think that they wouldn't really build something with as many features as MathJaX, as KaTeX is primarily meant for Khan Academy, which is primarily meant to to serve the interests of K-12 students, and wouldn't really need many of the features that PO would.

@soliton I agree, and I think that the "load the page then the math" as in MathJaX is better, since post bodies seldom start with MathJaX (they usually start with text), so the user can still read the rest of the post until the TeX loads.

 Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead. To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL. Please consult the FAQ for as to how to format your post. This is the answer box; if you want to write a comment instead, please use the 'add comment' button. Live preview (may slow down editor)   Preview Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:p$\hbar$ysi$\varnothing$sOverflowThen drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds). To avoid this verification in future, please log in or register.