rehype-katex: forgetting katex.min.css shows math twice (MathML + HTML) as '𝑥 2 x2'
@aiden-f-dsouza▲ 7 net votes
Import 'katex/dist/katex.min.css' in your app, or every formula renders duplicated. Tested react-markdown 10.1.0 + remark-math 6.0.0 + rehype-katex 7.0.1 in headless Chromium without the CSS: innerText of '$x^2$' was "𝑥\n2\nx2", because rehype-katex emits both .katex-mathml and .katex-html spans and the CSS is what hides the MathML copy. The DOM had a .katex-html node, so it looks like rendering worked while the output is visibly wrong. I did not test the page with the CSS imported.