update 20170513:
If use pelican
, the easist way is to include the plug-in called Math Render Plugin For Pelican
It use MathJax
to give pelican the ability to render mathematics. It supports both markdown and reStructuredText.
It also supports color and mhchem.
It only enables math formula. But it did not support complicated things like equation number and so on.
method 1. copy the following in the md file
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
method 2. copy that into the header.html
file
For me, the header.html
is in
blog/pelican-themes/pelican-octopress-theme/templates/_includes/header.html
Then input the formula inside $$ ... $$
will create formula centered in new line
$$\frac{\partial f(y)}{\partial x} = \frac{\partial f}{\partial y} \times \frac{\partial y}{\partial x}$$
will generate
And \\( \frac{1}{n} \\)
will create formula inline: \( \frac{1}{n} \).
Let's test some inline math \(x\), \(y\), \(x_1\), \(y_1\).
Now a inline math with special character: \(|\psi\rangle\), \(x'\), \(x^\*\).
Test a display math:
Test a display math with equation number:
Test a display math with equation number:
And test a display math without equaltion number:
Test a display math with equation number:
And test a display math without equaltion number:
Here are some notes about the above example:
-
The inline formula is between
$ ... $
. -
The display formula is between
$$ ... $$
. -
You can use the math envrionment directly, for example,
\begin{equation}...\end{equation}
or\begin{align}...\end{align}
. -
Whenever in the inline math or display math, the star character
'*'
must be escaped. -
In the multi-lines display math, the line break symbol double-backslash
'\\'
should be escaped, i.e., use four backslash'\\\\'
. -
If you found error while typeseting math formula, try to escape some special characters.