Displaying Math equations using MathML in mediawiki

Posted on 28/12/09 by webadmin No Comments

Mathematical Markup Language (MathML) describes mathematical notations and capturing both its structure and content. The objective of mathml is to integrate mathematical formulae into World Wide Web documents.
For examples of mathematical expressions and the syntax for writing them within a wiki refer

http://meta.wikimedia.org/wiki/Help:Formula

Example:
$ {x}^{2}+4x+4=0$

represents the expression

To setup mathml support in mediawiki, we have to install several modules in the server. Please find the steps to make it work below.

1.Setup Tex proccessing in LocalSettings.php
Open the file LocalSettings.php and enable tex processing. This can be achieved by setting $wgUseTeX = true;

2. Install texvc
The mediawiki application by default comes with the source code for texvc in /mediawiki/math. To install this, we can follow any one of the options below.

* Download the precompiled binary from http://prdownloads.sourceforge.net/wikipedia/texvc-linux-x86-20040107.tar.gz?download to the math folder.
* Self compilation and copy to math folder.
I prefer the (i) method. Also please make sure that the texvc binary file in the math folder has executable permission.

3. Install TeTeX (http://www.tug.org/teTeX/)

4. Install Ghostscript (http://www.ghostscript.com/)

5. Install ImageMagick (http://www.imagemagick.org/)

6. Install AMS fonts (http://www.ams.org)

Please make sure that latex, dvips, convert and gs are installed.
To know whether these modules are installed and the path, use the commands “which latex” , “which dvips” etc in the console.

7. Install libstdc++5(sudo apt-get install libstdc++5)

8. Please make sure the Ghostscript and ImageMagick do not have conflicting versions.

9. PNG files for mathematical expressions are stored in the math directory. Please check the subdirectories math and tmp in the upload subdirectory to see their contents. Sometimes if the
conversion process ceases or has any issue in certain stage, files of that type may remain in the tmp directory only.

Post a Comment

Your email is never published or shared. Required fields are marked *