Numbered equations in Word

Microsoft boasts of its academic staff, but really, I often get the impression that no-one involved with Word has any idea of what academics do, need, or want. When the referencing tools in Word came out I got all excited, only to be severely disappointed (you can read about all my gripes in my book). Basically, after more than six years now (from Word 2007 to Word 2013), Microsoft is still more than two decades behind in the reference management field. Then again, is it fair to expect Word to do what is actually the domain of a whole difference class of software? Probably not, but then why did Microsoft even try?

One thing that Word should be able to do, and that you will find people regularly complaining about, is to neatly number equations. It seems that waaaaaaay back (I can’t even recall how far back, but I am certain that it was pre-Word 95), someone at Microsoft thought that being able to add a caption titled “Equation” with the Insert Caption tool was all that any academic would ever want (they probably have never worked through a statistics textbook).

The generally touted workaround (it remains a workaround until Microsoft actually addresses the problem, which seems as likely as Microsoft ever building true 3D capabilities into Excel) is this: Add an unbordered table consisting of one row and three columns, and then add the equation in the middle column, and the number in the right column. See, for example:

http://ist.uwaterloo.ca/ec/equations/equation2007.html

http://blogs.office.com/b/microsoft-word/archive/2006/10/20/equation-numbering.aspx

http://word.tips.net/T000273_Numbering_Equations.html

Here’s my suggested method. I admit that it still requires more manual labour than I feel should be necessary, but I do believe it presents a more robust solution than that presented by Microsoft’s employees. The first step is to add two blank paragraphs, position yourself in the first of these, and then add the equation. Then position yourself to the right of the equation (i.e., just before the first of the two paragraph marks), and press Ctrl + Alt + Enter to add a Style Separator. Now add a tab, and then insert an Equation caption (remembering to set the numbering so as to include the chapter number, and the caption itself so as to Exclude the label from the caption).

Adding an equation caption

The convention, again, is for the equations to be enclosed in parentheses, which can now be added.

This will leave your equations, properly centred on the page, with auto-numbering equation captions properly aligned, that can easily be used to generate a list of equations using the Insert Table of Figures tool.
Admittedly, this may not be an ideal list of equations, as the fact that the actual caption “Equation” is excluded from the caption, means that the list will not contain entries like “Equation 2.1                p.13,” but rather “(2.1)            p.13.”
However, using some bookmark-modification techniques, the parentheses can easily be removed from the reference, and with some creativity, the remaining list can be formatted quite effectively (this need only be done once). Also, very often the idea behind numbering is not to generate a list of the actual equations, but rather to have an auto-numbering list that can be cross-referenced. Because the Caption tool uses the SEQ field, it remains ideal for this purpose. This list will show the equations with the right numbers, in the right order, with the right page references.
By this stage, you should have something similar to this:

Equation separated from caption by Style Separator.

The last thing that needs to be done is to align the equation number. By some quirk, it seems that, while the Style separator does allow you to combine two paragraphs into one, only the first paragraph’s tab stops seem to apply—since Microsoft has totally neglected documenting the Style separator, we are left at a loss as to whether this is by design or by oversight. And yet, if you close and save the file, and re-open it, you may find Word wanting the tab stop for the second “paragraph.” Thus, the safest thing to do seems to be to add the same tab stop on both sides of the Style separator—you need to position the I-beam both to the right and the left of the Style separator, and then add a right tab stop (remember that the Tabs dialog can easily be opened with Alt, O, T) equal to the text width of your page (e.g., if the ruler width is 16 cm, then add a 16cm right tab stop), as is demonstrated below:

Adding a tab stop to align an equation caption

The end result should be something like this:

A properly aligned equation caption

 Of course, all that work can get quite tedious, which is why I have created a simple macro to automate the work for you. You could add this yourself, or you could install my Word uTIlities, which includes this macro where it can be run with a click on the ribbon.

Sub AddCaptionedEquation()
'Created by J. Raubenheimer, 2012
'Adds an empty equation box and a right-aligned equation caption
  With Selection
    .TypeParagraph
    .TypeParagraph
    .MoveUp Unit:=wdLine, Count:=2
    .OMaths.Add .Range
    .MoveRight Unit:=wdCharacter, Count:=1
    .InsertStyleSeparator
    .TypeText Text:=vbTab
    .TypeText Text:="("
    .InsertCaption Label:="Equation", ExcludeLabel:=1
    .TypeText Text:=")"
    .HomeKey Unit:=wdLine
    Dim intPos As Integer
    With .PageSetup
      intPos = .PageWidth - .LeftMargin _
      - .RightMargin - .Gutter
    End With
    .ParagraphFormat.TabStops.Add Position:=intPos, _
     Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
    .HomeKey unit:=wdLine
    .ParagraphFormat.TabStops.Add Position:=intPos, _
     Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
  End With
End Sub
 
Please note, though, that this macro must only be run in a document which already uses the Heading styles to divide and number the chapters.

One last thing about this method needs to be said. Because of the way Word handles cross-references, you will notice that a cross-reference in your text to the equation will include the parenthesis on the left of the equation number. This problem, is caused by the hidden bookmark Word adds around the caption number when you add the cross reference. Again, my uTIlities contain two tools (the Bookmark Manager or the Shrink bookmark tool) that fix this.

After all is said and done, I admit that this approach is still not ideal–the ideal would be a real fix from Microsoft–but it does, to me, present several advantages over other methods, and the fact that I have automated it means that this is not a bad solution to the student who needs numbered equations–it’s what I use.

Share