Manual:Mathoid

Mathoid is an application which takes various forms of math input and converts it to MathML + SVG or PNG output.

Getting started
Mathoid is a web-service implemented using node.js, often referred to simply as node.

Mediawiki-vagrant
Install MediaWiki vagrant and run

NPM package (Debian Jessie)
Debian Jessie has been superseded by Debian Stretch. Jessie by default uses PHP 5.6 which is no longer supported as of MediaWiki 1.31+.

If you want to run  you'll need to install the   package.

NPM package (Debian Stretch)
(note : npm is not in the Debian Stretch repositories. These steps do not work with Debian 9)

If you want to run  you'll need to install the   package.

To setup mathoid to run as a standalone daemon and start automatically, move the folder to a system folder, and create a "mathoid" user to run the daemon as:

Create a  file with the following content:

And then enable and start the service with the following commands:

This does not work with Debian 9.

Trouble shooting with CentOS 6.

 * If you have  related error, install upgraded gcc.
 * use new gcc. (you can back to old gcc with .)
 * If you got error about, edit   in   like below.

Scientific Linux 7.2
Instructions based on SL 7.2 minimal install. Should be the same for Red Hat Enterprise Linux (RHEL), CentOS and clones. Important install latest Mathoid version, at time of writing 0.6.3 and corresponding node.js version, at time of writing 4.x LTS branch. Especially VM/Server needs direct internet connection during installation. Internet access via proxy did not work. Using node.js from repository did not work for Debian 8.5, Ubuntu 16.4, Ubuntu 14.4, Fedora 24 alpha and SL7 + EPEL.

First install prerequisites
Run the following as root. Disable SL7 fastbug repo (optional).

Install Node.js and Mathoid
Run the following as root. Get node.js repo from nodesource. Note one may want to first save and inspect the script before executing it as root.

Switch to user account

Test
To test run Mathoid as user with

Update firewall, setup security (e.g. SELINUX), setup to run as service, proxy server to access internet, etc... One should be able to install mocha through npm, if one wants.

LocalSettings.php
Config of LocalSettings.php in Mediawiki root directory.

Configuring
Check if the symlink config.yaml points either to config.prod.yaml or config.dev.yaml The settings should be self-explaining. Important is the port. Note that the port is different depending if you use config.prod.yaml (10042) or config.dev.yaml (10044).

Check the  section and change the   parameter to point to your api endpoint.

Check the  section and change the   parameter to point to your RESTBase endpoint.

Performance
With speech support, performance may be terrible, if there are many complex equations. you can turn off speech support.

Testing
After installation you can test your installation via

the expected output is:

you can use the option type=mml for mathml input.

Credits for


 * Gabriel Wicke
 * Frédéric Wang
 * Anton Grbin
 * Davide P. Cervone
 * Marko Obrovac

Troubleshooting

 * app.js is not found

in the config file change services->mathoid->module from app.js to mathoid/app.js

Development
Code review happens in Gerrit. See Gerrit/Getting started and ping the parsoid team in #mediawiki-parsoid.

The most recent development version is available from https://github.com/wikimedia/mathoid