Tip of the Week: De-Runt Your Paragraphs With a GREP Style

This InDesign tip was sent to Tip of the Week email subscribers on June 20, 2019.

InDesignSecrets Tip of the Week

Sign up now and every week you’ll get a new tip, keyboard shortcut, and roundups of new articles, plus exclusive deals sent right to your Inbox!

Just scroll down to the bottom of this page, enter your email address, and click Go! We’ll take care of the rest. Now, on with the tip!


Although you can control quite a few widow and orphan settings with InDesign’s Keep Option settings, one problem remains: a too-short last line (sometimes called a “runt”). Let’s assume you have a style rule that states the last line of a paragraph must contain at least 10 characters. The following GREP Style trick helps you follow that style.

1. Start by creating a Character Style called “no break” that only has the No Break option enabled.

2. Next, add a new GREP Style to your paragraph style, set the Apply Style pop-up menu to the “no break” character style you created earlier, then enter the following regular expression in the To Text field:
.{10}$ (That’s a dot-curly-ten-curly-dollar sign.)

Now any 10 last characters of the paragraph will never be broken.

Bookmark
Please login to bookmark Close

This article was last modified on May 6, 2020

Comments (6)

Leave a Reply

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

  1. Thank you for this great tip! I have a similar question, using GREP how can I tell Indesign to move to a new line the last 3 or 4 characters if a new sentence starts at the end of the line? I know I can use a Shift+enter manually, but I would like to have Indesign to automate and avoid this. Thank you

    1. Mike Rankin

      If I’m understanding your question, you don’t need GREP for that. In the paragraph style Hyphenation settings you can tell InDesign to only hyphenate after a certain number of letters in a word, preventing those stubs that come before the hyphen.

  2. Hi Mike,
    Thanks for the tip. I am facing a big problem though:
    In applying this GREP style I am getting very weird font behaviour.
    As I type in a text box, no matter the font, the characters shrink ever so slightly, starting 10 characters back from the current character being typed.
    Here is a gif showing what I mean: https://imgur.com/a/0Oujn9b

    This happens with various fonts using this paragraph style, and does not happen using the basic paragraph style or in other documents.

    If I take out the GREP style, the problem goes away. If I change the 10 to 5, for example, the shrinkage of letters begins 5 characters instead of 10 behind the last character. Why is this behaviour happening?
    Thanks for any help

    1. Mike Rankin

      That is really weird! If you select the text does it show that the point size or scaling is really changing? Or is it just a screen redraw problem? I’ve seen lots of screen glitches since switching to Big Sur.

      1. I’m on Windows. The answer has been revealed – nothing to do with GREP. The character style, in advanced character controls, was for some reason set to 106% vertical scaling. Credit to Laubender on the adobe forum for suggesting checking that. (link: https://community.adobe.com/t5/indesign/strange-font-behaviour-automatically-resizing-as-i-type/m-p/11800446?page=1) Thanks Mike!

  3. Gert Verrept

    FYI, this slows down ID (cc2019, win 10) when having a lot of pages with not that big paragraphs.