refine math representation for mathjax