snippets

🔌 Toolbox of short, reusable pieces of code and knowledge.

View the Project on GitHub rosikand/snippets

Use LaTeX in Jekyll

Simply paste

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

in the .html file in the _layouts folder of the layout you are using for the designated post. Note: you must wrap the LaTeX code in $$ instead of $ in the markdown source. If you want to bypass this requirement, insert the following snippet above the mathjax import:

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

Source: http://www.iangoodfellow.com/blog/jekyll/markdown/tex/2016/11/07/latex-in-markdown.html and https://tex.stackexchange.com/questions/27633/mathjax-inline-mode-not-rendering/27656