css - Add Auto Line-Breaks in KaTeX JS - Stack Overflow

admin2025-04-18  3

I'm using KaTeX to display equations in my website. But I have some long equations and they flow out the screen. I tried adding

.katex-display > .katex { white-space: normal }
/* Add space between broken lines: */
.katex-display > .base { margin: 0.25em 0 }
/* Compensate by reducing space around display math */
.katex-display { margin: 0.5em 0; }

which is mentioned in the document, but it didn't work for me. I also tried adding

.katex-display { max-width: 90%; }

but it doesn't solve my problem.

转载请注明原文地址:http://www.anycun.com/QandA/1744951781a89936.html