在md里面用脚本加载physics宏包 (NexT v7.7.2 已支持)

1
2
3
4
5
6
7
8
9
10
11
12
13
<script>
MathJax = {
loader: {
load: ['[tex]/physics']
},
tex: {
packages: {'[+]': ['physics']}
}
};
</script>
<script id="MathJax-script" async
src="https://cdnjs.loli.net/ajax/libs/mathjax/3.0.1/es5/tex-mml-chtml.js">
</script>

Hello \(\LaTeX\)

\(\Gamma(n) = (n-1)!\quad \forall n \in \mathbb{N}\)

\(\bra{\psi} \quad \ket{\psi} \quad \order{x^2} \quad \comm{A}{B}\)

\[ \Braket{ \phi | \frac{\partial^2}{\partial t^2} | \psi } \]

\[ \laplacian{\Psi} \quad \curl{\vb{a}} \quad \div{\vb{a}} \quad \grad{\Psi} \]

mathjax3.0+ 开始支持 braketphysics 宏包

  1. markdown 文档里使用 mathjax脚本 来加载 physics 宏包,这时就不用在最前面的 Front-matter 里设置 mathjax 选项了

  2. 另外 braket 宏包可以直接使用(前提 mathjax=true ),而不像 physics 宏包;当然 $\bra{\psi} \quad \ket{\psi}$ 也可以直接在 physics 宏包里使用

  3. 最后,行内公式在两个$ $需要注意,第一个$后面不能有空格,后面的$前面也不能有空格,而行间公式就没有要求,另外用脚本,方程引用好像有问题,还得进一步探索

正在加载今日诗词....
buy me a cup of coffee ☕️