There is a strange interaction between Markdown and MathJax when the character < appears in a math snippet which is followed by some (not all) non-whitespace character. I would have expected < not to have any special meaning between $ signs and the character after the closing $ not to matter, but this is not always the case.

I say “then $a<b$”. More $math$.

I say “then $a<b$”. *Emphasis* $math$.

I say “then $a

I say “then $aEmphasis $math$.

screenshot from <code>https://cs.stackexchange.com/questions/ask</code>

I observed this in Chrome 17.0.963.79. Initially while composing this answer, and the screeenshot above is from https://cs.stackexchange.com/questions/ask (my screenshot-grabbing extension sometimes puts the wrong URL).

  • $\begingroup$ Can confirm for Firefox 10.0.2. $\endgroup$
    – Raphael Mod
    Mar 26, 2012 at 6:31
  • 2
    $\begingroup$ A workaround is to use \lt and \gt. $\endgroup$
    – Aryabhata
    Mar 28, 2012 at 21:35

1 Answer 1


These should be encoded as \lt and \gt instead of using < and > directly.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .