Choose Define from the Text Variables submenu of the Type menu.. Choose Define from the Text Variables submenu of the Type menu.. Choose Define from the Text Variables submenu of the Typ
Trang 1Category Type Placeholder Example
* Simply enters “AM” or “PM,” does not provide for other capitalization, punctuation, or formatting options
** On the Mac OS, “(CA)” is appended to this example We don’t know why,
as there are plenty of people who live in this time zone who do not live in California It’s vaguely offensive
*** Simply enters “AD” or, we assume, “BC.” Does not provide for other capitalization, punctuation (e.g., “A.D.”), or alternative formats (e.g., “CE”
or “BCE”) If your system clock is entering dates from an earlier or later era, there’s probably something wrong
Table 3-4 Date Format Shortcuts
Trang 2Figure 3-32 Inserting a Text Variable
Select a text variable from the Insert Variable submenu of
the Context menu.
InDesign inserts a text variable instance in the text.
4 Select a text variable type from the Type pop-up menu The dialog fills in with the options for that variable type
5 Make changes to the options shown in the dialog box to define your new text variable When the settings look the way you want them to, click the OK button to close the dialog box and return
to the Text Variables dialog box
6 Click the Done button to close the Text Variables dialog box
Text variables are stored within the current file If you want to create a text variable that is available in all new documents, define
it when no documents are open When you do this, the variable will appear in each new document you open
You can change the definition of a text variable at any time When you edit a text variable, all of the text variable instances of that vari-able will update to reflect the changes you’ve made If your variable instances are inside paragraphs, be prepared for text to reflow and line endings of composed text to change when you edit a variable
To change the definition of a text variable, follow these steps
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Select a text variable and click the Edit button InDesign opens the Edit Text Variable dialog box
3 Make changes in the Edit Text Variable dialog box When the settings look the way you want them to, click the OK button to close the dialog box and return to the Text Variables dialog box
Editing a Text Variable
Trang 3Figure 3-33 Creating a Text Variable
Choose Define from the
Text Variables submenu
of the Type menu.
InDesign displays the Text Variables dialog box
Click the New button.
Select the type of text variable you want from the Type pop-up menu.
After you select a text variable type, the dialog box fills in with the default settings for that type of variable.
Define the text variable by entering text or
making selections from pop-up menus.
As you edit the text variable, InDesign displays a preview of the variable at the bottom of the dialog box.
4 Click the Done button to close the Text Variables dialog box
At this juncture, we are obligated to point out that you can modify any of the built-in text variable instances You could, for example, change the Chapter Number instance to enter the creation date, as Ole accidentally did when he first tried to create a new text variable
We urge you not to do this
Trang 4To load text variables from another document, follow these steps (see Figure 3-34).
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Click the Load button in the Text Variables dialog box InDesign displays the Open A File dialog box
3 Locate and select an InDesign document, then click the Open button InDesign imports the text variables from the selected document into the current document
4 InDesign will display the Load Text Variables dialog box, which shows a list of the incoming text variables If the document you’ve selected contains text variables with the same name as text variables in the current document, you can choose whether
to override the definitions of the existing text variables or to leave then unchanged (by renaming the incoming variable)
Click the OK button once you’ve finished, and InDesign will import the text variables from the selected document
As usual, if the definition of any text variable used in your text has changed, check for text reflow
To delete a text variable, follow these steps (see Figure 3-35) Note that you can use this process to merge two text variables
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Select the text variable you want to delete and click the Delete button If the variable has been used in the document, InDesign displays the Delete Text Variables dialog box
3 If you want to replace the text variable with another text able, select the replacement variable from the Existing Variable pop-up menu To convert all instances of the text variable to text, select the Text option To delete all of the text variable instances linked to the selected text variable, select the Nothing option
vari-4 Click OK to close the dialog box InDesign applies the changes you’ve specified
You can delete an individual text variable instance as you would delete any other text: Select it and press Delete
Loading Text Variables
Deleting a Text Variable
Trang 5Figure 3-34 Loading Text Variables Choose Define from the Text Vari- ables submenu of the Type menu
InDesign displays the Text Variables dialog box.
Click the Load button.
Locate and select the file containing the text variables you want to load.
InDesign displays a list of the text variables
in the file To keep a text variable from being
loaded, turn off (uncheck) the option.
If there are text variables in the selected
document whose names match the names
of text variables in the current document,
InDesign shows that there is a conflict.
Use the pop-up menu to specify the way you want InDesign to
resolve the conflict.
After you click OK, InDesign loads the text variables into the current document.
Trang 6Figure 3-35 Deleting a Text Variable Choose Define from the Text Variables submenu of the Type
menu InDesign displays the Text Variables dialog box.
If the text variable has not been used
in the document, InDesign deletes the variable, and you’re done.
If the text variable has been used in the document, InDesign displays the Delete Text Variables dialog box, which lets you choose what to do with the text variable’s instances.
Click the Delete button.
You can, at any time, convert text variable instances to normal text,
in effect “freezing” them in their current state Of course, if the able instance is inside a paragraph, this will often cause text to reflow,
vari-as InDesign is now free to apply its normal text composition rules
to the text of the variable You can choose to convert individual text variable instances to text, or you can convert all of the text variable instances associated with a text variable to text
To convert an individual text variable instance to text, follow these steps (see Figure 3-36)
1 Select the text variable instance with the Type tool
2 Choose Convert Variable to Text from the Context menu (or from the Text Variables submenu of the Type menu) InDesign converts the text variable instance to normal text
Converting Text Variable Instances
to Text
Figure 3-36 Converting a Text Variable Instance to
tool, then Choose Convert Variable to Text
from the Context menu.
InDesign converts the text variable instance to normal text This will almost certainly cause text recomposition.
Trang 7To convert all instances of a text variable to text, follow these steps Note that this does not delete the text variable itself.
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Select a text variable and click the Convert to Text button
InDesign converts all instances of the text variable to text
3 Click OK to close the Text Variables dialog box
Again, we have to point out that this may cause text recomposition and reflow Make certain that the line breaks in the document are where they should be after converting the text variable
You can also use find and change to work with text variable instances—see the section on finding and changing text, later in this chapter, for more information
In the following sections, we’ll present a series of “recipes” that show you how to use text variables for a variety of common page layout tasks
Creating a Time and Date Stamp We often like to enter the date and
time a file was printed, but we can’t always use the built-in time and date stamp from the Print dialog (because the page size is the same
as the printer paper size) In the past, Ole has created custom er’s marks files that move the page information up onto the page, but text variables have rendered that bit of esoteric knowledge obsolete Note, however, that if you plan to omit the time and date stamp from your final printed version, you’ll need to make arrangements to sup-press the printing of the text variables (such as moving them to a non-printing layer)
print-To create a text variable that will print the time and date a file was printed, follow these steps
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Click the New button
3 Enter a name for the variable and choose Output Date from the Type pop-up menu
4 Enter the placeholders and any punctuation or spacing for the date format in the Date Format Field We use “EEEE, d MMMM, yyyy h:mm a zzzz”—not only does it print the date and time in a civilized format, but it’s fun to say aloud
Text Variable Examples
Trang 85 Click OK to close the dialog box, then click Done to close the Text Variables dialog box.
Simple Custom Text Many people, on first hearing about custom
text variables, immediately think that they’d be a good way to enter commonly-used text Don’t do that There are many other, better ways to accomplish the same end (for example, you can trick autocorrect into entering text for you, as shown in the section on the autocorrect feature, later in this chapter)
Instead, think of custom text variables as a way to enter short pieces of text which might change before your layout is finished To
do this, follow these steps
1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Click the New button
3 Enter a name for the variable and choose Custom Text from the Type pop-up menu
4 Enter the text you want to have appear when you insert the text variable
5 Click OK to close the dialog box, then click Done to close the Text Variables dialog box
Page X of Y Ever wonder why so many financial and legal
docu-ments use a page numbering scheme that tells you how many pages there are in the document? For some documents, the simple knowl-
edge that there is an end is required to maintain one’s sanity.
If, for whatever reason, you need to extend this sort of ance to the reader, it’s easy to do using text variables Just enter an automatic page number special character, the text “to,” and insert the predefined Last Page Number text variable (see Figure 3-37)
reassur-Why didn’t we enter the “to” as part of the text variable? It’s because we’re following a general rule of keeping text inserted by text variables to a minimum to avoid potential composition prob-lems No, you can’t specify the last page of a multi-document book
Running Headers Many documents feature a layout in which the
text of key paragraphs—usually, headings of a given level—appears
in the header or footer of each page Note that this text could also appear in a footer, in a tab on the side of the page, or, really, anywhere
on the page There’s nothing special about the text variable type that
Trang 9Enter an automatic page number marker and static text (“Page” and “of ’’
in this example).
Use the Context menu
to insert the default Last Page Number text variable.
Figure 3-37 Creating a Page X of Y
vari-1 Choose Define from the Text Variables submenu of the Type menu InDesign displays the Text Variables dialog box
2 Click the New button
3 Enter a name for the variable and choose Running Header (Paragraph Style) or Running Header (Character Style) from the Type pop-up menu
4 Select the style you want to use from the Style pop-up menu
5 Choose Last on Page or First on Page from the Use pop-up menu
6 Set up the controls in the Options section of the dialog box as necessary For example, you’ll almost always want to turn on the Delete End Punctuation option
7 Click OK to close the dialog box, then click Done to close the Text Variables dialog box
8 Insert the text variable in text using the Insert Variable submenu
of the Context menu
Trang 10Figure 3-38 Creating a Running
Header Using Text
Variables
In this example, we created
two text variables using the
Running Header (Paragraph
Style) variable type We
then inserted text variable
instances in text frames on
the master spread.
InDesign uses the text from
the first or last instance of
the specified paragraph style
in the header on each document page.
In some layouts, you might need to create a pair of text variables
In a dictionary-style layout, for example, the left hand page header usually contains the first instance of text in a given style on the page, while the right hand page contains the last instance of the style (see Figure 3-39) If the right hand page is the first page in a section, how-ever, it typically uses the first instance of the specified style (not the last, as would normally be the case for a right hand page) You can change the header of the page manually, or you can create a special master page to accomplish the same task
When a page does not contain text formatted with the specified style, the variable in the header repeats the text from the previous instance of the same text variable However, InDesign will not carry over the last instance of a given style when another instance of the same style appears on the page (see Figure 3-40) If this is the style
of running heading your document calls for, you may have to adjust some pages manually
Phone book Style Running Header Another use for a running
header is to show the range of a certain type of paragraph style on a given page In a telephone directory or dictionary, for example, the
Trang 11Figure 3-39 Dealing with Special Cases in Running Headers
In a spread, the header of this hand page would be correct, as it lists the text of the last heading on the page If it’s the first page in the section, however, it should show the text of the first heading, instead.
right-You can solve this problem
by creating a new master
spread In this master
spread, the right hand page
header is set to show the text
of the first paragraph of a
given style, rather than the
last paragraph of that style.
Apply the master spread to the opening page, and the text of the header will reflect the text of the
correct paragraph.
page headers will show you the alphabetical range of names or topics shown on the page Ole, for example, proudly shares a phone book page containing family names from “Kustyukov” to “Kwok.”
To set up this type of running header, you’ll need to create two text variables: one for the first instance of a given paragraph or char-acter style on a page, another for the last instance of the same style Then you create a page header that contains instances of both text variables, as shown in Figure 3-41
Cross References
Cross references are a type of hyperlink, but we want to make the point that they’re incredibly useful for print publishing, as well We think that they’re most useful for entering text, which is why we’ll talk about them in this chapter, rather than in Chapter 13, “Interac-tive PDF,” where we discuss hyperlinks
Trang 12Figure 3-40 Problems in Running Headers
Figure 3-41 Phonebook Style Running Header
The header on the master page contains two text variables and a page number.
With the help of a nested character style and two additional text variables, you can add a navigational tab on the master spread.
The text variables pick up the first two characters of the first and last appearances of the character style
on the page.
In many designs, the text of
this header should reflect the
text of the previous heading
style, not the text of the first
or last paragraph of that
style on the page We have
not found a way to do this
using text variables.
Cross references give you a way to insert a marker (which Adobe calls the “source cross reference”) in text that refers to another piece
of text (which Adobe calls the “destination text”) We’ll refer to these two things as the “marker” and “destination,” respectively When the destination changes, the marker can change
This is a feature that is particularly dear to our tiny hearts, because it means that we can finally number the figures in this book
Trang 13automatically, rather than doing it manually or relying on a script (which worked, but exhausted authors could not always remember
to run it)
A cross reference is really made up of four parts: the marker and destination we’ve already mentioned, a cross reference format, which defines the appearance of the text in the marker, and the text of the destination itself This last is important—the text of the destination determines a great deal about the way you’ll construct all of the parts
of the cross reference
Cross reference markers can refer to two types of destinations: the text of a paragraph, or a text anchor Because text anchors refer to hyperlink text destinations, we’ll discuss them in Chapter 13, “Inter-active PDF.” In this section, we’ll talk about using paragraphs as our cross reference destination
Finally, creating a cross reference pretty much requires that the document use paragraph styles If you don’t use paragraph styles, it will be much harder to locate the text you want to refer to Go to the discussion of paragraph styles in Chapter 4, “Type,” and learn how
to stop working so hard
To create a cross reference, follow these steps (see Figure 3-42)
1 Move the text cursor to the location at which you want to insert the cross reference marker (or select text you want to replace with the marker)
2 Choose Insert Cross Reference from the Hyperlinks and Cross References submenu of the Type menu InDesign displays the New Cross Reference dialog box
3 Choose Paragraph from the Link To pop-up menu if it’s not already selected If the destination paragraph is in another document, select the (open) document containing the paragraph from the Document pop-up menu
4 Use the two scrolling lists in the Destination section to set the destination paragraph The list on the left shows the paragraph styles in the document; the list on the right displays the text of each paragraph in a particular style
5 Select the cross reference format you want to use from the Format pop-up menu To create a new format, click the pencil icon to the right of the pop-up menu (see “Creating or Editing a Cross Reference Format,” below)
Creating a Cross
Reference
Trang 146 The controls in the Appearance section define the format of the hyperlink associated with the cross reference For most cross references in print publications, we think you’ll probably want to select Invisible Rectangle from the Type pop-up menu and leave
it at that For more on hyperlink appearances, see Chapter 13,
“Interactive PDF.”
7 Click the OK button to insert the cross reference marker
Figure 3-42 Creating a Cross Reference
…then choose Insert Cross Reference from the Hyperlinks and Cross References submenu of the Type menu.
Or click the Insert Cross Reference icon on the Hyperlinks panel.
Select a paragraph
paragraph in this list (what you see
is the text of the paragraph).
Choose Paragraph Select a document.
Select a cross reference format.
Click this icon
to create or edit
a cross reference format.
InDesign adds the cross reference marker at the location of the selection.
Use the controls in the Appearance section to change the format of the
hyperlink, if necessary.
Select some text, or click
a text cursor in text…
Trang 15Cross reference formats define the appearance of the marker, ing both the text of the marker and the formatting applied to it Just
includ-as applying a character or paragraph style creates a link between the style and the text, applying a cross reference format creates a link between the marker and the cross reference format If you change the cross reference format, the corresponding markers will change.Before you create a cross reference format of your own, it’s a good idea to look through the existing ones—you might find exactly what you need—and you’ll get an idea of how to construct your own
To create a new cross reference format, follow these steps (see Figure 3-43)
1 Choose Define Cross Reference Formats from the Hyperlinks panel menu (display the panel if it’s not already visible) If you’re looking at the New Cross Reference dialog box, you can also click the pencil icon to the right of the Format pop-up menu
InDesign displays the Cross Reference Formats dialog box
2 Click the Create Format (the “+” below the list of formats) button
to create a new format The new format will be based on the selected format InDesign adds a new format to the list This also displays the definition of the format in the Definition field
3 Enter a name for the format
Creating or Editing
a Cross Reference
Format
Click the + button to add a
cross reference format.
Click the - button to delete the selected cross reference
format.
Use the + pop-up menu to add cross reference “building blocks” to the cross reference format definition.
The cross reference format
definition can look pretty
arcane, but don’t let it bother
you: just select building
blocks and then enter the
static text you want.
Figure 3-43 Creating a Cross Reference Format