최대 1 분 소요

Add the following to the _includes/scripts.html

 <script type="text/javascript" async
   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-MML-AM_CHTML">
 </script>

 <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      extensions: ["tex2jax.js"],
      jax: ["input/TeX", "output/HTML-CSS"],
      tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true
      },
      "HTML-CSS": { availableFonts: ["TeX"] }
    });
 </script>

Add mathjax: true in the default post configuration section of the _config.yml file as follows:

 # Defaults
 defaults:
   # _posts
   - scope:
       path: ""
       type: posts
     values:
       layout: single
       author_profile: true
       read_time: true
       #comments: true
       share: true
       related: true
       mathjax: true

A few suggestions:

  • Use \vert as the pipe symbol rather than using | within the math expressions. Sometimes it does not work.
  • I prefer $ for inline expression (math within paragraph)
  • Other than that, you can use \(\) for equations that are not within the paragraphs.

Reference

How to Add Latex Math to Jekyll based Theme - Minimal Mistakes - Roy’s Blog