Metalsmith Math
This is part of the articles collection.MathJax
Implemented here via the metalsmith-mathjax
plugin.
- Typically considered slower to load than KaTeX
- Adding
mathjax: true
to the metadata will prerender math to svg - Prerendering is fast but increases the page size significantly
KaTeX
Implemented here via CDN scripts.
- Loads faster than MathJax
- Consists of a subset of TeX (typically enough to use)
- Implemented here by adding
katex: true
to the metadata - However, this includes a multitude of fonts
- Overall size is not much reduced for sites with less equations
Stats
For the same document, the details are:
Engine | | (kB) | | Page Size |J (kB) | (kB) | S Load | Font Load | T | (kB) | (ms) | (ms) | otal | Time | DOM | ||
MathJax | ~200 | None | None | 200 | 753 | | 327 | |||
KaTeX | ~ | | auto- | 10 | katex.m render (3.8) | in.js (54.7) | 121.3 | | | | | 189.8 | 535 | 403 |
Conclusions
- Lots of equations, use KaTeX
- Else use MathJaX