First, in part 1, we talked about separating columns of text with dot or other kinds of leaders. Next, in part 2, “Formatting Leaders,” we learned that tabs and their leaders can be styled like any other character, opening the possibilities of creative column separators. Last week part 3 focused on using custom text underlines to stylize tabs within paragraph text. In addition to creating and formatting the tabs themselves, we sped up the process of styling multiple tabs through the use of character styles. The problem is, so far we’ve only talked about applying character styles manually–selecting each tab one at a time and applying a style from the Character Styles palette/panel. Manual application of character styles to a few tab spaces here and there isn’t a hassle. However, when you’re producing a long list of sports scores, a product catalog, or something else with more than a handful of tabbed lines, “manual application” is procedure you want to employ as rarely as possible. Fortunately, InDesign CS2 and CS3 can easily automate the application of character styles to tab spaces.
I’m talking about nested styles.
The concept of nested styles is simple: do this until it’s time to do that. By combining character styles with specific trigger characters or marks, you tell InDesign to format text up to or through a specific character with a certain style. For instance, you could easily have InDesign automatically format your tab spaces with a different font, color, and tracking without altering the text to either side of the tab. It may sound complicated, but, trust me, it’s a snap.
- First, prepare by creating the paragraph and character styles you’ll need. I find the best way to do that is by creating a sample line of text, formatting it manually, and then creating styles from its various bits. My project is a price list, so I’ll set my text with tabs and basic dot leaders in place, and then, using only the top item, I’ll format each bit of information as needed (see Figure 1).
- As you can see, I start out with one typeface and color, switch to a second for the tab space, a third for the product item number, back to the second style for the next tab, and finish off with four other character styles for the item price. Because the formatting of the first style, the item name, can be handled by a paragraph style, I’ll begin by creating a new paragraph style–“Cat Line.” That style will also store the other paragraph-level attributes like the positioning of tabstops, paragraph spacing, and so on.
- Jumping past the item name, my first formatting change is the tab space. I’ll highlight that and create a new character style–“Cat Line Tab”–to preserve those settings. Next is the item number, which gets its own character style, “Cat Line SKU,” followed by the four distinct styles in use in the price (actually, three; the dollar digits use the same formatting as the product name). Because both tab spaces use the same formatting options, they can use the same character style, and I don’t have to make another one just for the tab space between the SKU and the price.Following my lead, highlight and then create a character from each change in character formatting in your text. Even if you ultimately want only one change in style, make sure you have at least two character styles in addition to the paragraph style. You’ll need two to follow along with the remaining steps.
- Apply your paragraph style to the rest of your tabbed lines of text.
- Now, double-click on the paragraph style in the Paragraph Styles palette/panel to open the Paragraph Style Options dialog. Go down to the Drop Caps and Nested Styles pane (see Figure 2). Make sure the Preview box in the bottom-left of the dialog is checked; we want to monitor the changes we make to the paragraph style options on live text.
- In the Nested Styles section click the New Nested Style button, which should place your cursor in the first of four columns above it. The first column, a dropdown menu, offers all your character styles as well two special ones–[Repeat] and [None]. The former I’ll leave for another day’s discussion (or you can buy my Mastering InDesign CS3 book; I know, I’m shameless). The latter, [None], doesn’t use a character style; it leaves the text as formatted by the paragraph style’s own options. That’s what we want in this case, so set the style to [None].
- Set the values of the remaining three columns to: up to, 1, Tab Characters (the final column is another dropdown menu with Tab Characters listed as an option). When you’ve done that you will have completed a directive to InDesign stating, in effect, do not use any character from the beginning of the line until the first tab is encountered, however long that may be. We want text before the tab to remain faithful to the options in the paragraph style, and this statement accomplishes that. So would no nested style, of course, at least until we complete the next step. After that, we’ll be glad to have taken this first nested style.
- Click the New Nested Style button again to insert a new row beneath the first. With this nested style we’re going to tell InDesign how to format the tab space itself. Choose the appropriate character style, and then set the other options to: through, 1, Tab Characters. If you have Preview checked, you should immediately see the first tab space change in all your tabbed lines.The difference between “up to” and “through” in the second column is simple: The former has InDesign apply a style until but not including the specified character or mark, while the latter has the application include the specified character or mark in the style. These directives are also successive. Because we first said, “do nothing until you get to the tab,” InDesign ends that directive at the tab. When the first command ends, the next begins, formatting text after that–the tab itself–until InDesign encounters the specified character–the same tab; thus, it applies the character style to a single character, the tab.
- The next two nested styles are virtually identical. With my price list, I need a nested style that formats the SKU number between the two tabs–Cat Line SKU, up to, 1 Tab Characters–then the second tab–Cat Line Tab, through, 1, Tab Characters. Set up those, and your list should be complete or nearly so.
- The price is just as easy to format, but instead of telling InDesign to look for tab characters, I’ll tell it to look first for a dollar sign, then a period (between the dollar and cent amounts), and, finally, to format the cents themselves, to apply a style through two digits (numerals). Although the trigger character column has a dropdown menu of helpful characters and marks, you can type just about anything else (like a dollar sign or period) into that field.Figure 3 shows all the nested styles used on my price list.
Wait! Here’s the best part. Click OK to close the Paragraph Style Options dialog while saving the changes. Now, begin a new line of text and apply the paragraph style to it. Begin typing. Nothing’s happening, right? Press your keyboard TAB key, and keep on typing. InDesign applies the nested styles, formatting text, as you type! (It’s OK to ooh and ah at this point.)
As long as you use that paragraph style, InDesign will watch your typing for the nested style trigger(s) you configured, be that tab characters, dollar signs, or anything else. When a trigger is encountered, the character style is applied, and InDesign watches for the next trigger. And, it works with columnar or paragraph text. You need never manually apply character styles to multiple tabbed lines again!
Next week, in the fifth installment of the “Tab Leaders” series, I’ll offer some additional tips and tricks for working with tabs, leaders, and nested styles that are too small for their own posts but definitely too big to miss.