CHENXCHEN / hexo-renderer-markdown-it-plus

Markdown-it is a markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
https://chchc.me/hexo-article/2017/07/27/hexo-renderer-markdown-it-plus-plugin-demo/
MIT License
115 stars 22 forks source link

公式渲染失败,直接显示了latex源码 #37

Closed juruo123 closed 5 months ago

juruo123 commented 5 months ago

如图所示,部分行间公式无法正确渲染,行内公式倒是都渲染出来了。有看到说是相邻大括号之间需要空格,试了后没有用。部分复杂公式也能渲染出来,所以挺奇怪的。 image image

这是出错文章的链接:https://juruo123.github.io/2024/04/22/%E5%BE%AE%E7%94%B2II-%E6%96%B9%E5%90%91%E5%AF%BC%E6%95%B0%E4%B8%8E%E6%A2%AF%E5%BA%A6/ https://juruo123.github.io/2024/04/22/%E5%BE%AE%E7%94%B2II-%E9%9A%90%E5%87%BD%E6%95%B0%E6%B1%82%E5%AF%BC/

依赖有这些 "dependencies": { "hexo": "^7.2.0", "hexo-all-minifier": "^0.5.7", "hexo-deployer-git": "^4.0.0", "hexo-generator-archive": "^2.0.0", "hexo-generator-category": "^2.0.0", "hexo-generator-index": "^3.0.0", "hexo-generator-tag": "^2.0.0", "hexo-renderer-ejs": "^2.0.0", "hexo-renderer-markdown-it-plus": "^1.0.6", "hexo-renderer-stylus": "^3.0.1", "hexo-server": "^3.0.0", "hexo-theme-fluid": "^1.9.7", "hexo-theme-landscape": "^1.0.0" }

juruo123 commented 5 months ago

找到原因了。Katex对align的支持并不是很完好,某些时候可以将\begin{align}渲染出来(实际上在官网的演示渲染器中都可以展示出来),但是某些时候又会出错。所以尽可能用\begin{aligned}代替就好了。