Reply To: Can GREP apply nested line styles?

Home Page / Forums / General InDesign Topics (CLOSED) / Can GREP apply nested line styles? / Reply To: Can GREP apply nested line styles?

#61308

At times GREP sounds like the Ideal Magic solution, and indeed it can do a lot of stuff that's not possible with regular searching. However, in this case it cannot.

A GREP style cannot apply a line style. It's oblivious to 'lines' in paragraphs. Use a Nested Line Style to do so. In addition, you want to apply a GREP style if the paragraph style before the current one is something else. You can only use a GREP style inside the current style, and it cannot look outside of its paragraph.

You can use Find GREP to locate your first paragraphs. Look for this:

(?<!r)^.

and put your body paragraph style in the Find Format. It will locate the paragraphs where the previous hard return is “not found”, i.e., it's not found because it's not in the same formatting.

In the Replace With field you cannot add a nested style, so you still have to create a duplicate paragraph style that sets your first line highlight.

This article was last modified on December 24, 2011

Comments (0)

Loading comments...