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

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

Advocate ,
May 08, 2023 May 08, 2023

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!

TOPICS
Type
4.3K
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 08, 2023 May 08, 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 ch

...
Translate
Community Expert ,
May 08, 2023 May 08, 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%2....

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
Advocate ,
May 08, 2023 May 08, 2023

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





 

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 08, 2023 May 08, 2023

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

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 08, 2023 May 08, 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

 

Screenshot 2023-05-08 at 11.32.41 AM.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
Advocate ,
May 09, 2023 May 09, 2023

Hi Barb -

 

lol, yes, I'm using Paragraph Styles. Hundreds... for years and years (hence my 2023 comment, suggesting that "no runts" should simply be a checkbox and some settings in the Paragraph Style settings by now.) Or, perhaps I'm the only one who doesn't want runts...
That said, I havent used GREP to eliminate runts before, obviously, so will try out the technique you mention, but adjust it for last two words.

Regarding identifying various content types... I've been coloring (and more recently, background shading) styles for years as well. Really good, especially for importing lots of copy... 🙂

Cheers

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 09, 2023 May 09, 2023

"last two words" is a VERY dangerous variable length which can cause your text to go into cascading overset in a narrow column. I hope you have wide columns.

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
Advocate ,
May 09, 2023 May 09, 2023

Hi Peter - wide enough, I think. I'm experimenting with letter count first, but nothing is happening. I'll post in a minute.

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
Advocate ,
May 09, 2023 May 09, 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.

Screenshot 2023-05-09 at 7.17.05 AM.png

 

 

 

Screenshot 2023-05-09 at 7.15.23 AM.pngScreenshot 2023-05-09 at 7.33.41 AM.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
Community Expert ,
May 09, 2023 May 09, 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.

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
Advocate ,
May 09, 2023 May 09, 2023

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.

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 09, 2023 May 09, 2023

Can't send attachents by email -- you have to return to the forum for the screen shot.

And that's a big downside to GREP styles -- they can really slow things down if yoiuy get too many.

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
Advocate ,
May 09, 2023 May 09, 2023

Yes! Ah, the magic of restarting.
Here's the code for runts:
\<(\s?(\S+)){2}$
Found it here.

That said, I'll consider using this vs. character count. I personally don't mind a longer single word on a line by itself, but my client feels otherwise.
cheers

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 09, 2023 May 09, 2023
LATEST

And how do they feel about two short words alone?

Yoda says, "possible it 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
Community Expert ,
May 08, 2023 May 08, 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.

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