better mathjax handling