HTML Math Implementation Goals

Introduction

Rendering mathematical and other technical notation is a difficult task. Mathematical notation not only involves the use of a large extended symbol set, it relies on a rich collection of 2-dimensional layout schema, such as fractions, exponents, radicals and matrices. For these reasons, technology for scientific communication has traditionally lagged behind plain text processing tools, and in particular, the inadequacies of HTML for technical documents have limited the effectiveness of the Web for the transmission of scientific and technical material.

At the same time, the demand for effective means of electronic scientific communication is high. Increasingly researchers, scientists, engineers, educators, students and technicians find themselves working at a distance and relying on electronic communication. This extended scientific community represents a large commercial market that is not being well-served at present. Consider:

Taken together, these markets represent billions of dollars of business world wide for a robust HTML Math solution. Of course, such a solution necessarily has two parts -- a mark up standard, together with an implementation. The issue of a mark up language standard for HTML Math is addressed elsewhere. In this document, we focus on possible implementation strategies for HTML Math.

Motivating Examples

HTML 3.2 does not provide an adequate solution for scientific notation. To illustrate its main weaknesses, consider the following four examples.

Basic Examples

Intermediate Examples

Advanced Examples

The degree to which a HTML Math renderer can determine its context ultimately determines how seamlessly math can be embedded in text. Of course, a native browser implementation provides complete context information. Some of the more detailed context information required by a plug-in implementation arises in situations such as these:

Implementation Goals

By considering the examples assembled above, a short list of overarching implementation goals emerges:

Implementation Goal 1: HTML Math equations should render in accordance with user viewing preferences, and at the highest quality possible given the capabilities of the platform.

The two primary stumbling blocks to the widespread acceptance and use of the Web for technical documents are the unacceptably poor rendering quality of technical notation that current image based methods produce, and the difficulty of authoring technical Web documents. These make the cost/benefit ratio too low for widespread acceptance.

Implementation Goal 2: HTML Math equations should print properly and at high quality, printer resolutions.

In order to be widely useful, it must be possible to print technical Web documents. Image based methods provide unacceptable print quality, while other methods are either undependable, platform dependent, or simply non-existent. The overhead and inconvenience of maintaining a printable version and an electronic version of a document has proven itself too great for widespread acceptance.

Implementation Goal 3: HTML Math equations should be able to react to mouse gestures, and coordinate communication with other applications through the browser.

To be useful in a hypertext environment, at a minimum, HTML Math equations need the same linking support as surrounding HTML text. In particular, this includes the capability to link parts of equations. To be useful in a hypermedia environment, HTML Math equations need to be able to react to mouse gestures and coordinate communication with other applications in more sophisticated ways. A basic example is the ability to respond to a search engine with a linear as opposed to graphical form. A more advanced example might include interaction with a VRML viewer, or a Java applet.

Interface Requirements

A cursory examination of the implementation goals stated above show that current browser image handling and plug-in interfaces are not sufficient to achieve them. A more detailed analysis suggests a full implementation would require a number of browser enhancements:

Implementation Goal 1: HTML Math equations should render in accordance with user viewing preferences, and at the highest quality possible given platform capabilities.

Browser Interface Requirements:
  1. the ability to query the browser for context information, such as whether the equation is in-line or displayed, and the ambient font size and family.
  2. the ability to use the context information provided to specify equation size and alignment in terms of ascent and descent relative to the current baseline.
  3. the ability to be informed of context changes, and to update the display accordingly.

The litmus test here is whether a user can change font sizes, and have the equations scale to match the surrounding text, both in size, style and rendering quality.

Status: According to pre-release documentation, applets and plug-ins will have access to context information, and have the ability to use it for alignment in Netscape Communicator. The ability to react to context changes may or may not be possible.

Implementation Goal 2. HTML Math equations should print properly and at high quality, printer resolutions.

Browser Interface Requirements:
  1. the ability to access the same system printing information that is available to the browser.
  2. the ability to render equations for printing within the larger HTML page.
The litmus test in this case is simply whether one can click the print button on the browser and obtain a well typeset document of uniform quality, including mathematical notation. Status: Printing capabilities do not seem to be significantly improved for applets and plug-ins in Netscape Communicator. Some work around methods are available.

Implementation Goal 3. HTML Math equations should be able to react to mouse gestures, and coordinate communication with other applications through the browser.

Browser Interface Requirements:
  1. the ability to process mouse gestures over the equation
  2. the ability to make browser calls for fetching URLs
  3. the ability to make either browser or system calls to implement cut and paste functionality.
There is no single litmus test issue for interactivity; however, flexible linking and the ability to cut and paste equations into other applications such as computer algebra systems are probably the dominant examples to keep in mind. Status: These capabilities are largley available now to applets and plug-ins. Further enhancements have been announced for Netscape Communicator.

Implementation Strategies

In this section, we compare and contrast the strengths and weaknesses of two obvious implementation strategies: image based methods, and plug-in based methods. Needless to say, a native browser implementation is ideal, if not financially realistic.

Image Based Methods

The simplest implementation strategy for HTML math is to use an image and mark up pair in a standard HTML page. With current browser technology, this could be implemented as a standard image, together with source mark up in an ALT tag. A somewhat better solution would involve the introduction of a MATH tag which contained fields for an image or images, the equation mark up, and possibly some printable object.

Screen Rendering Quality With this method, screen rendering is unacceptably poor. As noted above:

Print Rendering Quality Although printing is possible with this method, print quality is again unacceptably poor, since the screen resolution is significantly lower than printer resolution.

Interactivity The only direct interactivity possible with this method is a link surrounding an entire equation, or the use of an image map, which is in general unreasonably complicated. By viewing the source text, it is possible to extract the original mark up. On the other hand, this is enough for external applications to properly process or convert HTML Math documents.

Other Considerations Large documents with many image files are bulky and slow to load. This is a very significant drawback for the majority of readers. Even a document of moderate length can take a long time.

A second factor is that hand editing is difficult, and typically involves a good deal of specialized software. The standard tool used in academia is latex2html which requires a user to install Perl, TeX, Ghostscript, and the PBM libraries. Moreover, converting from a source document to an HTML document is slow. Regardless of whether better conversion tools become available, it is inherently inconvenient and troublesome to have to maintain two versions of a single document.

Probable Improvements Two important devolpments are likely to make image based strategies more viable:

Possible Improvements Several simple browser interface improvements would increase the effectiveness of this method:

Plug-in Based Methods

A much more powerful and flexible strategy for implementing HTML Math involves using some sort of external processing program which interfaces with the browser. Options available using current technology include Java applets, Netscape plug-ins and ActiveX controls. We will generically refer to all these types of modules as plug-ins.

Although an HTML Math implementation is possible using current plug-in interfaces and HTML invocations, a better solution would involve introducing a new <MATH> tag, just as in the case of image based methods, along with a number of interface enhancements as suggested above.

Screen Rendering Quality With this method, screen rendering quality is in theory only limited by the platform. However, this is not the case with currently available browser interface APIs:

Print Rendering Quality Print quality varies with the kind of plug-in. It is not possible to print directly in context at all using only Java. It is possible to print in context with ActiveX controls and Netscape plug-ins.

Interactivity Fairly sophisticated interactivity is possible through the use of a plug-in. Complex linking, cutting and pasting, long expression folding, and even interprocess communication are all possible.

Other Considerations In theory, a plug-in solution solves the bandwidth problem that an image based solution presents, in that the HTML document need only contain the equation mark up. There is a one time cost for installing a plug-in or downloading a Java archive, but mechanisms for doing this efficiently or even automatically are already well developed. On the down side, plug-in solutions require current generation browsers on graphics capable platforms.

In practice, the Java implementations available in the current generation of browsers leave a good deal to be desired. Many of the weaknesses are quite technical in nature, and thus won't be detailed here. However, many important improvements have already been announced for Netscape Communicator.

Possible Improvements The browser interface enhancements necessary for full HTML Math implementation via plug-ins are those listed above.


Last modified: Wed Apr 30 13:39:46 1997