Grep styles with No Break
Learn / Forums / General InDesign Topics / Grep styles with No Break
- This topic has 4 replies, 4 voices, and was last updated 5 years, 5 months ago by David Blatner.
-
AuthorPosts
-
-
May 19, 2010 at 9:21 am #55754Rhiannon MillerMember
I have to deal with lists of names in the form 'Smith A, Jones B, Williams C'. The text is set in fairly narrow columns, and I want to try and avoid the text breaking between the surname and the inital. I set up a character style to apply No Break, and created a grep style in the paragraph style to apply this character style to text matching the following:
ul+ u+>
It almost works. The trouble is that sometimes the text refuses to break at the comma between two names where the surname is quite long. I end up with lines like
Guzman J,
Esmail R, Karjalainen K, Malmivaara A, Irvin E,
Bombardier C.
when I see no reason why I shouldn't be getting
Guzman J, Esmail R, Karjalainen K,
Malmivaara A, Irvin E, Bombardier C.
This seems more likely to happen where there are more long words immediately following, so I suspect it's something to do with the paragraph composer trying to fill the column width on most lines, even if that means leaving some drastically short. Any ideas on how I can fix this behaviour?
-
May 19, 2010 at 1:06 pm #55758Theunis De JongMember
It is rather odd. You are sure there are no other codes involved? (Soft line breaks, or non-breaking spaces, to name a few that could cause this.)
I suspect it's something to do with the paragraph composer trying to fill the column width on most lines, even if that means leaving some drastically short.
Nope — well, fairly sure of a “nope”. As I understand the paragraph composer, on your strange 3-liner it ought to settle for at least 2 fairly equal lines, followed by whatever remains. The “balance ragged lines” option forces the behavior you propose, but it's highly inappropriate for list of names (if only because it might decide to put each name on a line of its own, just because there is one long name in the list).
Theoretically, you ought the exact same behavior if you replace space-not-after-a-comma with a non-breaking space. Your GREP style method is superior since it doesn't need anything else; but can you try and see if it yields the same result on that paragraph?
(Footnote: it might also work to switch to the Single-line composer. Perhaps the very intelligent Paragraph Composer does get confused by this …)
-
May 20, 2010 at 5:38 am #55780Rhiannon MillerMember
You were right, changing to the single-line composer fixed it. (So did changing the spaces to fixed spaces, but that's less flexible, as you pointed out.)
Thanks so much!
-
October 18, 2018 at 11:29 am #111000Andy CookMember
I need to apply no break to names – ONLY if they are followed by a comma …
-
October 18, 2018 at 5:39 pm #111017David BlatnerKeymaster
Andy, names are tricky… GREP can only find very clear patterns. It doesn’t know about things like “names.” For example, the word “Cook” could, of course, be a name or a word. So GREP probably can’t tell what a name is.
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.