Chapter 21

Working with Automatic Text

In This Chapter

ᮣ Setting up automatic page numbers

ᮣ Working with section markers

ᮣ Setting up text variables

ᮣ Handling conditional text

Akey area of improvement over the years in InDesign is the increased use of automated text. From the very beginning, InDesign offered automatic page numbers so that your folios and cross-references would reflect the current pages as your layout changed. Later versions enhanced this capability with section markers, which let you create variable names in folios for your section titles. Still later came the ability to use data files and merge their contents into a layout to customize your output, similar to how word processors let you customize labels with their mail-merge feature. The newest version of InDesign adds to this mix a new option: variable text, which gives you more flexibility in where and how you can have InDesign update text automatically throughout a document based on your specifications.

Altogether, these features have helped InDesign stake significant ground in reducing the labor and time of manual processes, such as searching and replacing for text that changes predictably throughout the document.

Another type of text variable is the cross-reference, which can insert the page number or other text for you (such as See page 227 or Learn how color works in the “All about Color” chapter). InDesign CS4 now supports such automated cross-references. It also retains those cross-references imported from Word files. Because InDesign’s cross-references capability uses the hyperlinks functionality, I cover this type of automated text in Chapter 24. 30_388488-ch21.indd 329

9/23/08 7:41:34 PM

330 Part VI: Getting Down to Business

Automating Page Numbers

You’ll often want page references in text — the current page number in a folio, for example, or the target page number for a “continued on” reference. You can type a page number manually on each page of a multipage document, but that can get old fast. If you’re working on a multipage document, you should be using master pages (see Chapters 4 and 5). And if you’re using master pages, you should handle page numbers on document pages by placing page-number characters on their master pages.

If you want to add the current page number to a page, you can choose Type➪Insert Special Character➪Markers➪Current Page Number

(Option+Shift+Ô+N or Ctrl+Shift+Alt+N) whenever the Type tool is active and the text-insertion cursor is flashing. If you move the page or the text frame, the page-number character is automatically updated to reflect the new page number.

To create “continued on” and “continued from” lines, choose Type➪Insert Special Character➪Markers➪Next Page Number to have the next

page’s number inserted in your text, or choose Type➪Insert Special Character➪Markers➪Previous Page Number to have the previous page’s number inserted. (There are no shortcuts for these complex menu sequences.) That next or previous page will be the next or previous page in the story, not the next page in the document.

One flaw in InDesign’s continued-line approach is that the text frames must be linked for InDesign to know what the next and previous pages are. Thus, you’re likely to place your continued lines in the middle of your text. But if the text reflows, so do the continued lines. Here’s a way to avoid that problem: Create separate text frames for your continued-on and continued-from text frames. Now link just those two frames, not the story text. This way, the story text can reflow as needed without affecting your continued lines. Using Section Markers

InDesign offers another marker called the section marker, which lets you insert specific text into your document and update it by just changing the marker text.

The section marker is defined as part of a section start (see Chapter 4), and it’s meant to be used in folios to put in the section name or chapter name. But you can use it anywhere you want — and for anything you want, not just for section or chapter labels.

Chapter 21: Working with Automatic Text

331

To define a section marker (you can have only one per section, of course), open the Pages panel (Window➪Pages, [Ô+F12 or Ctrl+F12]) and choose Numbering & Section Options from the panel’s flyout menu. In the resulting dialog box, type a text string in the Section Marker field. Then click OK. To use the marker, have the text insertion point active in whatever text frame you want to insert it and then choose Type➪Insert Special Character➪Markers➪Section Marker. That’s it!

Using Text Variables

With InDesign text variables, you can define an unlimited number of text variables that InDesign will happily update across your documents whenever you change them or your layout does.

To create a text variable, choose Type➪Text Variables➪Define. You see get the Text Variables dialog box, shown in Figure 21-1. It lists existing text variables — including the eight predefined ones in InDesign: Chapter Number, Creation Date, File Name, Last Page Number, Modification Date, Output Date, and the two types of Running Header. Any of them that you create are added to this list.

The source of the number used in the Chapter Number text variable is something you define as part of a book. Chapter 22 explains books and how to set the chapter number.

To create a new text variable, click New. The New Text Variable dialog box appears, as shown in Figure 21-1. Give the variable a name in the Name field, and choose the type of variable you want from the Type pop-up menu. Your choices are the seven predefined types plus Custom Text, which lets you put in any text of your choosing. (This means you can create more than one variable for, say, File Name or Modification Date. You might do this because you want them formatted differently in different usage scenarios.) The options for formatting the chosen type of variable varies based on the type of variable it is. Three options are available for more than one type of text variable:

ߜ

Text Before and Text After: These two fields — available for all Type pop-up menu options except Custom Text — let you add any text you want before or after the variable. For example, you might enter the word Chapter in the Text Before field for a Chapter Number variable. Note that both fields have an unnamed pop-up menu to their right from which you can select a variety of common symbols and spaces.

332 Part VI: Getting Down to Business

ߜ

Style: This pop-up menu lets you select the style to apply in the Chapter Number, Running Header (Character Style), and Running Header

(Paragraph Style) text variables.

ߜ

Date Format: This field and its associated pop-up menu lets you choose the desired date and time formats for the Creation Date, Modification Date, and Output Date text variables. Examples include MM/dd/yy to get a date like 05/08/62 and MMMM d, yyyy to get a date like August 15, 1962. Don’t worry about memorizing codes — just pick the desired options from the pop-up menu instead.

Several other variables have unique options:

ߜ

Custom Text: This variable has the fewest options. Just enter the desired text, including choosing special characters, such as spaces and dashes, from the unnamed pop-up menu to the right of the Text field. That’s the only field to adjust for this text variable.

ߜ

Last Page Number: In addition to the Text Before, Text After, and Style formatting controls, this type includes one unique control: the Scope pop-up menu. Here, you choose between Section and Document to tell InDesign what you mean by last page number: the section’s last page or the document’s.

ߜ

File Name: In addition to Text Before and Text After formatting controls, this type has two unique check boxes — Include Entire Folder Path and Include File Extension — to tell InDesign exactly how much of the filename to include. If both are unchecked, InDesign includes just the core filename, such as Jun 07 TOC. Checking the Include Entire Folder Path adds the file location before the core filename, such as MacintoshHD:Projects:Jun 07 TOC or C:\Projects\Jun 07

TOC. Checking the Include File Extension appends the filename

extension, such as June 07 TOC.indd.

ߜ

Running Header: The formatting options for these two types —

Paragraph Style and Character Style — are the most complex, as shown in Figure 21-1. The two Running Header menu options have two options not available to other Type pop-up menu options:

Use: This option determines which text to use: First on Page uses the first text on the page that has the specific style applied, while Last on Page uses the last text on the page that has the specific style applied.

Options: Here, you can control whether the punctuation of the source text is retained in the running header (check Delete End Punctuation to remove it) and whether the running header overrides the text of the source text’s capitalization (check Change Case and then choose the appropriate capitalization option: Upper Case, Lower Case, Title Case, or Sentence Case).

Chapter 21: Working with Automatic Text

333

Title case means that the first letter of each word is capitalized, while Sentence Case means that only the first letter of the first word in each sentence is capitalized.

Figure 21-1:

At left:

the Text

Variables

dialog box.

At right: the

New Text

Variable

dialog box.

Editing and managing text variables

Editing text variables is very much like creating them: Just select the variable to change and click Edit in the Text Variables dialog box. You get the Edit Text Variable dialog box, which is identical (except for its name) to the New Text Variable dialog box covered in the previous section.

You can also import text variables from other documents by clicking Load in the Text Variables dialog box and then choosing the document to import the variables from. After choosing a document, you get the Load Text Variables dialog box, where you can select which variables are imported and handle name conflicts.

To get rid of a text variable, select it from the list in the Text Variables dialog box and click Delete.

To convert a text variable in your document to the actual text, highlight it and either choose Type➪Text Variables➪Convert Variable to Text or, if you happen to be in the Text Variables dialog box, click Convert to Text. 334 Part VI: Getting Down to Business

Inserting text variables

Inserting text variables in your document uses the same essential process as inserting a special character such as a section marker, except you use the Text Variables menu option: Choose Type➪Text Variables➪Insert Variable and then choose the desired variable from the submenu. If you happen to be in the Text Variables dialog box, click Insert.

Using Conditional Text

Have you ever worked on a document that has variations, forcing you to create separate copies that you must then ensure have any changes applied to all copies? Perhaps you used the layers feature (see Chapter 5) to restrict the unique content to its own layer so that you could make visible each version’s layer when you wanted to print that specific version. But you realized this technique doesn’t work well for text inside paragraphs, because changes to the text mean whatever you placed in layers won’t be at the right location if your text changes move the text’s locations in the “main” layer.

InDesign CS4 offers a new way to have multiple versions of text in a document that gets around these issues: conditional text. You can think of conditional text as sort of a layer that works within text, so if the text moves, the conditional “layers” do, too.

For example, say you have a publication that is distributed in Canada, Ireland, and the U.K., where pricing is different (dollars, euros, and pounds, respectively). You can’t really duplicate the main “dollars” layer and duplicate all the text in it for the “euros” and “pounds” layers. Why? The reason is that if you changed the text in the main layer that includes the dollar prices, the pounds and euros layers would have the old text and need to be changed also (a management nightmare). You may think that you can avoid this problem by having a main layer for the text, and then separate layers for the dollar, euro, and pound pricing. Unless your pricing wouldn’t move ever (such as if it’s in an independent table), if the main text is edited and reflows, those text frames would get out of place — an even worse situation. With conditional text, you instead have just one layer for your text, and where the text may need to change (such as for pricing), you insert conditional text. Then, if you want to display the price in dollars, you enable the dollars condition, and the right text appears, no matter how the text is flowing. When you want to display the price in euros, you enable the euros condition. Ditto for pounds.

30_388488-ch21.indd 334

9/23/08 7:41:34 PM

Chapter 21: Working with Automatic Text

335

Here’s how it works:

1. In your text, enter each of the text variations you want.

For example, as you can see in Figure 21-2, if you have three prices, enter all three in sequence as if they were one piece of text. Apply any formatting desired. Don’t worry for the moment that you don’t want them all to display or print at the same time.

Figure 21-2:

The

Conditional

Text panel

and its New

Condition

dialog box.

Above them

is the text to

which the

conditions

are applied

(the three

prices).

2. Open the Conditional Text panel (WindowType & Tables

Conditional Text) and choose New Condition from the flyout menu.

3. In the New Conditions dialog box, give the condition a name and determine how you want it to be highlighted (using the Appearance, Method, and Color pop-up menus) in the layout, as shown in

Figure 21-2.

Your highlighting options are Underline and Highlight (which puts a colored background behind conditional text), either of which you can apply a color to. If you choose Underline, you can select a line type in the Appearance pop-up menu. (It’s unavailable if you choose Highlight.) This highlighting doesn’t print; it’s just lets you know in InDesign where and what conditions are applied to text.

You can modify conditions later by choosing Condition Options from the Conditional Text panel’s flyout menu. The dialog box is identical to the New Conditions dialog box.

336 Part VI: Getting Down to Business

4. In the text, highlight a piece of text (such as the euro price) and then click the related condition to apply that condition to the selected text.

A check mark appears to the immediate left of the active condition for whatever text is selected or in which your text cursor is active. In your layout, the text also has whatever line type in whatever color you specified in the New Conditions dialog box so that you have a visual guide as to what conditions are applied to what text.

Add as many conditions using Steps 3 and 4 as you need. The figure’s example has three: one for each price. (Note that the [Unconditional]

condition is just your regular text, which always displays and prints.)

5. Now, click the squares in the Conditional Text panels to the far left of the various conditions.

If the square shows an eye, any text tagged with that condition is visible. If the square is empty, any text tagged with that condition isn’t displayed. By controlling which conditions are active (eye icons), you determine what displays and prints in your document. (This process is exactly how you make layers visible and invisible in the Layers panel, as Chapter 5 explains.) Figure 21-3 shows the same text as in Figure 21-2, but with just the [Unconditional] and the euros text visible.

Pretty easy, isn’t it? Just turn off and on the text you want to display and print by hiding and showing the appropriate conditions.

Figure 21-3:

The same

text as in

Figure 21-2,

but with

the dollars

and pounds

conditions

turned

off in the

Conditional

Text panel

so that only

the euro

pricing

displays and

prints.