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
A 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!
bil ANDERSEN
May 2, 2021 3:30 amExcellent summary of “runts”… which we called “widows” in the olden days (60’s-70’s)!
I agree with Raphael Freeman. Runts should extend to match or exceed the indent so the eye doesn’t get confused. It only needs to be a couple of characters or punctuation marks to achieve a satisfactory result.
Wish I knew how to use GREPs! I know nothing about scripting!!!
Keep up the great work.
bil ANDERSEN
May 3, 2021 2:34 amCORRECTION! “Runts”… were called “Orphans” in the olden days (60’s-70’s)! NOT “Widows”!
Getting my P’s & Q’s mixed up… old age I guess.
Raphaël Freeman
February 13, 2017 8:49 pmMy attitude is different. If the runt is as long as the first line indent then it’s fine. So if you are typesetting with an em space as your first line indent you are going to be fine most of the time. However if you have very generous first line indents, then this grep will help.
Also this could be very useful in an index…
CathleenK
January 11, 2017 4:49 amI’ve been typesetting for almost 20 years, and I’ve found that runts (single words as the last line of a paragraph) aren’t the end of the world (except maybe a non-fiction book). However, I do technical textbooks which have a narrow width text frame and if I force it to have at least two words, the result, in my opinion, is worse than the “runt.” The text has a lot of hyphenated words and capitalized titles that can’t break and often I have limited options.
If I have to decide between “rivers of white space” between words of the preceding lines to force this rule, I’ll choose the runt. My rule of thumb is if it has at least 5 characters, I’ll let it go if the “fix” is worse.
Due to crush deadlines, I don’t have the option of going back and forth with editorial to fix via text changes. A book will have hundreds of graphics in a book and each time you adjust the paragraphs, the figures have to be reset due to the height and width of the graphics. (Embedding graphics is not an option due to other layout considerations.)
Does anyone else agree that there are some types of books which runts are acceptable? I’ve read almost 90-95% online comments say it is absolutely unacceptable and I’m a terrible typesetter if I don’t.
MrH
May 17, 2017 9:47 pmYou are not a terrible typesetter for taking that route.
ASF
January 19, 2016 4:24 pmDon’t know if it’s the same thing, but a lot of times we get a single word on a line,
This grep does the job great within a paragraph style (grep to a character style with no break)
.\S+?$
Thank you
Maria
December 1, 2022 7:31 pmThank you, this code was EXACTLY what I was looking for!
Ingo Krehl
November 10, 2015 4:14 pmOr:
(\w\W*){4}$
Admin
November 10, 2015 4:17 pmRight — a little simpler, but \w also finds the underscore _ character, which I don’t want. However, as it’s a wide character (and so visually prominent), perhaps some would like to include it, in which case your GREP is fine.
JR
November 9, 2015 4:27 pmGreat GREP !
Thank you.