[Mediawiki-l] Math support; tex not working.

Bri bnospam at rogers.com
Tue Oct 3 23:19:27 UTC 2006

I am getting an error in my installation of mediawiki, on a Linux box:

"Failed to parse (PNG conversion failed; check for correct  
installation of latex, dvips, gs, and convert): \sqrt{1-e^2}"

However, I logged the command, and run it from the command-line:

./math/texvc '/home/wiki/public_html/MediaWiki/images/tmp' '/home/ 
wiki/public_html/MediaWiki/images/tmp' '\sqrt{1-e^2}' 'utf-8'

And it works fine, creating the temporary file, fine. There are tons  
of temporary files in the images/tmp directory, so it's not a(n)  
(obvious) permissions problem.

When I create a php script:

--- begin script ---
$cmd = "./math/texvc '/home/sovereig/public_html/MediaWiki/images/ 
tmp' '/home/sovereig/public_html/MediaWiki/images/tmp' '\sqrt{1-e^2}'  
   $ret = system($cmd .  " 2>&1");
   $ret = substr($ret, 1, strlen($ret)-2);
   print "<img src='images/tmp/$ret.png'>";
--- end script ---

I capture the following output from the command:

-- begin output --
kpathsea: Running mktexfmt latex.fmt fmtutil: format directory  
`/.texmf-var/web2c' does not exist.
-- end output --
(Note: /.texmf-var/web2c does not exist; ~/.texmf-var/web2c  
*does* ... how do I change that?)

It will come up with the same .png file-name that the command line  
created, but it won't create it.

Does anyone have any suggestions as to why this might be happening  
and how to fix it?

Incidentally, I installed tetex with ./configure --prefix=/home/wiki/ 
local --datadir=/home/wiki/local .

As well, as a result of using this non-standard path, I added the  
following into my LocalSettings.php:
    putenv('PATH=/home/wiki/local/bin'. PATH_SEPARATOR . getenv 

I'd appreciate any help anyone can provide.

Thank you,

More information about the MediaWiki-l mailing list