Extension:Math/2

The Math extension provides support for rendering mathematical formulas on-wiki via texvc and other backends. It was a part of the core MediaWiki software until MediaWiki 1.18, r85706. See also the related bug #14202 on Bugzilla.

Configuration settings
There are basically 3 possible configuration options.
 * Local LaTeX image rendering (default in Math 1.0, 1.1, now deprecated)
 * Client-side rendering (uses MathJax)
 * Server-side rendering
 * using LaTeXML-service
 * using Mathoid-service (uses MathJax)

Discussion of pros and cons

 * The choice of the rendering mode heavily depends on the amount of math you wiki uses.
 * Server- side rendering can be done at your server or using a public rendering host
 * latexml.mathweb.org
 * Client-side rendering is slow

Client-side rendering (with MathJax)
From 1.19/1.20, the Math extension supports rendering via MathJax, a client-side JavaScript library for parsing latex or mathml code and producing in-browser representation using the browser's native support for HTML+CSS, or MathML, or SVG.

This can render math expressions more sharply (using subpixel antialiasing) and larger (scaling up for zoomed view, printing, or high-resolution screens).

Set $wgUseMathJax to enable MathJax rendering mode; it is still somewhat experimental. For now, users will have to opt in to MathJax on their preferences. In the future we hope to make it the default rendering mode.


 * Settings

Server-side rendering (with LaTeXML)
A convenient option to render LaTeX is to use the LaTeXML web service. This service converts LaTeX to high quality MathML.

You can enable the LaTeXML rendering option with the following settings A short guide to install LaTeXML on your own server can be found here: Install LaTeXML
 * Settings

The installation of Math is simplified to:

=
Local LaTeX image rendering =====

The following variables can be defined in LocalSettings.php after calling require_once("$IP/extensions/Math/Math.php"):

Purging pages that contain equations
Specifying the URL-parameter action=purge does not force the math equation to re-render the math tags. If a complete re-rendering of the math tags is desired the URL-parameter action=purge&mathpurge=true has to be passed. Be aware that this might cause side effects with other pages since the math extension uses the hash of the input TeX-input-string as the caching key. e.g. if you would force the re-rending with mathpurge option for a page containing the equation $E=mc^2$, the new rendering result would be used on all other pages containing $E=mc^2$ after the individual page caches are invalidated.