WD: How to Insert a Caption Next to an Equation or ObjectLast reviewed: February 6, 1998Article ID: Q123430 |
The information in this article applies to:
SUMMARYWord 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 ) MORE INFORMATION
Setting Up the CaptionFor either of the two alignment methods described below, use these steps to create the label with parentheses:
Inserting Additional CaptionsAfter you have created the new caption format, you can insert additional captions by following these steps:
Aligning the Equation and CaptionNote 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:
Method 3: Create a Macro that Automatically Runs Method 2Microsoft 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 engineers 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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/supportnet/refguide/ 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 MORE INFORMATIONSeveral 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:
ARTICLE-ID: Q158918 TITLE : WD97: How to Insert a Caption Next to an Equation or Object REFERENCES"Microsoft Word Developer's Kit," version 6.0, page 520
|
Additional query words: equations center centered align alignment position
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |