]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - math/README
MediaWiki 1.17.4
[autoinstalls/mediawiki.git] / math / README
index 1349b83e2dbec1db121dd84c0b191ddf9c2beea1..5b99d4c237b8d88bc11a9e9f1495068da5c9ecfd 100644 (file)
@@ -1,41 +1,45 @@
 == About texvc ==
 
-texvc takes LaTeX-compatible equations and produces formatted output in
-HTML, MathML, and (via LaTeX/dvips/ImageMagick) rasterized PNG images.
-Input data is parsed and scrutinized for safety, and the output includes
-an estimate of whether the code is simple enough that HTML rendering will
-look acceptable.
+texvc takes LaTeX-compatible equations and produces formatted output in HTML,
+MathML, and (via LaTeX/dvipng) rasterized PNG images.
+Input data is parsed and scrutinized for safety, and the output includes an
+estimate of whether the code is simple enough that HTML rendering will look
+acceptable.
 
-The program was written by Tomasz Wegrzanowski for use with MediaWiki;
-it's included as part of the MediaWiki package (http://wikipedia.sf.net)
-and is under the GPL license.
+The program was written by Tomasz Wegrzanowski for use with MediaWiki; it's
+included as part of the MediaWiki package (http://www.mediawiki.org) and is
+under the GPL license.
 
-Please report bugs at: http://bugzilla.wikimedia.org/ (under "MediaWiki")
+Please report bugs at: https://bugzilla.wikimedia.org/
+with "MediaWiki extensions" as product and "texvc" as component.
 
 == Setup ==
 
 === Requirements ===
 
-OCaml 3.06 or later is required to compile texvc; this can be acquired
-from http://caml.inria.fr/ if your system doesn't have it available.
+OCaml 3.06 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, and ImageMagick. These need
-to be installed and in the PATH: latex, dvips, convert
+Rasterization is done via LaTeX, dvipng. These need to be installed and in
+the PATH: latex, dvipng
 
-To work properly with rendering non-ASCII Unicode characters, a
-supplemental TeX package is needed (cjk-latex in Debian)
+AMS* packages for LaTeX also need to be installed. Without AMS* some equations
+will render correctly while others won't render. Most distributions of TeX
+already contain AMS*. In Debian/Ubuntu you need to install tetex-extra.
+
+To work properly with rendering non-ASCII Unicode characters, a supplemental TeX
+package is needed (cjk-latex in Debian)
 
 === Installation ===
 
 Run 'make' (or 'gmake' if GNU make is not your default make). This should
 produce the texvc executable.
 
-If you're using MediaWiki's install.php and have enabled $wgUseTeX in your
-LocalSettings.php, the installer will try to copy texvc into place, in the
-'math' subdirectory under where wiki.phtml is installed.
-
+Then you'll need to set $wgUseTeX to true in your LocalSettings.php. By default,
+MediaWiki will search in this directory for texvc, if you moved it elsewhere,
+you'll have to modify $wgTexvc and set it to the path of the texvc executable.
 
 == Usage ==
 
@@ -44,13 +48,13 @@ Just Works. It can be run manually for testing or for use in another app.
 
 === Command-line parameters ===
 
-    texvc <temp directory> <output directory> <TeX code> <encoding>
+    texvc <temp directory> <output directory> <TeX code> <encoding> <color>
 
 Be sure to properly quote the TeX code!
 
 Example:
 
-    texvc /home/wiki/tmp /home/wiki/math "y=x+2" iso-8859-1
+    texvc /home/wiki/tmp /home/wiki/math "y=x+2" iso-8859-1 "rgb 1.0 1.0 1.0"
 
 === Output format ===
 
@@ -80,7 +84,7 @@ texvc output format is like this:
 
 == Troubleshooting ==
 
-Unforunately, many error conditions with rasterization are not well reported.
+Unfortunately, many error conditions with rasterization are not well reported.
 texvc will return as though everything is successful, and the only obvious
 sign of problems for the user is a big X on a wiki page where an equation
 should be.
@@ -92,6 +96,15 @@ Ensure that the temporary and math directories exist and can be written to by
 the user account the web server runs under; if you don't control the server,
 you may have to make them world-writable.
 
+If some equations render correctly while others don't, you probably don't have
+AMS* packages for LaTeX installed. Most distributions of TeX come with AMS*.
+In Debian/Ubuntu AMS* is in tetex-extra package.
+To check if that is the problem you can try those two equations:
+    x + y
+    x \implies y
+The first uses only standard LaTeX, while the second uses symbol \implies from AMS*.
+If the first renders, but the second doesn't, you need to install AMS*.
+
 == Hacking ==
 
 Before you start hacking on the math package its good to know the workflow,
@@ -101,7 +114,6 @@ which is basically:
 2. texvc does its magic, which is basically to check for invalid latex code.
 3. texvc takes the user input if valid and creates a latex file containing it, see
    get_preface in texutil.ml
-4. latex(1) gets called to create a .dvi file, the a .ps file is created from the
-   .dvi file using dvips(1), and finally convert(1) creates a .png file from
-   the .ps file. See render.ml for this process (commenting out the removal of
+4. dvipng(1) gets called to create a .png file
+   See render.ml for this process (commenting out the removal of
    the temporary file is useful for debugging).