MathJax是什么?
MathJax是一个JavaScript,用于在博客或其他html页面上渲染Latex、MathML的工具,由服务器端提供,可以在网页上显示公式。
1,安装MathJax,需要在本地安装MathJax的Javascript,以及wordpress里面的MathJax插件
MathJax-LaTeX
This plugin enables MathJax (http://www.mathjax.org) functionality for WordPress. Version 1.0 is compatible with MathJax 1.1 and the CDN.
Download Version 1.0
要支持公式的引用需要修改MathJax的设置,参考http://zhiqiang.org/blog/it/mathjax-make-mathematics-beautiful.html
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {equationNumbers: {autoNumber: ["AMS"], useLabelIds: true}},
"HTML-CSS": {linebreaks: {automatic: true}},
SVG: {linebreaks: {automatic: true}}
});
</script>
如何修改,参考http://www.mathjax.org/docs/2.0/platforms/index.html
3,wordpress中使用MathJax
显示效果,可以采用完全Latex的写法写下面的公式 1 :
\begin{equation}\label{eq1}r = r_F+ \beta (r_M - r_F) + \epsilon\end{equation}
得到: