Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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


Sorry to tl;dr your code, but how exactly is it based on TeX? Do you actually run Knuth's TeX code to make this work, or did you reimplement it?

Also, kind of irrelevant, do you think we'll ever get something better than (La)TeX syntax? I've been frustrated by obscure error messages from LaTeX in big documents because it's a macro language, so the interpreter doesn't actually see what you're typing. How does KaTeX handle errors?


We reimplemented the TeX formatting algorithms in JavaScript. Most of them are in https://github.com/Khan/KaTeX/blob/master/src/buildTree.js (there are references to the pages from the TeXbook that the algorithms are on).

Also, we attempt to have relatively good error handling! If you open up the javascript console on the main page and type in a bad expression, you can see what the errors we throw look like. We're not planning on supporting anything other than LaTeX syntax for now though, unfortunately.


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


Awesome project ! could you explain me how you are rendering maths symbol without mathjax ?


We're using the similar fonts to what MathJax uses (ours have some slight changes in spacing), but we do our own layout calculations to be much faster.


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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: