# WebEQ

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

*WebEQ* is a suite of Java-based software tools for authoring and displaying mathematical equations in a Web page. See Add-on software: WebEQ for an overview of the different components of *WebEQ*. In this section, we provide some more details about the two components of *WebEQ* that are most relevant to authoring MathML: Editor and Publisher.

## Editor

*WebEQ* Editor is a Java application that provides a graphical interface for authoring equations. The interface of *WebEQ* Editor is very similar to that of *MathType*, which is not surprising considering they are both made by the same company, Design Science. The main difference is that *MathType* is a plug-in application that is typically used in combination with a word processing application like Microsoft *Word*. *WebEQ* Editor, instead, is a simpler version of *MathType*. It does not have many of the word-processing type features of *MathType* (such as automatic number of equations and alignment control). However, *WebEQ* supports a much wider range of MathML features, including attributes and actions.

As in *MathType*, you enter equations by inserting equation templates and symbols into the Editor window (see the following figure), by clicking buttons from the toolbar. There are templates corresponding to the basic building blocks of mathematical notation, such as fractions, square roots, subscripts, superscripts, and integrals. The toolbar is customizable. Using the Preferences menu you can create a configuration file to add or remove buttons for specific symbols or templates. There are also menu commands and keyboard shortcuts for entering the most common types of templates.

*Figure: Using WebEQ Editor to create an equation.*

Each equation template contains one or more empty slots or placeholders, which you can fill in by typing text and numbers from the keyboard. You can quickly build up complex equations by nesting and combining templates, or by copying and pasting fragments of equations. You can also import MathML equations saved as external documents. The Editor automatically recognizes the MathML tags and displays the corresponding notation in the window for you to edit.

As you build up an equation, its MathML ancestry is displayed at the top of the window, providing a convenient visual cue to the type of elements being created behind the scenes. The Editor also provides a syntax-checking feature to verify if the notation you have entered is meaningful for conversion to content markup. To test the syntax of an equation, you can select it and click the checkmark button in the toolbar. If the equation is malformed in any way, either because some template slots are unfilled or because some notation does not have a clear interpretation, a dialog that tells you about the type of problem appears.

Once you have finished entering an equation, you can save it in one of three formats: an image (in JPG or PNG format), a MathML equation, or a *WebEQ* Viewer Control applet. For each format, the *WebEQ* Editor automatically generates the tag for pasting the equation into an HTML document. If you choose to export as MathML or Viewer Control applets, you can also copy and paste equations directly into another application.

For each type of export format, several options are available. When exporting as MathML, you can generate either content or presentation MathML. By default, equations are exported as presentation MathML, but you can change the default using the Preferences menu. You can also add a particular namespace prefix to all tags and attributes in the markup generated. This is useful when you are authoring MathML equations meant to be displayed with a specific rendering application. The following figure shows the dialog for specifying MathML export options. This dialog appears each time you try to export an equation as MathML, either by copying the equation or using the File → Save as MathML menu. The dialog can also be accessed from the Preferences menu.

*Figure: Setting the export options when you are exporting equations in MathML format.*

*WebEQ* Editor also lets you create interactive equations, which perform some action in response to user events (such as moving the cursor over an equation or clicking it). Three types of actions are supported:

- Toggle: clicking on an equation causes it to alternate between two different displays.
- Link: this turns an equation into a hyperlink that points to a specified URL.
- Mouseover: moving the cursor over an equation highlights it by changing the background and foreground colors.

To create any of these types of actions, you choose the corresponding command from the Insert → Actions menu. This brings up a dialog with fields for specifying the various parameters that define the action. These actions are all implemented using the maction element of presentation MathML, which is currently not supported by most MathML display engines. However, the *WebEQ* Viewer Control Java applet does include support for the maction tag for the above three types of actions. Hence, if it is important to retain the interactive behavior when viewing an equation, you should save the equation as an HTML applet tag and view it using the *WebEQ* Viewer Control applet.

You can specify various properties for the equations, each of which corresponds to specific MathML attributes. The properties you can set belong to five categories:

- Font properties such as font color, font variant, font size, and background color.
- Operator properties such as the form of the operator.
- Layout properties such as script level, foreground, and background color.
- Matrix properties such as alignment and spacing of rows and columns.
- Action properties such as a change in color or a message displayed in the status line of a browser when an action is performed.

The following figure shows the dialog used for specifying operator properties. Most of the properties correspond directly to various attributes of the mo presentation element, such as form, stretchy, symmetric, or accent.

*Figure: The dialog for setting operator properties in WebEQ.*

## Publisher

*WebEQ* Publisher is a Java application for processing an HTML document that contains equations to make it suitable for viewing in a browser. The source document can contain equations in either MathML or WebTeX, a markup language developed by Design Science that is similar to LaTeX in its syntax. *WebEQ* Publisher converts all equations present in the input document into HTML tags for displaying images, MathML equations, or *WebEQ* applet code, depending on the user's preferences. The main advantage of using *WebEQ* Publisher to generate MathML documents is that it automatically handles the namespace and header declarations needed for viewing equations with specific rendering applications. The following figure shows the main window of *WebEQ* Publisher.

*Figure: Using WebEQ Publisher to transform a source document into a form suitable for viewing in a Web browser.*

Typically, you specify a source file as input and *WebEQ* Publisher writes the output to another file. But you can also enter input for conversion directly into the Publisher window and then view the output in a separate window on the screen (see the following figure). Viewing input and output directly on the screen is useful for debugging. For example, you can vary the different translation options and see how the output changes. Once you are satisfied that the conversion is taking place exactly as you want it, you can then write the output to a file by checking the appropriate box in the *WebEQ* Publisher window.

*Figure: Viewing the output on the screen instead of writing to a file.*

For each type of export format, you can set various options from the Options menu. Using the Appearance Options dialog, you can control various aspects of the equation's appearance, such as the font size, font color, background color, and vertical alignment relative to the surrounding text. When exporting equations as MathML, you can use the Translation Options dialog (see the following figure) to specify a namespace prefix and add header declarations that correspond to specific rendering applications such as *techexplorer*, *MathPlayer*, *Mozilla*, and *WebEQ* Viewer Control. You can also choose to insert a reference to the Universal MathML stylesheet. The Options dialog also lets you specify whether symbol names in the source document should be converted to named entity references, numerical entity references, or binary Unicode characters.

*Figure: The dialog for setting MathML export options.*

*WebEQ* Editor and *WebEQ* Publisher complement each other. The combination of the two applications provides you with a convenient and flexible method for authoring documents that contain MathML. To create a technical document for display on the Web, you would take the following steps:

- Construct an HTML version of your document using your usual method of creating Web pages.
- Author each equation that you want to include in the document using the symbol and template palettes provided by
*WebEQ*Editor. - Copy each equation as MathML (using content tags or presentation tags as desired) and paste them at the appropriate places in the HTML document.
- Once all the equations have been inserted into the HTML document, make it the source document for
*WebEQ*Publisher. - Use the Translation Options dialog in
*WebEQ*Publisher to control the namespace declarations. You should also add a prefix to each equation, based on the rendering application that will be used to view the document. You can also control the style in which the equations will be displayed using the Appearance Options dialog. - Process the document to generate an HTML document with embedded MathML equations.

<< back | next >> |

**Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003**

Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America