Members Only

GREP of the Month: White Space

Learn how to find and replace any white space characters in InDesign.

This article appears in Issue 84 of InDesign Magazine.

Poor white space, it never gets the credit it deserves. Think about it: without spaces, your text would all run together and you wouldn’t know where one word ended and the other began. According to the book Space Between Words by Paul Saenger, separating words with spaces didn’t really catch on until the tenth century; before that, it was up to the reader to decide where one word ended and the next began. Fun!!

Space between words is called “white space” because there’s no visible glyph; it’s the absence of ink. You may think there’s only one kind of white space—the kind you get by hitting the spacebar. Wrong! InDesign’s GREP allows you to search for and replace a dozen different kinds of white space, from the spacebar-created ones to complex constructs like figure spaces; to see them all, open the Find/Change dialog box, click the @ symbol, and then choose the White Space menu item. You can search for these white space characters the same as any other character.

Let’s say you’re a designer who likes to use en dashes with a space on each side – like this. But some smart aleck comes up to you and says you should really use nonbreaking spaces, so that your dash doesn’t accidentally wrap to the next line. 

Type ~= in the Find What field and ~S~=~S in the Change To field to change all those ordinary spaces to nonbreaking ones.

That character (“any white space”) is also handy if you want to change every instance of more than one space to a single space. Find {2,} and change to . The {2,} construct means “anything with two or more consecutive.”  Or you can use InDesign’s built-in Multiple Space to Single Space query, which does the same thing in a more verbose way.

Parting tip: When playing with spaces, it’s best to turn on Type > Show Hidden Characters. 

Bookmark
Please login to bookmark Close

Not a member yet?

Get unlimited access to articles and member-only resources with a CreativePro membership.

Become a Member

Comments (3)

Leave a Reply

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

Loading comments...