split up layout into nag and mathjax files