hexo支持数学公式

参考: https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/MATH.md

首先,卸载原有的渲染器 hexo-renderer-marked, 并安装新的渲染器hexo-renderer-pandoc

1
2
npm uninstall hexo-renderer-marked
npm install hexo-renderer-pandoc # 或者 hexo-renderer-kramed

然后在next/_config.yml中将mathjaxenable打开。

1
2
3
4
math:
...
mathjax:
enable: true

还要本地安装pandoc软件, 地址:https://github.com/jgm/pandoc/releases

公式示例:

\[ A = \begin{bmatrix} a_{11} & a_{12} & ... & a_{1n}\\ a_{21} & a_{22} & ... & a_{2n}\\ a_{31} & a_{22} & ... & a_{3n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{n1} & a_{n2} & ... & a_{nn}\\ \end{bmatrix} , b = \begin{bmatrix} b_{1} \\ b_{2} \\ b_{3} \\ \vdots \\ b_{n} \\ \end{bmatrix} \]

\[ P(A_i \mid B) = \frac{P(B\mid A)P(A_i)}{\sum_{j=1}^{n}P(A_j)P(B \mid A_j)} \]

行内公式\(A_b\)嗯.