Tab Leaders (Part 4): Automatic Styling
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.
Wow, Pariah! I’m sure your series on working with tabs will be a lifesaver for many an InDesign user.
Re nested styles, I usually start by creating and applying the paragraph style first. (In Step 1 you say to create the character styles first.) Then I style selected text, create character styles from it; and finally go back to the original paragraph style and add the nested styles.
Somewhere in Step 2 you mention that you begin by creating and applying a paragraph style. So I got a little confused. ;-)
Thanks for catching that, Anne-Marie. You’re right: between steps 1 and 2 I was a bit confusing as to the order of paragraph and character style creation. I’ve revised it inline to make that clearer.
Just wanted to say thank you !!! Helps a LOT !
Hey Pariah –
Thank you indeed for sharing this with us.
I have a question though: Do *all* formatting parameters in a leader character style ? which in turn used in tab paragraph style as a nested style ? work? Let me explain what I did and didn’t get expected results.
– Created paragraph style containing tab formatting
– Created character style containing leader formatting (with a different colour and with stylistic set 1 enabled in the OpenType Features section)
– Nested the character style within the paragraph style, exactly as this article explains
Result: colour formatting works in the leader but not the stylistic set 1
Note: When I tested the character formatting on a piece of stand-alone text, it works just fine.
What am I doing wrong? Thank you very much indeed for your help.
Pages
@Pages: That is really interesting! It appears that none of the OpenType formatting in a character style is applied to the tab character in this situation.
It could be a bug. But my theory is that the OpenType formatting is being applied to the tab character instead of the leader characters “inside” the tab.
Yeah, it could be a bug. But I don’t think (and again, I am not certain) that the OpenType formatting is being applied to the tab character instead of the leader characters. I say this because I just did a quick test and typed the leader character in the text before and after the tab, and it rightly displayed without the stylistic set 1 glyph – rightly because I had not enabled the stylistic set 1 in the tab paragraph style (it was enabled only in the leader character style).
I plan on doing these tests on a colleague’s computer as well. I will post the results.
David, thanks much for your time.
Pages
David, I now see what you mean by (…)the OpenType formatting is being applied to the tab character instead of the leader characters ?inside? the tab.(…) That could probably be the reason (or the bug).
Having said that, the colour formatting got applied to the tab character, and hence the leader character, but the OpenType feature did not.
Pages
Coming up on a decade later, and this is still useful – exactly what I needed to know. Thanks!