共用方式為


More on Equation Numbering

The book Creating Research and Scientific Documents using Microsoft Word gives a method for numbering equations that works with all versions of Word from Word 2007 on and has automatic renumbering of the equations and the references to the equations. Those are very attractive features. The approach inserts a center tab before the equation and a right tab before the equation number. This works perfectly for simple equations, but there are some problems for more complicated equations. The problems could in principle could be solved with modifications to Word, but not in a backward compatible way. This post explains the problems and possible solutions.

The problems occur because the presence of tabs on the line outside the math zone makes Word think the math zone is an inline math zone and therefore uses inline math typography instead of display math typography. For inline typography, summation limits appear as subscripts and superscripts instead of being displayed above and below. Also fraction numerators and denominators are squeezed down to script level 1. A fix in Word would be to treat a math zone ensconced between such tabs as a display math zone. Such a fix wouldn’t require file format changes. For example, with inline math typography the display-math equation

looks like

 

The relatively compressed format is desirable inline so that a paragraph isn’t spaced too far apart. But it doesn’t look as nice as the display math version.

A second problem is that if an equation is too long to fit in the allotted space, it wraps using inline protocol and typically leaves the equation number centered instead of flushed right. Nice wrapping can be obtained using an equation array as discussed below.  A minor inconvenience with the center and flush-right tabs is that if you change the margins, you need to change the center and right tabs as well in order to keep the equation centered and the equation number flushed to the right. This problem would be fixed if Word added center-width and right-margin tabs that derive their positions from the current display width instead of from fixed values on the ruler. Adding two new kinds of tabs would change the tab-type enumeration in files.

If you use the three-cell table approach of Dong Yu, these problems don’t occur and the approach works with Word 2007 on. You can have numbered equations with nice wrapping like

   

 

 

(1.1)           

The first and third cells have the identical, small widths. The second cell is wide and contains the equation. The third cell contains the equation number. Or you could put the equation numbers in the first cell if your publisher wants equation numbers to be on the left (pretty rare). The three-cell table approach can be used instead of the center and right tabs, while using the approach of the book for formatting and referencing the equation numbers. Chapter 5 of the book discusses using tables to align figures in nice ways and tables are used extensively in HTML web pages to achieve special alignments. In fact, a three-cell HTML table is used here in this post to flush the equation number to the right.

In principle, the Office math handlers offer better approaches to equation numbering than using center and right tabs. An earlier post describes such approaches. The main glitch with the more elegant equation numbering approach using the Page/Table Services math handler is that Word needs some changes to utilize the facility.

Meanwhile an intermediate approach was quietly incorporated into OneNote 2013 and hopefully will show up in other apps pretty soon. This approach uses a special feature of the equation array, which flushes an equation number to the right margin. You enter a numbered equation by typing the equation followed by ‘#’ followed by the equation number and then an Enter key as described in Section 3.21 of the math linear format paper. The # is a code that triggers insertion of an equation array with a # argument separator. The text that follows the separator is flushed to the right of the page. This allows the equation to remain in display mode and to track margin changes automatically. Furthermore, by using a nested equation array with line breaks and appropriate aligning and spacing &’s, you can get arbitrary inter-equation alignments as explained in the equation-array post. The numbering and cross referencing can be accomplished using the techniques explained in Chapter 6 of the book. Once you have one equation number in place, all you need to do is to copy that number to generate appropriately numbered equations elsewhere in the document and bookmark them for cross referencing purposes. Word’s automatic sequence numbering renumbers the equations as need be (you can fire the update by pressing the F9 key). The equation-number option of the equation array doesn’t require any file format changes, but on unaware apps, it displays the equation number adjacent to the equation instead of flushed right.

The good thing is that there are ways to number equations in Word pretty easily, although they aren’t as discoverable as other kinds of numbering in Word. For the moment at least, I like using the three-cell table approach with the formatting and referencing methods described in the book. That combination gives you easy equation number updates along with display-math formatting and nice equation line breaks.

Comments

  • Anonymous
    February 22, 2014
    The comment has been removed

  • Anonymous
    February 23, 2014
    I totally agree with Davidacoder! It is really sad.

  • Anonymous
    February 27, 2014
    I suspect "OneNote 2010" is a typo and should be "OneNote 2013". If so, worth fixing the text, otherwise people will wonder just how long it might take to get the featueres into the other Office applications :-)

  • Anonymous
    February 28, 2014
    I would like to see a manual switch to change the layout of formulas between inline and display mode. When I create worksheets for school I need this capability. For example: a.) formula 1                 b.) formula 2.          c.) formula 3 d.) formula 4.                e.) formula 5.          f.)  formula 6 Sure, I could make a table for it. But with tabstops and the ability to change between inline and display mode manually would be easier.

  • Anonymous
    February 28, 2014
    The comment has been removed

  • Anonymous
    March 06, 2014
    I have made an add-on to Word which adds easy equation numbering to Word. It basically uses the 3-cell table approach as described here. In combination with SEQ-fields to achieve automatic numbering. You can download here: www.eduap.com     look for  WordMat   (it's free) Then you can: press alt+m to insert equation. press alt+m twice to insert numbered equation (alt+m toggles numbered/unnumbered) In settings you can choose to have the equation in the left or right side. and choose between two numbering styles (1) or (2.1) The add-on adds a lot of other functions which you might not need though.

  • Latex conversion
  • All kinds of Calculations on math expression
  • Anonymous
    March 10, 2014
    @michael  Now that sounds very useful. Im going to check it out right away and will post my first experience with the add in.

  • Anonymous
    August 15, 2014
    Apparently Mikael has set up a Codeplex site in the meantime: http://wordmat.codeplex.com/

  • Anonymous
    November 30, 2014
    In Microsoft Word it would be nice to have right aligned automatically generated equation numbers. When referencing to an equation I like to get a list of all equations (in 'professional lay-out'), and then you just have to click on the equation you want to reference.

  • Anonymous
    January 23, 2015
    The problem with the table approach is that it forces a new paragraph. It is very rare to start a paragraph with a mathematical equation; usually the equation is part of a continuous sentence. [The ability to insert commas or other punctuation marks immediately after a display equation would also be handy for this reason.] This means that special care must be taken with the paragraph spacing so that the "new" paragraph doesn't noticeable to the reader. However I want a 6 pt gap between real paragraphs. So, unless I manually format every paragraph (urgh) I am rather stuck. As much as I love the equation editor it really doesn't feel like it was intended to be used in serious pieces of work.

  • Anonymous
    February 07, 2017
    It's surprising to find on microsoft.com a resource so precious about equations. We will note your page as a benchmark for More on Equation Numbering.We also invite you to link and other web resources for equations like http://equation-solver.org/ or https://en.wikipedia.org/wiki/Equation.Thank you ang good luck!