next-theme / hexo-filter-mathjax

💯 Server side MathJax renderer plugin for Hexo.
https://www.npmjs.com/package/hexo-filter-mathjax
MIT License
105 stars 6 forks source link

块引用内 行内公式 渲染失败 #47

Closed yiyungent closed 2 years ago

yiyungent commented 2 years ago

块引用内 行内公式 渲染失败

https://moeci.com/posts/Ant-Colony-Algorithm/

image image

可以发现,在 引用块 内的行内公式会渲染失败,而其它正常,

正常

https://moeci.com/posts/Genetic-Algorithm/

image image

PS

意外发现 Typora Latex 块公式 正常,vscode 不正常

vscode image

typora image

yiyungent commented 2 years ago

package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "5.2.0"
  },
  "dependencies": {
    "@next-theme/plugins": "^8.7.0",
    "@waline/hexo-next": "^2.0.5",
    "hexo": "^5.0.0",
    "hexo-asset-img": "^1.0.0",
    "hexo-cloud": "^0.1.1",
    "hexo-deployer-git": "^2.1.0",
    "hexo-encrypt-token": "^4.2.0",
    "hexo-filter-mathjax": "^0.8.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-json-content": "^4.2.3",
    "hexo-generator-searchdb": "^1.4.0",
    "hexo-generator-sitemap": "^2.1.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-related-popular-posts": "^5.0.1",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-pandoc": "^0.3.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^2.0.0",
    "hexo-symbols-count-time": "^0.7.1",
    "hexo-theme-next": "^8.10.0"
  }
}
yiyungent commented 2 years ago

我用的 GitHub Action 安装 pandoc, 因此每次应该是最新的: 2.9.2.1

apt-get install pandoc

https://packages.ubuntu.com/impish/pandoc

stevenjoezhang commented 2 years ago

这是 pandoc 的问题,我们修不了。

yiyungent commented 2 years ago

这是 pandoc 的问题,我们修不了。

我卸载了此插件,再次使用 hexo-renderer-pandoc 是没问题的,https://moeci.com/posts/Ant-Colony-Algorithm/,
只是使用这个插件就不行了,建议文档里标注一下吧,让更多人知道,不过好像原理不一样吧,毕竟 Mathjax 通过 js 在前端渲染,我也不太清楚

stevenjoezhang commented 2 years ago

我自己的测试显示,pandoc 的默认设置对引用块内\( \)的处理与预期不符。你可以禁用全部数学插件,直接用 pandoc 渲染以下内容

> $\alpha$
> \(\alpha\)
yiyungent commented 2 years ago

感谢!是指先卸载 hexo-renderer-pandoc 吗? 上次测试确实没卸载这个,而是禁用 NexTMathjax 后安装 hexo-filter-mathjax 配置下就完了,后面我试试吧

yiyungent commented 2 years ago
> \(\alpha\)

这种我就没用过,图片上的是 网页效果,就使用 hexo-filter-mathjax 后的效果, 即 > $\alpha$ 变成了 > \(\alpha\)

stevenjoezhang commented 2 years ago

这样么……但我自己用下面这种语法

> $\alpha$

是完全正常的。可能是其它的插件冲突了。