«

»

Jan 09 2005

MathML

I recently became interested, again, in how far along displaying math for the web has come. This was something I investigated awhile back, mainly in relation to how TeX could be converted to html. The answer, then, was that it could only be done very poorly.

The solutions for converting directly from TeX to html were basically limited to two applications, both of which display mathematical expressions by rendering in TeX to a dvi, and extracting the image as a bitmap, then entering it into html with an img tag. One, Tex4ht, did not function upon trying to set it up. I could generate basic stuff, but it always failed when moving onto something more complicated. The other is latex2html, which is slightly more viable.

Latex2html is a perl script that relies on netpbm and ghostscript. To set up the system one has to modify a config file to indicate the paths of the two dependencies, and the install was fairly painless (it became necessary to reinstall netpbm into a directory with no spaces in it, but after that it worked ok). I then played with the settings to try to make output that didn't look like shit, with only marginal success (link to results is below).

The question is, is MathML ready for prime time? Can it render something better or at least as good as latex2html, which is a very bad system indeed? After some investigating, I think it can.

Here are the links to some files for the reader to compare. The first is a pdf compiled by pdflatex of the original TeX file (a quantum mechanics homework assignment that I TeXed long ago). The second is a latex2html conversion of the same. The third is a hand-coded xhtml file of the first part of the file (I got lazy). See for yourself. Font smoothing technology is highly recommended.

PDF compilation.
latex2html conversion.
MathML code (requires Firefox and fonts for mathml).