It's a long standing problem in katex. https://github.com/KaTeX/KaTeX/issues/2003 It doesn't seem to be an easy solution. Is it possible to switch to mathjax for equation support?