Copy link to clipboard
Copied
I followed the instructions here: what grep setting will let me not have a hyphanated word at the end of a paragraph in a paragraph st...
And it's not working. If I take the Character Style and apply it to the whole word, it's blocking the hyphen and moving the whole word to the last line (orphan) of the paragraph. I was assuming that the "\w+$" command would do that. But it's not. As the instructions (above) state, "This forces the entire last word to stay on one line, preventing it from being hyphenated. " What I'm thinking is that this is preventing the last word from hyphenating and is trying to keep it on the original line. There is no room for the entire word on that line, and it has to drop to the next line — which it's not letting happen.
At least that's how it seems. Am I right? If so, how can I get this to move the last word to the next line (and be an orphan)? [I cannot rewrite the text to make room for this orphan; I have to accept that. It's better than having the last line:
er.
Thanks!
Hi @gary_sc
I wonder why you don't simply untick this check box in the paragraph style option?
My screenshot is in French, but I am sure you'll understand where it is located.
Copy link to clipboard
Copied
Hi @gary_sc
I wonder why you don't simply untick this check box in the paragraph style option?
My screenshot is in French, but I am sure you'll understand where it is located.
Copy link to clipboard
Copied
HA!
Well, if I knew that, I would not have asked!
Big thanks!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Yeah, this is definitely better than GREP.
Copy link to clipboard
Copied
Is there any punctuation at the end of the paragraph? Your AI gnerated GREP does not mat a word followed by punctuation.
Try \w+\W*[[:punct:]]*\W*$ which should also pick up cases of trailing white space and footnote markers.
Copy link to clipboard
Copied
Hi, @Peter Spier let me try that (at least for curiosity), thanks.
Alas, it did not work. But thank you VERY much for the suggestion.
And thanks again to @jmlevy for the simpler solution (that also works)
Copy link to clipboard
Copied
It worked for me, so I'm surprised it didn't work for you, but As I pointed out in my previous post, your original expression has no option for anything other than a word character at the end of the paragraph, so is unlikely to match anything in normal text.
Copy link to clipboard
Copied
Again, I really appreciate the effort.
Unfortunately, I know more about the existence of GREP than I do about how to create proper expressions. Were it not for copy/paste, I'd not be using it at all.
Big thanks,
Gary
Copy link to clipboard
Copied
If you'd like to learn to write GREP expressions, I highly reccommend https://www.amazon.com/GREP-InDesign-InDesignSecrets-Peter-Kahrel/dp/0982508387
Find more inspiration, events, and resources on the new Adobe Community
Explore Now