From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:SimpleMathJax and the translation is 7% complete.

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

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+
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.

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( 'SimpleMathJax' );, you need to use:

require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";

Or you can git clone.

$ git clone 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

The following variables can be defined in LocalSettings.php after calling wfLoadExtension( 'SimpleMathJax' );. Note that for a simple site adding $wgSmjSize = 110; might be all you need to make it Just Work™.

Version Setting name Default value Kuvaus
0.6.1 $wgSmjSize 110 The default font size for SimpleMathJax
( defaults to 110 )
0.6.1 $wgSmjScripts ['//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML',
can use local or another remote scripts
( defaults to use cloudflare CDN )
0.6.1 $wgSmjInlineMath [] can add some additional inlineMath symbols pairs
0.6.1 $wgSmjDisableChem false disable <chem> tags
( defaults to use chem tags )
0.6 $wgSimpleMathJaxSize 125 deprecated
(replaced by $wgSmjSize)
0.6 $wgSimpleMathJaxUseCDN true deprecated
(replaced by $wgSmjScripts)
0.6 $wgSimpleMathInlineMath [] deprecated
(replaced by $wgSmjInlineMath)

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

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

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

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


More examples

Katso myös

External links