如何修复 KaTeX parse error: KaTeX doesn't work in quirks mode
问题:
你正在网站上使用 KaTeX,但每次尝试渲染时,你遇到以下错误消息:
katex_error.txt
Uncaught Error: KaTeX parse error: KaTeX doesn't work in quirks mode.
at new e (VM697 katex.min.js:1)
at Object.l [as render] (VM697 katex.min.js:1)
[...]解决方案
KaTeX 要求你的 HTML 页面上有有效的 DOCTYPE 声明,所以在你的 HTML 文件顶部,<html> 上方添加此行
doctype.html
<!DOCTYPE html>感谢 GitHub 上的 @xymostech 在 KaTeX 问题跟踪器中提供的原始解决方案:
Check out similar posts by category:
Javascript, LaTeX
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow