My one complaint about InDesign’s paragraph composer is that it doesn’t seem to object enough to “runts” at the end of paragraphs. The first person I ever heard use this term was David Blatner. He had grown so tired of the endless discussions about widows and orphans (neither of which is synonymous with runt) that he coined a new term for those short lines at the ends of paragraphs.

Nested Styles provide a way of making it easy to manage runts interactively. The basic strategy is to apply the text attribute No Break to to the back-end of a paragraph forcing the composer to recompose the paragraph without a runt.

The Runt Problem — Before Nested Styles

It was marginally possible with previous versions of InDesign to tackle runts using the No Break text attribute which has been around since the beginning. But applying it was always somewhat messy, and experimenting was positively gruesome.

Let’s work on an example. Look how the paragraph composer set this paragraph:

Most unfortunate to have that little runt “here.” on a line by itself. Before InDesign CS, I’d have selected the space between “typing” and “here” and made it No Break. And that would have resulted in this:

The last line still looks runty and now we have a bad hyphen on the third line made worse by what was already a sad looking one on the first line. Clearly, applying No Break to more of the paragraph can solve these problems, but it’s messy and takes more hand-eye coordination than I like to expend on something like this. (It doesn't look like much when it’s just one paragaph, but imagine a 500 page book with one or two of these on every page.)

Nested Styles to the Rescue

Nested styles change things dramatically. Experimenting consists of typing a character where you want No Break to start, and if you don’t like the result you can simply Undo and type the character again somewhere else.

This is quite a departure for nested styles which superficially seem to work on the beginning of paragraphs, a kind of super-drop-cap facility that lets you do run-in heads or format bullets or numbered lists.

Let’s walk through the setup. First, we need a character style to apply No Break for us. I call the style “No Break,” thus:

Next we add two nested styles to our Body paragraph style:

The first nested style does nothing until an “End Nested Style Here” character is encountered. This means that if there is not such a character in the paragraph, then these nested styles do nothing at all. That’s important because we don’t want to have to apply a different paragraph style to the troublesome paragraphs; the idea is to apply a single style to all similar paragraphs and only use this derunting procedure on paragraphs that need it.

There’s one more step before we’re ready to rock-and-roll. To activate this style, we need to insert the “End Nested Style Here” character into the text. That can be done using the contextual menu, but anticipating that we’re going to use this feature a lot, it’s sensible to assign a keyboard shortcut to the character.

Maybe the Adobe engineers don’t consider this a bug, but why is it called “End Nested Style Character” in the Paragraph Style dialogs, but “End Nested Style Here” in the contextual menu and Type menu?

Call up the Keyboard Shortcuts editor from the Edit menu and then choose the Type Menu panel:

On my Macintosh, Ctrl+\ seemed like a good choice, particularly in view of the character used to represent it when Show Hidden Characters is activated:

Putting our style to work

Remember our problem? This paragraph has a runt:

It’s already set in the Body style to which we have added our nested styles so all we have to do is click an insertion point before the word “typing” and hit our shortcut keystroke:

That was easy, but what if we want to experiment. There aren't many opportunities here, but perhaps the result would look better still if there were three words on the last line. Let me start by making a deliberate mistake to emphasize a subtle point here. I'm just going to click before the “I” of “I’m” and key another End Nested Style Here character:

Huh? We’re back where we started. How can that be?

I’ve activated Show Hidden Characters to help explain. We now have two End Nested Style Here characters, the one we just typed and the one we previously typed before the word “typing.” And that’s our problem. That character always ends a nested style even if the style calls for some other ending (such as in our case, the end of a sentence).

My first reaction to this discovery was rather negative and I thought it a bug, but after some discussion with others who thought it a feature, I concur. What’s more, I’ve already made use of this to override a nested style in a situation where one of my paragraphs was badly structured for the particular combination of styles called for.

So, what I should have done was hit Undo before typing the new End Nested Style Here character. Had I done so, this would have been the result:

Which I’m inclined to think is not as good as the earlier solution. But the point is that it took a moment to find out, and now it’s easy enough to get back to where we were.

Before closing with a bug report, let me point out one more thing that might not be so obvious: in previous versions of InDesign, one could have achieved the same result by selecting the last two or three words of the paragraph and then applying the character style No Break to them. But what if there were already a character style applied to some or all of that text?

With nested styles, this is not an issue because you can apply character styles both directly and through a nested style to the same text. The result is additive if the two styles do not contradict each other. If they do clash, then the locally applied character style prevails.

Oh No! A Bug!

And a real one, too. One of the weakest features of InDesign is its spelling checker (it has improved slightly with the CS release because of the options, albeit they’re buried in Preferences), but it comes a cropper if you do what we’ve just done. Look at this:

Because of the End Nested Style Here character nestling up to the word “typing” the spelling checker gets confused and fails to recognize the word. So be warned: check your spelling before you address your runts.