#44. Defining Nested Styles
Nested styles are one of the innovative ways InDesign saves you trips to the Character Styles palette. Within a paragraph style, you can set up character styles to apply to a range of text based on a certain length or character and then automatically switch to another nested character style or revert to the base paragraph style. For example, you could define a character style to run through to the first sentence or after the first colon. This makes nested styles ideal for creating run-in headings that are popular in magazines (Figure 44a). But this is just one obvious application for them.
Figure 44a. Nested styles are perfect for handling run-in headings where the first few words or the first sentence is styled differently than the rest of the paragraph.
Before defining nested styles, create the paragraph and subsequent character styles you want to use. Double-click on the paragraph style in the Paragraph Styles palette. Next, click Drop Caps and Nested Styles on the menu list on the left of the dialog. Click the New Nested Style button and choose one of your character styles from the first menu labeled [None]. Then decide which item will determine the end of the character style formatting. You can enter a character or number, or select a special option from the menu (Figure 44b). Although you can type a whole word in the field, only the first character will be used. You can click on "through" to switch it to "up to," which changes the character style range from including the ending character to not doing so. Then add as many other nested styles as you want and order them using the up and down buttons.
Figure 44b. You can enter a character or choose from the menu that includes special characters or other factors to end your nested style.
Once you've defined your nested styles within the paragraph style, all paragraphs that previously had the style applied automatically update. It's even more fun to watch the nested styles switch as you type. Create a new text frame by dragging a rectangle with the Type tool. Then select the paragraph style with the nested styles and start typing. Watch as the formatting automatically switches as you trigger the determining characters or factors.