It turns out that they can make some jobs easier, and sometimes they can make it possible to do things that wouldn’t be practical to do using menus, dialog boxes, and the Character and P
Trang 17 Click the Change button to change the text to the regular expression you entered in the Change To field.
8 At this point, you can continue finding and changing text by clicking the Find Next, Change, or Change and Find buttons, or click the Change All button to apply your changes to all of the matching text in the specified range
One of the coolest things about finding and changing text using
GREP is that you can use marking subexpressions—a way of
slic-ing, dicslic-ing, and rearranging the text you’ve found Marking pressions can take a part of the text you’ve found and use it in the replacement text The best way to show what this means is to present
subex-a couple of exsubex-amples
Re-ordering names Imagine that you have to take a list of names that
have been typed in “last name, first name” order and convert them to
“first name last name” order This kind of operation is impossible to
do using the Text search method, but it’s easy with GREP and ing subexpressions (see Figure 3-78)
mark-Marking Subexpressions
GREP Expression: What it does:
(?i) Makes the find/change case-insensitive[A-Z0-9._%-] Matches the specified character range:
from A to Z, from 0 to 9, and the acters “._%-”
more times
[A-Z0-9._%-] Matches the specified character range:
from A to Z, from 0 to 9, and the the characters “._%-”
more times
{2,4} Matches a two to four letter string
(.com, org, edu)
Table 3-9 What’s Going on in the
GREP Example?
Trang 2chapter 3 text 229
Figure 3-78 Re-Ordering Names with GREP
Parentheses mark parts
of the found text In this
example, the GREP regular
expression we’re entering in
the Find What field is:
$1
$2
Formatting text between tags Next, imagine that you’re working
with an author who consistently marks bold and italic text with simple HTML-style formatting tags: “<i>” for italic and “<b>” for bold Luckily, they’re quite consistent about marking the end of the formatting using “</i>” and “</i>” How can you find the text between the formatting tags, format it, and, at the same time, remove the tags?
In this example, we’ll use a marking subexpression to capture the text between the tags, and we’ll replace the text with the captured text, excluding the tags (see Figure 3-79) Using regular expressions
to find text between some arbitrary beginning and ending text is one
of the great things about the GREP find/change method
By now, every desktop publisher is familiar with the drill: place a word processing file, then find and change all of the little annoyances that make a mess of text Double spaces Multiple tabs Space before punctuation For years, we’ve used the standard text find/change fea-tures (what you see in the Text panel of the Find/Change dialog box)
to do this—but this often means that we have to run through the search multiple times to get all of the instances of the offending text Take double spaces as an example: we search, search, and then search again until InDesign tells us no more instances have been found
GREP offers us a better way to deal with this type of search Rather than finding and changing the text multiple times, we can take care
of it all in a single pass Table 3-10 shows a few of our favorite text cleanup operations Note that we use $1 in some cases to avoid delet-ing a return character and, potentially, paragraph formatting
Simple Searches Made
Better with GREP
Trang 3Task: Find What: Change To:
Replace runs of spaces with single space
Better with GREP
Figure 3-79 Formatting Tags with GREP
Parentheses mark parts
of the found text In this
example, the GREP regular
expression we’re entering in
the Find What field is:
<i>(.+?)</i>
This captures the text
between the tags as $1.
Replace the text between the tags and format
it as italic This deletes the tags themselves.
InDesign replaces applies the
formatting and removes the
tags themselves.
We don’t have the space here to cover GREP in all its glory Peter Kahrel has written an excellent tutorial on using GREP in InDesign that is available as a downloadable PDF from O’Reilly—that would probably be the best place to start learning about GREP
Learning More about GREP
Trang 4chapter 3 text 231
Another O’Reilly book, Mastering Regular Expressions, by Jeffrey
E F Friedl, is a fairly complete tour of GREP It does not specifically talk about GREP in InDesign, but it’s a great place to learn more about the inner details of how regular expressions do their work
For more information on either or both of the above titles, you
can go to www.indesignsecrets.com/grep/.
Ole likes a regular expression development and debugging tool called “RegexBuddy,” by JGSoft It’s Windows-only, and a demo ver-
sion is available from www.regexbuddy.com.
We’ve talked about the wonder of Unicode and OpenType fonts, or,
at least, we will talk about them in Chapter 4, “Type.” There are lots
of good things to say about a system that makes publishing in just about any language or character set much easier than it used to be, and provides great typesetting features at the same time
But you’ve probably noticed that there are some things that the combination of Unicode, OpenType, and InDesign don’t handle very well By “noticed,” of course, we mean that you’ve spent time yelling
at your screen when a specific character can’t be found, or can’t be entered, or displays the “dreaded pinkness” of glyph substitution.Take, for example, the font we use for this book, Minion Pro Minion Pro has a number of ornamental characters we’re very fond of—the only trouble is that they’re all considered bullet characters by InDesign Which leads to a problem: There is simply no way to enter the replacement character in the Change To field of the Text panel of the Find/Change dialog box If you try to copy the character into the field, you’ll get ^8 (or Unicode <2022>), a normal bullet You can’t even use the Unicode value you can find from your operating system
to refer to the correct character
Instead of screaming in frustration, you can use the controls in the third panel of the Find/Change dialog box, Glyph The Glyph find and change method can only find one character at a time, but it does this single job very well (see Figure 3-80)
1 Open the Find/Change dialog box (press Command-F/Ctrl-F) Click the Glyph tab to display the Glyph panel
2 Choose the font, font style, and glyph you want to find You can enter the Unicode/Glyph ID if you know it, but it’s usually better
to choose a glyph from the Glyph pop-up menu (which is really something like a miniature version of the Glyphs panel)
3 Choose the font, font style, and glyph you want to change to
4 Set the range of the search using the Search pop-up menu
Finding and Changing Glyphs
Trang 5Figure 3-80 Finding and Changing Glyphs
In this example,
we need to replace
a Zapf Dingbats ornament with an ornament from Minion Pro.
Set the font family and font style in the
Find Glyph section of the panel, then use
the Glyph pop-up menu to specify the
glyph you want to find.
Then do the same thing for the replacement glyph in the Change Glyph section of the panel.
InDesign replaces the glyph you’re looking for with the replacement glyph.
5 Click the Find button InDesign finds an occurrence of the character you specified and displays the matching text in the document window, turning pages and scrolling to display the character, if necessary
Trang 6chapter 3 text 233
6 Click the Change button to change the glyph
7 At this point, you can continue finding and changing text by clicking the Find Next, Change, or Change and Find buttons, or click the Change All button to apply your changes to all of the matching text in the specified range
If you have a find/change operation that you use often, you should save it To do this, click the Save Query button in the Find/Change dialog box—it looks like a floppy disk—a computer storage medium some of us can still remember
Enter a name for the query in the Save Query dialog box, then click the OK button to save the query Once you’ve done this, the name of the query will appear on the Query pop-up menu in the Find/Change dialog box, and you can recall all of the settings of that particular find/change operation by choosing the menu item
Working with InDesign Tagged Text
One of the most useful features of InDesign is rarely mentioned in the marketing materials It’s not the typesetting features, nor is it the ability to place native Photoshop and Illustrator files We think those are great features, but they’re not it
What is this mystery feature? It’s the ability to save and read tagged text To explain why this is so important, we’ve got to explain
a little bit about what tags are
Tags have been around for a long time Before desktop publishing appeared, the world of typesetting was ruled by dedicated typeset-ting systems As we set type on these machines, we didn’t see any-thing that looked like the type we were setting Instead, we saw the text of our newspapers, books, and magazines surrounded (and sometimes obscured) by cryptic symbols: typesetting tags and codes
To see what these symbols meant, we had to print the file Only then would we see our type with its formatting applied
Then came the Macintosh, PageMaker, the LaserWriter, and WYSIWYG (What you See Is What You Get) publishing This revo-lution made it easier for more people to set type—in part because it freed us from having to learn and use the obscure codes and tags
of the dedicated typesetting systems These days, modern desktop publishing programs are better typesetting systems than anything
we had in the old days—and you can see what you’re doing
Saving Queries
The Land That WYSIWYG Forgot
Trang 7Why should you mess with tags in this day and age? It turns out that they can make some jobs easier, and sometimes they can make it possible to do things that wouldn’t be practical to do using menus, dialog boxes, and the Character and Paragraph panels.
The tagged text export filter takes formatted InDesign text and turns it into tags in a text file The tagged text import filter reads tags and turns them into formatted (“WYSIWYG”) text InDesign’s tagged text export filter is the only text export filter that doesn’t change the appearance of the text you’re exporting
Here are some of the reasons you might want to use tags:
▶ If you work with people who use text editors (instead of featured word processors), they cannot apply formatting such as bold or italic or paragraph styles
full-▶ Any application that can save files in text-only format can be used to create formatted text for use in InDesign This means that your catalog clients can use FileMaker database to mark up their text—Visual Basic, Microsoft Excel, and Microsoft Access are other obvious choices It might even help your old uncle who lives in a cave and uses nothing but EDLIN
▶ You can store frequently used formatted text as tagged text files It’s far quicker to place a tagged text file than it is to open another InDesign publication and copy/paste the text you want
To learn how tags work, the best thing to do is export some ted text from InDesign (select the story, choose Export from the File menu, and change the Format pop-up menu to InDesign Tagged Text) and then use a text editor to look at the file
format-While it is possible to open these tagged text files in a word sor like Microsoft Word, those programs often assume that because there are tags in the file, it must be HTML (so you either get errors
proces-or things get really weird) That’s why text editproces-ors (such as Windows Notepad or BBEdit) are better—they just deal with plain text and never try to format anything
The “official word” on tagged text is the Tagged Text.pdf file, which you’ll find inside the Adobe Technical Info folder on your InDesign installation CD This guide includes basic instructions and
a list of most of the tags you can use
One thing that’s implied by the tagged text documentation, but not explicitly stated, is that you can enter any character using its Uni-
code value To do that, use the form “<0xnnnn>”, where nnnn is the
hexadecimal form of the code (as seen in the Glyphs panel)
Why Bother with Tags?
Getting Started with
Tagged Text
Trang 8chapter 3 text 235
InDesign’s tags can specify basic character formatting (such as font, point size, color, or baseline shift), paragraph formatting (such as indents, tabs, and paragraph space before and after), and styles (both paragraph styles and character styles) Any formatting that can be applied to text can be applied using tags Even tables can be exported
or imported as tagged text (That means you can program your base to export fully formatted InDesign tables.)
data-InDesign tags are always surrounded by open (<) and close (>) angle brackets (which most of us also know as “greater than” and “less than” symbols) The first characters in a tagged text file must state the character encoding (ASCII, ANSI, UNICODE, BIG5, or SJIS), followed by the platform (MAC or WIN) So the typical Windows tagged text file begins with <ASCII-WIN>, and the Macintosh ver-sion begins with <ASCII-MAC> If InDesign doesn’t see one of these tags at the start of the file, InDesign won’t interpret the tags, and all the tags show up as part of your text Here are a few more details
▶ Any characters you enter outside a tag will appear as characters
in the imported text
▶ Enter an empty tag to return the formatting affected by the tag
to its default state For example:
Baseline <cBaselineShift:3>Shift<cBaselineShift:> text following should be back to normal.
If you’re a long-time PageMaker user, you may have worked with PageMaker’s style tags to apply paragraph formatting to text files InDesign’s tagged text format is different than PageMaker’s, but you can create a “minimalist” tagged text file that’s almost as easy to work with as PageMaker’s paragraph style tags Here’s the header for
an example tagged text file:
<ASCII-WIN>
<DefineParaStyle:heading><DefineParaStyle:subhead><DefineParaStyle:para>
<ColorTable:=<Black:COLOR:CMYK:Process:0,0,0,1>>
Note that the paragraph style definitions in this tagged text file
do not contain any formatting—our assumption is that you’ll set up corresponding paragraph styles in your publication Then all you need to do is paste the appropriate header at the top of a text file, and then enter the paragraph style tags for each paragraph If, when preparing a file for import into PageMaker, you entered “<heading>” then enter “<ParaStyle:heading>” for InDesign
What Tags Can Contain
Tag Structure
Paragraph Style Tags
Trang 9Here’s an example (very simple) text file marked up with Maker paragraph tags:
Page-<heading 1>TimeTravelTickets
<subhead>Travel through time to experience the greatest artistic performances in history!
<para>We are pleased to announce our Summer, 2007 series.
Here’s the same text, marked up with InDesign tags:
<ParaStyle:para>We are pleased to announce our Summer, 2007 series.
A few things to note about converting PageMaker paragraph style tags to InDesign tagged text:
▶ While you do not need to include the <DefineParagraphStyle> tags
in the heading of the file, it’s a good idea to do so If you don’t, and then import the tagged text file into a document that does not contain the styles referred to in the tagged text file, InDesign will not associate the paragraphs with the style
▶ While PageMaker paragraph style tags don’t require that you tag each paragraph, you should tag each paragraph in the InDesign version of the file
Em Software (www.emsoftware.com) has created XTags, an InDesign import/export filter pair that supports not only QuarkXPress’ native set of tags, but adds additional tags
After Words
In academic circles, debate continues on whether we’re born with the ability to understand language, or whether it’s something we’re taught We don’t know the answer, and, most of the time, we don’t even know which side of the argument we want to be on What we
do know is that language is the most important technology humans have developed
In this chapter, we’ve shown how to get words into InDesign, how to organize them in your publications, and how to get them out again Next stop—typesetting with InDesign!
What About XPress Tags?
Trang 10Ole’s tale: “Late night The pale glow from the monochrome monitor
of my Compugraphic phototypesetter The smell of the office dard ‘French Vanilla’ coffee—warming, now, for several hours and resembling nothing so much as battery acid The gentle snoring of one of the staff writers, who is curled up in the warmth of the unit that holds the filmstrips containing the fonts I’m using to set his story
stan-“These are the things I think of when I hear the word ting’—they’re memories from my job at Seattle’s free rock and roll
‘typeset-newspaper The Rocket, circa 1982 Desktop publishing didn’t exist
yet, and digital (as opposed to photo) typesetting systems—with their WYSIWYG displays—were rare The codes and characters I saw on my screen wouldn’t look anything like type until they were printed, one character at a time, on a strip of photographic film and developed I could set just about any kind of type using that machine, provided the characters would fit on a piece of film not more than seven inches wide, and provided I didn’t need to use characters from more than six fonts.”
When desktop publishing appeared, we found that it couldn’t do everything Ole could do with his Compugraphic—but that being
able to see what our type would look like before we printed it more
than made up for any deficiencies These days, page layout programs are far more capable than Ole’s trusty EditWriter Does that mean, however, that there’s no more room for improvement? For surprising new features? Is typesetting “done”?
Trang 11Not a chance—InDesign offers a number of improvements and surprises in the area of typesetting It’s an evolutionary product—not a revolutionary one, but, on its release, InDesign became the best desktop typesetting program, and raised the bar for its competition.
In this chapter, we’ll walk through InDesign’s typesetting tures We’ll start with character formatting (font, point size, kern-ing, and baseline shift are examples of character formatting), move
fea-on to paragraph formatting (indents, tabs, space above and below, and composition), and then dive into formatting using character and paragraph styles Along the way, there may be a joke or two
Generally, when you want to change the formatting of some text, you have to select it with the Type tool However, there are two caveats
to this statement First, because paragraph formatting (which we’ll discuss later) always applies to an entire paragraph, you don’t have to select every character in the paragraph before applying it
Second (and more interesting) is that you can apply text matting to text frames you’ve selected using the Selection tool or the Direct Selection tool When you do this, InDesign applies the formatting to all of the text in the text frame, including any overset text InDesign won’t let you use this method to apply formatting to text frames that are linked to other text frames Tired of using the Type tool to select and format every photo caption on a page? Use the Selection tool to select them all and apply your formatting—it’s easier, and it’s quicker (see Figure 4-1)
for-Selecting and Formatting Text
Use the Selection tool to
select the text frames you
want to format…
…and apply formatting
InDesign applies the formatting to all of the
text in the text frames
That’s all there is to it
Figure 4-1 Formatting the Text in Text Frames
In this example, we changed character attributes (font, font style, and leading) and paragraph attributes (alignment).
Trang 12chapter 4 type 239
The ability to apply formatting with the Selection tools is very powerful, but it’s also slightly dangerous Let’s say you set a single character to Zapf Dingbats somewhere in your text frame If you select the text frame using the Selection tool and then apply a new font, every character—including that dingbat—gets changed
The only warnings that InDesign gives you that some of the text
in the selected text frame uses a different font are: the Font field in the Character panel is blank, and the Font submenu (under the Type menu) has hyphens next to each font
Character Formatting
Character formatting controls the appearance of the individual ters in your publication Font, type size, color, and leading are all aspects of character formatting (Longtime QuarkXPress users won’t think of leading as a character format, but we’ll cover that next.)
let-We refer to all formatting that can be applied to a selected range of text as “character” formatting, and refer to formatting that InDesign applies at the paragraph level as “paragraph” formatting Tab settings, indents, paragraph rules, space above, and space after are examples
of paragraph formatting There are areas of overlap in these tions Leading, for example, is really a property that applies to an
defini-entire line of text (InDesign uses only the largest leading value in a
line), but we’ll call it “character” formatting, nonetheless, because you can apply it to individual characters
In addition to these distinctions, InDesign’s paragraph styles can include character formatting, but apply to entire paragraphs See
“Styles,” later in this chapter
InDesign’s character formatting controls are found in both the acter panel and the Control panel (see Figure 4-2) The controls in the panels are substantially the same, so we’ll discuss them once
Char-To display the Character panel and shift the focus to the panel’s Font field, press Command-T/Ctrl-T If the panel is already visible, InDesign hides it; you may need to press it twice
To display the Control panel, press Alt-6 If the panel is already open, but is displaying the paragraph controls, press Command-Option-7/Ctrl-Alt-7
Command-Option-6/Ctrl-Selecting a font in InDesign is a little bit different than selecting a font in most other page layout programs To InDesign, fonts are categorized as font “families,” and each family is made up of one or
Character Formatting
Controls
Font Family and Font
Trang 13more type styles A font family is a set of typefaces designed to have
a common “look.” A “font,” then, is specified by its font family and type style In this book, we’ve used the font family Minion Pro, and the type style Regular for the body text—so the font of the body text
is “Minion Pro Regular.”
InDesign’s user interface for selecting fonts mirrors this approach When you choose a font from the Font submenu of the Type menu, you must select both the font family and a specific type style
Note that InDesign does not have “type styles” in the same way that other programs do—it makes no assumption that the selected
font family has a “bold” or “italic” member, and will never generate
a fake bold or italic version If you don’t have a font for a particular type style, you won’t see it on the Type Styles menu (see Figure 4-3)
To select a font family or type style, you can type into the priate field—you don’t have to use the menu As you type the name
appro-of a font family or type style, InDesign will display the available font
or fonts that match the characters you typed For instance you can type “T” and it will guess “Tekton” (if you have that font installed);
if you meant “Times” then you may have to type “Ti” or even “Tim” Note that you can also press the up and down arrow keys, which is especially helpful in the Style field to move from Regular to Bold to Italic, and so on
Figure 4-2 Character Formatting
Character panel to a more useful size.
Character panel in its “minimalist” state.
Many options can be found on the Character
panel menu…
…and even more can be found
on the OpenType submenu.
The same controls (including the menu choices)
are also available on the
Control panel—in slightly
rearranged form.
Trang 14chapter 4 type 241
Font Style Keyboard Shortcuts Although InDesign won’t generate
a bold or italic weight, you can type Command-Shift-B/Ctrl-Shift-B
to make your text bold and Command-Shift-I/Ctrl-Shift-I to make it italic If a font doesn’t have a bold or italic version, InDesign will not change the text
Symbols and Dingbats Sometimes, when you change to a symbol
font (such as Zapf Dingbats), you may encounter font substitution (the dreaded pink highlight) This can happen because InDesign is attempting to map the character from one font to another To avoid this problem, hold down Shift as you apply the font
Duplicate Font Names Some folks have more than one font with the
same name on their systems—such as a TrueType and a PostScript version of Times Roman While most programs just pick one (and you never know which you’re getting), InDesign displays both fonts, including either T1 or TT in parentheses after the font name
You can change the size of text by entering the point size you want
in the Size field of the Character or Control panel, or choose a point size from the attached pop-up menu (see Figure 4-4) If you type the size, you can specify it in 001-point increments After you’ve entered the size you want, apply the change by pressing Return/Enter or by pressing Tab to move to another field
Size Adjustment Keyboard Shortcuts You can increase the size of
selected type by pressing Command-Shift->/Ctrl-Shift->, or decrease the size by pressing Command-Shift-</Ctrl-Shift-< The amount that InDesign increases or decreases the point size when you use these shortcuts depends on the value in the Size/Leading field in the Units
& Increments Preferences dialog box
Size
Figure 4-3 Selecting a Font Select a font family
and then select a type style InDesign will not generate fake bold or italic type styles.
The number of type styles available varies from family to family.
On the Mac OS, you can
choose the family and style
from the Font pop-up menu
in a single step.
Trang 15Click the “nudge”
buttons, or…
…enter a point size, or…
Figure 4-4 Point Size
To increase or decrease the size of the selected text by five times the value entered in the Size/Leading field, you can add the Option
or Alt key: Option-Shift->/Ctrl-Alt-Shift->, or Option-Shift-</Ctrl-Alt-Shift-<
Command-Scaling Text by Command-Scaling the Frame You can scale text by scaling the
frame itself To do this, select the text frame with the Selection tool, then hold down the Command/Ctrl key and drag a corner or side handle Hold down Command-Shift/Ctrl-Shift as you drag to scale proportionally (a good thing, as far as text is concerned)
Text characters—usually—sit on an imaginary line, the baseline Leading (pronounced “ledding”) is the vertical distance from the
baseline of one line of text to the next text baseline When you hear
“10 on 12” or see “10/12”, it means “10-point text on 12-point leading.”
In InDesign, leading is measured from the baseline of a line of text
to the baseline of the line of text above (see Figure 4-5) When you increase the leading in a line, you push that line farther from the line above it, and farther down from the top of the text frame
In InDesign—as in PageMaker—leading is an attribute of vidual characters, but the largest leading value in a line predomi-nates (see Figure 4-6) This differs from QuarkXPress, where leading
indi-is a paragraph attribute (although if you use QuarkXPress’s relative leading mode, the largest leading in a line predominates)
For those of us who came to desktop publishing from typesetting, the idea of leading being a character attribute seems more natural than QuarkXPress’ method of setting it at the paragraph level For-tunately, InDesign lets you have it both ways: When you turn on the Apply Leading to Entire Paragraphs option in the Type pane of the Preferences dialog box, the program automatically sets the leading of every character in a paragraph to the same value QuarkXPress users will probably want to turn this option on
Leading
…choose a size from the pop-up menu.