Katex

179 views
Skip to first unread message

Jason Grout

unread,
Sep 16, 2014, 12:24:17 AM9/16/14
to mathja...@googlegroups.com
FYI, I saw an article on HackerNews about Katex, a mathjax competitor
just released by Khan Academy:

http://khan.github.io/KaTeX/

(comments here: https://news.ycombinator.com/item?id=8320439, including
some comments from the developers)

It doesn't do nearly as much as mathjax does, but it is apparently quite
a bit faster for what it does do.

Thanks,

Jason

Peter Krautzberger

unread,
Sep 16, 2014, 5:03:20 AM9/16/14
to mathja...@googlegroups.com
Thanks, Jason. It's great to see they've released v0.1. 

KaTeX is a very interesting project and it's always great to see more people working to push math on the web forward.

Peter.

PS: The next MathJax release will see considerable improvements in terms of speed.




--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jean Kaplansky

unread,
Sep 16, 2014, 2:09:58 PM9/16/14
to mathja...@googlegroups.com
which is interesting, since the Khan Academy is listed on the mathjax.org page as a MathJax user...

Davide P. Cervone

unread,
Sep 16, 2014, 2:14:43 PM9/16/14
to mathja...@googlegroups.com
They have been using it, and still do, but are moving toward using their KaTeX when possible, falling back to MathJax when not.  I'm not sure what the timeframe for moving to that arrangement is (perhaps they've already done so).  But even after they do, they will still be using MathJax for the more complicated situations (anything involving arrays, for example, which they haven't implemented).

Davide


To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.

Jean Kaplansky

unread,
Sep 16, 2014, 3:13:27 PM9/16/14
to mathja...@googlegroups.com
Thanks for clarifying. Sounds like the Khan Academy is going to be experiencing some serious fragmentation as they do this migration. They must really see some business value in what they're doing over waiting for the next MathJax release with the improved performance.

fe...@fbreuer.de

unread,
Sep 16, 2014, 4:36:40 PM9/16/14
to mathja...@googlegroups.com, dp...@union.edu
I would be curious to hear where the current speed difference between KaTeX <-> MathJax comes from. Am I right in assuming that by not handling arrays, matrices, etc. KaTeX can avoid the issue of the height of child elements influencing the width of the parent element - and therefore KaTeX can rely more on built-in browser layout mechanisms?

Felix



On Tuesday, September 16, 2014 8:14:43 PM UTC+2, Davide P. Cervone wrote:
They have been using it, and still do, but are moving toward using their KaTeX when possible, falling back to MathJax when not.  I'm not sure what the timeframe for moving to that arrangement is (perhaps they've already done so).  But even after they do, they will still be using MathJax for the more complicated situations (anything involving arrays, for example, which they haven't implemented).

Davide


On Sep 16, 2014, at 2:09 PM, Jean Kaplansky wrote:

which is interesting, since the Khan Academy is listed on the mathjax.org page as a MathJax user...
On Tue, Sep 16, 2014 at 12:24 AM, Jason Grout <jason...@creativetrax.com> wrote:
FYI, I saw an article on HackerNews about Katex, a mathjax competitor just released by Khan Academy:

http://khan.github.io/KaTeX/

(comments here: https://news.ycombinator.com/item?id=8320439, including some comments from the developers)

It doesn't do nearly as much as mathjax does, but it is apparently quite a bit faster for what it does do.

Thanks,

Jason


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Krautzberger

unread,
Sep 27, 2014, 12:06:54 PM9/27/14
to mathja...@googlegroups.com, Davide P. Cervone

Hi Felix,

We're busy with the next release and haven't had the time to look into KaTeX in detail yet. So the following are just some preliminary thoughts.

First off, comparing MathJax and KaTeX is difficult. KaTeX is more similar to Davide's old jsmath while MathJax has a very different approach with the focus on MathML.

Testing speed is a messy business. The jsperf test on KaTeX's github page seems to time both the download of components and the layout speed for MathJax but only the layout speed of KaTeX. Murray's test seems more real-life and tells a different story once loading is optimized. Still, KaTeX is undoubtedly faster right now -- that's pretty cool.

(I had written this long detailed post about the complexities involved, the tools available and other things. But I feel that this is not very helpful to people -- so instead, let me try to simplify.)

a) KaTeX implements the TeX pipeline; that's easier than MathML rendering (which is what MathJax does).

 b) KaTeX does not support more complex content (e.g. arrays); this allows some simplifications (e.g., no width calculations, you can hard-code more CSS). From Davide's experience, it seems difficult to get more advanced TeX features that way (but it would be exciting if they find a way!). 

c) KaTeX has less features, not just in terms of TeX. (That's a complicated issue and might not be worthwhile for casual users.)

d) KaTeX uses more modern CSS (the HTML-CSS output is designed to support everything down to IE6 and all the horrors of the web of 2008).

e) It's not magic. Our new output for MathJax 2.5 takes a similar approach. It's ~10x faster than the HTML-CSS output (it's a bit rougher right now, mostly because it currently uses Times-like fonts to avoid web fonts).

So overall, KaTeX's speed improvements are great. It's what you can do with modern techniques and by dropping a lot of functionality.

Still, I can't help but find the timing unfortunate. Khan Academy has been a long time MathJax user and started KaTeX about a year ago -- when our roadmap already listed speed improvements as the primary goal of the next feature release. And it seems we've been thinking about the same kind of improvements. So I'm sorry they never reached out; it would have been a great opportunity to work together and push everybody forward.

Peter.

Reply all
Reply to author
Forward
0 new messages