gitlabhq/gitlabhq — pull request #5280 by harbulot (2013-10-06 15:34:14+00:00)
Title: Added MathJax support in Wiki and Markdown files.

This patch enables [MathJax](http://www.mathjax.org/) rendering in wiki pages and in `.md` files.

MathJax needs to be installed separately. The [MathJax CDN](http://docs.mathjax.org/en/latest/start.html#mathjax-cdn) can be used, for example.

To enable this feature, simply set the MathJax URL (e.g. `http://.../MathJax.js?config=TeX-AMS-MML_HTMLorMML`) as the `mathjax_url` option in the `extra_config` section of `config/gitlab.yml`.

Note that, unlike other Markdown processors, the GitLab Markdown processor already processes `^`, so this symbol has to be escaped if used in a formula: `\^`.

Here are a couple of examples that can be used in wiki or markdown content:

```
Here is a mathematical formula:

$$f(x) = \sum\_{i=1}\^{N}{x\^2}$$

Here is an inline formula: \\( f(x) = \sum\_{i=1}\^{N}{x\^2} \\)
```

The formulae should be turned into mathematical notation after the page is loaded. The first time MathJax is used, this transformation might seem a bit slow, mainly because it needs to download a number of fonts. This improves once MathJax is cached.