Share via


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

Comments

  • Anonymous
    September 04, 2007
    Thank you very much.  This is exactly what I was after.  As a general comment on mathematics in Office 2007, it certainly looks better than the previous EqnEdit but I do miss the key board shortcuts!

  • Anonymous
    September 05, 2007
    Yeah that was useful. Still I think in your next patch you should add support for breaking between pairs of bracketed expressions, e.g. between (a+b) and (c+d) in (a+b)(c+d). In an ideal world manual alignment would never be necessary, the automatic one would be sufficiently sensible for almost all occasions. Still some automatic alignment is better than none coughLaTeXcough...

  • Anonymous
    September 11, 2007
    Hi, the way you have explained about the breaking equations is very excellent...please go on and explain more and more in your next blog... Cheers, Suma valluru


www.esumz.com

  • Anonymous
    September 12, 2007
    The comment has been removed

  • Anonymous
    September 12, 2007
    And one more bug: When using the "shift-enter" trick you mentioned above on equations in a table cell, if the block of equations would go across a page boundary, Word gets confused and prints the first equation on both pages.

  • Anonymous
    January 06, 2008
    The comment has been removed

  • Anonymous
    January 12, 2008
    Why can't I just break lines by pressing enter in an equation where I want? Why make it unnecessarily complicated?

  • Anonymous
    November 04, 2008
    An earlier post describes math context menus (right click somewhere in a math zone) for changing the

  • Anonymous
    December 18, 2008
    The comment has been removed

  • Anonymous
    March 22, 2009
    The comment has been removed

  • Anonymous
    March 22, 2009
    The comment has been removed

  • Anonymous
    March 25, 2009
    The comment has been removed

  • Anonymous
    March 25, 2009
    What is a zwsp ? If you type it into an equation, it disappears, but produces no error. If you type zwsp into the help system, nothing is found.

  • Anonymous
    March 26, 2009
    The comment has been removed

  • Anonymous
    March 26, 2009
    The comment has been removed

  • Anonymous
    July 14, 2009
    The comment has been removed

  • Anonymous
    July 14, 2009
    The comment has been removed

  • Anonymous
    September 28, 2009
    Shift + Enter doesn't work for me.  It still creates a new paragraph.  How do I fit this?

  • Anonymous
    October 25, 2009
    Could you show the text that is required to create an alignment within an equation.   For example, under the "Bracket" menu, the first one under "Common Brackets" at the bottom. I am trying to do a similar thing, but having no luck with the right alignment and the "tabs" that are used there.

  • Anonymous
    October 25, 2009
    The comment has been removed

  • Anonymous
    June 09, 2010
    The comment has been removed

  • Anonymous
    June 09, 2010
    Have you tried selecting all three equations, right clicking to get the context menu, and then clicking on "Align at ="? That works for me.

  • Anonymous
    June 09, 2010
    I did. I finally chased the issue down to having the leading tab character within the cell. If I delete it, then I can do alignment and selecting all three works. But if I have the leading tab within the cell it looks like it treats it as inline and that's what's messing it all up. So I've now gone to a one row / 3 column table with the large center column holding the equation and centering it. This is working well, but I've now run into the issue noted in earlier comments when the table row spans two pages (because I have multiple equations in the row). Word is duplicating equation lines on both pages...

  • Anonymous
    June 09, 2010
    The comment has been removed

  • Anonymous
    January 10, 2011
    The comment has been removed

  • Anonymous
    January 10, 2011
    You're right, there's a bug in Word's inline equation wrapping. I'll investigate. Thanks for the feedback.

  • Anonymous
    February 13, 2011
    The comment has been removed

  • Anonymous
    February 14, 2011
    Yes. I think I’ll do a blog post on it. The functionality is described in Section 3.19 of Unicode Technical Note #28,

  • Anonymous
    February 14, 2011
    The comment has been removed

  • Anonymous
    February 14, 2011
    Actually, I am looking for a way to align d to (a x b x c) taken as one thing, so that d would appear right below  the middle of (a x b x c): R0 = one thing  x  next thing  x  last thing     =        a          x         b          x       c     =                               d Looking forward to your blog!

  • Anonymous
    May 13, 2011
    The comment has been removed

  • Anonymous
    June 08, 2011
    The comment has been removed

  • Anonymous
    August 11, 2011
    The comment has been removed

    • Anonymous
      August 10, 2016
      Thanks Miki, a trick with matrix helped me! Hovewer, in my Word 2007 right click context menu doesn't appear. I have found the following workaround for removing the second column from the matrix: 1. Click the down arrow at the right end of the equation and choose Linear. For empty matrix, equation will look like ■(&).2. Remove "&" symbol.3. Switch back to Professional mode.4. Bingo! :)
  • Anonymous
    December 16, 2016
    It was very useful. Thank u so much.