Extension:TrustedMath

TrustedMath is an extension that allows embedding LaTeX equations on wiki pages, similarly to the built-in math renderer, but without dependency on Ocaml and working almost out of the box on Windows.

Usage
The reason that MediaWiki normally renders math via an intermediate Ocaml script, is because TeX is not inherently safe. The intermediate texvc script removes all unsafe markup. The TrustedMathe extension does not contain these validation mechanisms. Instead it allows certain users to write unvalidated LaTeX which can be embedded into a page by anyone.

Please note that normally math is validated for a reason. The author does not know the exact security implications, but it could be very well possible that users who are allowed to render math may crash your wiki, steal your passwords and delete your database, so do not allow access to users you don't trust.

Safe mode
The safe mode is enabled by default. The extension creates the Math: namespace, which is restricted to users with the  user right. You need to grant that right to sysops or some other group that you trust. These users can then put equations in the Math namespace. Those equations can be embedded using the  syntax.

Unsafe mode
The unsafe mode allows math embedded in regular  syntax and is almost compatible with the built-in math renderer. To enable it set  to true in LocalSettings.php.

Installation

 * Install LaTeX. Windows users may want to install LaTeX using the MiKTeX package
 * Download TrustedMath and unpack it into your extensions folder
 * Add the following line to the bottom of your LocalSettings.php:
 * Tell MediaWiki where the  and   renderers are located.
 * For Linux those are usually  and
 * For Windows those are something like  and
 * Set them in LocalSettings:
 * If you are using the safe mode, you need to give a group the  right. To do so for sysops, add to your LocalSettings:

Now test your installation. Create a page with the Riemann zeta function at Math:Riemann zeta: \zeta(s) = \sum_{n=1}^\infty n^{-s} = \frac{1}{1^s} + \frac{1}{2^s} + \frac{1}{3^s} + \cdots \;\;\;\;\;\;\;\sigma = R(s) > 1. \!

Embed it on another page using. It should now show:

$$ \zeta(s) = \sum_{n=1}^\infty n^{-s} = \frac{1}{1^s} + \frac{1}{2^s} + \frac{1}{3^s} + \cdots \;\;\;\;\;\;\;\sigma = R(s) > 1. \! $$

IIS users
IIS and possibly other Windows users need to set the environment variable USERPROFILE to a path that the webserver can read/write to. Add to LocalSettings.php:

Math support
Not all math syntax supported by the math renderer of Wikipedia is supported, such as \mathfrak. If you know how to fix this please leave a message at the talk page.