首先进入到Hexo项目的根目录中,运行
shellnpm install hexo-math hexo-renderer-pandoc #当你使用npm时 # or yarn add hexo-math hexo-renderer-pandoc #当你使用yarn时
yml#插件 markdown: plugins: .... - hexo-math #增加 ..... # 增加这一配置MathJax math: engine: 'mathjax' mathjax: src: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML
需要安装pandoc命令,用以支持LaTex的解析
shellbrew install pandoc #当你使用macOS时 # or sudo apt-get install pandoc #当你使用ubuntu时
如果已经构建过项目,请先进入项目根目录下运行,清除缓存
shellhexo clean
然后进行正常的hexo的生成和测试
shellhexo g & hexo s
测试LaTex,应能得到图1.1
,[object Object],
图1.1