Skip to main content
Susan Culligan
Inspiring
May 24, 2023
Answered

Compound words hyphenated with GREP prefer not to break at all

  • May 24, 2023
  • 2 replies
  • 612 views

Hi! I found the lovely GREP style for preventing bad breaks in compound words (applying NoBreak and entering "\b\w+?-\w+?\b"), but I find that they also resist breaking at the proper hyphen at the end of the line, causing the entire compound word to move to the following line. This often causes a loose line, and I have to track in or out or change working slightly to correct it (see "second-mover" below).

 

 

Is there another piece to the GREP statement that will allow the compound word to break at the proper hyphen? (I'm fascinated by GREP and am eager to learn all of its wonders.) 

 

 

Thanks,

Susan

 

 

This topic has been closed for replies.
Correct answer Eugene Tyson

Here's my approach

 

Setup a new Character Style - call it No Language or something that is ok for you
 Make sure all fields everywhere are blank - except the Language

 

 

In your Paragraph Style - go to the Grep Style and select No Language style you created
And insert

\b\w+(?=-)

 

This allows the Program to use a No Language character style - but won't interfer with other character styles applied

Effectively allowing to have 2 styles applied to the same piece of text.

 



 

2 replies

Eugene TysonCommunity ExpertCorrect answer
Community Expert
May 25, 2023

Here's my approach

 

Setup a new Character Style - call it No Language or something that is ok for you
 Make sure all fields everywhere are blank - except the Language

 

 

In your Paragraph Style - go to the Grep Style and select No Language style you created
And insert

\b\w+(?=-)

 

This allows the Program to use a No Language character style - but won't interfer with other character styles applied

Effectively allowing to have 2 styles applied to the same piece of text.

 



 

Susan Culligan
Inspiring
June 1, 2023

It worked!! Thank you thank you. This will make my workflow ever so much easier.

Peter Spier
Community Expert
Community Expert
May 24, 2023

Another similar discussion last week at https://community.adobe.com/t5/indesign-discussions/grep-for-preventing-double-hyphenation/td-p/13795647

Seems the success of No Break is language dependent for no apparent reason. Using [No Language] insttead seems to solve this with some minor downsides discussed in the above-mentioned thread.

Susan Culligan
Inspiring
May 24, 2023

Thanks, Peter, I'll check it out.