FrameMaker 7.0 Tutorial:
Variables and Conditional Text

Developed for advanced documentation students by
David A. McMurrey Jana Owens
Spring 2004
Jacqueline J. Pulido
Fall 2000
Thomas A. Moore
Pam Renwick

For additional study materials, refer to the FrameMaker resource page. Got a question about this tutorial?
Post it in the FrameMaker FAQ


FrameMaker version 9 tutorials are now available.

This tutorial is provided for advanced documentation students on a free, as-is basis, without guarantee of accuracy. If you find any errors or think we should include other tasks, let us know!

This tutorial discusses the following topics:

Subsequent tutorials focus on tags, tables, anchored frames, graphics, templates, master pages, reference pages, cross-references, tables of contents, indexes, book building, conversion techniques, and structured documents. These tutorials provide an overview of each topic discussed. If you required information about advanced FrameMaker topics, refer to the Adobe FrameMaker User Guide or Adobe FrameMaker Classroom in a Book for the current version of FrameMaker.

Note: For the sake of brevity, we use an abbreviated style for menu commands throughout this lesson. For example, "Select File > New" means "Select New from the File menu."

Variables

When documenting new products, variables are essential. The names of these products often change several times and are often not established until weeks before a release. Variables allow you to change product names quickly and consistenly across several documents.

FrameMaker provides a default set of system variables, such as dates and file names, and the ability to create user variables. This section discusses user variables.

Creating a User Variable

The best way to manage user variables is to create them within a template for your documentation library. Each document within your library should be based on this template; for more information about templates, see Templates.

In this exercise, you create a user variable within a template.

  1. Open a new document, and save it as a template:

    1. Open FrameMaker, and select File > New > Document.

    2. From the New dialog box, click Portrait.

    3. Select File > Save.

    4. In the File name box, type template for the template name, and click Save.


    Note: If you are working in the TCM computer lab, save the file to your lab account. If you do not have a lab account, please contact your instructor.

  2. Select Special > Variable.

    The Variable dialog box appears.
    Variable dialog box

    You can use the scroll bar to view the existing variables; these variables are known as system variables.

    Note: System variables can be modified, but they cannot be deleted. Also, you cannot use system variable building blocks in a user variable definition.

  3. In the Variable dialog box, click Create Variable.

    The Edit User Variable dialog box appears.
    Edit User Variable

  4. In the Name box, type FM.

  5. In the Definition box, type FrameMaker.

    Note: Variable names are case-sensitive; FM is not the same as fm.

  6. Click Add to store this variable.

  7. Click Done to close each dialog box.

  8. Save and close your template.

Inserting a User Variable

You can now create a new document from your template and insert the variable:
  1. Select File > New > Document.

  2. In the New dialog box, locate and select the template that you just created (template.fm).

    The file name appears in the Use Template box.


  3. Click New.

  4. Select Special > Variable.

    The Variable dialog box appears.
    Variable dialog box

  5. Within the Variable dialog box, select the variable that you just created, and click Insert.

    Tip: You can also press Ctrl + 0 (zero) to insert a variable. When you press Ctrl + 0, the bottom left side of the FrameMaker status bar becomes highlighted. Press the first letter of the variable to insert. When the variable appears in the bottom left corner, press Enter.

    Status Bar


  6. Select File > Save.

  7. In the File Name box, type variables for the file name, and click Save.

Changing a Variable Definition

To change a variable definition:
  1. Open your template (template.fm).

  2. Select Special > Variable.

  3. In the Variable dialog box, select the FM variable, and click Edit Definition.

  4. In the Definition box, type 7.0, and click Change.

  5. Click Done to close each dialog box.

  6. Click Save File (Save) to save the template.

Importing Variable Definitions

Once you change a variable definition, you must import it into other documents in your library.

To import variable definitions:
  1. Select Window > variables.fm to view your document.

  2. Select File > Import > Formats.

    The Import Formats dialog box appears.


  3. From the Import from Document pull-down menu, select template.fm.

  4. In the Import and Update area, click Deselect All.

  5. Select the Variable Definitions check box, and click Import.

    Tip: You can import individual elements by selecting the appropriate check box within the Import and Update: area, and clicking Import.

The modified variable is updated within your document. To verify, open the Variable dialog box, and display the variable.

Conditional Text


Conditional text enables you to support two versions of a document using one set of files. For example, if you create a document that supports two versions of the same product, you can apply condition tags to the text that differs between the products. When you release the document, you show or hide the text based on the condition tags.

Creating Condition Tags

This procedure describes how to create your own conditional tags and edit existing tags.

Note: If you are working on a book that consists of several files, you should create condition tags in a template and then import them into each book file.
  1. Open a new document, and select File > Save.

  2. In the File Name box, type conditional, and click Save.

  3. Select Special > Conditional Text.

    The Conditional Text dialog box appears.


  4. In the Conditional Text dialog box, click Edit Condition Tag.

    The Edit Condition Tag dialog box appears.


  5. In the Tag box, type product1.

  6. From the Color pull-down menu, select Blue, and click Set.

  7. In the Conditional Text dialog box, click Edit Condition Tag.

  8. In the Tag box, type product2.

  9. From the Color pull-down menu, select Red, and click Set.

  10. Click X to close the Conditional Text dialog box.

Applying Condition Tags

After you create the condition tags, you must apply them to the text:
  1. Type the following text into your document (or create two lines of text on your own):

    Product 1 has a lifetime warranty.
    Product 2 has a limited warranty.

  2. Select the first line of text.

  3. Select Special > Conditional Text.

  4. In the Conditional Text dialog box, select product1.

  5. Click (left arrow).

    Your settings should look similar to the following.
    Conditional Text

  6. Click Apply.

  7. Repeat the previous steps to apply the product2 condition tag to the second line of text.
The condition tags are applied to the text. You text should look similar to the following.

Showing and Hiding Conditional Text

After you apply the condition tags, you can show or hide the text:
  1. In the Conditional Text dialog box, click Show/Hide.

    The Show/Hide Condition Text dialog box appears.


  2. From the Show: column, select product1, and click (right arrow).
    Show/Hide

  3. Click Set.

    The text for product 1 is hidden. Experiment with conditional text settings; try adding and removing text, spaces, punctuation, and words. Note that when you apply conditional tags to text, it is important to include or exclude spaces, periods, and paragraph symbols to maintain the appropriate formatting whem the text is hidden.

    Tip: Before you release a document that contains conditional text, turn off the conditional text formatting so the text appears normal. To turn off conditional text formatting, uncheck the Show Condition Indicators check box in the Show/Hide Condtional Text dialog box, and then click Set.

Autonumbers

FrameMaker allows you to automate all numbering streams within a document, including multi-file documents such as books. Numbering streams are used with page numbers, chapter and section numbers, figure and table numbers, and numbered lists. You apply numbering streams using autonumber formats.

In this exercise, you create autonumbers for sections, subheadings, figures, tables, and chapters.

An additional resource on FrameMaker autonumbers.

Creating Autonumbers for Sections

To add autonumbers for sections:
  1. Open a new document, and select File > Save.

  2. In the File Name: box, type autonumber, and click Save.

  3. In the document window, type Installing the SuperWidget, and apply the Heading1 paragraph format.

  4. With your cursor within the Heading1 paragraph, open the Paragraph Designer (Ctrl + M).

  5. In the Paragraph Tag: box, type SectionHeading1, and press Enter.

  6. In the New Format dialog box, click Create. (Make sure the Store in Catalog and Apply to Selection options are selected.)

  7. In the Paragraph Designer, select the Numbering tab.

  8. In the Autonumber Format: box, type Section <n+>.<n=0>< > . (Include a space at the end of the text.)

    Autonumbering box

    Note: Autonumber formats are created using building blocks. The building block, n+, is an autonumber counter. This counter adds 1 to the value of n. In this case, because it is the beginning of the file, n is zero. To begin the autonumber stream from a number other than 1, you can set n equal to that number; for example, <n=5>. You can view other building blocks within the Numbering tab of the Paragraph Designer.


  9. Click Update All.

    Your text should look similar to the following.
    Header

  10. Place your cursor at the end of this paragraph, and press Enter.

  11. Type Configuring the SuperWidget, and apply the SectionHeading1 paragraph tag.

Creating Autonumbers for Subheadings

To create autonumbers for subheadings:
  1. Create a new body paragraph beneath the Installing the SuperWidget heading, and type Set Up and Installation.

  2. Press Enter, and type Troubleshooting.

  3. Place your cursor in the first subheading, and apply the Heading2 paragraph format.

  4. With you cursor in the Heading2 paragraph, open the Paragraph Designer, and create a new paragraph tag named SectionHeading2 using the procedure you learned in the previous section.

  5. In the Paragraph Designer, select the Numbering tab.

  6. In the Autonumbering Format: box, type <n>.<n+>< > . (Include a space at the end of the text.)

  7. Click Update All.

  8. Apply the SectionHeading2 paragraph format to the Troubleshooting subheading.

  9. Beneath the Configuring the SuperWidget heading, type the following text:

    Windows 2000 Configuration
    Windows 95/98 Configuration

  10. Apply the SectionHeading2 paragraph format.

    Your text should look similar to the following.


Creating Autonumbers for Figures

To create autonumbers for figures:
  1. Below subsection 1.1, create a new body paragraph, and type Layout of a Basic SuperWidget.

  2. In the Paragraph Designer, create a new paragraph tag named FigureHeading, and then select the Numbering tab.

  3. In the Autonumbering Format: box, type Figure <n>< >.<n+> . (Include a space at the end of the text.)

  4. Click Update All.

  5. Type at least two paragraphs under each subsections, and apply the FigureHeading paragraph tag to each line.

    Your text should look similar to the following.


Notice that the figure headings correctly increment the section number, but the figure numbers continue sequentially from the figure numbers in Section 1. To fix this problem, you must restart the numbering for the figure number. Open the Paragraph Designer, and within the Numbering tab, change the autonumbering value for SectionHeading1 to Section <n+>.<n=0>< =0> , and click Update All. The tag < =0> tells FrameMaker to make the figure number value zero, but do not display it.

Creating Autonumbers for Tables

To create autonumbers for tables:
  1. Create a new body paragraph within Section 1.

  2. In the Paragraph Designer, create a new paragraph tag named TableHeading, and select the Numbering tab.

  3. In the Autonumbering Format: box, type T:Table <n+> . (Include a space at the end of the text.)

  4. Click Update All.

  5. Within sections 1 and 2, create several paragraphs, and apply the TableHeading paragraph format to each paragraph.

    Your text should look similar to the following.



Notice that the TableHeading format uses a numbering system that is different from the section and subsection numbers. This alternate numbering system is created using a series label; in this exercise, the series label is T:. For more information about series labels, refer to Framemaker Online Help.

Creating Autonumbers for Chapters

To create autonumbers for chapters:
  1. Open a new document, and select File > Save.

  2. In the File Name: box, type chapter, and click Save.

  3. In the document window, type SuperWidget Installation Procedures, and apply the Title paragraph format.

  4. In the Paragraph Designer dialog box, create a new paragraph tag named Chapter, and select the Numbering tab.

  5. In the Autonumber Format: box, type Chapter <$chapnum>: . (Include a space at the end of the text).

    Notice that <$chapnum> is used instead of a series label. The <$chapnum> building block keeps your chapter numbers accurate and up-to-date. You can reorder, add, and delete documents without having to manually update the chapter numbers.

  6. Click Update All.

    Your text should look similar to the following.

    Chapter tag
Note: If you add this document to a book that includes other chapters. The chapter number increments according to the numbering properties for that file.

The following table provides autonumber formats for chapter-based numbering.
Example Tag Autonumber Format
Chapter 3: Chapter Chapter <$chapnum>: \t
Section 3.1 Head1 M:Section <$chapnum>.<n+>< =0> \t
Section 3.1.1 Head2 M:Section <$chapnum>.<n>.<n+> \t
Figure 3-1 Figure F:Figure <$chapnum>-<n+> \t
Table 3-1 Table T:Table <$chapnum>-<n+> \t


Experiment with the autonumbering formats in the previous table, and create your own formats using the building blocks in the Paragraph Designer.

This tutorial introduced you to some useful features: variables, conditional text, and autonumbers. By incorporating these features into your documents, you can create and edit documents more efficiently and effectively.


Home Previous Next

Information and programs provided by hcexres@prismnet.com.