# Manual talk:Math

Searching for "texvc" in the english wikipedia shows me that:

"Like the rest of MediaWiki, it is available under the terms of the GNU GPL from the MediaWiki site."

When I click the link to the MediaWiki site, I can't find anything about a texvc download. If I type "texvc" into the search field, I come to this site. But I can't find a hint how and where I can download the software. 84.134.179.36 21:23, 18 June 2007 (UTC)

texvc is included with the MediaWiki download. See the "math" directory under your installation. There's a README for how to make texvc. Kaolin 00:59, 17 February 2008 (UTC)

And what do we do when it refuses to compile?

$grep OCaml README OCaml 3.06 or later is required to compile texvc; this can be acquired from$ ocaml -version
The Objective Caml toplevel, version 3.12.1
$ocamlopt -version 3.12.1$ pwd
/var/www/localhost/htdocs/wiki/extensions/Math/math
$make ocamlopt -o texvc unix.cmxa util.cmx parser.cmx html.cmx mathml.cmx texutil.cmx lexer.cmx render.cmx texvc.cmx /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/ocaml/libasmrun.a( roots.o): relocation R_X86_64_32S against caml_frametable' can not be used when making a shared object; recompile with -fPIC /usr/lib64/ocaml/libasmrun.a: could not read symbols: Bad value collect2: ld returned 1 exit status File "caml_startup", line 1, characters 0-1: Error: Error during linking make: *** [texvc] Error 2  --70.97.12.233 23:51, 31 January 2012 (UTC) ## How to set permissions on newly rendered png's? For some security reasons we drive php as cgi-script using suphp. So all the mediawiki stuff is executed under a userid different from wwwrun. Since texvc is started via php, the resulting files are owned by this userid, too. This is nice, but the file permissions of the png-graphics is read/write only for the owner. As the pngs are loaded without php, wwwrun must have read access. I tried to fix this using acls on all the directories containing the math-graphics but with no effect. The resulting files are read/writeable only by the files owner. Any idea how to avoid this? I think the easiest place would be to add a system/exec chmod command in includes/Math.php Kaolin 01:03, 17 February 2008 (UTC) ## The 'math temp directory' Failed to parse (Can't write to or create math temp directory)  It seems that the above stated is a common error message people get after compiling texvc and enabling$wgUseTeX in LocalSettings.php.

When you will try to fix this, make sure you try to generate new images every time you try if it worked. This can be done by working in preview-mode and then changing a letter in the formula or something like that.

Unfortunately I couldn't find a solution to the problem on the web (but several error messages in wikis around the world...) and the README file in the math subdirectory of the wiki installation only states

Ensure that the temporary and math directories exist and can be written to by the user account the web server runs under


But it doesn't say what temporary directory is meant. Creating tmp, temp, temporary as well as math/tmp, math/temp, math/temporary, all with 777, does not help. Could anyone please say which directory is meant and how the permissions should be set to make it work?

I installed the last stable MediaWiki (1.11.0) locally, running MacOS X 10.4.10. --Ileo 11:27, 1 November 2007 (UTC)

After looking through includes/Math.php I found that the directory Mediwiki wants is "images/tmp". I chown'd the images directory to apache, and it was then happy to create the directory for me. Kaolin 01:02, 17 February 2008 (UTC)

My images folder contains both a /math folder and a /tmp folder. My /math folder was set to 777 but not /tmp. On changing the permissions of /tmp from 755 to 777, the error message cleared. Now I have a new error message to solve:
Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert)

It looks like some help can be found on the page "Troubleshooting math display errors" --93.97.21.214 18:11, 2 March 2009 (UTC)
I think that the solution to this issue is addressed in Manual:Troubleshooting math display errors. Jdpipe 07:37, 13 May 2009 (UTC)

I got it to run on a host. First
1. #apt-get install mediawiki-math
1. then set the globals:
1. on LocalSettings.php
• $IP = "/home/user/htdocs/wiki"; •$wgScriptPath = "/wiki";
• $wgEnableUploads = true; •$wgUseTex = true;
• $wgUploadPath = "$wgScriptPath/images";
• $wgUploadDirectory = "$IP/images";
• $wgMathPath = "$wgUploadPath/math";
• $wgMathDirectory = "$wgUploadDirectory/math";
• $wgTmpDirectory = "$wgUploadDirectory/tmp";
• $wgUploadBaseUrl = false; #not sure about why this one too... •$wgTexvc = "/usr/bin/texvc"; #install through apt-get instead of make on ./math
1. and also global rights for images/ , images/math/ and images/tmp/
1. user@host:~/htdocs/wiki#chmod 777 images/ images/math/ images/tmp

Abacatabacaxi 02:53, 26 May 2011 (UTC)

## Wiki at host

Is there any way to get this up and running if your wiki is located at a host? Thanks, Guido den Broeder 20:56, 9 March 2009 (UTC)

## This manual page could be more helpful

I came here directly from the FAQ page, because I wanted my wiki to show mathematical formulae.

Here it says that "To use TeX formulas in MediaWiki, you have to build and configure the texvc program". This is actually not true. Texvc is one way of having LaTeX formulae in MediaWiki, and arguably not the easiest, especially if your wiki is on a host and/or you have limited experience with or access to the shell.

Sure, it is what Wikipedia is using, but many private wikis do not have the same requirements.

The other problem I have with this manual page is that it (correctly) links to MetaWiki:Help:Formula for help on math syntax, and then spends 90% of the page showing a few syntax examples.

The real instructions are supposed to be found in the linked Manual:Enable TeX. Alas, even that page fails to deliver—see my other comment here.

I propose we merge/replace this page with the much more useful Mediawiki and LaTeX on a host with shell access plus this other fine but slightly disorganized page.

I shall wait for a couple of weeks and will do that if there are no objections. Thanks. Hopefully acceptable username 01:20, 8 November 2009 (UTC)

## Indent Math formula?

I cannot use : as an indentation with $For example, if I do like this. the latter sections are all messed up: :[itex] \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}}$

<br /><br />
To display above formula, put the corresponding latex form inside the tags $and$ like that:<br />

:<syntaxhighlight lang="latex">
$\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}}$
</syntaxhighlight>
<br />


## Failed to parse (Cannot store math image on filesystem.)

Hi guys (sorry, forgot my Wiki login, will do this anonymously). I am getting the following error: Failed to parse (Cannot store math image on filesystem.) I can't seem to find information on this specific error anywhere. Here's what I already tried:

• Set chmod 777 on /images/math (assuming this is the canonical math image file direcory)
• Set chmod 777 on /extensions/Math/math (for good measure)
• Explicitly set the full path to:

 $wgMathDirectory = "/var/lib/mediawiki/images/math";  $wgMathPath = "/var/lib/mediawiki/images/math"; 

(I am running on Turnkey Linux's system, which is Debian-based, and upgraded to MW 1.20).

Any clues? I'm all out of ideas.

--Luke Loughead 204.101.124.26 19:36, 13 September 2013 (UTC) (I'll check back here for updates)

UPDATE:

I have also added $wgTmpDirectory = "/var/lib/mediawiki/images/temp"; and set chmod 777 on that directory. Still nothing. Even restarted apache. It would be nice if the error gave a specific directory that it could not write to, eh? --Luke Loughead 204.101.124.26 19:52, 13 September 2013 (UTC) I encountered the same "Cannot store math image on filesystem" error. It appears that either; a)$wgUploadPath/$wgUploadDirectory are not being set (they are not in LocalSettings.php - perhaps they should have been generated by wikifolder/mw_config/index.php?) or; b) their default values are not being set as defined in the mediawiki documentation (http://www.mediawiki.org/wiki/Manual:$wgUploadPath/http://www.mediawiki.org/wiki/Manual:$wgScriptPath; "{$wgScriptPath}/images"/"{$IP}/images"). I managed to get the Mediawiki Math extension working on Ubuntu by performing the following; 1. copy Math extension to wikifolder   sudo chown yourusername /var/www/html tar xvf Math-xxx.tar.gz cp -rf Math /var/www/html/wikifolder/extensions/ 2. create image folders   cd /var/www/html/wikifolder/images mkdir math mkdir tmp sudo chown -R www-data:www-data * 3. configure LocalSettings.php;   nedit /var/www/html/wikifolder/LocalSettings.php require_once "$IP/extensions/Math/Math.php"; $wgUploadPath = "{$wgScriptPath}/images"; $wgUploadDirectory = "{$IP}/images"; $wgMathPath = "{$wgUploadPath}/math"; $wgMathDirectory = "{$wgUploadDirectory}/math"; $wgTmpDirectory = "{$wgUploadDirectory}/tmp";

4. update mediawiki

 

cd /var/www/html/wikifolder/maintenance php update.php

5. compile texvc (texvc must be compiled for the Math extension to work);

 

sudo apt-get install build-essential dvipng ocaml texlive-fonts-recommended texlive-lang-greek texlive-latex-recommended (install Math extension dependencies) cd /var/www/html/wikifolder/extensions/Math/math make ./texvc /home/yourusername/temp /home/yourusername/temp "y=x+2" iso-8859-1 "rgb 1.0 1.0 1.0" (to test texvc is working)`

Richardbrucebaxter (talk) 04:53, 11 August 2014 (UTC)
To prevent having to configure LocalSettings.php with $wgUploadPath/$wgUploadDirectory/$wgMathPath/$wgMathDirectory/\$wgTmpDirectory (step 3.), enable image uploads during the mediawiki installation Richardbrucebaxter (talk) 03:09, 12 August 2014 (UTC)

## Zh translate

Can admin give the permission to translate this page of chinese?PikAsriel (talk) 05:19, 3 June 2020 (UTC)