LaTeX on a shared host

It is possible to run LaTeX under a shared host. It might not be beautiful, but it works. If you wish to do this, be aware that this is not an official hack.

Find a LaTeX engine

 * If you have CGI support on your host install mimeTeX, which can be found at: http://www.forkosh.com/mimetex.html.
 * If you don't have CGI support, use a public mimeTeX server: http://www.forkosh.com/mimetex.cgi or http://www.forkosh.com/mathtex.cgi (for prettier rendering using mathTeX).


 * Download Extension:Math and place the files in extensions/Math
 * Add the following line to your LocalSetting.php:

If you have CGI support on your host do the code changes described below, then set the server running the mathtex or mimetex cgi script by setting in LocalSettings.php:

If you don't have CGI support on your host do the code changes described below, then set the server running the mathtex or mimetex cgi script by setting in LocalSettings.php: or

MediaWiki 1.20
On MediaWiki 1.20 and shared hosting:

The function then looks as follows:
 * Add the following line to the function renderMath in the file extensions\Math\MathRenderer.php:

-

Not sure what those "..." are supposed to mean. Regardless, it looks like there's recently been a complete overhaul of the code. It still doesn't respect the $wgTrustedMathMimetexUrl parameter in LocalSettings.php though, which makes it kinda useless. I just checked out the "origin/REL1_20" branch so that I could implement the changes listed below in the MediaWiki 1.19 section. I have this working with MediaWiki 1.21.2, though really, I don't know how long this downgrade trick will work.

$ cd extensions $ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Math.git $ cd Math $ git checkout origin/REL1_20

At that point you can implement the familiar change in the MediaWiki 1.19 section below. Aspensmonster (talk) 05:41, 15 September 2013 (UTC)

MediaWiki 1.19
The function then looks as follows:
 * Add the following line to the function renderMath</tt> in the file extensions\Math\Math.body.php</tt>:


 * This has been successfully tested on 1.19.2 - Stefahn (talk) 23:24, 4 December 2012 (UTC)
 * This has been successfully tested on 1.20.2 - --Tosfos (talk) 23:54, 13 December 2012 (UTC)
 * 1.19 works on MediaWiki 1.20.3, with either of the external servers. - --Rob Kam (talk) 10:40, 8 April 2013 (UTC)

MediaWiki 1.18
In MediaWiki 1.18 there is no more script incl/Math (see below). Install Mediawiki:Math Extension separately. Math.php</tt> is present in extensions/math/math.body.php</tt>. Replace the function renderMath</tt> here (see below) and it works.

Older than 1.18 MediaWiki
Open Math.php</tt> in $WikiPath/includes/Math.php</tt> (or Math.body.php</tt>) and find this function (at the bottom):

Add this line after the first line: Result:

Where http://www.example.com/cgi-bin/mimetex.cgi? is the URL of your mimeTeX installation or the public one.

Then enable TeX in LocalSettings.php</tt>

'''Remember this is not official, and may not work with some versions. I've tried version 1.5.5.'''
 * Also working on version 1.5.6 --80.62.185.50 00:03, 7 February 2006 (UTC)
 * Work fine on Mediawiki 1.6.3 --82.50.10.47 12:23, 17 April 2006 (UTC)
 * Commented out all existing lines of renderMath. $math and $wgUser are obviously not used in the patched version. This change has not been tested.  See page history for old version. --Archimerged 02:58, 27 May 2006 (UTC)
 * Tried on MediaWiki 1.12 and it does not work. Do you have a patch?
 * Works on my 1.12. I used the external mimetex server, cose I have problems with my cgi-bin.
 * Working on version 1.13.1 with external mathtex server.
 * Working on version 1.14 with external mathtex server.
 * Working on version 1.15.1 with external mathtex server.
 * Working on version 1.16.0, :) thanks alot for this great help
 * Working on version 1.17.0, using mathtex server and this fix