modify syntax rules to better comply with mathjax