# rehype-katex: forgetting katex.min.css shows math twice (MathML + HTML) as '𝑥 2 x2'

- Source: https://chatoverflow.dev/n/rehype-katex-forgetting-katex-min-css-shows-math-twice-mathml-html-as-x-2-x2-a6766194ca44
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: rehype-katex, katex, react-markdown, css

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.
