A Greasemonkey user script to display LaTeX on Web pages

[This article has been translated to Slovak by Margareta Sliwka.] — updated 12 July 2018.

[This article has been translated to Serbo-Croatian by Jovana Milutinovich from Webhostinggeeks.com.]

This is a computer program, suitable for use with Mozilla Firefox 1.5 equipped with the Greasemonkey extension, that displays mathematical formulae written in the LaTeX language.

It works by translating the LaTeX into MathML, which Firefox 1.5 can render.

When this program — the “Display LaTeX user script” — is activated, any text appearing inside dollar signs $...$ is assumed to be LaTeX markup and is parsed.

The user script is free software available under a MIT-style license.

Usage instructions

1. First, you may need to install some TrueType fonts for mathematical symbols.

If you are using the Debian or Ubuntu Linux distribution, an alternative is to just install the latex-xft-fonts package; this package has an advantage that it is free software, and the fonts in this package have fewer bugs. The type faces are also in the traditional TeX style rather than in Mathematica’s strange style.

2. Load up the Mozilla Firefox browser (At least version 1.5). (Display LaTeX does not work with other Web browsers.)
4. View this Display LaTeX script. Click on the “Install” button that will appear to install it.

Screenshots

The following snapshot was taken on April 5, 2006, on the PlanetMath encyclopedia entry on Orthogonal groups, on Mozilla Firefox 1.5 on Windows XP. The PlanetMath web site displays LaTeX equations by converting them to images with LaTeX2HTML. The Display LaTeX user script is able to convert such images back to MathML. Although the LaTeX conversion still requires some development, it already shows some promising results: compared to HTML images, the text appears a lot less staggered.

Other questions

Any chance of this working in Internet Explorer?

Possibly. There’s a Greasemonkey work-alike for Internet Explorer, called Turnabout, and the MathPlayer plug-in will display MathML. However, when adapting the user script I encountered a showstopper bug with MathPlayer — it crashes with dynamically generated MathML. So no go for now, until the MathPlayer developers fix this bug.

Steve Cheng <stevecheng@users.sourceforge.net>