Manual:Enable TeX

From MediaWiki.org
Jump to: navigation, search

See also Meta-Wiki Displaying Formula.

There are also instructions, particularly for Ubuntu Precise, in the math/README file in the code.

Requirements[edit | edit source]

  • texvc, the script MediaWiki calls to render the "math" fragments, is included in the Math extension
  • 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 latex, dvips, convert, gs 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[edit | edit source]

texvc 
Should be in your MediaWiki distribution (in the sub-directory math/) or, if you use MediaWiki 1.18+, this is part of Extension: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

Installation[edit | edit source]

MediaWiki 1.17 and earlier[edit | edit source]

  1. Change to the "math" sub-directory of your MediaWiki install
  2. Make sure the math directory is writable: sudo chown your-username .
  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[edit | edit source]

  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: sudo chown your-username .
  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.

Notes[edit | edit source]

With litespeed[edit | edit source]

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):

#! /bin/bash
export PATH="$PATH:/usr/bin"
/the/full/path/to/your/texvc/binary/texvc-bin "$1" "$2" "$3" "$4" "$5"

See also[edit | edit source]

Language: English  • 한국어