# Using MathFlow in Arbortext

## Overview — using MathFlow

MathFlow for Arbortext consists of three major components:

MathFlow for Arbortext consists of three major components:

### MathFlow Editor

MathFlow Editor is a WYSIWYG editor for entering MathML into your XML documents. The MathFlow Editor is integrated with the Arbortext Editor so that MathML can be quickly and easily edited in the Arbortext environment. For information on using the MathFlow Editor, refer to the Tutorials and MathFlow Editor sections.

### MathFlow Composer

MathFlow Composer is used to translate your XML pages, including MathML, into a variety of HTML formats for viewing on any browser. MathFlow Composer works together with Arbortext Composer to generate output documents in HTML, XHTML, and PDF formats. For information, refer to MathFlow Composer.

### MathFlow Import/Export (Windows Only)

MathFlow Import/Export works together with Arbortext Import/Export (formerly Interchange) to import Microsoft Word documents containing MathType 7 and Equation Editor equations into XML MathML-aware documents. For more information, refer to MathFlow Import/Export.

The remaining topics on this page describe how to access MathFlow Editor from within the Arbortext Editor.

## Integration with Arbortext

The MathFlow Editor is integrated with the Arbortext Editor so MathML can be quickly and easily edited in the Arbortext environment. The following modifications are made to the Arbortext menu and toolbar interface for access to MathFlow

The Insert Equation icon () on the toolbar opens a MathFlow Editor window.

The menu entries Save as HTML and Compose HTML File on the File menu each open a modified dialog box, with extra options for dealing with the translation from MathML to HTML. For more details, consult MathFlow HTML Composition.

A MathFlow menu is added which includes these items: Insert MathML…, Reload MathML images, View MathML markup, and Edit MathML directly.

The MathFlow menu includes two additional items: MathFlow Help, which opens a window with the MathFlow documentation; and About MathFlow which opens a window with information on the installed MathFlow version, as well as about what features are licensed and available for use.

The basics of using the MathFlow Editor in Arbortext are described in the topics that follow. For further details on the editor, please refer to the MathFlow Editor and Tutorials sections.

As a general rule, while editing a document that is not of a MathML-aware doctype, the Arbortext Editor will not contain the above MathFlow enhancements (except for MathFlow Help and About MathFlow and will operate as if MathFlow has not been installed.

## Inserting an equation

To insert an equation, you can either click the *Insert Equation* icon on the toolbar or choose *Insert MathML…* from the Arbortext MathFlow menu.

The keyboard shortcut **Alt**+**Shift**+**M** will also insert an equation.

All these options open an instance of the MathFlow Editor.

Once you have created an equation in the MathFlow Editor, click the OK button to close the Editor and insert the resulting MathML into the document structure. A preview image is generated and displayed in the Arbortext Editor window.

## Editing an existing equation

To edit an existing equation, double click the equation preview in the Arbortext Editor. This will reopen the equation in the MathFlow Editor. Once you have finished editing the equation, click OK to update the equation.

## Editing MathML source

### With equation images

You can edit MathML source directly from Arbortext as usual. For example, this might happen as the result of a Find and Replace operation, or by using "Edit Selection as XML Source" from the Arbortext Edit menu. However, if you modify the MathML source directly, you will need to manually resynchronize the preview images in the Arbortext Editor window. To do this, select "Reload MathML Images" from Arbortext's MathFlow menu.

By default, MathFlow will hide the MathML markup in Arbortext's Editor window, and only display a preview image. If you would like to examine the MathML structure within the Arbortext Editor window, check the "View MathML Markup" option on the MathFlow menu.

This will only provide useful results if you also select "Partial Tags" or "Full Tags" on the View menu as well. Otherwise, you will merely see the CDATA contents of the MathML elements adjacent to the preview image.

### Without equation images

As an alternative to the procedure described in the previous section, you can also select "Edit MathML Directly" from Arbortext's MathFlow menu. (Make sure that the cursor is **not** inside MathML markup when choosing this menu entry, otherwise some of the options it tries to set, like displaying full tags, will not be set.) Note that equation editing works as usual; i.e. double clicking inside the MathML markup will still open the equation in the MathFlow Editor, just the same as if the equation images were generated.

## Sample document types

The concept of a MathML-aware document type (doctype for short) is important to understand when authoring MathML documents in Arbortext. MathFlow is only active for doctypes it has been configured to recognize.

There are several considerations in setting up a new math doctype, such as including the MathML 3.0 DTD module. Although MathFlow has been designed to help minimize the amount of work required (and in some cases setting a few configuration variables will suffice), in most instances much more customization will be needed. For complete details on setting up your own doctype, including discussion of the DTD (Document Type Definition), please refer to the Setting Up a Custom Doctype section later in this documentation.

MathFlow comes with two sample doctypes, which can be used as guides when setting up MathFlow to work with custom doctypes. The demo files which accompany the sample doctypes can also be used to familiarize yourself with MathFlow features.

### Axdocbook_math

The axdocbook_math doctype is an extension of the Arbortext DocBook v4.0 doctype. To find out more about DocBook, DocBook.org maintains documentation for the DocBook standard.

The doctype files for axdocbook_math can be found in the following location:

`<custom-path>/doctypes/axdocbook_math/`

Among these is a sample file to demonstrate how to use MathFlow to include MathML in a document:

`<custom-path>/doctypes/axdocbook_math/demo.xml`

### DITA_mathml

The dita_mathml doctype is a MathML domain specialization for DITA. DITA is a public standard maintained by OASIS.

The doctype files for dita_mathml can be found in the following location:

`<custom-path>/doctypes/dita_mathml`

The demo files for the dita_mathml doctype include a map file that references a topic file and a concept file and are located in the following folder:

`<custom-path>/doctypes/DITA-samples`

To start creating your own DITA files using the MathML domain specialization, you can use the templates provided in the following location:

`<custom-path>/doctypes/DITA-templates`