Manual:Math

''If you are looking for information on the syntax, see. Other ways of rendering math in Mediawiki are listed here.''

MediaWiki supports embedding mathematical formulas using TeX syntax in   tags.

Installation
To use TeX formulas in MediaWiki, you have to build and configure the texvc program, which uses LaTeX to render the formulas. It is located in the math directory in your MediaWiki installation directory, see Manual:Enable TeX and the README file in that directory for instructions. When the texvc program is built, you have to enable it using the $wgUseTeX setting.

Usage
Once texvc is installed, end users can enter LaTeX formulae between tags in the wikitext of any page.

If texvc is not installed, the graphics output is not visible, and you will see a red-coloured error message text instead.

An extensive user guide with examples of LaTeX output produced in this manner can be found here:. One example follows here for completeness:

produces

$$  \operatorname{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt = \frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}} $$

Configuration
The behavior of the tools that support the   tag can be changed by various configuration settings. Visit the TeX section of the  configuration settings page for more details.

Changes in $wgTexvcBackgroundColor not reflected in existing images
The $wgTexvcBackgroundColor configuration variable sets the global background color for formulas generated from the contents of    tags.

Changes to the value of $wgTexvcBackgroundColor will not be reflected in formulas that have already be generated. An untested way to deal with this issue is to remove the existing generated images and force MediaWiki to generate new images. The steps to do this are:


 * 1) ensure that  $wgMathCheckFiles is set to true
 * 2) move the image files for formulas that have already been generated to another directory. (You could simply delete the files, but moving is safer.) Check the  $wgMathDirectory</tt> configuration variable to find the path to this directory.
 * 3) Clear the cache for the page. Visit  How do I purge a cached page? for instructions.
 * 4) View a page containing a formula to see if the images are being regenerated.