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

How NOT to split NAMES on a single line in InDesign?

Community Beginner ,
Aug 10, 2024 Aug 10, 2024

Hi everyone,

Does anyone know how to prevent InDesign from splitting names that are separated by commas at the end of a line? I’ve tried a few GREP expressions, but they haven’t been entirely effective. Any suggestions?

TOPICS
How to
729
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

Guide , Aug 11, 2024 Aug 11, 2024

I don't say this Grep code that groups complete names will work in all situations! …

 

((\u\.?['\w-]*)\h?(\u\.\h?)*)+(?2)

 

Capture d’écran 2024-08-11 à 13.50.29.png

 

Best,

(^/)  The Jedi

Translate
Community Expert ,
Aug 10, 2024 Aug 10, 2024

Replace the spaces within names with nonbreaking spaces.

 

Or apply a no-break character style across each name.

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 Beginner ,
Aug 10, 2024 Aug 10, 2024

Hi James,

Thanks for your prompt response. I tried both options and once again it's not working. When I replaced the spaces with nonbreading spaces, suddenly the text disappeared. Any further support? 

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 ,
Aug 11, 2024 Aug 11, 2024

Use the non-breaking spaces only between the parts of a single name, NOT between the names or anywhere else you want the text to break.

you can use the following GREP to get you most of the way there:

Find: (\u\l+)( )(\u\l+)(?!,)

Change: $1~S$3

This will work for most names, but will fail for those with lowercase prefix portions or that have a suffix such as Jr.

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
LEGEND ,
Aug 11, 2024 Aug 11, 2024

@Peter Spier

 

Shouldn't be:

 

Change: $1~S$3$4

 

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 ,
Aug 11, 2024 Aug 11, 2024

Don't think so. That last is a negative look ahead. Expression works here as-is.

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
LEGEND ,
Aug 11, 2024 Aug 11, 2024
quote

Don't think so. That last is a negative look ahead. Expression works here as-is.


By @Peter Spier

 

Right sorry. 

 

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 ,
Aug 11, 2024 Aug 11, 2024

No worries. I'm hardly a GREP guru.

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 ,
Aug 11, 2024 Aug 11, 2024

Sorry if I wasn't more clear — as already noted, you replace ONLY the spaces you don't want to break with this method. It's fairly standard to create or process name lists with a hard or nonbreaking space within each name, so that they will not break no matter how or where they are used further in the project or process.

 

A hard space in every slot just makes a string the app can't process. 🙂

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 ,
Aug 10, 2024 Aug 10, 2024

Create a character style with no language and apply it to names. 
i doubt that it is possible to apply names such a style automatically as names do not follow any regular rules. 
Applying this character style will also exclude them from any spell checks. 

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
Guide ,
Aug 11, 2024 Aug 11, 2024

I don't say this Grep code that groups complete names will work in all situations! …

 

((\u\.?['\w-]*)\h?(\u\.\h?)*)+(?2)

 

Capture d’écran 2024-08-11 à 13.50.29.png

 

Best,

(^/)  The Jedi

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 Beginner ,
Aug 11, 2024 Aug 11, 2024
LATEST

This GREP command seems to be working well for me so far.

Thank you!

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