Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

The Mystery of the Trailing Space Contest Answer and Winner

It’s time to reveal the solution—and the winner—for this month’s InDesignSecrets contest!

Here’s the scenario:  

You receive an InDesign document with text formatted in a Body Text paragraph style. The Body Text style includes a GREP style to prevent runts from occurring. You notice there are trailing spaces at the ends of some paragraphs, and decide to remove them to clean up the document.

InDesign trailing space mystery

When you delete some of the trailing spaces, the paragraph text completely rewraps.

InDesign trailing space mystery

In other paragraphs, removing the trailing space does nothing.

Why does the paragraph text sometimes rewrap when the trailing space is removed?

Solution: The culprit is the GREP style in the Body Text paragraph style. It was used to prevent runts from occurring by automatically applying a No Break character style to the last 9 characters of the paragraph.

The method is explained in this article about runts. It uses the GREP wildcard code for “any character”, which includes whitespace characters, like the trailing space.

So when that trailing space is removed, the range of characters where No Break is applied shifts one character earlier in the paragraph, which can cause the text to rewrap.

And the winner of this contest is…

Tuyen Pham

Tuyen wins 3 months access to videos of any 2 days of CreativePro Week 2017.

Thanks to everyone who entered, and be on the lookout for another contest with a new great prize next month!

Mike Rankin

Mike Rankin

Editor in Chief of InDesignSecrets.com, InDesign Magazine, and CreativePro.com. Author of lynda.com courses on InDesign and Illustrator. Husband. Dad. Dog walker.
Mike Rankin

Latest posts by Mike Rankin (see all)

  • - November 30, -0001
Tags
Related Articles
Comments

2 Comments on “The Mystery of the Trailing Space Contest Answer and Winner

  1. I run a macro before I import text files and one of the things it does is delete a space before a paragraph return.

    I hate those spaces, mainly years ago a paragraph return would end up on a line of its own.

  2. I find that when I use a drop cap paragraph style on an opening paragraph that ends with an extra space, the next para applies the next style correctly. If I then do a search and replace of ‘period space para’ as in your quiz to delete the space, the next paragraph is changed to a drop cap style. I wonder if your answer is related.

Leave a Reply

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