Manual:Enable TeX
From MediaWiki.org
See also Meta-Wiki Displaying Formula.
There are also instructions, particularly for Ubuntu Precise, in the math/README file in the code.
Contents |
Requirements [edit]
- 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,gsshould 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]
- 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]
MediaWiki 1.17 and earlier [edit]
- Change to the "math" sub-directory of your MediaWiki install
- Make sure the math directory is writable:
sudo chown your-username . - Run 'make' (or 'gmake' if GNU make is not your default make). This should produce the texvc executable.
- Enable $wgUseTeX and $wgEnableUploads in your LocalSettings.php and everything should work.
MediaWiki 1.18 and later [edit]
- Download and install Extension:Math
- Change to the "extensions/Math/math" sub-directory of your MediaWiki install
- Make sure the math directory is writable:
sudo chown your-username . - Run 'make' (or 'gmake' if GNU make is not your default make). This should produce the texvc executable.
- Enable the extension in your LocalSettings.php and everything should work.
Notes [edit]
- Remember that Tex code is rendered during saving, but only changed data is rerendered and saved
- More information is included in the "README" file in the "math" directory.
- For Debian there is a neat Debian-howto going through the whole procedure step by step, also pointing out some possible traps and problems.
- Enabling TeX on Apple OS X requires getting around some additional security. see Manual_talk:Running_MediaWiki_on_Mac_OS_X#Mathematics
- Enabling TeX in Windows Systems might be a little more tricky. See Manual:Running_MediaWiki_on_Windows#Mathematics_Support for more details! Please do read the section Manual:Running_MediaWiki_on_Windows#Troubleshooting, too!
With litespeed [edit]
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]
- /problems
- Manual:Troubleshooting math display errors
- Mediawiki and LaTeX on a host with shell access
- LaTeX on a shared host with mimeTeX (now replaced by mathTeX)
- Extension:TrustedMath — extension that does not require Ocaml, but also does not validate math input
| Language: | English • 한국어 |
|---|