Add LaTeX to Minimal Mistake Jekyll

1 minute read

In this post, I will show a brief note about adding LaTeX support to your Minimal Mistakes Jekyll.

Step 1. Set Markdown Engine to Kramdown

In your _config.yml, change the engine to kramdown as follows

# Build settings
markdown: kramdown

Step 2. Copy the original script.html

To get Latex support, visit the original Minimal Mistakes repo here. Copy over minimal-mistakes/_includes/scripts.html and paste to our _includes/scripts.html.

Step 3. Modify head.html

Append the following content to head.html.

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

Step 4. Hellow \(\LaTeX\)

use $$ ... $$ displaying math equation.

For inline mode
type your equation in line with other text
For display mode:
type your equation such that there is a blank line before beginning $$ and there is a blank line after ending $$


The example is as following

The Einstein equations is as following

$$R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R=\frac{8\pi G}{c^4} T_{\mu\nu}\,,$$

where $$R_{\mu\nu}$$ is Ricci curvature, $$R$$ is scalar curvature, $$g_{\mu\nu}$$ is metric, $$G=6.67\times 10^{-11}$$ is the Newtonian constant of gravitation, $$c=2.99\times 10^{8}$$ is the speed of light in vacuum and $$T_{\mu\nu}$$ is the stress–energy tensor.


The Einstein equations is as following

\[R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R=\frac{8\pi G}{c^4} T_{\mu\nu}\,,\]

where \(R_{\mu\nu}\) is Ricci curvature, \(R\) is scalar curvature, \(g_{\mu\nu}\) is metric, \(G=6.67\times 10^{-11}\) is the Newtonian constant of gravitation, \(c=2.99\times 10^{8}\) is the speed of light in vacuum and \(T_{\mu\nu}\) is the stress–energy tensor.

Reference

  1. https://www.janmeppe.com/blog/How-to-add-mathjax-to-minimal-mistakes/

  2. https://sort-care.github.io/Latex-on-Blog/