Skip to main content
Inspiring
May 8, 2023
解決済み

"No runt" GREP styles need to be attached to Character Styles?

  • May 8, 2023
  • 返信数 3.
  • 4568 ビュー

Just trying to make sure I'm understanding this properly...

I'm trying to set up a GREP to avoid runts.

Seems like all the discussions include creating a Character style called "No Break" or similar.

Is this correct?
If so, it seems this character style needs to be manually applied to every instance where a runt may occur?
I hope not... I'm thinking there must be a way to have GREP automatically apply this to the last two words of every sentence, but maybe not... I may have just been reading too quickly.
Unfortunately, I can't find a reference to this in Peter Kahrel's GREP in InDesign, as I'm not sure what to search for.

thanks!

このトピックへの返信は締め切られました。
解決に役立った回答 Barb Binder

Hi @turner111:

 

I have a couple of editions of @Peter Kahrel's book and just leafed through — I don't see him referring to this in his books. That said, I was sitting in one of his presentations, and I picked up the GREP style shown below directly from him. (EDIT: on second thought, I learned it from Nigel French!)

 

Create a character style called no break and enable the no break attribute. Add the GREP style shown below to your Body Text style to assign the no break attibute to the final 8 characters in your Body Text paragraphs. Keep in mind you can base other paragraphs on Body Text (i.e., lists and quotes) so that the character style carries through.

 

Rereading your question, I'm wondering if you're actually using paragraph styles in your workflow. If not, you should be. An entry level technique is to select all when you place a story and assign the Body Text style. Then you can identify paragraphs that are not body text, like headings and subheadings, etc. That will ensure that all the body paragraphs are using this character style. You do not have to do this one paragraph at a time.

 

~Barb

 

返信数 3

Peter Spier
Community Expert
Community Expert
May 8, 2023

If, as Barb Binder says, you are not using paragraph styles to do this (and I also would recommend that you do) you can use the same expression in a regualr GREP find/change query. Set the change format to No Break or your no break character style.

As a matter of policy I strongly suggest never basing anything on the Basic Paragraph style. Since that style appears by default in every new document there is a great potential for unexpected text reformatting when moving text between files.

Barb Binder
Community Expert
Barb BinderCommunity Expert解決!
Community Expert
May 8, 2023

Hi @turner111:

 

I have a couple of editions of @Peter Kahrel's book and just leafed through — I don't see him referring to this in his books. That said, I was sitting in one of his presentations, and I picked up the GREP style shown below directly from him. (EDIT: on second thought, I learned it from Nigel French!)

 

Create a character style called no break and enable the no break attribute. Add the GREP style shown below to your Body Text style to assign the no break attibute to the final 8 characters in your Body Text paragraphs. Keep in mind you can base other paragraphs on Body Text (i.e., lists and quotes) so that the character style carries through.

 

Rereading your question, I'm wondering if you're actually using paragraph styles in your workflow. If not, you should be. An entry level technique is to select all when you place a story and assign the Body Text style. Then you can identify paragraphs that are not body text, like headings and subheadings, etc. That will ensure that all the body paragraphs are using this character style. You do not have to do this one paragraph at a time.

 

~Barb

 

~Barb at Rocky Mountain Training
turner111作成者
Inspiring
May 9, 2023

Just tried it with 8 character and 15 character variables, though nothing's happening. I'm sure I'm doing something incorrectly, but created this in a brand-new doc & am not sure what needs to change.

 

 

 

 

turner111作成者
Inspiring
May 9, 2023

Show us the GREP style panel, too. It's probably an error in the expression.

You can test it using and ordinary find/change to see what your expression finds, and if you add a color highlight to the style temporarily it should also jump out wherever it's applied.


Oops 🙂 Was jumping around with screenshots. Here you go.
Something's going on, though, because when apply this, the frame blinks for a moment. Things are getting really slow (especially some external things like navigating a PDF), so I'm going to try the old tech support standby and... restart. Back with a report.

Frans v.d. Geest
Community Expert
Community Expert
May 8, 2023

 No, you create that GREP inside a Paragraph style to automatically apply that character style to the GREP expression 😉 So when you apply the Paragraph style with that GREP it will automatically be applied.


https://redokun.com/blog/grep-indesign#:~:text=You%20can%20insert%20a%20GREP,the%20%22To%20text%22%20field.

turner111作成者
Inspiring
May 8, 2023

Hmm...
Ok, I'll have to re-read this.
That said... it's 2023. 😉





 

Frans v.d. Geest
Community Expert
Community Expert
May 8, 2023

Yep, in 2023 and nothing that changed over all these years...😉