Math equations in Blog Posts

MathJax integration with Jekyll

Posted by Steven on August 6, 2018

Setup

MathJax is a JavaScript display engine which renders $\LaTeX$ syntax in markdown files. This is very useful for displaying math equations for my blog posts.

To integrate MathJax into Jekyll blog posts, I added the following code to _includes/head.html, right before <head>:

<!-- Mathjax Support -->
<script type="text/javascript" async
  src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

In addition, set mathjax: true in the _config.yml file.

Latex examples

Matrix:

Equation:

Proof: