How to deal with the confliction between PHP-Markdown and MathJax?
I use PHP-Markdown plugin in WordPress. In order to show the formula beautifully, I add some code to use MathJax.
Like this:
script type="text/javascript" src="http://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
But something wrong happens. Once my formula contains at least two underlines, the MathJax doesn't work. Such as $$P_1, P_2$$
, and the words between the two underlines will be transformed to italic.
The formula will be transformed by PHP-Markdown first, and it can't be transformed by MathJax again.
Could you help me?
Topic markdown latex Wordpress javascript
Category Web