0%

搭建博客

https://connor-sun.github.io/posts/41255.html

加载数学公式

目前,NexT 提供两种数学公式渲染引擎,分别为 MathJax 和 Katex,默认为 MathJax。这里推荐使用 MathJax + hexo-renderer-pandoc。

安装pandoc

在官网安装https://pandoc.org/installing.html,对于mac来说可以

1
brew install pandoc

更换渲染器
1
2
npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-pandoc --save
配置主题文件
1
2
3
4
5
6
7
8
9
10
11
12
# Math Formulas Render Support
math:
# Default (true) will load mathjax / katex script on demand.
# That is it only render those page which has `mathjax: true` in Front-matter.
# If you set it to false, it will load mathjax / katex srcipt EVERY PAGE.
per_page: true

# hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
mathjax:
enable: true
# See: https://mhchem.github.io/MathJax-mhchem/
mhchem: false