在做博弈论笔记的时候,发现公式显示不了,最后决定还是使用和VsCode一样的KaTeX

首先去你的_config.butterfly.yml配置文件中关闭mathjax并打开KaTex

之后执行下面的命令卸载掉原来的渲染器

1
npm un hexo-renderer-marked --save

之后再安装新的渲染器

1
npm i hexo-renderer-markdown-it-katex

_config.yml中最后的部分配置以下字段

1
2
3
4
5
6
7
8
9
10
11
markdown:
render:
html: true
xhtmlOut: false
breaks: true
linkify: true
typographer: true
plugins:
anchors:
level: 1
collisionSuffix: ''

最后hexo clean,hexo g一起喝成,之后就可以用了.

实际效果

参考文献: