# Main ideas

## Overview, MathFlow Editor

The MathFlow Editor interface includes two input/display modes, Design view and Source view.

**Design view**is the standard mode for creating and editing your equations. In this view, the input is displayed as it will be seen in your document.**Source view**is an alternate mode which displays the exact MathML syntax and structure and operates just like a text editor, allowing you to directly edit equation content within the MathML itself.

After you have added the templates in the Design view, you can view and edit the MathML in the Source view. Click the Design view or Source view tab just below the editor window to switch modes. Changes made in either mode are immediately reflected in the other. The Editor will always open into the view used in the last editing session. Most of the MathFlow Editor documentation is based on the standard Design view. We describe Source view later in the Source editing section and in the MathFlow tutorials.

### Equation templates

The editor is based on the idea of an equation template. There are templates for fractions, subscripts, superscripts, matrices, etc. To build an equation, you insert templates and fill in the blanks.

To fill in the blanks, enter letters and numbers from the keyboard, select symbols from a palette, or replace a blank with another template. If you select something before inserting a template from the toolbar, the symbol or expression you've selected will automatically be inserted into the first blank in the template. Some people describe this as "wrapping" a template around a selection.

By nesting equation templates inside one another, you can build up almost any equation. Navigate around an equation using the mouse and arrow keys. You can also cut and paste sub-expressions to build up more complex expressions.

The editor templates and symbols are directly based on MathML. MathML is the markup language for encoding math on the Web standardized by the World Wide Web Consortium (W3C). You can certainly use the editor without knowing much (if anything) about MathML.

**Example:** MathML source code for a very simple expression *x* + 4.

<math><mi>x</mi><mo>+</mo><mn>4</mn></math>

MathFlow Editor allows you to customize many typesetting and style properties to fine-tune visual appearances. You edit properties by selecting an expression and opening a property dialog box from the editor menu bar. Typesetting and style properties mostly correspond directly to MathML concepts. That is, changing properties corresponds to setting MathML attributes. In most cases, MathFlow can process the full range of valid MathML attribute values.

The possible values for each style property are discussed in MathFlow Editor: Controlling style properties, and in the Editor online help.

## Entering symbols

For simple equations, you may only need the letters, symbols, and digits available on the keyboard. However, in many situations, you will want to enter special mathematical symbol characters. You can enter a symbol in an equation by clicking it on the toolbar, or by selecting it from one of the symbol palettes, also on the toolbar.

Alternatively, if you know the symbol's name or numerical code, you can enter it directly, using the Insert Symbol submenu.

The standard toolbar configuration contains many commonly used symbol characters. However, there is a very large number of MathML symbols (around 1300), and although MathFlow doesn't support all 1300, it supports more than what appears in the standard toolbar.

### Caution

**Note:** It's common for the hex value for a Unicode character to be displayed with the leading characters **0x**. In the Insert Symbol dialog, if you lead the value with 0x, you will get an error. Thus the correct entry for the example above is 2135 as shown, and not 0x2135.

MathFlow Editor has customizable toolbars and by changing toolbar palettes, you can access most of the MathML symbols MathFlow supports. However, some rare characters don't appear in the built-in toolbars, so if you need to use these characters frequently, you will probably want to make a custom toolbar containing them.

## Combining Characters

At times you may find that a symbol or a character is not available. However, you may be able to create it by combining symbols with other symbols or characters from the keyboard. The symbols that are available for combinations are contained within the standard toolbar.

To create the combined character, place the cursor to the right of the symbol or character you want to combine with another symbol. Select the appropriate symbol under the "Common combining mark templates", , or the "Other combining mark symbols", .

For example, you can combine a tilde with the character 'c'.

You can also strike through a character by combining it with a slash.

Only one symbol can be combined with another symbol or character at a time.

## Non-MathML Elements

Non-MathML elements are valid markup which can be found anywhere within MathML elements but do not belong to the MathML standard. There are three different types of non-MathML elements you can use in the MathFlow Editor:

Processing Instructions

Comments

Elements from non-MathML namespaces

Such non-MathML elements are retained by the MathFlow editor.

Here is a sample MathML equation containing each element listed above:

<math> <mrow> <?foo?> <!--comment--!> <atag/> <mi>d</mi> </mrow> </math>

The element `<?foo?>`

is called a processing instruction, where "foo" can be additional information that can be used to display the content in a way that is user-specific.

The element `<!--comment--!>`

is a standard XML comment.

The element `<atag/>`

is a valid XML element where "atag" is the element name. This could also be of the form `<atag></atag>`

, where the text between those two tags could be anything (including MathML elements).

### Safe mode

MathFlow Editor includes an option called safe mode that prevents the user from accidentally changing non-MathML elements contained within an equation. When safe mode is engaged for a given type of non-MathML, the Design view within the editor will display non-MathML as a downward pointing triangle within token elements (such as `mi`

, `mn`

, `mtext`

) and container elements (such as `mrow`

and `mstyle`

). The editor will also prevent certain actions from occurring, such as deleting portions of an equation that contain non-MathML elements. Depending on the circumstances, you will either be warned of the presence of non-MathML elements in the status line or prompted for permission to delete the non-MathML elements. When you disable safe mode for any type of non-MathML element, you will not see the non-MathML element in Design view, nor will you be prompted or warned when deleting the non-MathML element. Disabling safe mode will be useful for experienced users who are aware of the presence of non-MathML elements and do not need the additional safety provided by this mode.

To illustrate what non-MathML looks like in Design view, consider the following MathML:

<math> <mrow> <!--comment 1--!> <mi><?pi1?>a<?pi2?>b<?pi3?>c<?pi4?></mi> <!--comment 2--!> </mrow> </math>

Notice that there are four processing instructions surrounding the letters "abc", plus the two comments that are to the far left and right of the letters. Viewing this equation in Design view will show red markers above the content at the location of the non-MathML elements as seen here.

Since the comments were placed inside the container element `mrow`

, these triangles are slightly lower than the processing instructions that are contained within the `mi`

. This may be helpful in determining where the non-MathML elements reside. You can also determine what the contents of the non-MathML element are by moving your cursor over the triangle, which will cause the status line to display as much of the non-MathML element as possible.

Non-MathML that is not within a token or container element is displayed as an upward facing triangle just below the current cursor position. Examples of this are shown under "Cursor Embellishment for Non-MathML Elements" in Cursor shapes.

While it is useful to enable safe mode to display non-MathML in token and container elements, it is possible to turn off portions of safe mode or to turn it off entirely. For full details, see Customizing Editing Behavior.

By default, MathFlow will warn you when the equation contains non-MathML by displaying a dialog box. This is done whenever there are major changes to the equation such as doing the following:

Opening the editor

Switching from Source view to Design view

Pasting an equation into the editor

Since this warning can become tedious, you have the option to disable it. This can be done from within the warning dialog box by checking the "Don't show this dialog again" checkbox:

It is also possible to disable the warning through General Editing Preferences. See Customizing Editing Behavior.