本文主要解决Hexo-next主题支持数学公式问题
更换Hexo的markdown渲染引擎
hexo-renderer-kramed引擎是在默认的渲染引擎,hexo-renderer-marked的基础上修改了一些bug,两者比较接近,也比较轻量级。
npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-kramed --save
解决语义冲突
找到
node_modules\kramed\lib\rules\inline.js
修改如下两处
//escape: /^\\([\\`*{}\[\]()#$+\-.!_>])/,
escape: /^\\([`*\[\]()#$+\-.!_>])/,
//em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
em: /^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
在next主题中开启mathJax开关
# 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
engine: mathjax # 添加这个,反正我的主题默认没有这一行
# hexo-renderer-pandoc (or hexo-renderer-kramed) required for full MathJax support.
mathjax:
enable: true # 这个改为true
# See: https://mhchem.github.io/MathJax-mhchem/
mhchem: true # 这个改为true
# hexo-renderer-markdown-it-plus (or hexo-renderer-markdown-it with markdown-it-katex plugin) required for full Katex support.
katex:
enable: false
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex: false
打开mathjax开关
---
title: Using-Machine-Learning-for-Data-Center-Cooling-Infrastructure-Efficiency-Prediction
date: 2019-11-28 22:53:32
tags: [datacenter, machinelearning]
category: DataCenter
mathjax: true
---
添加公式
$$
COP = \frac{Q_{CoolingCircuits}}{P_{CoolingCircuits}}
$$