Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compare performance MathJax vs MathQuill vs Katex

I'm looking for the fastest way to create formules inside a web page.

I thought I found the solution on jsperf in which MathQuill is by far the quickest. After I studied the tests a bit I noticed that the test for MathQuill runs in sync-mode, but it had an async setup. However, if you check the async checkbox, MathQuill will never fire the render event and thus the test will never complete.

So the questions is, is MathQuill async ? And is this is good performance test ? And is there maybe a better formula renderer ?

like image 338
Jeanluca Scaljeri Avatar asked Nov 30 '14 19:11

Jeanluca Scaljeri


People also ask

Is KaTeX better than MathJax?

KaTeX, according to most benchmarks I've seen, is faster than MathJax, by a long shot. However, it has somewhat incomplete support for LaTeX, so that may be an issue. MathJax is pretty slow, relative to the others, but it has almost complete support for LaTeX. If that's the price you're willing to pay, then go for it.

Is KaTeX the same as LaTeX?

KaTeX is not LaTeX at all. It is a mathematical typesetting library designed for use on websites. It, like MathJax, uses a LaTeX-like syntax for its commands and produces output that looks very much like that of LaTeX, but neither KaTeX nor MathJax are actual LaTeX.


2 Answers

So the questions is, is MathQuill async?

Based on the MathQuill source, it renders elements on document ready, synchronously, but it can also render elements on the fly, through the .mathquill() API. Technically though, you could call the method yourself and do it asynchronously.

And is this is good performance test?

I can't really speak to the usefulness of the test because it's unclear what you're trying to do, but I can provide you with some general background on the issue.

MathQuill's main strength is the ability to render math on the fly, with pretty, user-friendly textboxes. They themselves admit that it's not a good option for rendering static math, due to it's limited LaTeX support.

KaTeX, according to most benchmarks I've seen, is faster than MathJax, by a long shot. However, it has somewhat incomplete support for LaTeX, so that may be an issue.

MathJax is pretty slow, relative to the others, but it has almost complete support for LaTeX. If that's the price you're willing to pay, then go for it.

In short, choose MathQuill for editing, KaTeX for speed, for MathJax for comprehensiveness.

And is there maybe a better formula renderer?

These three are the only ones I've heard of. Based on a previous question, the only other option is jsMath, MathJax's predecessor. It's from 2004, so there's no reason that you should use it.

like image 126
hkk Avatar answered Oct 13 '22 04:10

hkk


You can use mathlive for both editing and static TeX content.

like image 26
MOHRE Avatar answered Oct 13 '22 05:10

MOHRE