Know what are variables in FrameMaker, understand system and user variables, use the variables pod to manage variable.
A variable in FrameMaker allows you to define a name-value pair of data that can then be reused across a document. For example, you can create a variable author_name that defines the name of the document author. If the value of the variable is changed, this change is reflected across the occurrences of that variable in the document.
FrameMaker provides a set of pre-defined system variables. You use system variables to add information to a document that is specific to the FrameMaker or current computer environment. For example, the Chapter Number variable, if included in a page, displays the chapter number to which the page belongs. The Modification Date (Long) variable that displays the last date the document was modified.
You can also create user variables to define custom values. For example, you can create a user variable, author_name for the name of the document author. Besides the value that you assign to a user variable, you can also assign a character format to display variable value. For details, see Creating user variables.
To open the Variables pod:
From the View menu, choose Pods > Variables.
Alternatively, from the Insert menu, choose Variables.
The Variables pod displays the list of system and user variables that you can add to the current document.
To sort the list, click a column header in the list. The list is sorted by the header that you click.
To resize a column:
Hover the mouse between two columns until the cursor is a bi-directional arrow.
Hold down the left mouse button, drag, and release the mouse button when the column is sized as required.
Use the Variables pod to:
The red icon indicates a system variable.
The blue icon indicates a user variable.
Search for a variable in the list. The SAYT (search as you type) functionality works on all the columns in the variable list.
Open the Add Variable dialog to create a user variable. See Creating user variables.
To edit the selected variable, open the Edit Variable dialog (for user variables) or Edit System Variables dialog (for system variables). See Editing user and system variables.
Delete a selected user variable. See To delete a user variable.
Insert the selected variable at the insertion point in the current document. See Insert variables.
To insert a variable, you can also double-click the variable in the pod.
If you edit the definition of a system variable, use this command to update the definitions of the variables used in the current document. For details, see Editing user and system variables.
Convert the variable to text. In the Convert Variables to Text dialog, you can choose to convert the selected variable, named variables, or all variables to text. See Converting variables to text.
Select from the list of open documents to display the variables available in that document.
Refresh the list of available variables.
Learn how to insert variable in a document in FrameMaker.
You can insert a variable in the body or master pages of a document. For example, to display the last modified date in the footer of a document, add the Modification Date to the footer section of the master page of the document. You can also display a variable value at a specific location of the content of a document by inserting the variable in the body page of the document.
Place the insertion point at the point in the document to insert the variable.
To insert the variable at the insertion point, select the variable in the pod and click Insert or double-click the variable.
When you insert a variable in a document, whether the variable name or value displays depends on the type of variable. All user variables and most system variable display the value on both the master and body pages of a document. However, the following system variables display the name on the master page and the value on the body page:
Current Page #
Running H/F variables
When you insert a variable into a structured document, FrameMaker inserts an XML variable and creates an XML entity element. FrameMaker then uses this combination of XML variable and entity to maintain the variable.
To view the XML variable and entity created in the XML, go to the XML view.
For example, if you insert the Modification Date (Long) variable
in a structured document, FrameMaker inserts a &fm.lmdate;
variable
and a corresponding entity element.
Understand how to manage variables in FrameMaker, create and update user variables, import variables, convert variables to text.
From the Variables pod you can create and delete user variables, edit user and system variables, or convert variables inserted in a document to editable text.
This section covers the following topics:
You create and add user variables, to display custom information in a document. For example, you can create a variable, author_name, that specifies the name of the document author. Or, you can create a variable, product_name, to specify the name of the product.
In the Variables pod, click Create New User Variable.
The Add/Edit Variable dialog is displayed.
Enter a name for the variable: product_name.
Enter a definition for the variable.
For example, you
can enter the definition as Adobe FrameMaker
for
the variable product_name. Or, you can create
a variable using multiple paragraph or element tags. For example, <$paratext[Chapter,
Section, Appendix]> retrieves the text of the most recent
paragraph tagged Chapter, Section, or Appendix
You can also specify a character format for the variable by preceding the variable definition with the character format.
To apply a character format to the definition of a variable:
Click a character format in the list.
The character format is added to the variable definition.
Follow the character format by the variable value. For example:
<Callout>Adobe
You can also add multiple character formats to the different text in the variable definition. For example:
<Callout>Adobe <emphasis>FrameMaker
To create the variable, click Add.
After you create a user variable, you can insert the variable into your document. See Insert variables.
You can edit the definition of a system or user variable.
A User Variable definition can include character formats of the
document. A System Variable definition can contain FrameMaker building
blocks other than character formats. For example, the default format
for the Creation Date (Short) system variable is: <$monthnum>/<$daynum>/<$shortyear>
.
You can edit this to any other format such as: <$daynum>/<$monthnum>/<$shortyear>
.
Similarly, you can change either the definition and / or the character
format applied to a user variable.
Select the variable in the Variables pod and click Edit.
The variable editing dialog is displayed.
Edit the definition of the variable:
User variables:
You
can edit the name, definition, or the character format of a user
variable. For example, you can update a product_name variable: <Callout>Adobe
<emphasis>Frame
to <Default ¶ Font>Adobe
<Emphasis>RoboHelp
.
System variables:
You can edit the definition of a system variable using the variable definitions available in the Building Blocks list.
You can include character formats to System variables as you do when Creating user variables.
The Location list in the pod displays the page number in the current document where the variable is used.
To save the update to the variable, click Edit.
You can delete the user variables that are no longer required for use in the document.
You can also delete the occurrences of a system or user variable added in a document.
When you delete a user variable, the variable definition is removed from the document catalog. After this, the variable is no longer available for use in the document.
Select the user variable in the Variables pod and click Delete.
If the variable is used in the current document, you are prompted with the message that all occurrences in the document will be converted to editable text. Click OK to delete the variable and convert all its occurrences to text.
You can choose to delete specific occurrences of a variable in a document. This retains the definition of the variable in the document catalog and other occurrences of the variable in the document.
Open the Find/Change dialog.
In the Find list, select Variable - of Name and enter full or partial name of the variable you want to remove from your document.
Click Find to locate the variable in the document.
To remove the selected occurrence, press the Delete key or click Delete below the occurrence list.
In this case, the variable occurrence and the associated text is removed from the document.
You can covert the variables in a document to text. This removes the reference of the variable from the document and makes the converted text editable.
In the Variables pod, click Convert to Text.
The Convert Variables to Text dialog displays.
You can choose to convert:
All occurrences of the variable selected in the Variables pod.
All occurrences of the variable selected in the variable list.
All occurrences of an element tag assigned to a variable.
All occurrences of all variables in the document.
Click Convert.
The variables in a document are available for use in the document where they are created (user variables) or edited (user and system variables).
You can make these changes available to other documents by importing the variables definitions.
Open the document containing the variable definitions that you need to make available in one or more other documents.
Open the document into which to import the variable definitions from the source document.
If you are working in a FrameMaker book, you can multi-select the documents in the book into which you want to import the definitions.
From the File menu, choose Import > Formats.
In the Import Formats dialog, click Deselect All, check Variable Definitions, and click Import.
Know how to add variables to headers and footers in FrameMaker.
When you add a variable to a running header or footer on the master page of a document, the variable definition displays across pages of the document. For example, in the Chapter FrameMaker template, the Running H/F 1 (chapter title) and Running H/F 2 (level 1 heading) variables are inserted in the odd and even page headers, respectively.
This section covers the following topics:
The following table describes the default Running H/F variables available in a (new) blank document in FrameMaker:
Default Running H/F variable |
Description |
---|---|
Running H/F 1 |
Chapter title |
Running H/F 2 |
First level heading. For example, Heading 1. |
Running H/F 3, H/F 4, H/F 13 through H/F 18 |
Marker text defined for markers of type Header/Footer $1 through $8. For details, see Using markers to display text in a running header or footer. |
Running H/F 5 through H/F 12 |
Paragraph text as defined by the paratag part of the definition. For example, see Creating a dictionary-style header or footer |
You can use the Running H/F variables (4, 5, and 13 through 18) to add marker text to a running header or footer. Use these variables to display text in a header or footer that is not available in the content or in a system variable.
Go to the body pages of a document (View > Body Pages>).
Place the insertion point at any location in the document and open the Marker dialog (Insert > Marker).
In the Maker Type pop-up list, choose Header/Footer $1.
In the Marker Text box, enter the text to display in the header or footer.
Open the master pages of the document (View > Master Pages) and insert the Running H/F 3 variable in the header or footer.
Similarly, use the Running H/F 4 and H/F 13 through H/F 18 with the corresponding Header/Footer $2 through Header/Footer $8 marker type to add additional marker text to a running header or footer.
The term displayed in the header or footer of an odd numbered page of a dictionary is the first term described on the odd number page. Similarly, the term displayed in the header or footer of an even number page is the last term described on the even number page. To create a dictionary-style header or footer, use one of the paratext (Running H/F 5 through H/F 12) variables:
Open the master page of the document (View > Master Pages) and go to the odd master page.
Select a paratext variable and click Edit in the Variables pod.
In the Add/Edit Variable dialog, edit the definition of the
variable to specify the paragraph tag that is used by the dictionary
terms in the document. For example, edit the definition of Running
H/F 5 to <$paratext[Heading3]>
.
Insert the variable into the odd page header.
Go to the even page header.
In the Add/Edit Variable dialog, edit the definition of the
variable to specify the paragraph tag that is used by the dictionary
terms in the document. For example, edit the definition of Running
H/F 5 to <$paratext[+, Heading3]>
.
The odd page headers of the document display the first paragraph tag defined in the Running H/F variable and the even pages display the last paragraph tag.