1

Math extension 2.0.0
MediaWiki 1.24.1
Ubuntu 14.04.3

I've followed the steps in https://www.mediawiki.org/wiki/Extension:Math

At at the bottom of my LocalSettings.php I have:

require_once "$IP/extensions/Math/Math.php";
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';

This is thanks to Tgr's answer. So I am trying to make use of a remote Mathoid Service.

But if I try to create a wiki page with:

<math>x^2</math>

...it gets rendered as:

Failed to parse (Missing <code>texvc</code> executable. 
    Please see math/README to configure.): 

...and this README file just seems to contain instructions for building texvc. But in light of Tgr's answer, I don't want to be using texvc. I want to be using a remote Mathoid service.

Even though it is not suggested in the instructions, thanks to the guys on #mediawiki IRC, I do:

pi@PiDroplet:~$ cd web/wiki/extensions/Math/

pi@PiDroplet:~/web/wiki/extensions/Math$ make
cd math; make 
make[1]: Entering directory `/home/pi/web/wiki/extensions/Math/math'
ocamlopt -c util.ml
make[1]: ocamlopt: Command not found
make[1]: *** [util.cmx] Error 127
make[1]: Leaving directory `/home/pi/web/wiki/extensions/Math/math'
make: *** [texvc] Error 2

To install ocamlopt, I do apt-get install ocaml-nox -- now make completes, and I'm onto a different rendering error:

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

Following https://www.mediawiki.org/wiki/Manual:Troubleshooting_math_display_errors#.22Failed_to_parse_.28PNG_conversion_failed.3B_check_for_correct_installation_of_latex.2C_dvips.2C_gs.2C_and_convert.29.22 I do:

ls -lH `which gs` `which latex` `which dvips` `which convert`

... which tells me I don't have a 'convert' -- everything else is present.

sudo apt-get install imagemagick ... So now I have a /usr/bin/convert

Looks like I also need sudo apt-get install dvipng

Still working from the same link, I have to do sudo apt-get install texlive-latex-extra followed by rebooting the server, and it is rendering correctly!

However, if I turn my errors on:

# DEBUG
error_reporting( -1 );
ini_set( 'display_errors', 1 );

$wgShowSQLErrors = true;
$wgDebugDumpSql  = true;
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;

I get at the top of the page:

PHP Notice:  Missing <code>texvccheck</code> executable. 
Please see math/README to configure. 
in /var/www/wiki/extensions/Math/MathInputCheckTexvc.php on line 65

https://www.mediawiki.org/wiki/Extension_talk:Math#Please_see_math.2FREADME_to_configure.in.2Fvar.2Fwww.2Fwiki.2Fextensions.2FMath.2FMathInputCheckTexvc.php_on_line_65 has a solution:

sudo apt-get install ocaml
cd extensions/Math/texvccheck
make

I got that first command from further up the page.

$wgMathTexvcCheckExecutable = "$IP/extensions/Math/texvccheck/texvccheck";

HA! Finally, correct output and 0 errors!

P i
  • 29,020
  • 36
  • 159
  • 267

1 Answers1

1

Using Math used to involve compiling texvc; older versions of the extension page tell you how. The current version uses Mathoid (a service that runs on a different machine and the wiki engine can interact with it via HTTP); again, the extension page tells you how. You probably don't want to install Mathoid on your own server, it's a lot of extra effort.

Tgr
  • 27,442
  • 12
  • 81
  • 118
  • Thanks, I finally have it working. But it took a lot of work! Am I missing something? – P i Jan 14 '16 at 14:29