Skip to content

Add MathJax support in Wiki and Markdown files.

Matthias Käppler requested to merge github/fork/harbulot/mathjax into 6-1-stable

Created by: harbulot

This patch enables MathJax rendering in wiki pages and in .md files.

MathJax needs to be installed separately. The 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.

Merge request reports