Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Compound words hyphenated with GREP prefer not to break at all

Engaged ,
May 24, 2023 May 24, 2023

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).

 

Compound word.png

 

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

 

 

TOPICS
Type
551
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 24, 2023 May 24, 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

EugeneTyson_0-1684990744966.png

 

 

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

\b\w+(?=-)

EugeneTyson_1-1684990794085.png

 

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.

EugeneTyson_2-1684991120437.png

 



 

Translate
Community Expert ,
May 24, 2023 May 24, 2023

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

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2023 May 24, 2023

Thanks, Peter, I'll check it out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2023 May 24, 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

EugeneTyson_0-1684990744966.png

 

 

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

\b\w+(?=-)

EugeneTyson_1-1684990794085.png

 

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.

EugeneTyson_2-1684991120437.png

 



 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 01, 2023 Jun 01, 2023
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines