the-mvm / the-mvm.github.io

The Minimum Viable Model website and Jekyll theme.
https://the-mvm.github.io
GNU General Public License v3.0
86 stars 398 forks source link

Preview shows raw math equation #47

Closed RomaLzhih closed 1 year ago

RomaLzhih commented 1 year ago

The math equation in markdown file will be displayed in a raw way when preview (see below), which could be composed with MathJax as well.

preview

RomaLzhih commented 1 year ago

This can be achieved by placing following code into archive.html file

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
      processEscapes: true
    },
    "CommonHTML": { linebreaks: { automatic: true } }
    });
  </script>
<script src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>