-
卸载Marked渲染器,安装Markdown it Plus渲染器。
npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
-
配置_config.yml文件。
markdown_it_plus: highlight: true html: true xhtmlOut: true breaks: true langPrefix: linkify: true typographer: quotes: “”‘’ plugins: - plugin: name: markdown-it-katex enable: true - plugin: name: markdown-it-mark enable: false
-
在博客html的head中加载Katex的CSS样式。
vi themes/next/layout/_partial/head.swig
添加:
<link href="https://cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">
-
最后重新编译部署。
可能会提示插件
markdown-it-katex
不存在,使用命令npm install markdown-it-katex --save
安装即可。
Hexo渲染数学公式
最新推荐文章于 2024-06-20 11:54:16 发布