My blog has been established successfully today. However, Jekyll’s native Markdown interpreter doesn’t always work well with Latex. This article records how I add $\LaTeX$ support for my site.

  • Disable the math intepreter of Kramdown by adding the following code in _config.yml
kramdown:
    math_engine: null
    
  • Include MathJax by adding the following script in ./_includes/head.html
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
      inlineMath: [['$','$']]
    }
  });
</script>
    

Now we can enter the $\LaTeX$ equations successfully! For example:

$$ e^{i\theta}=\cos\theta+i\sin\theta $$