Closed hermitlsr closed 1 year ago
我使用了您在 readme 中推荐的公式编译插件,效果并不理想。我的是数学笔记设计很多复杂公式。 于是我使用 hexo-renderer-markdown-it-plus 渲染器解决了这一问题,该渲染器完美支持 KaTeX 使用步骤:
hexo-renderer-markdown-it-plus
卸载原有的渲染器,安装新的渲染器
npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
在主题根目录设置文件中设置 _config.yml:
_config.yml
## 原始设置 highlight: enable: false
markdown_it_plus: highlight: true html: true xhtmlOut: true breaks: true langPrefix: linkify: true typographer: quotes: “”‘’ plugins:
plugin: name: markdown-it-mark enable: false
3. 在 `/themes/material-x/layout/_partial/head.ejs` 中最后一行添加:
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);">
👍欢迎提交合并到 readme 里
我使用了您在 readme 中推荐的公式编译插件,效果并不理想。我的是数学笔记设计很多复杂公式。 于是我使用
hexo-renderer-markdown-it-plus
渲染器解决了这一问题,该渲染器完美支持 KaTeX 使用步骤:卸载原有的渲染器,安装新的渲染器
在主题根目录设置文件中设置
_config.yml
:新增
markdown_it_plus: highlight: true html: true xhtmlOut: true breaks: true langPrefix: linkify: true typographer: quotes: “”‘’ plugins:
plugin: name: markdown-it-mark enable: false
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);">