How to Insert Mathematical Formula in Markdown

Markdown is the best tool for me to write blog and articles. However, it does not support formula editing, so I had some trouble when writing something like algorithm proof or math related topic. After some search, I found some solutions:

Method 1. Using Google Chart Server

1
<img src="http://chart.googleapis.com/chart?cht=tx&chl=Insert Latex formula here" style="border:none;">

An example:

1
<img src="http://chart.googleapis.com/chart?cht=tx&chl=\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}" style="border:none;">

Result:

Method 2. Using forkosh Server

1
<img src="http://www.forkosh.com/mathtex.cgi? Insert Latex formula here">

For example

1
<img src="http://www.forkosh.com/mathtex.cgi? \Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}">

Result:

Method 3. Using MathJax Engine

Do you admire those beautiful formula on Stackoverflow? Try this engine! It is also easy to use on Markdown.

Firstly, add this script in article:

1
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script>

Then, use LaTex syntex to write formula, $$formula$$ shows block of formula. As for inline formula, unlike \(formula\), we need to use \\(formula\\) since \ is escape character in Markdown. For example:

Block of formula

1
$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

In-line formula

1
\(x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\)