In turn execute the following command
npm install hexo-math --save
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
Configuration
Site root of the following _config.yml
:
math:
engine: katex
katex:
css: https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css
js: https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js
config:
# KaTeX config
throwOnError: false
errorColor: "#cc0000"
yelee the following topics _config.yml
:
# Math Equations Render Support
math:
enable: true
per_page: false
#engine: mathjax
engine: katex
katex:
# Use 0.7.1 as default, jsdelivr as default CDN, works everywhere even in China
cdn: //cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css
#cdn: //cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css
# CDNJS, provided by cloudflare, maybe the best CDN, but not works in China
#cdn: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css
copy_tex:
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
enable: true
copy_tex_js: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js
copy_tex_css: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css
hexo clean && hexo g && hexo d
学如逆水行舟,不进则退