# Extension:MathJax

MediaWiki extensions manual
MathJax
Release status: beta
Implementation Extended syntax
Description Allows math rendering for TeX/LaTeX with the JavaScript library MathJax, including LaTeX style formula references.
Author(s)
MediaWiki 1.26+
Check usage and version matrix.

The MathJax extension enables MathJax, a Javascript library, for typesetting TeX and LaTeX formulae in MediaWiki inside math environments. The following math environments are defined for inline style math:

• $$...$$
• $$...$$
• [itex]...</math>

And the following math environments are defined for display style math:

• $...$
• \begin{...}...\end{...}
• [itex]...</math>

MathJax produces nice and scalable mathematics, see their website (http://www.mathjax.org/) for a demonstration. This extension also enables the usage of \label{} and \eqref{} tags with automatic formula numbering. If needed you can still hand label by using \tag{}.

## Installation

• Download and place the file(s) in a directory called MathJax in your extensions/ folder.
wfLoadExtension( 'MathJax' );
# Change default font size (default: 100)
// $wgMjSize = 100; # Use local MathJax installation (default: false, use CDN) //$wgMjUseCDN = true;
# If you want to use local CDN (put parameter above false), then you need to download the MathJax-folder in this repo: https://github.com/mathjax/MathJax/tree/2965eab516910550491f895322bc181f1d24ca5a and place it with the name "MathJax" into the "modules" folder of the "MathJax" extension folder. (This note can be removed by the maintainer of this extension, once this MathJax-folder is added to the download repo.)

•  Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'MathJax' );, you need to use:

\newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}$$We consider, for various values of$$s$$, the$$n-dimensional integral \begin{align} \label{def:Wns} W_n (s) &:= \int_{[0, 1]^n} \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x} \end{align} which occurs in the theory of uniform random walk integrals in the plane, where at each step a unit-step is taken in a random direction. As such, the integral \eqref{def:Wns} expresses thes$$-th moment of the distance to the origin after$$n$$steps. By experimentation and some sketchy arguments we quickly conjectured and strongly believed that, for$$ka nonnegative integer \begin{align} \label{eq:W3k} W_3(k) &= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}. \end{align} Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. The reason for \eqref{eq:W3k} was long a mystery, but it will be explained at the end of the paper.  (Which comes from a preprint of Jon M. Borwein, et. al. Some arithmetic properties of short random walk integrals.) ## Change log 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. 0.5.2b (20110215) Removed redundant comma's in the MathJax configuration hub file to please IE... 0.6 (20120418) Updates for MediaWiki 1.18 (tested with 1.18.2) and MathJax 2.0, amonst others incorporating a patch from EvanChou (thanks!) and the CDN modification of Evan. This is mainly a maintenance update to get the extension back on track for 1.18.2. 0.7 (20120422) Complete rewrite,  and can now be turned on and off, much better protection and detection, numbering is consistent among different environments, no global variables anymore (everything is now in one class), new tag <nomathjax>, magic words to turn on and off features: __MATHJAX__ and __NOMATHJAX__, __MATHJAX_NUMBER__ and __MATHJAX_NONUMBER__, __MATHJAX_DOLLAR__ and __MATHJAX_NODOLLAR__, and __MATHJAX_DOLLARDOLLAR__ and __MATHJAX_NODOLLARDOLLAR__.
1.0 (2015)
Version before archival in 2017.
1.1 (20190501)
Restored. Update for MediaWiki 1.27, using script loading method done in extension Extension:SimpleMathJax. Disable support for $...$. Use Cloudflare CDN by default. Configuration parameter for font size.