# Add KaTeX rendering (KaTeX 0.10.0) #50

Open
wants to merge 1 commit into
from

## Conversation

Contributor

### hcgatewood commented Mar 11, 2019

 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 from index.html: katex.min.js katex.min.css the KaTeX fonts directory 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. 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.  \begin{aligned} a_{n+1} &= \frac{x_{n+1} + nc_n}{n+1} \\ \iff a_{n+1} &= a_n + \frac{x_{n+1} - a_n}{n+1} \end{aligned} 
 Add KaTeX rendering 
 51d951e