Microsoft KB Archive/123430

= WD: How to Insert a Caption Next to an Equation or Object =

Article ID: 123430

Article Last Modified on 11/23/2006

-

APPLIES TO


 * Microsoft Word 6.0 Standard Edition
 * Microsoft Word 6.0a
 * Microsoft Word 6.0c
 * Microsoft Word 95 Standard Edition
 * Microsoft Word 95a
 * Microsoft Word 6.0 for Macintosh
 * Microsoft Word 6.01 for Macintosh
 * Microsoft Word 6.01 for Macintosh

-



This article was previously published under Q123430



SUMMARY
Word does not offer a built-in method of automatically inserting a caption flush with the right edge of a document. Many scientific journals require equation objects to be either centered or left aligned and the caption to be on the same line, flush with the right margin, and the caption number enclosed in parentheses. This article explains how to achieve that format.

NOTE: This article uses the term "equation," but this method applies to any item (such as a figure or picture) where the caption needs to appear on the same line as the object.

Examples of scientific journal formats:                              y = mx + b                            ( 1 )

- or -

y = mx + b                                                         ( 1 )



Setting Up the Caption
For either of the two alignment methods described below, use these steps to create the label with parentheses:


 * 1) From the Insert menu, click Caption.
 * 2) Select New Label.
 * 3) In the Label box, type an opening parenthesis.
 * 4) Choose OK.
 * 5) In the Caption box, to the right of the number, type a space.
 * 6) Type a closing parenthesis.
 * 7) Choose OK.

Inserting Additional Captions
After you have created the new caption format, you can insert additional captions by following these steps:


 * 1) From the Insert menu, choose Caption.
 * 2) In the Caption box, to the right of the existing caption, type a space and a closing parenthesis.
 * 3) Choose OK.

Aligning the Equation and Caption
Note that if you will be cross-referencing the caption number, method 2 is the preferred method.

Method 1:

Insert the caption. Move to the Start of the line. Set a right-aligned tab for the right margin. Insert the equation. Press the TAB key to move the caption to the right edge of the page.

Method 2:

Insert the Equation in a table. If you want the equation to appear on the left edge of the page, insert a two-column table. If you want the equation in the center of the line, insert a three-column table.

To position the equation on left margin:

 Insert a two-column table. Format the first cell (column) width to Auto. Format the second cell (column) width to 0.5. Insert the equation in the first cell. Insert the caption in the second cell. To center the equation: <ol style="list-style-type: lower-alpha;"> Insert a three-column table.</li> Format the first and third cells (column) width to 0.5.</li> Format the second cell (column) width to Auto.</li> In the second cell, choose the Center button.</li> Insert the equation in the second cell.</li> Insert the caption in the third cell.</li></ol> </li></ol>

Method 3: Create a Macro that Automatically Runs Method 2
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

Sub MAIN ' This macro will prompt you to choose either Left Aligned or Centered ' for the equation object. The caption for this equation will be flush ' with the right margin or column. This macro will then launch Equation ' Editor.

ScreenUpdating Begin Dialog UserDialog 280, 108, "Select Equation Alignment" OptionGroup .OptionGroup1 OptionButton 69, 14, 120, 16, "Left Aligned", .OptionButton1 OptionButton 69, 31, 140, 16, "Center Aligned", .OptionButton2 OKButton 40, 68, 88, 21 CancelButton 145, 69, 88, 21 End Dialog On Error Goto bye Dim dlg As UserDialog Dialog dlg choice = dlg.OptionGroup1 Select Case choice Case 0 x = 2 Case 1 x = 3 End Select TableInsertTable .NumColumns = Str$(x), .NumRows = "1" If x = 2 Then       'For left aligned, insert a two cell table. NextCell CharRight 1, 1 TableColumnWidth .ColumnWidth = "0.5", .PrevColumn ElseIf x = 3 Then   'For center aligned, insert a three cell table CharRight 1, 1 TableColumnWidth .ColumnWidth = "0.5", .PrevColumn TableColumnWidth .ColumnWidth = "0.5", .PrevColumn EndIf TableColumnWidth .ColumnWidth = "Auto" NextCell InsertCaption .Label = "(", .Title = " )", .Position = 1 RightPara PrevCell If x = 3 Then CenterPara InsertObject .Class = "Equation.2", .Caption = "Microsoft Equation 2.0" bye: ScreenUpdating End Sub Several methods exist for inserting captions. AutoCaption inserts a caption either above or below an inserted object; manually inserted captions appear above or below the object when the object is selected, or to the immediate right when the insertion point is to the right of the object.

For information about how to do this in later versions of Word, see the following article in the Microsoft Knowledge Base:

158918 WD97: How to Insert a Caption Next to an Equation or Object

<div class="references_section">