FrameMaker 7.0 Tutorial:
Variables and Conditional Text
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."
|
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.
- Open a new document, and save it as a template:
- Open FrameMaker, and select File > New > Document.
- From the New dialog box, click Portrait.
- Select File > Save.
- 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. |
- Select Special > Variable.
The Variable dialog box appears.

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. |
- In the Variable dialog box, click Create Variable.
The Edit User Variable dialog box appears.

- In the Name box, type FM.
- In the Definition box, type FrameMaker.
|
Note: Variable names are case-sensitive; FM
is not the same as fm. |
- Click Add to store this variable.
- Click Done to close each dialog box.
- Save and close your template.
Inserting a User Variable
You can now create a new document from your template and insert the variable:
- Select File > New > Document.
- 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.
- Click New.
- Select Special > Variable.
The Variable dialog box appears.

- 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.
|
- Select File > Save.
- In the File Name box, type variables for the file name, and click
Save.
Changing a Variable Definition
To change a variable definition:
- Open your template (template.fm).
- Select Special > Variable.
- In the Variable dialog box, select the FM variable, and click Edit
Definition.
- In the Definition box, type 7.0, and click Change.
- Click Done to close each dialog box.
- Click
(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:
- Select Window > variables.fm to view your document.
- Select File > Import > Formats.
The Import Formats dialog box appears.
- From the Import from Document pull-down menu, select template.fm.
- In the Import and Update area, click Deselect All.
- 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 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. |
- Open a new document, and select File > Save.
- In the File Name box, type conditional, and click Save.
- Select Special > Conditional Text.
The Conditional Text dialog box appears.
- In the Conditional Text dialog box, click Edit Condition Tag.
The Edit Condition Tag dialog box appears.
- In the Tag box, type product1.
- From the Color pull-down menu, select Blue, and click Set.
- In the Conditional Text dialog box, click Edit Condition Tag.
- In the Tag box, type product2.
- From the Color pull-down menu, select Red, and click Set.
- Click
to close the Conditional Text dialog box.
Applying Condition Tags
After you create the condition tags, you must apply them to the text:
- 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.
- Select the first line of text.
- Select Special > Conditional Text.
- In the Conditional Text dialog box, select product1.
- Click
(left arrow).
Your settings should look similar to the following.
- Click Apply.
- 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:
- In the Conditional Text dialog box, click Show/Hide.
The Show/Hide Condition Text dialog box appears.
- From the Show: column, select product1, and click
(right arrow).
- 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. |
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.
To add autonumbers for sections:
- Open a new document, and select File > Save.
- In the File Name: box, type autonumber, and click Save.
- In the document window, type Installing the SuperWidget, and apply
the Heading1 paragraph format.
- With your cursor within the Heading1 paragraph, open the Paragraph
Designer (Ctrl + M).
- In the Paragraph Tag: box, type SectionHeading1, and press Enter.
- In the New Format dialog box, click Create. (Make sure the Store in Catalog
and Apply to Selection options are selected.)
- In the Paragraph Designer, select the Numbering tab.
- In the Autonumber Format: box, type Section <n+>.<n=0><
> . (Include a space at the end of the text.)

|
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. |
- Click Update All.
Your text should look similar to the following.

- Place your cursor at the end of this paragraph, and press Enter.
- Type Configuring the SuperWidget, and apply the SectionHeading1
paragraph tag.
To create autonumbers for subheadings:
- Create a new body paragraph beneath the Installing the SuperWidget heading,
and type Set Up and Installation.
- Press Enter, and type Troubleshooting.
- Place your cursor in the first subheading, and apply the Heading2
paragraph format.
- 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.
- In the Paragraph Designer, select the Numbering tab.
- In the Autonumbering Format: box, type <n>.<n+>< >
. (Include a space at the end of the text.)
- Click Update All.
- Apply the SectionHeading2 paragraph format to the Troubleshooting subheading.
- Beneath the Configuring the SuperWidget heading, type the following text:
Windows 2000 Configuration
Windows 95/98 Configuration
- Apply the SectionHeading2 paragraph format.
Your text should look similar to the following.

To create autonumbers for figures:
- Below subsection 1.1, create a new body paragraph, and type Layout of
a Basic SuperWidget.
- In the Paragraph Designer, create a new paragraph tag named FigureHeading,
and then select the Numbering tab.
- In the Autonumbering Format: box, type Figure <n>< >.<n+>
. (Include a space at the end of the text.)
- Click Update All.
- 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.
To create autonumbers for tables:
- Create a new body paragraph within Section 1.
- In the Paragraph Designer, create a new paragraph tag named TableHeading,
and select the Numbering tab.
- In the Autonumbering Format: box, type T:Table <n+> . (Include
a space at the end of the text.)
- Click Update All.
- 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.
To create autonumbers for chapters:
- Open a new document, and select File > Save.
- In the File Name: box, type chapter, and click Save.
- In the document window, type SuperWidget Installation Procedures,
and apply the Title paragraph format.
- In the Paragraph Designer dialog box, create a new paragraph tag named Chapter,
and select the Numbering tab.
- 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.
- Click Update All.
Your text should look similar to the following.

|
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.
Information and programs provided by hcexres@io.com.