Manual:Enable TeX

See also Meta-Wiki Displaying Formula

Requirements

 * texvc, the script MediaWiki calls to render the "math" fragments, is included in the "math" sub-directory of the installation
 * OCaml 3.06 (Objective Caml) or later is required to compile texvc; this can be acquired from http://caml.inria.fr/ if your system doesn't have it available.
 * The makefile requires GNU make.
 * Rasterization is done via LaTeX, dvips, ImageMagick, and Ghostscript. These need to be installed (probably available in your Linux distribution) and in the PATH: the commands,  ,  ,   should all work on the command line.
 * To work properly with rendering non-ASCII Unicode characters, a supplemental TeX package is needed ("cjk-latex" in Debian)

Getting

 * texvc : Should be in your MediaWiki distribution (in the sub-directory math/).
 * OCaml : Latest Objective Caml release
 * GNU make : On Linux, you should have it.
 * Under Windows, you can use MinGW or Cygwin.
 * On Mac OS X, install Xcode tools from either the DVD that came with your computer or from http://developer.apple.com
 * All others: see GNU Make - GNU Project - Free Software Foundation (FSF)


 * LaTeX and dvips : see TeX Live - TeX Users Group (It's large and a pain to get.)
 * Many Linux systems have LaTeX already installed.
 * The Mac OS X distribution is available from http://www.tug.org/mactex/ and includes a painless installer.


 * ImageMagick : ImageMagick: Install from Binary Distribution or from source (note that you will need the latter if you don't have X11 installed under Mac OS X)
 * Ghostscript : On Linux, you may have it. It is easiest to install from packages for your distribution.
 * Source files are available from SourceForge.net

MediaWiki 1.17 and earlier

 * 1) Change to the "math" sub-directory of your MediaWiki install
 * 2) Make sure the math directory is writable:
 * 3) Run 'make' (or 'gmake' if GNU make is not your default make). This should produce the texvc executable.
 * 4) Enable $wgUseTeX and $wgEnableUploads in your LocalSettings.php and everything should work.

MediaWiki 1.18 and later

 * 1) Download and install Extension:Math
 * 2) Change to the "extensions/Math/math" sub-directory of your MediaWiki install
 * 3) Make sure the math directory is writable:
 * 4) Run 'make' (or 'gmake' if GNU make is not your default make). This should produce the texvc executable.
 * 5) Enable the extension in your LocalSettings.php and everything should work.

With litespeed
When MediaWiki runs under litespeed webserver (lsapi PHP), 'texvc' is involked with cleared PATH and it will never find 'latex' executable. A workaround that works for me: move your 'texvc' to 'texvc-bin' and create 'textvc' script with the following contents (assuming that 'latex' is in '/usr/bin', modify if it is somewhere else):