Extension talk:Math/Archive 1

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)

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)

"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  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)