In this post, I will show one way of forcing InDesign to avoid runts in paragraphs. First, though, let me clarify what I mean by runt.

Runts

runt in a typographic context refers to a short last line of a paragraph. This is generally not considered desirable, probably because (a) a short last line creates too noticeable a gap between paragraphs – it is too obtrusive, creating something that could be likened to a horizontal typographic river; and (b) since most paragraphs have a first line indent, a very short last line might be not even reach to the end of the indent in the next paragraph, creating a river proper.

The challenge, therefore, is to discover an automatic method to force InDesign to avoid runts. And although InDesign has fairly decent widow and orphan controls, it has nothing to assist the typesetter in avoiding runts. And who can afford a proper copy-editor these days!

The obvious solution is to use InDesign’s Find/Change to apply a no-break attribute to the last few characters of each paragraph, thus ensuring that those characters, at a minimum, always appear together on the same line. And rather than a text find–change operation, which cannot be set to find any characters according to their position in a paragraph, it is likely we must resort to a GREP (regular expression) find–change, which can.

(It would also be possible to use a GREP style as part of a paragraph style definition. But applying a GREP style to every paragraph in a long document is processor heavy, and risks excessively slowing InDesign down. I therefore prefer a one-time find–change operation.)

How Short is Short?

Before going ahead and constructing the necessary GREP expression, we must answer the question, How short is short? What is the minimum number of which characters that must appear together on the last line of a paragraph to avoid it being a runt?

I’ve seen several blogs on the Internet propose a simple solution: something like 5 characters minimum on every last line. However, this is simplistic: one could end up with a last line that hardly has any significant characters in it and mainly consists of punctuation and parentheses.

Instead, I propose adopting a definition that I have found in the Chicago Manual of Style, 15th edition. In the “House Style for Composition and Page Makeup,” reproduced on p. 845 of that tome, we find the following rule:

The final word of a paragraph is allowed to hyphenate except that a minimum of four characters (not counting periods, commas, and quotation marks) is required on the final line.

So the challenge is to construct a GREP expression for InDesign that will apply the no-break attribute to the last four characters of every paragraph, not counting punctuation marks. (Admittedly, Chicago house rules explicitly mention only three types of marks that don’t count; but I will extend that to all punctuation marks – anything, in fact, except digits and letters.) More precisely, then:

The last line of a paragraph must consist of at least 4 letters or numbers, not counting any other punctuation marks or signs.

The GREP

Well, the GREP I came up with to do this is as follows:

([[:alnum:]][^[:alnum:]]*){4}$

Let’s see how this works.

To find any character with GREP, the standard code is [\u\l] meaning, “uppercase or lowercase letter.” However, the problem with this approach is that it only matches Latin letters. Any letters from other alphabets are not matched, and this is a real problem.

Luckily, InDesign GREP provides a neat solution in the form of the Posix expression [[:alnum:]]. Not only does this match any letter in any alphabet, it also matches any digit. So this is the one we want.

Now, we want to start applying the no-break attribute from the fourth last letter or number all the way through to the end of the paragraph. So our match must begin with a letter or number.

The opening parenthesis marks the start of a group, and the first [[:alnum:]] makes sure we begin our match with an alphanumeric character.

Following that, we want to include zero or more non-alphanumeric characters, and that is the second part of the group: [^[:alnum:]]* means: Zero or more non-alphanumeric characters.

If we multiply that group by four, we know we’ll have 4 alphanumerics, interspersed and followed by zero or more non-alphanumerics. The {4} achieves that. (And of course, if you decide you’re happy with only three alphanumerics, or perhaps want at least 5 on the last line, change the 4 accordingly.)

Finally, the $ means: position = end of paragraph.

So that’s it! In the Change To field, select the No-break character attribute, do a change all, and you’ve ensured in a single click that the last line of all paragraphs in the document will contain at least four letters or numbers, not counting punctuation or any other signs, as per the Chicago Manual.

If paragraphs are heavily edited at a later stage, just run the GREP again. Alternatively, make it into a GREP style, though, again, I don’t recommend doing that.

Comments, critiques and improvements to this method are welcome below!