From MediaWiki.org
Jump to: navigation, search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎한국어 • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎Tiếng Việt
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type Tag
DescriptionTemplate:Extension#description Allows to render mathematical formulas using MathJax with MediaWiki math style
Author(s)Template:Extension#username jmnote, vedmaka, jamesmontalvo3, badshah400
Latest versionTemplate:Extension#version 0.6.1 (2017-06-12)
MediaWikiTemplate:Extension#mediawiki 1.23 - 1.28
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 3.0
ExampleTemplate:Extension#example zetawiki.com

$wgSimpleMathJaxSize, $wgSimpleMathJaxUseCDN, $wgSimpleMathJaxInlineMath

Hooks usedTemplate:Extension#hook

Translate the SimpleMathJax extension if it is available at translatewiki.net

Check usage and version matrix.

The SimpleMathJax extension enables MathJax, a Javascript library, for typesetting TeX formula in MediaWiki inside math environments. This extension will load resources from mathjax.org on all wiki pages. Since April 30, 2017, cdn.mathjax.org is shutting down proposing alternatives like cdnjs.cloudflare.com for loading resources with a fixed version (see external links). Please change version number accordingly in Configuration settings.

  • Simple
  • Lightweight
  • UTF-8 Support
  • Mobile View OK
  • Setting Font Size
  • chem tag support for chemistry
  • additional inlineMath symbols pairs support
  • MediaWiki Style! Look at the samples.


  • Download and place the file(s) in a directory called SimpleMathJax in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";
    #$wgSimpleMathJaxSize = 120;
  • If necessary configure at your convenience
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Or you can git clone.

$ git clone https://github.com/jmnote/SimpleMathJax.git

If you want to use not CDN but local mathjax scripts, you can use git clone recursive. ( MathJax is pretty heavy. )

$ git clone --recursive https://github.com/jmnote/SimpleMathJax.git

SimpleMathJax is meant to be used as an alternative to the Math extension. If the Math extension is installed it may take precedence and cause SimpleMathJax to not work. The SimpleMathJax extension is the only thing you need to start rendering equations.

Configuration settings[edit]

The following variables can be defined in LocalSettings.php after calling require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";. Note that for a simple site adding $wgSimpleMathJaxSize = 125; might be all you need to make it Just Work™.

Setting name Default value Description
$wgSimpleMathJaxSize 125 The default font size for SimpleMathJax; defaults to 125
$wgSimpleMathJaxUseCDN true use CDN files instead of local files
$wgSimpleMathJaxInlineMath [] add some additional inlineMath symbols pairs

If you want to change font size, set $wgSimpleMathJaxSize like below.

wfLoadExtension( 'SimpleMathJax' );
$wgSimpleMathJaxSize = 150;

If you want to use local module, set $wgSimpleMathJaxUseCDN like below.

wfLoadExtension( 'SimpleMathJax' );
$wgSimpleMathJaxUseCDN = false;

If you want to enable some additional inlineMath symbol pairs, set $wgSimpleMathJaxInlineMath like below.

wfLoadExtension( 'SimpleMathJax' );
$wgSimpleMathJaxInlineMath = [["$","$"],["\\(","\\)"]];


More examples

See also[edit]

External links[edit]