Magic of MathJax.
Procedure
- Add following piece of code to jekyll _includes folder, we can name it
mathjax.html
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\[","\]"], ["\\[","\\]"] ],
processEscapes: true
},
messageStyle: "none",
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js">
</script>
- Then add following inclusion to _layouts/default.html
{% include mathjax.html %}
Test it on Page:
$$
\begin{align}
\sigma_b^2(t) & = \sigma^2(t) - \sigma_w^2(t) = w_0(\mu_0 - \mu_T)^2 + w_1(\mu_1 - \mu_T)^2 \tag{maximum variance} \\
&= w_0(t)w_1(t)\left[\mu_0(t) - \mu_1(t)\right]^2
\end{align}
$$
Put it on markdown file. We don't need to put $$...$$
into code formate. Just copy and past only