Comments (17)
嗯,应该是因为 hexo-renderer-markdown-it 所依赖的 @iktakahiro/markdown-it-katex ,直到最新版本才将使用的 KaTeX 版本从 0.10.0 升级为 0.11.1,导致版本不匹配。这个插件也有两年没更新了,可能需要寻找替代品。
见 iktakahiro/markdown-it-katex@5238dd1
from hexo-theme-next.
Thanks for opening this issue, maintainers will get back to you as soon as possible!
from hexo-theme-next.
Issue-Label Bot is automatically applying the label Question
to this issue, with a confidence of 0.63. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from hexo-theme-next.
设置没有问题。如果 hexo-renderer-markdown-it-plus 是最近安装的,执行一下 hexo clean 试试。
from hexo-theme-next.
感谢您的回复,我尝试hexo clean后仍不能解决问题
from hexo-theme-next.
是否方便提供一下安装的全部 Hexo 插件(在博客根目录下执行 npm ls --depth 0
)。可能是与其它的插件冲突导致的问题,我可以帮忙测试一下。
from hexo-theme-next.
如下所示,十分感谢
$ npm ls --depth 0
[email protected] D:\Philchieh's Blog
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
from hexo-theme-next.
试试这样:
npm uninstall hexo-renderer-marked
hexo clean
我待会把文档更新一下,这几个插件的使用描述有些不清楚
from hexo-theme-next.
您好,按照您的操作后已经能够显示KaTex公式,然而公式显示十分诡异,请您打开以下网站以得知我的情况
https://philchieh.github.io/2020/08/12/BSGS%20%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/
from hexo-theme-next.
您好,可能是由于字体原因,在不同浏览器上显示有差异
from hexo-theme-next.
我在我的浏览器上也是这个样子,但是正常的Katex应该与Mathjax的效果一致,如下图
from hexo-theme-next.
请问是主题的问题亦或是Katex的问题?
from hexo-theme-next.
KaTeX 的渲染分为两步:
hexo-renderer-markdown-it-plus
插件用于预处理,例如将$\frac{\pi^2}{6}$
转为
<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><msup><mi> π</mi><mn>2</mn></msup><mn>6</mn></mfrac></mrow><annotation encoding="application/x-tex">\frac{\pi^2}{6}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.36292em;vertical-align:-0.345em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.01792em;"><span style="top:-2.6550000000000002em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">6</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.03588em;">π</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8913142857142857em;"><span style="top:-2.931em;margin-right:0.07142857142857144em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span>
- 而 NexT 负责加载
katex.min.css
,为上面的这一段 HTML 添加样式。
从您提供的页面来看,第二步加载的 CSS 没问题,因此不是 NexT 的问题。
我自己一直用的是 MathJax,对 KaTeX 不熟。个人感觉这很有可能与 Markdown Renderer 有关,可以根据文档换用 hexo-renderer-markdown-it
插件试试: https://theme-next.js.org/docs/third-party-services/math-equations#Render-Engines 。
from hexo-theme-next.
意思是使用后者,也就是hexo-renderer-markdown-it with markdown-it-katex plugin对吗
from hexo-theme-next.
您好,我找到问题了,在layout third-party math 路径下的katex.njk中cdn.jsdelivr.net/npm/katex@0 改为cdn.jsdelivr.net/npm/[email protected]即可。
from hexo-theme-next.
感谢回答,我先关闭了
from hexo-theme-next.
This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.
from hexo-theme-next.
Related Issues (20)
- Giscus render error HOT 4
- No url found for submodule path 'themes/next' in .gitmodules HOT 2
- fontawesome样式文件加载失败导致图标不显示 HOT 4
- 有中文的docs吗? HOT 5
- 使用 label 标签外挂在开头时,会导致无法换行 HOT 2
- 主题Pisces和Gemini的移动端显示侧边栏 Request for displaying sidebar on mobile for scheme Pisces and Gemini HOT 3
- 代码块与引用,图片与引用,代码块与图片,这些元素相连时,边距有点小。 HOT 1
- Quotation marks replaced with odd character HOT 4
- 图片 caption 不能正常渲染 HOT 12
- Next Versoin版本下Tags页和categories页面的数据不能展示 HOT 7
- darkmode设置为了false,但是页面依然处于暗色模式 HOT 2
- Footer 中备案位置的一个小问题 HOT 6
- Support Hexo 7.0.0 HOT 2
- v8.19.0 "The resource has been blocked" & "Uncaught TypeError" HOT 3
- 【求助】我是低版本升级过来的,出现部分字体乱码是怎么回事 HOT 1
- On the mobile phone, there is a problem with the display when long words appear in the homepage title. HOT 3
- hexo 7, next 18.19.1代码无法高亮 HOT 3
- 当标题中同时出现 `module` 和 `exports` 这两个单词时渲染出现bug HOT 3
- 代码高亮无法正常显示 HOT 3
- npm resolution error report HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-next.