support mathjax in custom templates