How to automatically prevent Widows/Orphans in InDesign

Explorer ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Hi,

I constantly create multi-languaged leaflets within InDesign CS5 and the one thing I often find is that I constantly have to revisit the entire document to prevent widows (or orphans - whatever you call them) at the end of a paragraph.

Is there a way to setup within my paragraph style to prevent, lets say, anything less then 10 characters at the end of the paragraph?

I am aware of using the White-Space non break command, but the amount of text I have to visit I wondered if it could be setup in the first instance and prevent widows appearing at the end of a paragraph.

Thanks for taking the time to read

Steve

TOPICS
How to, Type

Views

49.3K

Likes

translate

Translate

Translate

Report

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

Adobe Community Professional , Feb 28, 2013 Feb 28, 2013
To prevent last lines shorter than 10 characters, run this Grep query:Find what: .{10}$Change to: <leave empty>Change format: No BreakOr you can do this as a Grep style.Widow and orphan prevention is set in the paragraph style, see Keep Options.Peter

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

To prevent last lines shorter than 10 characters, run this Grep query:

Find what: .{10}$

Change to: <leave empty>

Change format: No Break

Or you can do this as a Grep style.

Widow and orphan prevention is set in the paragraph style, see Keep Options.

Peter

Likes

translate

Translate

Translate

Report

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
Explorer ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Thats exactly it! Thanks ever so much Peter!

Likes

translate

Translate

Translate

Report

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 ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

This comes up from time to time, and usually sparks a discussion about why it might not be adviseable, but I'll dispense with that for now and say that you can create a character style that applies No Break, then use a GREP style to apply it to the last n characters in a paragraph in the GREP Styles section of your Paragraph Style definition.  The expression .{n}$ should work, where n = the number of characters you want to keep from breaking.

Likes

translate

Translate

Translate

Report

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
New Here ,
Apr 01, 2014 Apr 01, 2014

Copy link to clipboard

Copied

I created a grep that assigns a NOBREAK character style the last word of every paragraph: (\s\w+.?)$

This should apply the NOBREAK character style to...

a space (\s)

+ word (\w+)

+ optional punctuation (.?) - really any character

at the end of every paragraph ($)

I think my parenthesis are actually optional as well, and I'm sure I could get more specific with the punctuation part too but this seems to the the trick for me.

Likes

translate

Translate

Translate

Report

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
New Here ,
Dec 15, 2015 Dec 15, 2015

Copy link to clipboard

Copied

I searched for an answer to this question, and I found these. I am not following how to create a GREP style. Can someone walk me through that process either by clear instructions or screen shots? I tried a few different things, but I must not be fully comprehending how to do this. TIA

Likes

translate

Translate

Translate

Report

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
New Here ,
Feb 08, 2016 Feb 08, 2016

Copy link to clipboard

Copied

MarketingMama: Here's a screenshot video I make adding this GREP to a paragraph style sheet in InDesign: Dropbox - GREP_Widows.mov

Likes

translate

Translate

Translate

Report

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 ,
Apr 05, 2016 Apr 05, 2016

Copy link to clipboard

Copied

Cowanji,

Thanks for the video. I'm sure that's the best way to show how to accomplish a task.

Unfortunately, it is too blurry to see, and you move too quickly for me to follow what you're doing.

Is there a step-by-step instruction available somewhere?

Thanks again!

Likes

translate

Translate

Translate

Report

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 ,
Jun 17, 2016 Jun 17, 2016

Copy link to clipboard

Copied

I had to watch this again as I had forgotten. This is so awesome. So glad I saved the link. Really saving me a lot of time of double checking copy breaks. Thank you so much.

Likes

translate

Translate

Translate

Report

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 ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Thank you! That was very helpful!

Likes

translate

Translate

Translate

Report

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
New Here ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

I tried this, but the problem I found is that if the last two words already had a character style, like italic on them, then the NOBREAK style would knock any other character style that is already on the words. So the last two words of an italic paragraph ended up coming out non italic. Also did the same with bold text, it knocked the bold off. Is there a way to apply a NOBREAK character style without removing a style already applied?

Likes

translate

Translate

Translate

Report

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