Jekyll: Render LaTex with MathJax

Since I fell in love with the way LaTeX renders mathematics, I want to include MathJax.

If you are using the minima theme, there is currently no option to simply include additional Javascript. Therefor you have to create _includes/head.html and paste the content of the original head.html.

Now you can add {{ "{% include mathjax.html "}} %} before the closing head tag. This will include the content of _includes/mathjax.html which you have to create with this content:

<script
  type="text/javascript"
  src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
></script>

You can now render a formula by using {{ "$$ a^2 + b^2 = c^2 $$"}}:

$$ a^2 + b^2 = c^2 $$

Tags

Comments

Related