Publishing Methods for Mathematics on the Web

There are several ways to publish mathematical document on the web. From PDF, over HTML with MathML formulas up to fully formalized theories in a specialized format. We look at some of the possibilities and compare their advantages and the effort they impose on the author.

Mathematicians have developed a very efficient way to communicate mathematical knowledge. They use a kind of partially fomarlised natural language and, most importantly, a way to lay out formulea on a two-dimensional surface.

Evolving technology has made it easier to publish mathematical knowledge. The typesetting system TeX made it possible to write high quality typsetted mathematical texts on a computer. Together with LaTeX, a macropackage for TeX, it became efficient for the avarage mathematician to write such texts. While printing is still important, a new way of sharing them has become popular: sharing them in an electronic form on the world wide web. The question turns up, how to manage this knowledge and how mathematics can benefit from the capabilities of the web.

We have by far not exhausted the full potential of the web with respect to the management and communication of mathematical knowledge. In fact, we are just at the beginning.

Gain and Effort

Choosing the method of authoring and publishing mathematical documents is dirven by two factors: The amount of effort it creates and what one gains doing it that way.

Intersting possiblities can be gained by writin mathematics in a certain way. Which of them are essential and which are optional depends. Writing a paper does not require interactive formulas while writing educational material for elementary school nowadays does. Automatically verifying a proof even requiress complete formalization. The gain can be improved by better software, but it is limitted by the available information. For example, proof verification can only be done if the proof can be completely formalized. In this article we talk about the following possibilities one can gain:

visual presentation
It is known how the formula looks like on the screen or on paper.
structured presentation
Because the structure of the formula is known, it can be adapted to the display, a part of it can be selected and copied into other applications, it can be styled with stylesheets. Text to speech systems can make use of the structure to better read the formula and allow the user to navigate it.
interactivity
A part of the formula can act as a link or a link target. Based on events, the formula can be changed or styled differently.
semantics
The meaning of the formula is known. Importing in in computer algebra software, computing it, automatically verifying and discovering proofs becomes possible.
web integration
The symbols used in the formula link to their definition and more facts on the web. Theories, definitions, and theorems are all identified by an URI. This applications to discover more facts and authors to collaborate.

Effort constitutes itself as time spent by humans. Writing mathematical documents is very time consuming. Doubling the time it takes can therefore already be unacceptable. For text, using a keyboard and a simple text editor is superior to every other method. On the other hand, writing formulas is probably still done fastest using pencil and paper. Therefore, most mathematicians use a pencil for personal notes and only revert to computers when they want to share or publish their work. The main source of effort is the amount of information that has to be required. When publishing a paper, it is assumed that the audience has already a solid understanding of the topic and the employed conventions. Many details can be ommited in this situation. If the goal is to verify a proof by a computer, all these details and everything that a competent human can derive from the context has to be provided. There are various ways to reduce the effort. The most important one is to have a workflow: Being able to work quickly and seemlessly with the employed tools. This can be achieved by good software.

Why do people use LaTeX, why do people use HTML? In some way, the gain from using these pays out the effort they require. The diagram shows some strategies at their position in the effort/gain-space. The diagonal line is the line of acceptance. The strategies above are used, the ones below are not. (Note that this line is hypothetical and may have a different gradient depending on the situation.) The goal of the developers is of course to move OMDoc and sTeX in direction of less effort and more gain.

Considering effort and gain puts the publishing methods discussed below into perspective. The diagonal line symbolises the barrier a method has to cross such that people start to use it: The gain must be more than the effort. The arrows show what better software could change about the current situation. Dotted arrows are possible in theory, but have not yet been fully exploited.

Publishing Methods

There are several strategies to publish mathematical content on the web, some of them taking more advantage of the web than others. This list is, of course, not complete, but it covers the ones the author knows about.

LaTeX and PDF

LaTeX has become very popular because of its high quality visual output and because a mathematical text can be written rather quickly. However, LaTeX catches only the (visual) presentation. These days, mathematical papers are usually written in LaTeX and published as PDF.

PDF is mainly useful if you want to print the document and never want to change it. It integrates badly into the web. Linking, styling, and interactivity are not possible.

It is important to user PDF/A for archival purposes because it includes all fonts and therefore makes shure that the document stays readable in future.

LaTeX imposes very little effort on the author. While not very readable, the syntax for formulas is compact and quick to write. It is probably not possible to reduce the effort even more.

HTML plus raster graphics

This is probably the only method that has no gain at all. Images only provide visual presentation. They do even this in an insufficient way, because they can not be scaled. They don't provide the structure and the meaning of the furmula. Therefore cut and paste, styling using stylesheets, interactivity, and indexing are all out of the question. In addition loading takes a long time and images do not render at the right position, as the baseline is often shifted vertically.

The effort can be made very low by good software to the niveau of writing LaTeX. Indeed, there are converters which take a LaTeX document and convert it to HTML with pictures interspersed.

One can conlude that this method should not be used at all. Only the very desperate use it as a fallback.

HTML plus vector graphics

This is certainly an improvement over raster graphics, since it allows arbitrary scaling without quality loss. It only provides visual presentation but at least in a scalable manner.

HTML plus Presentation MathML

Presentation MathML encodes the structure of a formula as XML. Therefore browsers can use their existing infrastructure to parse and render MathML. Because it integrates well into the DOM, interactivity and styling through CSS are easily possible. Text to speech systems can make use of the formula's structure. However, Presentation MathML only gives enough information to present the formula to the user. The meaning of the formula is not encoded.

The effort to write MathML source code with a text editor is enormous. There are applications which are tailored to edit or export MathML. There are also converters from other encodings. For example, carefully written LaTeX can be converted to MathML. Care must be taken, because LaTeX does not require the author to specify the structure of a formula entirely. Often, one has to insert additional fences to help the converter. Consequently, choosing the right software and workflow is essential when working with MathML.

For the enduser this is the best way to go. Unfortunately, despite being part of HTML5, many browsers still lack good MathML rendering. There is server-side software which delivers MathML or falls back to images based on browser detection or user configuration. This can also patially be done on the client side using javascript.

HTML plus Content MathML

Content MathML encodes the meaning of a formula. Such formulas can be undestood by software. This allows one to copy and paste a formula for example into a computer algebra application. However, it is too difficult to consume for humans and has to be converted to Presentation MathML first. It is also possible to mix Presentation MathML and Content MathML such that a browser can show the formula but the meaning is encoded too.

The effort is even worse than for Presentation MathML. Firstly, Content MathML is written in prefix notation. Secondly, it is longer, since operators and functions have to be called by their full name, for example plus instead of +.

This method might be useful in some cases, but because of the formal nature of Content MathML and because HTML only encodes the presentation of documents, one is often better advised to use MathML together with a document format that is tailored to mathematical theories.

OMDoc

OMDoc is a markup language for mathematical documents. It represents theories, theorems, proofs, and examples and how they relate to each other. It is fully integrated in the web by identifying mathematical concepts with URIs. It allows but does not require to fully formalize the theories. Formulas are encoded with Presentation MathML, Content MathML or OpenMath.

Depending on how formal OMDoc one writes, the gain varies. The advantage is that one can start with a non-formal version written in a human language with fromulas in Presentation MathML and then make it step by step more formal.

Because it uses MathML and OpenMath, the effort is horrible. This can be improved by using good software. Unfortunately, not a lot of software is available at this point. However, there is sTeX discussed below, which can be converted to OMDoc.

In theory, it is possible to convert OMDoc to HTML plus MathML. Also, it provides a way to define notation rules which allow one to convert the Content MathML to Presentation MathML suitable for human consumption. In this way, formal documents can be presented in a nice way.

sTeX

People who are familiar with LaTeX and want to capture the meaning of their documents should consider this option. One can generate beautiful PDF documents from it, like it is known from LaTeX and one can generate OMDoc from it. (OMDoc in turn can then be converted to HTML plus MathML.) Unlike OMDoc, it is more human editable using a text editor, but still way more difficult than LaTeX.