Integrate Blog Content With MathJax

MathJax is a javascript library that able to display mathematical formula in your web page.

To integrate MathJax into your Jekyll server. You will need to include the following code in your <head>...</head> html block.

For example, we could create a head.html in our folder named _include with the following code format :

The next step is to add the head.html file in html file located in ./_layout/default.html with code :

The content in the default.html should structured as :

Test formula

Test the following latex formula in markdown post document:

The result should display as following if the library is successfully deployed : $$a^2+b^2=c^2$$

Note :

If we do not want a liquid tag to be processed, the code can be surrounded with {% raw %} and {% endraw %}.

The tag syntax is described in Liquid for Designers.