Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to enable markdown preview with mathjax?

+1 vote
166 views
asked Dec 23, 2016 in Plugins by John Bao
I have a lot of math formula to write, hence I use mathjax and markdown,but its preview doesn't works. I have checked all questions and answer in this web, but cannot get useful answer.

I need your help, how do I do?
Q2A version: 1.7.4

1 Answer

+1 vote
answered Dec 23, 2016 by fara

Admin> Layout> Custom HTML in <head> section of every page:

<script type="text/javascript"
   src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</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>
...