Maths in Octopress
Background
I need to show some mathematical expressions in my blog, LaTex is perfect and the styles are rich while a little hard to use. So how to get LaTeX‘s maths integrated into Octopress is necessary for me. I mainly referred to the blog.
Settings
I need to preview each post at local, so I installed kramdown first.
gem install kramdown
And add a following source code to my octopress system in ~/octopress/source/_includes/custom/head.html
, which is an empty file for me.
1 | <!-- mathjax config similar to math.stackexchange --> |
Ok, then I can type any mathematical depressions in .markdown files just like in .tex file. For example, I can input $y=x^2+\lambda*\beta$
as an inline formula like that $y=x^2+\lambda*\beta$. What’s more, a centered form can be presented like that:
$$\exp(-\frac{x^2}{2}),$$
by input $$\exp(-\frac{x^2}{2}),$$
. It is only different with the $
and $$
.
Ok, job’s done!