LaTeXMathML in JavaScript

LaTeXMathML was originally developed as a javascript utility by Dr. Douglas Woodall (and was based on ASCIIMathML by Dr. Peter Jipsen). Dr. Woodall's original web page for this script (no longer actively maintained) is located here.

The javascript functionality was then greatly extended by Dr. Jeff Knisley, whose page about this is located here.

More details on the development and use of LaTeXMathML in javascript can be found on the two websites just linked.

The Odyssey/Pillars system uses Dr. Woodall's original javascript version of LaTeXMathML. You are welcome to download a copy of the LaTeXMathML.js file that we use (slightly modified from the original), and to view a LaTeXMathML Guide Page which copies many of Dr. Woodall's notes on the use of the script.

The LaTeXMathML Perl Port

In the process of developing the Odyssey/Pillars system, I (Peter Williams) have created a Perl port of LaTeXMathML - specifically of Dr. Woodall's version. This port attempts to function in exactly the same way as the original javascript.

The primary benefit of creating this port is that, rather than streaming the output to a browser, the function can run entirely on the server side and save its MathML output to a file. This output can then be passed to other scripts as part of an automated process, to perform further tasks using the math content (such as generating a PDF file).

Some examples (view the page sources to see the LaTeXMathML and MathML code):

The LaTeXMathML Guide - converted into MathML with the Perl port

MathML Torture Tests - converted into MathML with the Perl port

You are welcome to download a copy of the LaTeXMathML Perl port for your own use. This Perl port is released under the GNU General Public License (version 2 or later). Unfortunately, due to constraints in the Odyssey/Pillars project, we are unable to provide ongoing maintenance for this script at this time. It is provided on an as-is basis only.

Using the LaTeXMathML Perl Port:

The LaTeXMathML Perl port requires a working copy of the XML::LibXML module and, naturally, Perl. Don't forget to assign execute permissions to your copy. It can then be used either from the command line, with a command such as:

# perl ./ inputfile ./latexmathmlguide.xhtml outputfile ./latexmathmlguide2.xhtml

Or it can be called from another script, with a syntax such as:

require "./";
&LaTeXMathML("inputfile", "./latexmathmlguide.xhtml", "outputfile", "./latexmathmlguide2.xhtml");

See the script itself for a few more configuration options.


This Perl port was developed by Peter Williams for the University of Pittsburgh's Department of Chemical Engineering, as part of the Odyssey/Pillars project (supported by the National Science Foundation under grant number EEC-0342713).

This page is available online at

Copyright © 2008 University of Pittsburgh