Skip to main content
Participant
August 11, 2024
Answered

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

  • August 11, 2024
  • 2 replies
  • 988 views

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?

This topic has been closed for replies.
Correct answer FRIdNGE

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

 

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

 

 

Best,

(^/)  The Jedi

2 replies

Willi Adelberger
Community Expert
Community Expert
August 11, 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. 

FRIdNGE
FRIdNGECorrect answer
August 11, 2024

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

 

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

 

 

Best,

(^/)  The Jedi

STAVAuthor
Participant
August 11, 2024

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

Thank you!

James Gifford—NitroPress
Legend
August 11, 2024

Replace the spaces within names with nonbreaking spaces.

 

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

STAVAuthor
Participant
August 11, 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? 

Peter Spier
Community Expert
Community Expert
August 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.