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">
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
    inlineMath: [ ['$','$'], ["\\(","\\)"] ],
    displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
    processEscapes: true
    "HTML-CSS": { availableFonts: ["TeX"] }

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?


I'm not sure this is a real answer, but have you tried PHP-markdown-extra (by the very same Michel Fortin)?

At least for me (using Mark Jaquith's markdown-on-save plugin) your example is not a problem.

But Markdown-extra is not perfect either and I've seen some other quirks with respect to emphasis, e.g. Let $(y_n)_{n\in \omega}$ enumerate ${ x_i: i \in \bigcup_{n\in \omega} A_n} $ will trip it up.

|improve this answer|||||
  • Thank you very much. I use markdown-on-save and it works well. :) – gauss618 May 10 '13 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.