Variables

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.

System variables

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.

User variables

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:

Variables pod
Variables pod in FrameMaker

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:

  1. Hover the mouse between two columns until the cursor is a bi-directional arrow.

  2. Hold down the left mouse button, drag, and release the mouse button when the column is sized as required.

Use the Variables pod to:

A (red icon)

The red icon indicates a system variable.

B (blue icon)

The blue icon indicates a user variable.

C (Search text):

Search for a variable in the list. The SAYT (search as you type) functionality works on all the columns in the variable list.

D (Create New user Variable):

Open the Add Variable dialog to create a user variable. See Creating user variables.

E (Edit):

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.

F (Delete user variable):

Delete a selected user variable. See To delete a user variable.

Note: You cannot delete a system variable.
G (Insert):

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.

H (Update System Variables):

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.

I (Convert to Text):

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.

J (Select):

Select from the list of open documents to display the variables available in that document.

Important: You can use variables at a document level. This implies that variables available in one document can be used in that document. However, you can import variables from one document to another. For details, see Importing variables from one document to another.
K (Refresh):

Refresh the list of available variables.

Insert 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.

To insert a variable in a document

  1. Place the insertion point at the point in the document to insert the variable.

    Note: The Variables pod displays only the variables that are relevant to the position in the document of the current insertion point. For example, the Running H/F variables are displayed in the pod only if the master page of a document is in focus.
  2. To insert the variable at the insertion point, select the variable in the pod and click Insert or double-click the variable.

How variables display in a document

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

Inserting variables into structured documents

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.

fm.lmdate; variable and corresponding entity element
Inserting variables into structured documents

Manage variables

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:

Creating user variables

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.

To create a user variable:

  1. In the Variables pod, click Create New User Variable.

    The Add/Edit Variable dialog is displayed.

    Add Variable dialogAdd Variable dialog in FrameMaker
  2. Enter a name for the variable: product_name.

    Important: If you enter name that is used by an existing variable (system or user), the definition of the existing variable is overwritten.
  3. 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:

    1. Click a character format in the list.

      The character format is added to the variable definition.

    2. 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
  4. To create the variable, click Add.

After you create a user variable, you can insert the variable into your document. See Insert variables.

Editing user and system 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.

To edit a variable

  1. Select the variable in the Variables pod and click Edit.

    The variable editing dialog is displayed.

    Add/Edit Variable dialogEdit Variable dialog in FrameMaker
  2. 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.

    Note: You cannot change the name of a system variable.
  3. To save the update to the variable, click Edit.

Note: When you edit a user variable, the Add/Edit Variable dialog displays the Edit button. If you change the name of the user variable and click Edit, the old variable’s name is changed. However, since you cannot change the name of system variables, the Edit button only updates the variable definition.

Deleting variables in a document

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.

To delete a user variable

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.

  1. Select the user variable in the Variables pod and click Delete.

    Note: If you select a system variable, the Delete button is disabled.
  2. 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.

To delete a variable occurrence

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.

  1. Open the Find/Change dialog.

  2. In the Find list, select Variable - of Name and enter full or partial name of the variable you want to remove from your document.

  3. Click Find to locate the variable in the document.

  4. 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.

Converting variables to text

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.

  1. In the Variables pod, click Convert to Text.

    The Convert Variables to Text dialog displays.

    Convert Variables to Text dialog
    Convert Variables to Text dialog in FrameMaker

  2. You can choose to convert:

    Selected Variable:

    All occurrences of the variable selected in the Variables pod.

    Variable Named:

    All occurrences of the variable selected in the variable list.

    Variables with Element Tag

    All occurrences of an element tag assigned to a variable.

    All Variables

    All occurrences of all variables in the document.

  3. Click Convert.

Importing variables from one document to another

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.

To import variable from one document to another

  1. 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.

  2. From the File menu, choose Import > Formats.

  3. In the Import Formats dialog, click Deselect All, check Variable Definitions, and click Import.

Important: If the destination documents contain user variables with the same names as the source document, the user variable definitions are overwritten. Also, if the definitions of system variables in the source document are updated, the definitions of the corresponding variables in the destination documents are overwritten.

Add variables to headers and footers

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:

Running H/F variables in FrameMaker

The following table describes the default Running H/F variables available in a (new) blank document in FrameMaker:

Important: You can modify the default definition of all Running H/F variables as per your project’s requirements. For example, you can create a Running H/F variable that contains fixed text, one or more building blocks, and character formatting.
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

Using markers to display text in a running 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.

  1. Go to the body pages of a document (View > Body Pages>).

  2. Place the insertion point at any location in the document and open the Marker dialog (Insert > Marker).

    Note: The location of the marker in the document is not relevant. For example, you can place all the markers to include header or footer text at one location in the document.
  3. In the Maker Type pop-up list, choose Header/Footer $1.

  4. In the Marker Text box, enter the text to display in the header or footer.

  5. 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.

Creating a dictionary-style 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:

  1. Open the master page of the document (View > Master Pages) and go to the odd master page.

  2. Select a paratext variable and click Edit in the Variables pod.

  3. 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]>.

  4. Insert the variable into the odd page header.

  5. Go to the even page header.

  6. 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]>.

    Important: The plus (+) sign preceding the paragraph tag displays text from the last paragraph with the tag specified in the variable definitions.

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.


April 29, 2020

Legal Notices | Online Privacy Policy