Skip to content
TURNKEYGNU / LINUX
AppsDocumentationBlogScreenshotsGitHubTurnKey Hub
文English
EnglishDeutschEspañol日本語Português中文
Home/Documentation/MediaWiki math rendering support

Documentation

MediaWiki math rendering support

To enable the MediaWiki math rendering engine, perform the following steps:

Install the mediawiki-math package and a couple of other dependancies

apt-get update
apt-get install mediawiki-math texlive-latex-extra dvipng

Create the math image and temp directories and change ownership to the web server user

mkdir -p /var/lib/mediawiki/images/{math,tmp}
chown www-data:www-data /var/lib/mediawiki/images/{math,tmp}

Add the following to /etc/mediawiki/LocalSettings.php or /etc/mediawiki/extensions.php

# Math engine
$wgUseTeX = true;
$wgUploadPath = "/images";
$wgUploadDirectory = "images";
$wgMathPath = "{$wgUploadPath}/math";
$wgMathDirectory = "{$wgUploadDirectory}/math";
$wgTmpDirectory = "{$wgUploadDirectory}/tmp";

Enable the extension and update MW DB

mwenext Math.php
php /usr/share/mediawiki/maintenance/update.php

Go create your math formulas...

Note: if you added the above to /etc/mediawiki/extensions.php you might have to clear mediawiki page cache.

More resources:

  • http://www.mediawiki.org/wiki/Manual:Math
  • http://meta.wikimedia.org/wiki/MediaWiki_math_markup
  • http://meta.wikimedia.org/wiki/Help:Formula
TURNKEYGNU / LINUX

Own your infrastructure without starting from scratch.

Explore TurnKey
AboutDocumentationFAQBlogGitHub
Free and open sourceSecure by defaultReady to deploy