Live data from Hacker News

KaTeX: Math typesetting for the web

khan.github.io

11–20 of 101 posts

Re: KaTeX: Math typesetting for the web

#11

Any benchmarks against MathJax beyond the visual at the bottom of the page?

They have a benchmark page, where you can benchmark for yourself: http://jsperf.com/katex-vs-mathjax

Yep! Also, ignore the IE 8 data on that page, there was a fluke with IE 8's .innerHTML. You can see http://jsperf.com/katex-vs-mathjax/2 for a version that IE 8 supports.

Re: KaTeX: Math typesetting for the web

#12

Did Mathjax just become obsolete?

Not quite yet, but we're working on it. There are some significant features that KaTeX doesn't yet support, but we're working to add them in the near future. In the meantime, you could use our TeX React component to use KaTeX when possible, and fall back to MathJax only when necessary: http://khan.github.io/react-components/#tex

Great work! Would love to read a blog post in the future about how you guys did your layout engine behind this.

Re: KaTeX: Math typesetting for the web

#13

MathML, MathJax and now KaTeX Not that there isn't a usecase for this, but is this fully MathJax compatible?

We're not compatible yet, but we're working on it! In the meantime, you can fallback to MathJax on things we don't support. That way, most things can be rendered fast, and anything super complicated gets special treatment. We'll be releasing something soon on how to do this, and if you use React you can use the KA TeX component: http://khan.github.io/react-components/#tex

Re: KaTeX: Math typesetting for the web

#14

Did Mathjax just become obsolete?

Not quite yet, but we're working on it. There are some significant features that KaTeX doesn't yet support, but we're working to add them in the near future. In the meantime, you could use our TeX React component to use KaTeX when possible, and fall back to MathJax only when necessary: http://khan.github.io/react-components/#tex

It would be helpful to know what KaTeX can and cannot do.

Re: KaTeX: Math typesetting for the web

#16
Heavy mathjax user here. Couple of use cases I'd love to know more about:

- does KaTeX work pretty reasonably across the platforms? The simplest way I figured out for rendering math notation in-app on mobile devices was through web views + mathjax. E.g. say I wanted to use it in a web view in iOS or Android, would it work as intended? MathJax comes by default with a giant folder of various fonts / ways of rendering, what's the KaTeX story for this?

- would KaTeX work just fine in a headless environment? e.g. say I'm using http://wkhtmltopdf.org/ to generate PDF from some HTML

- how does KaTeX compare to MathJax from a payload size? Mathjax takes quite a bit to load from basic connections even though you have to cache it only once.

Re: KaTeX: Math typesetting for the web

#18

Earlier quoted context omitted.

Not quite yet, but we're working on it. There are some significant features that KaTeX doesn't yet support, but we're working to add them in the near future. In the meantime, you could use our TeX React component to use KaTeX when possible, and fall back to MathJax only when necessary: http://khan.github.io/react-components/#tex

It would be helpful to know what KaTeX can and cannot do.

There's a list of functions it supports here: https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX

Most inline math is done, but we're missing a bunch of individual symbols (see CONTRIBUTING.md in the repo if you'd like to contribute!) The main things we're missing are environments (i.e. \begin and \end), but we'll be working on those soon!

Re: KaTeX: Math typesetting for the web

#19

MathML, MathJax and now KaTeX Not that there isn't a usecase for this, but is this fully MathJax compatible?

We're not compatible yet, but we're working on it! In the meantime, you can fallback to MathJax on things we don't support. That way, most things can be rendered fast, and anything super complicated gets special treatment. We'll be releasing something soon on how to do this, and if you use React you can use the KA TeX component: http://khan.github.io/react-components/#tex

So is your goal to be a faster MathJax-compatible alternative? We currently use MathJax, but there's definitely a need for faster rendering. As an example, we sometimes run a page load through wkhtmltopdf, and MathJax content can take a LONG time

EDIT: Thanks for replying to my comment in spite of the downvotes

Post reply on HN