To add a variable to a page, you must fi rst defi ne the variable. InDesign has nine diff erent variable types, but this section exclusively discusses the two style-related variables: Running Header (Character Style) and Running Header (Paragraph Style). As their names suggest, the former is generated from text to which a particular character style is applied, and the latter is generated from text styled by a paragraph style.
Continuing with the example in Figures 9.9 through 9.12, here are the steps for creating the dictionary’s left page running header:
1. From the Type menu, choose Text Variables > Defi ne to access the Text Variables dialog (FIGURE 9.13).
2. Click the New button to access the New Text Variable dialog.
3. Choose Running Header (Character Style) from the Type pull-down menu. Th e dialog changes to refl ect options specifi c to this kind of vari-able (FIGURE 9.14).
FIGURE 9.13 Text variables are added to or removed from a document from the Text Variables dialog.
NOTE
The Running Header (Character Style) variable will only find a character style that has been applied manually or is part of a standard nested style. It will not detect character styles that are part of a nested line style, GREP style, or any character style used to style the numbers in a numbered list.
ADOBE INDESIGN CS4 STYLES How to Create Better, Faster Text and Layouts 187
4. Select the character style to be used by the variable from the Style menu, which includes all available character styles in the document. You can also create a new character style by choosing New Character Style at the bottom of the list.
5. From the Use menu, select either First on Page or Last on Page (FIGURE 9.15).
For this example, First on Page is the appropriate option for the header on the left page.
6. To wrap “static” text around the variable, enter text in the Text Before or Text After fi elds; each of which has a pull-down menu of special charac-ters available to it. Th is is similar to how specifi c text is included before the number in a numbered list (see Chapter 7, “Drop Caps, Bullets, and Numbering”). In this example, neither is necessary.
FIGURE 9.14 Option for a Running Header (Character Style) variable.
FIGURE 9.15 Select which instance of the character style to assign to the variable.
Suppressing Static Text
It’s best to include any static text within the variable rather than typing it outside of the variable placeholder as “live” text in the header. Let’s assume your variable is tied to a subtopic paragraph style and the header follows the format “Chapter Name: <Subtopic>.” You’ll want to build the colon and the space that follow the chapter name into the Text Before field of the variable.
That way, if no subtopic style is used (and therefore no variable is gener-ated), there won’t be a trailing colon after “Chapter Name” on any page header. If a variable is not generated on a given page, neither is any static text in the Text Before and Text After fields.
7. In the Options area, fi ne-tune the presentation of your running header in two additional ways:
• Delete End Punctuation. You can delete any ending punctuation in the text to which the selected character style is applied by selecting Delete End Punctuation (FIGURE 9.16). In this dictionary example, each defi ni-tion term is followed by a period, which also has the “Term” character style applied to it. With Delete End Punctuation selected, that period does not get included in the header.
• Change Case. Optionally, you can choose Change Case to change the case in which the variable presents the text. Th is is not the same as choosing between normal and all caps as a character-level formatting option, which can’t lowercase text that’s specifi cally typed as upper-case. Th e options here actually change the case of the text regardless of how it’s typed. Text Variables is the only InDesign feature that supports these case-changing options in a dynamic way.
8. Name the style, click OK in the New Text Variable dialog to close it, and then click Done in the Text Variables dialog.
Th e right header variable would be created in the same way except you would choose Last on Page in step 5 instead of First on Page.
FIGURE 9.16 Punctuation and case-changing options.
ADOBE INDESIGN CS4 STYLES How to Create Better, Faster Text and Layouts 189
Beware of Long Variables
The dictionary example uses a running header variable driven by a charac-ter style, but the same principles and behavior apply to a running header variable driven by a paragraph style. In that instance, the text of the entire paragraph would populate the variable. This brings up an important caution about text variables in general: The text that populates a variable will never wrap onto another line (or lines). Whatever text is collected by the variable is considered a single, nonbreaking entity. Therefore, the text frame into which you’ve inserted a variable placeholder must be large enough to fit the largest possible amount of text it may find on a single line. When a vari-able’s text exceeds that length, it won’t create overset text. Instead, the text will be jammed together into a sequence of overlapping characters to force all the text onto a single line in the text frame containing the variable.
For this reason, the Running Header (Paragraph Style) variable typically calls on styles for category headings and section breaks, not body text.