Controlling Line Breaks with Nested Styles

A customer came to me recently with an interesting InDesign problem. I only had a few minutes to help them. I thought I’d share my “hack” solution to their problem here in hopes that someone else can make use of it or learn something from it. Or, perhaps, someone can suggest a simpler, more elegant solution?

The problem:

The client had hundreds of pages of text that contained entries like this:

Screen-Shot-2015-04-14-at-6.45.10-AM.png

If a bold heading was long enough to wrap to a second line, they always wanted the break to occur after the first comma, as indicated by the magenta lines in the screenshot above. They didn’t want to fix each of these manually. The solution I came up with uses the “No break” attribute.

The solution

1. Create a character style named “No break” that has the No Break attribute enabled:

Screen-Shot-2015-04-14-at-6.48.27-AM-copy.png

2. Create a paragraph style for the headings with three nested styles as shown below:

Screen-Shot-2015-04-14-at-6.51.42-AM-copy.png

The first style applies the “No break” character style from the start of the paragraph through the first comma. Then no character style is applied through 1 space (allowing the line to break after that space), and then the “No break” character style is applied to the rest of the sentence. So the “No Break” attribute ends up getting applied to the entire sentence except for the space character that occurs after the first comma.

3. When the paragraph style is applied to the headings, this is the result:

Screen-Shot-2015-04-14-at-6.57.08-AM.png

If I add some additional text to the last heading, it also wraps after the comma-space, automatically:

Screen-Shot-2015-04-14-at-6.59.45-AM.png

This could have also been accomplished with a GREP style. But a thought a nested paragraph style was easier to explain quickly to the customer. I also created a second paragraph style for the headings that did NOT contain the nested styles, and instructed them to use this second style for “exceptions” when they wanted to control the line break manually.

Screen-Shot-2015-04-14-at-7.09.29-AM.png

Bookmark
Please login to bookmark Close

This article was last modified on July 25, 2019

Comments (12)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...