Long equations that span more than one line have to break somewhere. Hence, there is a myriad of different style rules that specify on which character an equation should break, and how the equation should be aligned. For example, here is a guide about typesetting equations, and here is a manual from the US Government Publishing Office Style (guidelines for equations are on page 264).

This article teaches you how to break and horizontally align MathML equations at a specific character within the equation.

## Problem

Your MathML equations are not breaking or aligning according to your style guide.

### Why `<mtable>`

may not work

The suggested best practice for setting MathML to account for breaks and alignment is to use the `<mtable>`

element along with other alignment elements. movemen MathTools supports `<mtable>`

, but the results may not conform to your style guides. More importantly, by using a table, the entire set of equations becomes an unbreakable block which could end up wider or taller than the page, resulting in failed jobs. The other alignment tags (`<maligngroup>`

and `<malignmark>`

) are also not currently supported by MathTools.

## Solution

There are two steps:

- Edit equations in the source content: Depending on your workflow, you can use Microsoft's Equation Builder in Typefi Writer, or edit equations directly in the MathML.
- Add the Align Equations event script to your Typefi workflow.

### Edit equations in the source content

Depending on your workflow, you can author and edit equations with Microsoft's Equation Builder, or directly in the source MathML.

#### Microsoft's Equation Builder

Use Microsoft's Equation Builder to insert and edit equations. When you are editing equations, you can break equations at specific points and horizontally align equations on the equals sign (**=**), or any other character in the equation.

To insert a set of equations that align on an equals sign (=):

- Choose
**Insert → Equation**and select**Insert New Equation**from the bottom of the built-in equation gallery. This inserts an equation placeholder where you can type your equation. TIP Press**Alt**+**=**to insert an equation quickly. - Type the equation and press
**Shift**+**Enter**at the end of the line. Pressing**Shift**+**Enter**inserts a soft return, which signifies the end of a line. - Type the next equation, followed by
**Shift**+**Enter**; repeat until the last equation. - Select the whole set of equations.
- Right-click and choose
**Align at =**.

To insert a set of equations to align on something else:

- Choose
**Insert → Equation**and select**Insert New Equation**from the bottom of the built-in equation gallery. This inserts an equation placeholder where you can type your equation. - Type the equation and press
**Shift**+**Enter**at the end of the line. Pressing**Shift**+**Enter**inserts a soft return, which signifies the end of a line. - Type the next equation, followed by
**Shift**+**Enter**; repeat until the last equation. - In the first equation, select the character you want to align to.
- Right-click and choose
**Align at This Character.** - Select the alignment character in each of the other equations, right-click and choose
**Align at This Character**.

To break an existing equation into parts:

- Right-click at the point where you want to break the equation and choose
**Insert Manual Break.** - Press Tab to align the equations.

#### MathML source content

If your workflow does not use Typefi Writer to import content, you can break equations and horizontally align them directly in the MathML:

- Insert
`<mspace linebreak = 'newline'/>`

where you want the equation to break.`<mspace>`

is a MathML tag that is used to display a blank space, and`linebreak='newline'`

is a MathML attribute that indicates there should be a new line at the space. - Insert
`<mo>‍</mo>`

before the operator you want the equation to align.`<mo>`

is a MathML tag that represents an operator (for example + or -).`‍`

is the Unicode character for the Zero Width Joiner. The Align Equations event script—which you'll add in Typefi Server—uses the Zero Width Joiner as its alignment character.

For example, the equation below breaks and horizontally aligns on the equals sign.

It is represented in MathML as:

### Add the Align Equation event script in Typefi Server

No matter if you edited your equations in Microsoft Word, or in the MathML directly, you must add the Align Equations event script to your workflow. The Align Equations script works by looking for lines separated by soft returns, and if the first and the last characters are Math Zones, it horizontally aligns the equations. Add it to the **Document end** event.

NOTE The MathML Handler and MathML to MathZone scripts are required for all workflows that contain MathML content. For more information, see Core MathML scripts.

If you have any questions, please contact us. We're happy to help.

## Comments

0 comments

Please sign in to leave a comment.