safer handling of mathjax