问题
前段时间给博客增加了Jetpack插件,今天突然发现文章里数学公式大部分变成了下边样式的图片:
排查
一开始怀疑是博客的Cache插件问题,不过经过逐个关闭插件排查,发现是Jetpack的Beautiful Math模块在作怪。看看Jetpack官网的说明:
If your LaTex code is broken, instead of the equation you’ll see an ugly yellow and red error message. Sorry, we can’t provide support for *LaTex *syntax, but there are plenty of useful guides elsewhere online. Or a quick post in our forums might find you a solution. One thing to keep in mind is that WordPress puts all of your LaTex code inside a LaTex
math
environment. If you try to use LaTex that doesn’t work inside themath
environment (such as\begin{align} ... \end{align}
), you will get an error
也就是说,我的MathJax-Latex插件并没有生效,反而被Jetpack的Beautiful Math代替了,而其对一些LaTex公式并不支持。
解决
解决方案也很简单,若不希望更换公式的写法为Beautiful Math,只需要关掉它就好:
- 打开“你的网址/+/wp-admin/admin.php?page=jetpack_modules”
- 找到“Beautiful Math”或者中文“ 美妙的数学 ”
- 禁用之
再打开您的页面,问题是否解决了呢?XD