# Rendering Math with KaTeX

The other day, I was looking into how easy it is to render LaTeX via a Markdown document. MathML isn’t yet widespread enough to use reliably, so instead I started looking at some of the third-party libraries available. I had looked at KaTeX from Khan Academy a few times in the past, and was happy to find that it was exactly what I wanted.

To add support, all you need is KaTeX, auto render support, and the CSS file:

<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/contrib/auto-render.min.js"></script>

Then, in Markdown, you can write your LaTeX within $$ blocks. $$
$$ This renders like so:$$ a = \sqrt{b^2 + c^3}