GREP style after double line break
- This topic has 3 replies, 3 voices, and was last updated 6 years, 12 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / General InDesign Topics / GREP style after double line break
Learn / Forums / General InDesign Topics / GREP style after double line break
Tagged: GREP
I would like to apply a GREP style to all words after a double line break (before the next line break). Basicly highlight all the titles in the document. What would be the code for that?
I’m not a GREP expert, but I think the pattern for your GREP Style would be
APPLY:
Bold [character style selected from menu]
TO TEXT:
Line break, Line break, Any character repeated one or more times, Line break
which in GREP-ese is \n\n.+\n
I did a test over here and that seems to work. Does it for you?
To be clear, this is what you’d edit in the *paragraph style’s* GREP Style panel. The paragraph style that you’ll be applying to the paragraphs containing all the titles.
It’s not a GREP Find/Change … but the same codes could work there.
GREP styles are defined inside a paragraph (or paragraph style). Which means that you’d first have to apply a paragraph style to those titles — in which case you don’t need a GREP style, you simply make the formatting part of the paragraph style. Also, Anne-Marie correctly wrote that you can look for \n, but that’s a forced line break. If those line breaks are paragraph breaks then you can’t use a GREP style.
Why don’t you apply a paragraph style with a GREP find/change? Look for (?<=\r\r).+ and apply a paragraph style. And if you set space before in the paragraph style, you can remove those two line breaks (which you really should do): Find what: \r\r(.) Change to: $1 Change Format:
Peter
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!