News for hackers. Stuff that matters.
Re:KaTeX – Fast math typesetting library for the web by ktpsns on Sunday March 24, 2019 @05:52AM (#19475415)
This is fantastic. A real concurrent to mathjax, which is notoriously slow on pages like mathoverflow - exactly the shown example :-)

Even better, both are open source. Amazing, thanks for all of that, lovely world!

Re:KaTeX – Fast math typesetting library for the web by raphlinus on Sunday March 24, 2019 @10:26AM (#19476495)
A huge amount of the speed problem in MathJax is just the default configuration, which does the math typesetting in a deferred callback and throttles the work, basically guaranteeing that the browser will go through a full relayout and repaint many times if there are lots of math on the page. It's possible to change this, but I don't think many people do.

Another reminder of the power of defaults.

Re:KaTeX – Fast math typesetting library for the web by kevinb7 on Sunday March 24, 2019 @01:55PM (#19477674)
My limited understanding of MathJax is that it uses the browser to measure glyphs. KaTeX on the other hand includes metrics for many of its glyphs. Where things get a little tricky is i18n. There are many languages which our current fonts don't cover and thus we have no metrics for them (we make some educated guess about some unicode ranges). It would be really nice if browsers implemented a Font Metrics API, unfortunately efforts to do so appear stalled at the moment.
Re:KaTeX – Fast math typesetting library for the web by enriquto on Sunday March 24, 2019 @11:15AM (#19476790)
Can you please elaborate a bit more on that? How can you configure it to be faster? I'm considering leaving MathJax for pre-rendered png because it is unusably slow (with the default configuration at least). My use case is a whole book of math on a single html page. Pdf viewers have no problem with that. Yet, firefox+mathjax cannot cope.
Re:KaTeX – Fast math typesetting library for the web by raphlinus on Sunday March 24, 2019 @04:44PM (#19478650)
Yes, you want to set processSectionDelay to 0. Here's an example: https://github.com/raphlinus/ghilbert/blob/master/src/htmlou...
Re:KaTeX – Fast math typesetting library for the web by williamstein on Sunday March 24, 2019 @01:32PM (#19477550)
I have been using MathJax since before it was called MathJax (it used to be jsMath), and I've never found any synchronous rendering option to speed it up. You can minimize the page updates by not showing anything until mathjax is done, but that is disturbing to users (who either see nothing for an unknown amount of time, or see raw latex formulas), and it's frankly not much faster in my testing. If there really is such a MathJax option to synchronously render faster, then this page [1] should in fairness mention it.

[1] https://www.intmath.com/cg5/katex-mathjax-comparison.php