Extension:JsMath

JsMath is an extension that provides an additional math rendering mode using the javascript library jsMath. This extension will add an extra option "jsMath" to the math tab in the preferences form. When the user selects this rendering mode the javascript library jsMath will be included on pages and math formulas written using the tag (in wiki texts) will be output inside special tags that are recognized and processed by jsMath on the user's web browser.

The main benefits of using jsMath, instead of the normal math rendering, are primarily that The main drawback is that it takes time for jsMath to process math formulas on the client, especially if a page contains a lot of math. A user might therefore only want to enable jsMath when he or she needs to do a print-out.
 * 1) formulas resize when the text on a page is enlarged,
 * 2) it is possible to get high-quality print output, and
 * 3) it works on almost all browsers (compare this to MathML).

As an alternative: The MathJax javascript library, which is the jsMath replacement, can be used through the MathJax extension. This extension supports TeX style labeling (with automatic numbering) and referencing through  and. (Comment placed here by the author of the MathJax extension Dirk Nuyens 22:13, 15 November 2010 (UTC))

Install jsMath
Detailed instructions are available from the homepage of jsMath.

Configure jsMath
Detailed instructions are available from the homepage of jsMath.

This extension assumes that jsMath is configured through the file easy/load.js. You can edit this file to your heart's content, but below are some recommendations:

 Turn off jsMath's special interpretation of \(, \[, $ and $$ as math mode delimiters.  Load AMSmath and some extra fonts. Notice that you also need to install the extra fonts cmbsy10, cmmib10</tt>, msam10</tt> and msbm10</tt> on the server, as outlined on this page. </li> </ol>

Save the code
Create the directory $IP/extensions/JsMath</tt> and save the php code in the files JsMath.php</tt> and JsMath.i18n.php</tt>, respectively, in that directory.

Configure the extension
First of all you need to have TeX support installed (see this page). Make sure the file $IP/LocalSettings.php</tt> contains the line

Then you add the following lines at the end of the file $IP/LocalSettings.php</tt>

where $wgJsMathRoot</tt> is the root directory of the javascript library jsMath on the server (it should have the same value as the root</tt> variable in easy/load.js</tt>).

If you want jsMath rendering to be the default for users then you should add the following line before JsMath.php</tt> is loaded

If you want to include any plugins to jsMath that cannot be included in easy/load.js</tt> then you should add them to the $wgJsMathPlugins</tt> array before JsMath.php</tt> is loaded. For example, to load the smallFonts.js</tt> plugin you write