MathJax allows us to write and display math equations in web page. We can add MathJax easily using some wordpress plugins. However, you may also can not show math equations after having install mathjax in wordpress. In this tutorial, we will list some problems and fix them.
Preliminary
1. You should install a mathjax plugin to use mathjax in wordpress.
As to us, we use Simple Mathjax plugin.
2. You should write a math equation correctly in your wordpress post.
For example:
\[QK^T\]
Now, we can find problems and fix them.
1. Loading the Mathjax script correctly?
Look at below:
Here we load Mathjax script file with an async mode, it is wrong.
Because we only allow browser to load and run Mathjax script file tex-chtml.js at the end of the html page, however, all math equation text in post content have been displayed before loading tex-chtml.js.
How to fix this problem?
We can use a defer mode to load Mathjax script file tex-chtml.js
To understand the difference between async and defer mode in script loading, you can view:
Understand JavaScript async Vs defer Vs inline: When to Use async, defer or inline?