0%

设置 Next 主题支持 Latex 渲染

需求:让 hexo 的 next 主题支持渲染 LaTeX 语法的数学公式。

环境: hexo version即可查看hexo版本; img

查看theme/next/package.json即可查看next版本; img

步骤:

1、Powershell :

1
2
npm uninstall hexo-rendered-marked
npm install hexo-filter-mathjax --registry=http://registry.npm.taobao.org

2、修改next主题配置文件,搜索math,找到mathjax,修改为true;

1
2
mathjax:
enable: true

3、在文章的 front-matter 中添加 mathjax: true ,该文章即可渲染[1];建议将 mathjax: true 写入 \scaffolds 的 post.md 文件中的 front-matter,以后每篇文章都会自动添加,自动渲染。

参考文章


  1. Hexo Next主题渲染 Latex 公式的配置方法↩︎
+