Breaking Equations into Multiple Lines

Long equations often do not fit on a single line and ways are needed to break them up for display on multiple lines. Word 2007 offers two approaches: automatic and manual line breaking. A related feature is alignment of multiple equations, such as aligning the equal signs of a group of equations. This post describes all three subjects.

Automatic line breaking occurs when an equation doesn’t fit on a single line and no user defined breaks exist. This kind of line breaking is essential for viewing in rendering environments like HTML that can be resized and don’t generally require the panning and scrolling used by fixed-width displays such as for pdf’s. The algorithm used for automatic breaking is similar to that for optimum line breaks in a paragraph: various possible line breaks are assigned penalty values and the line breaks with the minimum total penalty are chosen. Binary and relational operators outside of built-up functions have the lowest penalties, whereas these operators inside built-up functions like parenthesized expressions have higher penalties. In addition the distance from the maximum break point is an important factor in the breaking formula. Each line break starts a new line at a document-specified indentation. Such breaking is effective, but it’s not the most aesthetically satisfying.

Users who desire more pleasing line breaking can “right click” on a binary or relational operator and choose the option to “Insert Manual Break”. Three document-level possibilities exist: break before, break after, and duplicate. In the United States, mathematical typography is almost always “break before”, i.e., the operator chosen starts the new line. But some locales prefer another option. In particular, the duplicate option (display operator at the end of the broken line and at the start of the new line) is popular in Russian mathematical typography. Since the layout routine was developed primarily by Russian computer scientists (see my blog on LineServices), we certainly had to support this option!

Once such a line break is selected, the user can type the Tab key to tab into the position of a binary or relational operator on the line above. Each successive Tab key aligns to the next binary/relational operator on the previous line. Such operators can be inside parenthesized expressions, even if the expression ends up spanning several lines. The parentheses (or other brackets) are sized to fit the total expression within, in spite of the line breaks. It’s an easy and aesthetically pleasing way to break lines. Naturally if the viewer nevertheless insists on making the window width too small, additional automatic breaks may occur that don’t look as nice.

A common scenario is the display of a group of several related equations aligned at particular equal signs or other relational operators. To do this, separate the equations not by the usual Enter key, but by Shift Enter, which is a special user-defined line break that doesn’t terminate a paragraph. Then select the desired operators to be aligned with one another choosing the “Align at this Character” option for each one. The operators will then all line up precisely. It’s very cool J