效果
$$\ce{4Al + 3O2 \xlongequal{\Delta} 2Al2O3}$$
1
| $$\ce{4Al + 3O2 \xlongequal{\Delta} 2Al2O3}$$
|
原理
Mathjax
支持插件,我们在其中安装mhchem
插件导入即可。
该项目在Github
上开源,项目在这里。
BootCDN
也提供了该项目的加速服务,下面的代码也使用了他们的服务。
方法
在主题的header.php
内添加找到mathjax
代码段,然后添加下列代码。
1 2 3 4 5 6 7 8 9
| <script type="text/x-mathjax-config"> MathJax.Hub.Config({messageStyle: "none",tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Ajax.config.path["mhchem"]="https://cdn.bootcss.com/mathjax-mhchem/3.3.2/"; MathJax.Hub.Config({ TeX: { extensions: ["[mhchem]/mhchem.js","extpfeil.js"] } }); </script>
|
对于Handsome
主题:
在主题的header.php
约$44$行处找到下列代码段,然后在修改为下列代码。
1 2 3 4 5 6 7 8 9 10 11 12
| <!--mathjax--> <?php if (@in_array('mathJax',$this->options->featuresetup)): ?> <script type="text/x-mathjax-config"> MathJax.Hub.Config({messageStyle: "none",tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); MathJax.Ajax.config.path["mhchem"]="https://cdn.bootcss.com/mathjax-mhchem/3.3.2/"; MathJax.Hub.Config({ TeX: { extensions: ["[mhchem]/mhchem.js","extpfeil.js"] } }); </script> <?php endif; ?>
|