需求:让 hexo 的 next 主题支持渲染 LaTeX 语法的数学公式。
环境:
hexo version
即可查看hexo版本;

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

步骤:
1、Powershell :
npm uninstall hexo-rendered-marked
npm install hexo-filter-mathjax --registry=http://registry.npm.taobao.org
2、修改next主题配置文件,搜索math,找到mathjax,修改为true;
mathjax:
enable: true
3、在文章的 front-matter 中添加 mathjax: true
,该文章即可渲染[1];建议将 mathjax: true
写入 \scaffolds
的 post.md 文件中的 front-matter,以后每篇文章都会自动添加,自动渲染。
网友评论