Manual talk:Math

Where can I download the extension?
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? --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/

Abacatabacaxi 02:53, 26 May 2011 (UTC)
 * 1) user@host:~/htdocs/wiki#chmod 777 images/ images/math/ images/tmp

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 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&mdash;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)


 * I object. This page is referenced from the FAQ as the place to read about the extension. The FAQ states: MediaWiki allows embedded math formulas via [...] texvc [...]. See Manual:Math for setup instructions. In my view, this page is supposed to explain the usage of the  tag; it's not full detail on the installation of texvc, nor is it a complete reference for the math syntax. But I think it probably still has a place. I note also that this page is the top ranking for a google search for "mediawiki math syntax". Jdpipe 23:48, 8 November 2009 (UTC)

Thank you.

You say, "This page is referenced from the FAQ as the place to read about the extension". I must disagree with your interpretation. The FAQ is aimed at MediaWiki installers/administrators, not end-users. The question reads, "How do I enable embedded math formulas?", as opposed to "How do I embed mathematical formulae in wikitext once they have been enabled?", and it definitely does not read, "What's the syntax for LaTeX formulae?". The answer in the FAQ, as you quoted, reads (bold mine) "See Manual:Math for setup instructions", and not "end-user instructions".

The official page for "meadiawiki math syntax" is here:. I don't propose we remove the link to that page from this page, but this should not become a poor-man's duplicate of that page. (And indeed the examples in this page are pretty bad already.)

What I propose is to either point the FAQ to another page, or to change the contents of this page to actually answer the question. Thanks. Hopefully acceptable username 11:34, 14 November 2009 (UTC)

Almost entirely unrelated: What font (typeface) is used?
User "nickel@[11317].com" at MyFonts.com would like to know what font (typeface) is used by the MediaWiki/TeX combination to display maths formulae. I also would like to know. See http://new.myfonts.com/WhatTheFont/forum/case/306689/ for more info. 207.65.109.10 03:43, 7 August 2010 (UTC)

Latex2HTML
I was wondering if we can replace the current math formula maker by an HTML using a script like javascript? As a start I tried making some simple expressions and found them working perfectly. For example, the following code: x^{(2sin^2\theta+cos^2\theta)}+ 2 = 0 can be regenerated by JavaScript to HTML equivalent code: Which in trun becomes: x (2sin 2 &#952;+cos 2 &#952;) + 2 = 0

--Email4mobile 09:56, 11 April 2011 (UTC)

Wikipedia ?
What is the way Wikipedias are using for math coding?

I am wondering, while I am reading here all the documentation around the TEX or math and the recommended extension. That is the Extension:Math.

It does not look like the Extension:Math could be used in current Wikipedias with the extension having Release status: experimental only (or do they?). I do not understand. Is it experimental? Or is there any other more stable version how to allow  to function? Do not tell me, that Wikipedias are running only the experimental version of some extension to allow such an frequently used function. (or does it?)

In the related pages here is written, that from MW version of 1.18, this function was separated from core, to the extension. However; I think the Wikipedias are running usually on relatively new versions of WM.. so that would indicate, that they use really the version, were the math is already not part of the core and so it had to be installed somehow. How?

I do not understand from the documentation, what is needed to allow just this (and no more, no less), what is normal in Wikipedia.

Is wikipedia using the TeX?

As in here?: Manual:Configuration_settings
 * it writes : To use inline TeX - and it means in order to use TeX in MediaWiki You need to do the indicated.. (no more no less). And it presumes in the first place, that I already want to use inline TeX. But is that inline TeX exactly what Wikipedia is using, to generate equations from its MediaWiki source code?

Sorry to everyone, for me Wikpedia represents somehow the norm. The easiest way to understand MediaWiki. I do not think I need anythink more special related mathematics or TeX. If this is what Wikipedia is using, I will gladly use it. But I would never guess a thing whether the    coding in Wikipedia MWs is TeX or whatever else --Reo On 15:16, 30 August 2011 (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:

\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}} $$

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