Extension talk:Math/Archive 1

Difficulty Installing in Mediawiki 1.19.2, head version of Math extension incompatible, must use version from 2012-08-20
I have a freshly installed mediawiki with the following settings, as reported by the special version page.

with only the math, and vector extensions enabled, and showing up on the special version page

I have successfully compiled texvc.

The problem comes about when I try to use the math extension. As soon as I try adding the following

$$\theta$$

to a page and try to save it I immediately get the error



I have checked /var/log/apache2/error.log and found

[Thu Oct 11 15:53:25 2012] [error] [client 192.168.56.1] PHP Fatal error: Call to undefined method TempFSFile::autocollect in /home/cgeroux/public_html/notes/extensions/Math/Math.body.php on line 129, referer: http://192.168.56.101/notes/index.php?title=Main_Page&action=edit

It seems that some function definition is missing, but I have no idea why, I followed the installation instructions as closely as possibly but there are some gabs that I had to fill in with, which I think, were fairly reasonable assumptions.

The version of the math extension I downloaded is

author	Translation updater bot  Sat, 6 Oct 2012 21:29:28 +0000 (21:29 +0000) committer	Translation updater bot  Sat, 6 Oct 2012 21:29:28 +0000 (21:29 +0000) commit	5bbee223c4e3e2de7cb5a9b20298bb7ff0bb498b tree	7453c887642980b34ca900523365f9d9423d70f8	tree | snapshot parent	22a09c87d3895c6e23dab09539ff5887c24eb81f	commit | diff

I have read that this extension is incompatible with mediawiki 1.19.1, but what about 1.19.2? If not compatible with these version of media wiki, which version is it compatible with? I also found a link that said there was a version that was compatible with media wiki version 1.19, but the link didn't produce any downloadable version, or useful information. Is there a working version of the math extension for 1.19.2? This is a huge feature for me, without it, it almost makes mediawiki, for my purposes, useless (I working in a field that uses math formulas heavily). Any help with getting this extension working with mediawiki would be greatly appreciated.

I have also tried version 1.18.5 with similar errors. If this is a result of picking an unstable version of the extension from the head, perhaps a clear link to a stable version should be added to the download section of the extension page.

Cgeroux (talk) 21:27, 12 October 2012 (UTC)

After doing some hunting around I found that there was a fairly recent change on the git repository that had to do with added file backend support which seems to have added code which uses function calls to undefined methods, at least in mediawiki 1.19.2. After some googling, I found a Doxygen page for some version of mediawiki, which clearly showed function definitions for these missing functions. I am not sure which version of mediawiki it was as it didn't clearly indicate, perhaps it is an up and coming release.

author	Aaron  Mon, 20 Aug 2012 22:11:16 +0000 (15:11 -0700) committer	Aaron  Thu, 23 Aug 2012 00:16:49 +0000 (17:16 -0700) commit	ae9e0d989b744996ac2229b0dfeb740921f642f4 tree	ffe09c16ae00daa6dcb7bcf60b801bf876896e8b 	tree | snapshot parent	29a0a80e8fbb2d33507760075e4da9103439cbd9	commit | diff Added file backend support via $wgMathFileBackend. * Also removed old legacy migration code. Change-Id: I43cfd7f0da49690a2d0b4eb2daab9b8a110137b7

after I went to a snapshot just before this commit it worked :). At least my simple $$\theta$$ test worked. If it is simply a case of not picking the right version of this extension which is compatible with my mediawiki 1.19.2 install, it should really be much more clearly indicated which git snapshots are compatible with which mediawiki versions.

Cgeroux (talk) 21:45, 14 October 2012 (UTC)

How to retrieve a compatible version with 1.19.2
Thank you Cgeroux for your research. I was able to get Math running using your guidelines.

Here are the commands to get i work on 1.19.2.

cd extensions git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git cd Math git reset --hard 29a0a80e8fbb2d33507760075e4da9103439cbd9

Jgrocha (talk) 12:30, 15 October 2012 (WEST)


 * Thanks guys, this really helped me. Was also getting an error about "TempFSFile::autocollect". --Romanski (talk) 13:12, 18 October 2012 (UTC)


 * This solved the problem for me too (mediawiki 1.18) 83.46.86.109 19:27, 27 January 2013 (UTC)

About the old texvc
hi, I have compiled a texvc.exe when I used the version 15.1 of Mediawiki. it works very well. May I upload the former texvc.exe to my website of version 18.1? --Simonlsw (talk) 14:08, 15 March 2012 (UTC)

Would be great to have a place where you can define the absolute path for the various TeX functions
Math is calling among other the following TeX functions: dvips, latex, dvipng. It assumes that those functions are located in a directory on a web server which is loaded in the PATH of the web user (usr/bin). If this is not the case, the extension will give the following error message:

"Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert)"

I don't want to clutter up usr/bin by adding a symbolic links to each of the funcions so it would be nice to have a file where you can define a variable for the installation path of TeX (so before you actually do the 'make' command. A work around (what I did) would be to edit the render.ml file and add the absolute path to the various dvips, latex and diving functions. But remember that you have to set this every time you update the math extension.

--Albert Ke (talk) 22:36, 27 February 2012 (UTC)

MathAfterTexvc Hook
I was wondering about the MathAfterTexvc hook. I downloaded MediaWiki 1.18, installed everything I needed and built everything. MediaWiki creates the .tex files using texvc and puts them in the directory I specified, but nothing else happens from there. I was looking in the PHP files and it calls MathAfterTexvc hook, but it seems there is no definition anywhere for that hook. Blahtex has that function, but I was under the impression that this extension would take the .tex file and call latex and dvipng somewhere to generate the PNG file. I can call latex and dvipng from the command line and generate the PNG, so I'm pretty sure I've got everything installed right. Is that hook the problem, or is it something else I've overlooked?

Mac OS X 10.6.8 (Snow Leopard), MAMP 2.0.5

--Capoeirista.muralha 14:24, 17 January 2012 (MST)

MathAfterTexvc was removed completely in version 1.18.0
this issue is an general issue, it has nothing to do with OS.

This feature was removed completely in version 1.18.0. pls refer to http://www.mediawiki.org/wiki/Manual:Hooks/MathAfterTexvc

--MarkYin

Note about location of texvc during upgrade from Mediawiki 1.18 before extension
If you had customized the location of TeX parser in $wgTexvc in LocalSettings.php for previous version of this service, that global is not read in from the extension in Math.php so it complains about not finding texvc. The extension should check to see if the variable is already set in LocalSettings.php and use that value is present. Instead, that value is now hard coded in the extension. Ubuntu installed with Mediawiki math, for example, has the texvc file located at '/usr/bin/texvc'. One can manually set it, as a workaround, in Math.php in the extension.

Gary Anderson 01:20, 30 April 2011 (UTC)
 * It is sufficient to define $wgTexvc in LocalSettings.php after calling require_once("$IP/extensions/Math/Math.php"); --Moejoe000 07:41, 18 May 2011 (UTC)

Localization malfunction
Hello,

I'm having some trouble when non-Englhish characters are place in formulas, like ç, á, ó, é and others. Is that a bug or is it possible for a simple user to fix that?

Thanks in advance.

Paulo.s.lima 13:11, 28 September 2011 (UTC)
 * Take a look on meta:Help:Displaying_a_formula and 798. Helder 12:03, 29 September 2011 (UTC)


 * I am interested in fixing this but being a native English speaker with little experience in latex'ing non-english formulas. I could use examples of things that should work.  The current examples in the bug reports only international characters in \mbox{}'s.  When I personally try to switch to a utf-8 input encoding and latex something like $$á$$ I get errors. Any thoughts welcome. Thenub314 16:58, 13 October 2011 (UTC)

Feature Requests
3840 Looks for high math images printing. The only thoughts I have here are to switch form dvipng to dvisvg and use svg images which would look better at all scales and hopefully would print better. Related 15777

4915 This bug looks to tweak the size of the images produced by texvc. I think this should simply be a WONTFIX. While it may look nice on his browser, at some scale. The real issue is to get the fonts of the math and the surrounding text to match. That would be a lot f work to make texvc do something like that. Mathml/Mathjax are better suited to these tasks.

5856, 10186 and 6722 are related to mhchem package. Users seem to be very interested in this. Perhaps this should looked into.

12223 Desperately needed and long overdue inline math tags. Probably would only make sense if base line issue is sorted out. Should we use a slightly smaller font for inline math? Not done in latex but may look nice on the web.

28258 It would be nice to have some commutative diagram packages. xy-pic may be a good option.

HTML Rendering
1594 Change the way - is rendered in HTML. Complication unary vs. binary minus are spaced differently, and not currently distinguished by texvc because automatically handled by LaTeX.

25645 Suggests we need a better algorithm for deciding about which mathematics is not render-able as HTML. Makes a good point, but rather nebulous and requires some thought.

10434 Don't italicize variables, but mark them as variables in HTML. Low priority, as it has no visible impact in most setups but is mostly a matter of "doing it right".

11663 Problems with &rho; on safari browser, upstream seems to be a wontfix, actually it seems more of a "we do it right". Low priority.

Backwards compatibility issues
31442 Should be fixed now. Some non-standard LaTeX and AMS-LaTeX work under texvc. Must be careful not to break texvc features.

Security and Misc
6248 Permissions issues on some machines. Very old bug, not sure if it still an issue. Not clear which configurations should be tested to confirm/reproduce.

Visual Appearance Issues
15777 I have to agree this looks fairly bad. Curious if switching to dvisvg would straighten this out.

Script to generate test corpus
The following flex grammar run on a dump generates an XML document of use cases. It probably doesn't cover some corner cases and doesn't eliminate duplicates, but it should be useful to some developers interested in having a larger test corpus.

--Tim&#160;Landscheidt 18:02, 10 January 2012 (UTC)

I get an error after installing the extension
My Wiki is in german and I got the error "Fehler beim Parsen (Das texvc-Programm wurde nicht gefunden. Bitte zur Konfiguration die Hinweise in der Datei math/README beachten.)" after installing the extension. Can someone help me. In english, french or german? --Carl Soehne 16:56, 25 January 2012 (UTC)
 * I get the same error too here.
 * MediaWiki: 1.19.1
 * PHP: 5.2.17 (apache2handler)
 * MySQL: 5.1.57
 * --Luca Ghio (talk) 20:24, 5 July 2012 (UTC)
 * Generally means that texvc is not compiled, texvc is not located in the right place, or you have some permission error. Did you read the README? Bawolff (talk) 13:17, 6 July 2012 (UTC)
 * As the README says, I installed ocaml-native-compilers and I compiled texvc, then I put it into /extensions/Math/math/. How can I check for permission errors?--Luca Ghio (talk) 13:29, 6 July 2012 (UTC)
 * In LocalSettings.php I added only the line: require_once("$IP/extensions/Math/Math.php");. Is something missing?--Luca Ghio (talk) 13:34, 6 July 2012 (UTC)
 * First step to check is can you from the command line run the texvc executable. Can you succesfully run the executable if you su to whatever user apache is running under. Bawolff (talk) 14:43, 6 July 2012 (UTC)
 * Please explain yourself better: should I open the Ubuntu terminal and enter my FTP folder?--Luca Ghio (talk) 14:56, 6 July 2012 (UTC)
 * Basically you can only do that test if you have shell access (So when you say unbuntu terminal, if unbuntu is where your website is hosted, that works, but you cannot do this test over ftp). If you enable MW's logging facilities (see How_to_debug), and render a page with a math tag on it, the debug log will say exactly what commands are executed. (you'll probably want to disable the debug log directly after that. the log file grows very fast). Once you have the individual commands, try them out from the command line to see if they work. p.s. For the permission issue, make sure the apache user has permission to read/execute the texvc command (See docs for chmod command if you don't know how to do that). Bawolff (talk) 16:26, 8 July 2012 (UTC)
 * I changed the permissions of the texvc file from 644 to 744 (see https://goput.it/bby.png). But... now there is another error!--Luca Ghio (talk) 19:43, 8 July 2012 (UTC)
 * Unfortunately I think I have to change my web host.--Luca Ghio (talk) 21:56, 8 July 2012 (UTC)

Supporting Arabic Digit
Hello. Anyone have an idea about supporting Arabic digits in this extension? a package (Arabi) has been released in 2005 in most of LaTeX distributions such as MiKTeX.(See User Guide here). For viewing it's output go to this link and insert these codes in blank area:

\documentclass{article} \usepackage[T1,LFE,LAE]{fontenc} \usepackage[utf8]{inputenc} \usepackage[farsi,arabic,english]{babel} \TOCLanguage{farsi}

\makeatletter %due to a bug in ARABI in which the command \textRL is not %changed to write Farsi though the main TOC language is Farsi. \def\textRL#1

%due to a bug in ARABI in which the quotaion marks are not %assigned to their counterpart font-glyphs in lfeenc.def \DeclareTextSymbol{\guillemotright}{LFE}{62} \DeclareTextSymbol{\guillemotleft}{LFE}{60} \makeatother

\begin{document} \selectlanguage{farsi} %a paragraph in Farsi %to write a number use \I{NUMBER} %to write some phrases in English use \textLR{English phrase} سلام. بالاخره یک سرور \textLR{On Line} پیدا شد که از فارسی نویسی در \textLR{ \LaTeX\ } حمایت کند!

$$\sum^{+ \infty}_{i=1} \frac{1}{i^2} = \frac{\pi^2}{6}$$

\end{document}

Any help is appreciated.--وحید قاسمیان 18:39, 13 February 2012 (UTC)

get independent of texvc
Hi,

I extended the math extension in the way that one can choose which tool to use to convert tex to image, html and mathml. In the code there are just a few lines which work as a driver for the texvc program. The other things can be used for any other converter like LaTeXML for example. Therefore I restructured the code of the math plugin and added two new classes.

Now I'd like to share that code and discuss what can be improved. I'm not sure if that's the right place for the discussion, but I didn't found a better place...

--Schubi87 (talk) 13:47, 7 April 2012 (UTC)

MathJax doesn’t work on IE9
MathJax doesn’t work on IE9 on wikipedia. It works on Firefox. A:-)Brunuś (talk) 15:03, 2 June 2012 (UTC)


 * I did not test on Wikipeda, but tested on my wiki with IE8 with Math (47e3cdb) of 2012-10-22 and everything seems to be fluffy. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 12:27, 3 February 2013 (UTC)

"LaTeX on a shared host" instructions outdated; possible feature request
The given instructions no longer seem to be applicable to the current versions of Math. I am on a shared host, and I installed mimetex.cgi and got it working (tested ok from the command line at least). I went to the next section of instructions where it tells me to modify the function in Math.php that returns the &lt;img> tag instead of doing the stuff the function normally does. I opened up Math.php, and I see that it has been completely rewritten and converted into OOP using classes and stuff. I followed the logic to Math.body.php where the actual rendering appears to happen, hoping that I could find a similar section of code to modify. Sadly, I could not. It seems that there are several places within the code that generate the URL to display the image. There also seems to be a detailed validation that Math is configured correctly. Even if I tweak the outputs to use my CGI path, I think the validations will fail prior to that point, and it will not work.

So, if it is easier to fix the docs to explain how to edit a MW 1.19+ installation with the current version of the Math extension, please do so. Otherwise, I'd like to request that the extension be updated to permit the site owner to simply add a configuration variable to LocalSettings.php with a full URL to the mimetex.cgi script, and then end-users will not have to edit anything else (once they get the CGI working or use a public server). Personally, I like this idea the best, because otherwise I will be very leery of updating my extension, because I had editing core files within extensions. Thanks! Will scrlt  ( Talk ) 00:15, 1 July 2012 (UTC)
 * You could try Extension:Mimetex alternative Bawolff (talk) 16:29, 8 July 2012 (UTC)

Fatal error on the latest git version
On the pages include formulas I get fatal error: Fatal error: Call to undefined method FSFileBackend::getRootStoragePath in /home/wiki/psylab.info/public_html/extensions/Math/Math.body.php on line 361 MW 1.19.1, PHP 5.3.10. Artem Klevtsov (talk) 10:06, 27 August 2012 (UTC)

commit ae9e0d989b744996ac2229b0dfeb740921f642f4 Author: Aaron <aschulz@wikimedia.org> Date:  Mon Aug 20 15:11:16 2012 -0700 Added file backend support via $wgMathFileBackend. * Also removed old legacy migration code. Change-Id: I43cfd7f0da49690a2d0b4eb2daab9b8a110137b7
 * I confirm that the following commit is not compatible with MW 1.19.1. --Rineau (talk) 10:57, 14 September 2012 (UTC)
 * Can anyone check whether the version of the Math extension that was available on, say, August 19th works with MediaWiki core 1.19? 2012-06-13: 1.19.1 released. The offending commit: August 20th. 2012-08-31: 1.19.2 released  I believe the extension should work on 1.19.1 sites but not 1.19.2 or 1.19.3 sites, or sites running off git master. Sharihareswara (WMF) (talk) 16:26, 21 November 2012 (UTC)


 * broken with 1.19.3 any ideas?
 * For me it's not broken with MW 1.19.2 on shared hosting. Here is how I got LaTex running. Maybe this problem is related only to not-shared hosting? Stefahn (talk) 23:31, 4 December 2012 (UTC)
 * No problems here (MW 1.19.3), too. However I am using the MathJax implementation. Perhaps you switch to this one, too for the time being. --&#91;&#91;kgh&#93;&#93; (talk) 12:29, 3 February 2013 (UTC)

Quick fix to a fatal error accessing Special:SpecialPages after switching Math from master to LaTeXML
Fatal error: Class 'SpecialMathDebug' not found in includes/SpecialPageFactory.php on line 345

Description:

Downloading the Math extension using git is not working properly for me. I get the following errors:

Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): x + y

Failed to parse (unknown function\large): \large a_2 + a^2

After a

git checkout LaTeXML

functions, sums, derivatives, integrals look ok.

LaTeXML is working very well using Firefox 19 on a KDE desktop and it doesn't require MathJax.

Then attempting to visit SpecialPages from the sidebar, I get the above fatal error.

Quick fix:

I added the missing Class in includes/SpecialPage.php as a quick fix:

I'm not sure if this is the right thing to do, at least it heals the error.