Blog使用的主题为NextT,使用文档请参考http://theme-next.iissnan.com/
Mathjax公式支持
使用hexo-math
插件支持,github link: https://github.com/akfish/hexo-math
安装方法:
1 | npm install hexo-math --save |
在博客的_config.yml
文件中加入
1 | math: |
使用方法就是$inline$
与$$block$$
,也有tag
用法,参见项目的帮助文件
重要的问题来了,hexo会把_
在markded.js
渲染下回被escape掉并被替换为<em>
标签,即斜体字,\\
也会被转义为一个\
。
改进的方法:
用编辑器打开
marked.js
,路径为.\node_modules\hexo-renderer-marked\node_modules\marked\lib
,如果找不到,可以在blog目录下search一下
1
escape: /^\([\`*{}[]()# +-.!_>])/,
替换为
1
escape: /^\\([`*\[\]()# +\-.!_>])/,
1
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
替换为
1
em:/^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,