Hexo-next主题支持数学公式

本文主要解决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}}
$$
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值