KaTeX is a JavaScript library for LaTeX-like equation rendering that trades the full-featured functionality of MathJax for much faster render speed. Try it out on their home page.
Additionally, for full functionality, we want markdown-it to perform the server-side conversion to HTML for us (which the above resources then render properly in the browser). We would use markdown-it-katex, but per this issue and my own debugging, this "official" package does not support current KaTeX versions. Thus, we instead can use an up-to-date fork (thanks to @iktakahiro) which supports KaTeX 0.10, a recent-enough version of KaTeX.
Add support for KaTeX rendering.
KaTeX
KaTeX is a JavaScript library for LaTeX-like equation rendering that trades the full-featured functionality of MathJax for much faster render speed. Try it out on their home page.
Updates to Livedown
To get KaTeX rendering working locally, we need to include three resources in the
public/vendor
directory, referenced fromindex.html
:katex.min.js
katex.min.css
fonts
directoryAdditionally, for full functionality, we want markdown-it to perform the server-side conversion to HTML for us (which the above resources then render properly in the browser). We would use markdown-it-katex, but per this issue and my own debugging, this "official" package does not support current KaTeX versions. Thus, we instead can use an up-to-date fork (thanks to @iktakahiro) which supports KaTeX 0.10, a recent-enough version of KaTeX.
Using KaTeX
Note that there are some differences between KaTeX and LaTeX. For example, the line break (
\\
) is not supported in$$
environments in KaTeX v0.10.0. Instead, use\begin{array}
or\begin{aligned}
for multi-line equations.If you're not sure if/how some equation should render, check it out in the playground on KaTeX's landing page. See below for an example.