How to enable math in JekyII
As a scientific worker, math description is inevitable. Latex is powerful and necessary tool for those writing scientific paper or notes. To share the idea or work online, I am searching for easy way to display the math.
My first trial is JekyII and MathJax, which is simple to set up.
- Edit the
_config.ymlto usekramdownas the markdown
markdown: kramdown
kramdown:
math_engin: mathjax
- Add the
Mathjaxin the template_layout\post.html
<article ...>
...
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</article>
Now you can enjoy playing with math
-
Inline expression like
Inline expression like $$ E = m c^2 $$ -
Block expression
$$
\begin{align}
f(x) & \sim \mathcal{GP}(\mathcal{K}) \tag{1}\\
g(x) & = ax + b \tag{2}
\end{align}
$$