Skip to main content
Participant
Aug 1, 2017 7:06 PM UTC
Answered

Nested or GREP style for forcing a line break

Hi all,

I've been away from using nested or GREP styles for a long time and a solution is eluding me. I'm working on a very long mobile document with lists of references that link to the related content.

The lists are separated by a semicolon initially as below:

w14 12/15 7-10; w14 8/15 29-30; w14 7/15 8 pars. 4-6; w14 2/15 26-27; w13 7/15 5 par. 8; 13-14 pars. 16-17, endnotes; 20-25; w11 7/15 24, 28; w10 7/15 20-23; w09 4/15 12-13; w08 2/15 23-24; w95 5/15 21-22, 24-26; w94 2/15 19-20 pars. 14-18; kr 11-12 pars. 16-20; 90-91; ia 142 box

I need to format them with a forced line break after each semicolon as below:

w14 12/15 7-10;

w14 8/15 29-30;

w14 7/15 8 pars. 4-6;

w14 2/15 26-27;

w13 7/15 5 par. 8; 13-14 pars. 16-17, endnotes;

20-25; w11 7/15 24, 28;

w10 7/15 20-23; w09 4/15 12-13;

w08 2/15 23-24; w95 5/15 21-22, 24-26;

w94 2/15 19-20 pars. 14-18;

kr 11-12 pars. 16-20; 90-91;

ia 142 box

Any input on how to create this style is greatly appreciated.

winterm
wintermCorrect answer
Legend
Aug 1, 2017 7:33 PM UTC

You can’t add nor remove any character (including forced line break) using style, be it para, char, grep or nested style, only format.

In your case, plain Find/Change might work. In Text tab:

Find: ;

Change to: ;^n

7 replies

Participant
Aug 1, 2017 7:36 PM UTC

Ok. That explains why I couldn't figure it out.

Thanks for the help.

Translate
Steeve Beach
Participating Frequently
Nov 2, 2021 3:31 PM UTC

I can't figure it out. What is the character style? What really brought me here is a search to find a way to keep short Russian prepositions with the next word. The proofreader commented for each to move to the next line:

 

 

currently if I apply a nobreak character style to "в[space]" of course it includes any в also at the end of a word, and will force both words to the next line. As in this example, "миллионов"

 

 

if I try to avoid that with the Find is: [space]в[space] there is a different problem: the nobreak understakeeps the previous word together

 

The search goes on, but if you had a suggestion...? 

 

 

 

Translate
makusvdw
Participating Frequently
Jun 20, 2025 2:51 PM UTC

Yes, I'm also looking for something like this and also exactly why I ended up on this feed.

Translate
winterm
wintermCorrect answer
Legend
Aug 1, 2017 7:33 PM UTC

You can’t add nor remove any character (including forced line break) using style, be it para, char, grep or nested style, only format.

In your case, plain Find/Change might work. In Text tab:

Find: ;

Change to: ;^n

Translate
Obi-wan Kenobi
Legend
Aug 1, 2017 8:11 PM UTC

Just for comment! … and with Grep Styles!

(^/) 

Translate
Jongware
Community Expert
Community Expert
Aug 1, 2017 8:24 PM UTC

Yeah, applying No-Break works ... right until one of the lines is too long. The find&change doesn't have that problem.

Translate