Extension:MathJax

What is this?
Extension:MathJax enables MathJax (http://www.mathjax.org/), a Javascript library, for typesetting TeX and LaTeX formulae in MediaWiki inside math environments. The following math environments are defined for inline style math: And the following math environments are defined for display style math: MathJax produces nice and scalable mathematics, see their website (http://www.mathjax.org/) for a demonstration. This extension also enables the usage of  and   tags with automatic formula numbering. If needed you can still hand label by using.
 * and
 * and
 * and
 * and
 * and

Usage
This extension allows for typical LaTeX math integration. For example: (Which comes from a preprint of Jon M. Borwein, Dirk Nuyens, Armin Straub, and James Wan. Random walk integrals.)

This renders as http://www.cs.kuleuven.be/~dirkn/Extension_MathJax/MathJaxExample.png.

An alternative for the default + math handling
If you but still want to render math, then this extension could be a solution for you.
 * don't want to use  because you
 * want scalable nicer mathematics,
 * transparent backgrounds, or
 * find having LaTeX on your server too inconvenient; or
 * can't use
 * as you have trouble configuring and compiling, or
 * can't easily write png files (because of ) or
 * for some other reason,

Note that you could as well load the MathJax JavaScript library by customizing your WM skin or account, but there is still one major advantage of this extension over such a method: E.g., writing $$ \sum f(x) = F(x) + g(x) $$ does what you want it to do using this extension, but not when using a customization method as the whitespace at the beginning of line 2 will make WM introduce a  tag and thus break the formula environment for MathJax.
 * this extension allows you to use as many whitespace in your formula as you want.

Install MathJax on your webserver
MathJax is just a Javascript library, so there is no compilation involved, just putting the MathJax files (Javascript files and fonts) on your webserver.

Install the MathJax Javascript library by following their installation instructions at http://www.mathjax.org/resources/docs/?installation.html. An easy installation would use their zip package as follows:
 * 1) Download the latest zip distribution from http://sourceforge.net/projects/mathjax/files/.
 * 2) Unzip the package (you get a directory  ) and place it in your root directory of your webserver (e.g.,  ).
 * 3) Test if it works by surfing to, e.g.,   and  . You should see nicely rendered math. Try right-clicking on the math to get the MathJax contextual menu (e.g., scale all maths on a page or enabling zooming on mouse hovering).

Install Extension:MathJax on your webserver
To install Extension:MathJax you need to put the  code on your server as well as a MathJax Javascript configuration file:. To enable the extension you then need to modify your  MediaWiki configuration file.


 * 1) Installing MathJax.php: cut and paste the code found on the Extension:MathJax/MathJax.php subpage and place it in  .  Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
 * 2) Install the MathJax Javascript configuration hub file: cut and paste the code found on the Extension:MathJax/mwMathJaxConfig.js subpage and place it in  . (If you like having a shared installation for multiple wiki's then place the config file inside the   directory such that it is easy to share.)

Configuration
To install this extension, add the following to LocalSettings.php:

The  array has keys of URLs to Javascript files and keys of local file paths to configuration hub Javascript files. Thus: This will be included in the rendered page (except when the page is in namespace ) as As noted by a user: a relative URL (e.g., " ") will be faster than an absolute URL (e.g., " ").

It doesn't matter if you have  set to   or  ; Extension:MathJax will take over rendering of the standard   math tags.

Changelog

 * 0.5 (20101116)
 * Initial public release.


 * 0.5.1 (20101201)
 * Modifications to allow integration with Extension:Semantic_MediaWiki.
 * Compatability code for Parser::MARKER_SUFFIX added.


 * 0.5.2 (20110203)
 * Kind of revert move away from the markers used by MW as it does no really matter which ones we use (so no need for the SMW fix from 0.5.1 anymore).
 * Allowed \label and \tag at the same time as one would expect.
 * Added clickable links for the formula references, this currently assumes the used label or tag is a valid XHTML id.