Hash handling for MathJax and LaTeX