Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Mathoid is a service that renders mathematical formuale on the server side. It accepts Wikimedias LaTeX dialect texvc, MathML or AsciiMath as input and outputs MathML, fallback images with dimension meta-information and a textual representation of the input.
Under the hood Mathoid uses texvcjs, MathJax node, librsvg, and the [speech-rule-engine] for the verification, rendering, conversion and the generation of the textual description. Mathoid was forked from svgtex.
An in-depth discussion of Mathoid can be in the following publications:
Mathoid: Robust, Scalable, Fast and Accessible Math Rendering for Wikipedia
M Schubotz, G Wicke
Intelligent Computer Mathematics - International Conference, CICM 2014, Coimbra, Portugal, July 7-11, 2014. Proceedings
Preprint | Bibtex | DOI: 10.1007/978-3-319-08434-3_17
A Smooth Transition to Modern mathoid-based Math Rendering in Wikipedia with Automatic Visual Regression Testing
M Schubotz, AP Sexton
Joint Proceedings of the FM4M, MathUI, and ThEdu Workshops, Doctoral Program, and Work in Progress at the Conference on Intelligent Computer Mathematics 2016 co-located with the 9th Conference on Intelligent Computer Mathematics (CICM 2016), Bialystok, Poland, July 25-29, 2016.
Preprint | Bibtex | PDF
Mathoid currently supports node version 6,8 or 10. To check your node version run
node --version
from the commandline.
In addition the prerequisites from librsvg are needed.
For Debian based systems installing the librsvg2-dev
should be sufficient.
sudo apt-get install librsvg2-dev
Thereafter, clone and install Mathoid by running
git clone https://github.com/wikimedia/mathoid/
cd mathoid
npm install
Before proceeding, we recommend running to run the tests via
npm test
The tests should pass in less than one minute. If you plan to use Mathoid to render formulae for your small to medium scale wiki you are done.
For larger wikis using RESTbase, running mathoid as a service is desired. To install Mathoid as a unix service, you can use our startup script.
A community maintained page with OS specific installation instructions is available from MediaWiki.
The main entry point is '/' with one required POST parameter 'q'.
Additional entry points for individual formats are
The 'complete' output format is equal to the 'json' one except that it also includes the headers for individual types in the response body as well. The output specification is identical, except that the 'mml', 'svg' and 'png' fields are now (JSON) objects containing the 'body' and 'headers' fields.
The performance tests can be run by executing the performance.sh script.
On our labs-vagrant test instance with 8 workers and 100 request the following results were obtained for the input $E = m c^2$:
format | time | sd |
---|---|---|
texvcinfo | 0005 | 003.2 |
mml | 0334 | 061.2 |
svg | 0343 | 058.6 |
png | 0027 | 007.2 |
format (without speech support) | time | sd |
---|---|---|
texvcinfo | 0005 | 003.0 |
mml | 0030 | 004.5 |
svg | 0030 | 004.2 |
png | 0030 | 005.7 |
The time, i.e. "Total Connection Times" were measured in unit ms. |
PM2 is a process manager for Node.js. It supports starting applications on system startup. You can set up mathoid to run automatically using this process manager.
For example, run
npm install pm2 -g
pm2 start pm2.config.js
pm2 save
pm2 startup
Thereafter check the generated output and run it as with root permissions.
Checkout the latest version and switch to the master branch:
see also https://wikitech.wikimedia.org/wiki/Git-buildpackage
publish as ppa
Based on the Template for creating MediaWiki Services in Node.js The template also includes a test suite a small set of executable tests. To fire them up, simply run:
npm test
If you haven't changed anything in the code (and you have a working Internet connection), you should see all the tests passing. As testing most of the code is an important aspect of service development, there is also a bundled tool reporting the percentage of code covered. Start it with:
npm run-script coverage
In a lot of cases when there is an issue with node it helps to recreate the
node_modules
directory:
rm -r node_modules
npm install
FAQs
Render TeX to SVG and MathML using MathJax. Based on svgtex.
The npm package mathoid receives a total of 23 weekly downloads. As such, mathoid popularity was classified as not popular.
We found that mathoid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.