[ HEXO ] LATEX IN HEXO

[ HEXO ] Writing Math Formulas In HEXO

  • Reference: ShallowLearner’s Blog
  • The notes covers:change the renderer in hexo, open the support of LATEX in Hexo

Change the engine

1
2
npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-kramed --save

Modify the escape string

  • open node_modules\kramed\lib\rules\inline.js
1
2
3
4
//  escape: /^\\([\\`*{}\[\]()#$+\-.!_>])/,
escape: /^\\([`*\[\]()#$+\-.!_>])/,
// em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
em: /^\*((?:\*\*|[\s\S])+?)\*(?!\*)/
  • restart hexo, use command hexo clean and hexo generate

Configure the theme

  • open themes/next/_config.yml
  • look for math and set enable: to True