Even more hacks and fixes for MathJax/Markdown compatibility