KaTeX vs MathJax (v47)

Revision 47 of this benchmark created on


Preparation HTML

<link href="//cdn.rawgit.com/Khan/KaTeX/v0.5.1/dist/katex.min.css" rel="stylesheet" type="text/css">
<script src="//cdn.rawgit.com/Khan/KaTeX/v0.5.1/dist/katex.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script>

<script>
MathJax.Hub.Config({
  jax: ["input/TeX", "output/HTML-CSS"],
  extensions: [],
  TeX: {
    extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]
  },
  "HTML-CSS": {
    showMathMenu: false,
  },
  messageStyle: "none"
});
MathJax.Hub.Configured();
</script>

<div id="math"></div>

Setup

var math = document.getElementById("math");
  var formula = "\\dfrac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}";

Teardown



            math.innerHTML = "";
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
KaTeX
katex.render(formula, math);
math.outerWidth;
ready
MathJax
// async test
math.innerHTML = "<script type='math/tex'>" + formula + "</script>";
MathJax.Hub.Queue(["Process", MathJax.Hub, math]);
MathJax.Hub.Queue(function() {
  math.outerWidth;
  deferred.resolve();
});
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.