How to use Latex on jekyll?

Instructions from LaTeX in Jekyll worked fine for me.

TL,DR

  • Add the following line to _layouts/post.html:
    • <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
  • Test out by adding the markdown I’ve provided below to one of your posts.
# Testing out latex

$$ \nabla_\boldsymbol{x} J(\boldsymbol{x}) $$

You should see something like this:

Code for the jekyll blog I’m using this in can be found GitHub - ian-whitestone/ian-whitestone.github.io, cloned from the github repo barryclark/jekyll-now (discourse isn’t letting me post more than 2 links :slightly_frowning_face: ).

4 Likes