Extension:ASCIIMath4Wiki

This extension adds a  tag that outputs math expressions written in ASCIIMathML as MathML.

It is a lighter alternative to LaTeX for mathematical expressions, which has higher demands in terms of storage space, process, Linux package installations, et cetera. This extension doesn't create image files, nor require any 3rd party server-side packages, but rely on client's browser support for rendering MathML. ASCIIMathML's syntax is also easier and more human-legible than LaTeX's.

Syntax
Math expressions can be written in ASCIIMathML syntax, contained by the custom  tag: ASCIIMath_expressions

Browser compatibility
MathML is a World Wide Web Consortium standard, but not all browsers support it properly.
 * Internet Explorer doesn't support MathML at all; Internet Explorer users can view MathML with the Math Player plugin.

Installation
The extension requires MediaWiki 1.6+ and the ASCIIMathPHP 1.1+ PHP extension, and the skin files must be modified to support MathML. Also, avoid using this extension with TeX; If you're using TeX, try to use that for math instead.


 * 1) Download the extension (includes ASCIIMath4Wiki and ASCIIMathPHP).
 * 2) Unpack the files to /extensions/ in the root of your MediaWiki installation. The package should include ASCIIMath4Wiki.php, ASCIIMathPHP.cfg.php, and ASCIIMathPHP.class.php.
 * 3) Add the following line to LocalSettings.php (near the bottom): include("extensions/ASCIIMath4Wiki.php");
 * 4) Specify the skins as XML and change their DTDs to support XHTML+MathML (see below).
 * 5) Watch out for unclean HTML rendering in wiki extensions.

Changing the skin's DTD
Caution: All wiki HTML tags rendered (even the ones parsed from the wiki text) are XHTML compatible, so the MediaWiki alone won't have any problem outputting as XHTML. But watch out for unclean HTML in other wiki extensions. Keep in mind that any tag error in output will generate an XHTML parsing error, "breaking" the page; XHTML is very unforgiving.

MediaWiki skins render pages as HTML. To allow MathML in your skin, you must make it as XHTML+MathML (by rendering it as a XML document and specifying the header about the XHTML and MathML tags). That mean you will have to change the wiki's page rendering to all allowed skins.

Below is an example of how to change MonoBook:

Open /skins/MonoBook.php in your wiki and find these lines; make sure to make the equivalent change in each skin's main file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>">

Change the above to this: '; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>">

Remember you should change it in all allowed skins, not only Monobook.