merge latest commits from Pacman and use better MathJax strategy