Skip to main content
Participating Frequently
September 1, 2023
Answered

Need GREP for first word in a sentence to not be just ONE word

  • September 1, 2023
  • 2 replies
  • 556 views

I need a GREP where I can fix the highlighted area. I dont want to start a new sentence with just one word. 

 

Any help?

This topic has been closed for replies.
Correct answer Peter Spier

This can be modified to apply only to words of x character length or shorter...

for example, (\.\h\w{1,4})\K\h would limit it to words up to 4 characters.

2 replies

Peter Spier
Community Expert
Community Expert
September 1, 2023

The following expression should find the space following the first word after a period, regardless of the length of that word:

(\.\h\w+)\K\h

Use the Change Formatting options to set No Break (best done as a character style) to the found space.

In the middle of a line it will have no visual effect, but it will eliminate all single words starting a sentence at the end of a line.

Peter Spier
Community Expert
Peter SpierCommunity ExpertCorrect answer
Community Expert
September 1, 2023

This can be modified to apply only to words of x character length or shorter...

for example, (\.\h\w{1,4})\K\h would limit it to words up to 4 characters.

Mike Witherell
Community Expert
Community Expert
September 1, 2023

In my experience, this is not directly possible. But have you...?

1. Made a paragraph style to control the text?

2. Set the word spacing, letter spacing, and glyph scaling? My favorite settings are 80/100/120 and -5%/0%/5% and 95/100/105.

3. Set the Hyphenation to 9/3/4/1/off/off/off?

4. Have you set kerning method to Optical? (I think it looks great, but not everyone agrees on this)
I find that when these general settings are setup well, I see less problems in the resulting text, leaving only a few things to possibly manually adjust.

One other thing you could try is GREP styles where you apply a nobreak character style to the space after a three-letter word. While this would passively apply it to many words, it would only matter when the 3-letter word is at the end of the line.

Mike Witherell
Isis5C26Author
Participating Frequently
September 1, 2023

Thank you.