다음을 통해 공유


Equation Numbering in Office 2016

Word 2016 and PowerPoint 2016 join OneNote 2010 (and later) in offering a way to display equation numbers flushed to the right margin. To enter an equation number using the linear format (see Section 3.21), type the equation followed by a # (U+0023) followed by the desired equation number text and hit Enter. For example, E=mc^2#(30) ⏎ renders as

 

(30)

Internally this layout is created with an equation array in which the # character acts as a marker telling the LineServices math handler to flush what follows the # to the right margin. Because equation arrays allow you to align parts of multiple equations vertically, you can use a nested equation array with line breaks and appropriate &’s to get arbitrary inter-equation alignments as explained in the equation-array post.

Flushing the equation number to the right margin is key, but in addition, one needs a way to number the equations automatically and refer to them in the text. Chapter 6 of the book Creating Research and Scientific Documents using Microsoft Word gives a method for doing just that. The approach inserts a center tab before the equation and a right tab before the equation number. While this works well for simple equations, it currently forces the equation to use inline typography, for which integral signs and the like are small rather than large as in display-mode typography (TeX $...$ vs $$...$$). This behavior is illustrated in the earlier post. So for Word 2016, the book approach can be updated to use the equation array # option instead of the flush-right tab.

The book explains how to number equations in Word automatically using the Equation Caption, which is based on Word’s handy SEQ Equation field. The other Office applications don’t have this feature unfortunately. The way it works is as follows. On the REFERENCES ribbon tab

1)      Click on “Insert Caption”

2)      Choose the Equation label

3)      Check the “Exclude label from caption” box

4)      Hit the OK button

5)      Insert a ( in front of your equation number and a ) after the number

6)      Change the formatting as desired preferably using an equation style with the formatting you like

The book notes that some publishers don’t want parenthesized equation-number references, so it’s a good idea to have the parentheses outside of the field. You can copy/paste this parenthesized equation number to insert equation numbers for other equations in your paper. Word automatically numbers all such entries sequentially.

To refer to an equation number, you first need to bookmark it. Select its Equation Caption with or without the enclosing parentheses and in the INSERT ribbon tab click on Bookmark. Give the equation number a name starting with “eq” so that you can tell equation numbers apart from other kinds of bookmarks and click on Add.

Wherever you want to reference an equation number, insert a Cross reference to the equation number’s bookmark. Specifically, on the INSERT ribbon tab

1)      Click on the Cross-reference button

2)      In the Reference type box, choose Bookmark

3)      Select the bookmark you want to refer to

4)      Ensure the “Insert reference to:” box contains “Bookmark text”

5)      Click Insert

If the bookmark doesn’t include the parentheses and you want them in the cross reference, you can enclose the cross reference in parentheses. If you don’t need flexible publishing style requirements, it’s simpler to include the parentheses in the bookmark itself. To update the cross references, type ctrl+a to Select All and F9 to update all the fields.

If you want to include chapter numbers in the equation numbers, in the Insert Caption dialog, click on Numbering… and check the “Include chapter number” box. The dialog gives options for how the chapters are defined using heading styles.

The equation handlers used in Microsoft Office have an elegant layout mechanism for equation numbers using the math paragraph, which also supports automatic equation wrapping and flexible equation alignments. The equation numbers can be placed on the left side or the right side and positioned vertically in various ways. In this connection, it might be worth modifying Word to treat a math zone that fills the [soft] paragraph aside from an optional leading center tab and a trailing right tab followed by text (the equation caption) as a display math zone. This would allow equation wrapping, something that has to be done a bit by hand with the equation-array approach. This “tabbed” math zone could be a way to represent the basic math-paragraph equation-number functionality in files. Another nice feature would be if inserting a cross reference, you could use Equation instead of Bookmark and see the current equation numbers without any surrounding text so that you wouldn’t have to create bookmarks. Inserting a caption always wants to include extra text unless the equation number is alone on a line. The bookmark lets you select the precise text you want in the cross reference.

The equation-array approach can also have arbitrary equation wrapping and alignments, but line wrapping isn’t automatic and you may need to insert appropriate markers to get what you want. So it’d be nice to follow through with the math paragraph approach someday. The present approach does work well for most purposes and is pretty easy to use. Enjoy!

Comments

  • Anonymous
    May 14, 2015
    The comment has been removed

  • Anonymous
    May 14, 2015
    Finally! Almost a decade too late, though. Will try this out some day.

  • Anonymous
    May 16, 2015
    Finally, after almost 10 years, I might be able to use the equation editor. Thank you, I know you always lobbied for this, thanks for being persistent and not giving up on this feature. How will these equations look on older versions of Word?

    • Anonymous
      September 08, 2016
      In older versions of Word, such as Word 2010 you can use a table-based method. To print chapter number use Insert--->Quick Parts --->Field and scroll down to StyleRef. Then place a period and Insert--->Quick Parts --->Field, scroll down to Seq. This will print sequential numbers. Exact procedure is here http://smps-power.blogspot.com/2016/09/insert-chapter-based-equation-numbers.html .
  • Anonymous
    June 08, 2015
    Hello Mr. Sargent, I tried Word 2016 and realized that the non-breaking space didn't work anymore like it does in Word 2010. I used it for example to keep the space between "3 km" constant, even if the paragraph format was set to justify. In Word 2016 the space between 3 and km is stretched in the german version of Word 2016. So I think the layout-engine ignores the non-breaking space that I inserted with Shift+Control+Space. A bug? I also tried the new formula numbering possibility. Here I think it is difficult to modify the fieldcode of the SEQ-Field in the mathzone because the Field-options (like show/hide fieldcode) didn't show up in the context menu, if I right-click on a field inserted in a mathzone. But nice to see, that numbering will be available in Word 2016. Are there chances that Word 2010 will get an update to display the numbering like Word 2016? At the moment it will show #(1) for example, when opening a Word 2016 document :-(. Best wishes from Germany Sebastian

  • Anonymous
    June 08, 2015
    You might try using one of the Unicode spaces like U+2004 (three-per-em space). Word doesn’t expand that at least. Good suggestion to back port the flush-right equation array feature to Word 2010/2013. The fix is simple, so hopefully I can convince people.

  • Anonymous
    June 08, 2015
    The comment has been removed

  • Anonymous
    June 09, 2015
    @Sebastian: Surely you use the keyboard to work with fields, like Shift+F9: english.rejbrand.se/.../msword.asp

  • Anonymous
    June 14, 2015
    Dear Murray, The below is a feature request that would be incredibly useful when working with math heavy Word documents: At present, it is possible to search for a single math character, and replace it with an arbitrary math expression, via the "insert clipboard contents" function in the search and replace dialogue. In a similar way that you can insert the clipboard contents into the replace field (only entering ^c in that field), it would be great if you could insert the currently highlighted text into the find field (perhaps just entering ^h). I cannot imagine that the actual process of searching for exact math expressions is that difficult, the problem rather was mostly(?) a UI one, and this proposal would solve that at least. Thanks in advance, Tom

  • Anonymous
    July 04, 2015
    Actually it's pretty easy to search for an arbitrary mathematical expression as described in blogs.msdn.com/.../math-find-replace-and-rich-text-searches.aspx. You're right, we ought to do it!

  • Anonymous
    July 11, 2015
    Does this method support Office Mac 2016?

    • Anonymous
      November 13, 2016
      This way of equation numbering in Word 2016 is now supported in Mac too! Thank you!
  • Anonymous
    February 16, 2016
    I'm afraid it doesn't support Office 2016 for Mac. At least not on my Mac :(

    • Anonymous
      October 15, 2016
      It "kinda works" in Office for Mac 2016 (at least as of today), but you have to do a little extra gymnastics... I'll assume you have already written your equation with its number flushed to the right, as described in the E=mc^2#(30) above. Then:1- put your cursor anywhere on the page2- hit Insert Caption, choose the Equation label, don't bother adding text, format the numbering to your liking3- click InsertNow you have a useless equation caption in the middle of a page. Great.4- copy the entire equation number (i.e. not the label, but including the chapter number if it is part of your numbering scheme)5- paste it between inside the equation field of the equation you had written, i.e. in the original example overwrite the "30" in "E=mc^2#(30)"Done. You can keep copy-pasting that same field in all your equations with right-flushed numbers. Unfortunately this method now considers the whole equation as the label of your caption, and it doesn't look like there's a way to cross-reference just the number of a caption, so you're stuck with the bookmarking extra step described by MurrayS3.
    • Anonymous
      October 31, 2016
      OK, but it's not supported in Word 2016 for Mac. We need to wait another 10 years...
  • Anonymous
    August 26, 2016
    The comment has been removed

    • Anonymous
      April 18, 2017
      Use an equation array for the three equations and put it in an equation array with the equation number
  • Anonymous
    October 14, 2016
    Where exactly is the syntax reference for this thing? I've looked all over and I can't find a trace of any sort of official documentation regarding the equation editor at all. This is the first hit on anything technical and official, so I'm asking here.

  • Anonymous
    January 03, 2017
    The comment has been removed

  • Anonymous
    January 03, 2017
    Also, is there a feature that recognizes when you delete an equation/or and an equation and then automatically renumbers your equations accordingly?

  • Anonymous
    January 05, 2017
    Works perfectly when I'm not using reference with header (E.g. 5.12).

  • Anonymous
    January 21, 2017
    "type the equation followed by a # (U+0023) followed by the desired equation number text and hit Enter. For example, E=mc^2#(30) ⏎"I can't make the equation numbering to work on my word 2016. The number doesn't flush to the right. Any idea why?

  • Anonymous
    February 09, 2017
    a1a Very good!!Next equaytion:a2a ???

  • Anonymous
    April 06, 2017
    I realize this blog post is fairly "old", but it does not work for me. Everything works up until bookmarking the equation caption. In the bookmarking dialog I tried virtually every combination that exists, but when I try to insert a cross-reference, it does not see any bookmarks. I am using a Hungarian localized Microsoft Word, I only see "Könyvjelző" instead of Bookmark, I don't know if this causes an issue somewhere under the hood (or something else goes wrong).

  • Anonymous
    December 18, 2017
    you made my day, thank you!

  • Anonymous
    March 12, 2018
    But, it doesn't work mythtype 6.x。。

  • Anonymous
    April 19, 2018
    I want to (1) display equation numbers flushed to the right margin AND (2) Align at =Unfortunately, once I use # to flush the equation numbers , the align at = does not really align the equations well.How can I do both together?

    • Anonymous
      September 28, 2018
      The equation number uses an equation array. If you nest an equation array inside, you can align at the ='s. It's a bit tricky, but it works.
  • Anonymous
    September 18, 2018
    hi, I have been aware of this short cut but for some reason my word stop allowing me to label my equation even though I am writing it as I normally do. Do you have any idea as to why this is happening?Thank you