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

Bri bnospam at rogers.com
Thu Oct 5 14:47:15 UTC 2006


Incidentally, for reference, I solved this problem.

I installed tetex into /home/wiki/local/teTex/, and leaving the  
binaries there, and hard-referencing the locations of 'dvips' and  
'latex' in the first two lines of mediawiki/math/render.ml, ala.

-- excerpt, math/render.ml{0,2} --
let cmd_dvips tmpprefix = "/home/wiki/local/teTeX/bin/dvips -R -E " ^  
tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
let cmd_latex tmpprefix = "/home/wiki/local/teTeX/bin/latex " ^  
tmpprefix ^ ".tex >/dev/null"
-- excerpt, math/render.ml{0,2} --

I imagine tetex must be able to find it's configuration files when  
called from its own directory, as opposed to a general /bin directory  
(i.e. /home/wiki/bin).

Cheers,
Brian

On 3-Oct-06, at 7:19 PM, Bri wrote:

> 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}'
> 'utf-8'";
>    $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
> ('PATH'));
>
>
> I'd appreciate any help anyone can provide.
>
> Thank you,
> Brian
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l







More information about the MediaWiki-l mailing list