Thread View: adobe.indesign.featurerequests
7 messages
7 total messages
Started by TomAbc
Sun, 08 Feb 2009 19:57
Grep Styles/Nested Styles from the end of the paragraph
Author: TomAbc
Date: Sun, 08 Feb 2009 19:57
Date: Sun, 08 Feb 2009 19:57
16 lines
1345 bytes
1345 bytes
Hi - It appears that grep styles, and nested styles only allow you to apply styles from the beginning of the paragraph until the match. I'd like to be able to apply styles from the END of the paragraph going back. This would allow me to apply a non-breaking character style to the end of a paragraph to control "runts". You could make the last two words of a paragraph non breaking, or set a 15 character threshold. This wouldn't work for all cases, but I'm working with centered, non-justified text, so it should work fine. If the feature was there. I'm sure there are other things one could do with it as well. There's a good discussion, and a MANUAL work-around on <http://pdsassoc.com/tipsCS/DeruntingParagraphs/index.html> Tom
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: Dave_Saunders
Date: Sun, 08 Feb 2009 20:42
Date: Sun, 08 Feb 2009 20:42
11 lines
1135 bytes
1135 bytes
With the arrival on the scene of GREP styles, you can indeed now do directly my derunting as described on that page you referenced. Now, if only my GREP were good enough that I could dash it off. After some fiddling about, I came up with this: Create a No Break character style then apply it using a GREP style to: [^\s]+\s+[^\s]+$ that will force the last two words of the paragraph to have no break applied to it. Dave
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: jongware
Date: Sun, 08 Feb 2009 23:18
Date: Sun, 08 Feb 2009 23:18
15 lines
1134 bytes
1134 bytes
Indeed, Dave. A tiny improvement on your nigh-on perfect answer would be that
\w
matches any word character -- you don't have to 'negate' space. A simple
\w\s+\w+\s*$
does the trick. You only have to specify one single character of the 2nd to last word, although a side effect is that this word might be broken (but if that bothers you, use '\w+' instead). The final '\s*' is to ignore zero-or-more space characters at the end of the paragraph, as there always seems to be.
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: jongware
Date: Sun, 08 Feb 2009 23:51
Date: Sun, 08 Feb 2009 23:51
1 lines
730 bytes
730 bytes
[?? But what happens to punctuation, using \w? Can't check now .. Oh no -- and the 'Edit Post' button is already gone ..]
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: Dave_Saunders
Date: Mon, 09 Feb 2009 00:40
Date: Mon, 09 Feb 2009 00:40
3 lines
670 bytes
670 bytes
I started out with \w and couldn't make it work. Dave
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: TomAbc
Date: Thu, 12 Feb 2009 09:02
Date: Thu, 12 Feb 2009 09:02
15 lines
883 bytes
883 bytes
Thanks folks. I didn't futz with it long enough. You are correct, it works as it is.
So I ended up with
\w+(\s+\w+){3}\.?\r
To keep the last 4 words together (3 + 1), with an optional period at the end.
Or
.{10}\r
To keep the last 10 chars together.
Tom
Re: Grep Styles/Nested Styles from the end of the paragraph
Author: Dave_Saunders
Date: Thu, 12 Feb 2009 12:48
Date: Thu, 12 Feb 2009 12:48
9 lines
1332 bytes
1332 bytes
I hope your column is wide enough to accommodate four long words; if not, you've created a permanent overset. I was thinking about this the other day: 1. InDesign CS4 is far less likely to create runts because of a change in the algorithm for setting justified type. 2. Rather than think in terms of words at the end of the paragraph, it might be better to think in terms of number of characters. For example, say the only word on the last line of a paragraph is "misunderstanding." -- is that a runt? I think I could live with that. Better than forcing "a catastrophic, horrendous misunderstanding." on to the last line of a two-line paragraph, rendering utterly terrible spacing in the first line. Dave
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads