Navigation Links

Note on Functions of Latex and MathML

Andrew Stacey PhD

Norwegian University of Science and Technology

Updated April 3, 2011

Editor's note by John Gardner: This short note is a response to questions about the role of Latex vs. MathML on a list serving blind people. Reprinted with permission of the author, with some very minor editing. It provides useful insight by a sighted Latex-using scientist.

Introduction

There seems to be some confusion regarding LaTeX and MathML here. I'd like to help straighten that out, if I may. The confusion is with regarding their roles.

LaTeX is an input format. It is how we mathematicians write our articles, books, webpages, and anything else where mathematics is involved. (And often anything where mathematics isn't involved.) It is not designed to be read as-is. It is intended to be processed into a suitable output format and then read.

If anyone thinks that they can read LaTeX and understand what is going on, then I have a few documents I can post samples from which will soon disabuse you of that notion. Of course, very simple LaTeX can be read. Something like x^2 + y^2 = z^2 is fairly easy to understand, but try something more complicated like

\sum_{m = 2 \over m \text{prime}}^{\infty} \frac{1}{m^s}

and you'll see what I mean. And that's fairly simple compared to what can be written. When you realize that LaTeX (or rather, TeX) is completely programmable, then you'll see that you can find absolutely anything in a LaTeX document.

MathML is an output format. It is not designed to be written directly, but it is designed to be read. Of course, one needs a suitable renderer: a browser for the sighted and something like MathPlayer for those who want their mathematics read aloud, but then the same is true of any output format. As it is an open standard, it is a reasonable task to design a program to render MathML in to any desired medium.

It is possible, though not always straightforward, to convert LaTeX to MathML. One reason why it is not always straightforward is that TeX (the program underlying LaTeX) often needs to know things about its output. When run normally, TeX has complete control over the process and so can know exactly how the output will be seen. When producing MathML (or XHTML), it can't know exactly how the output will be seen. But those are technical difficulties that can usually be avoided.

The main difficulty is that most websites don't bother with this route. They convert the LaTeX mathematics to a graphic which is then displayed, with the original LaTeX as the alt text. Because of how it is produced, the LaTeX is usually very simple (no complicated macros), and so it may be possible to get by with reading the alt text.

So if you want to read mathematics, look for MathML. If you want to write mathematics, learn LaTeX (or another TeX variant).


Return to home page


Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License

Valid XHTML 1.0 Strict