2 Replies Latest reply on Jan 29, 2017 2:05 AM by Obi-wan Kenobi

    GREP for Titles

    dumitrus56120735

      Hello!

       

      My name is Dumitru.

      I work on design on books, and thus trying for a while to compose a GREP for subtitles to ease mai work load, but no success.


      I have the Paragraph Styles and I can do the Character Styles for these subtitles with no dot “.“ at the end of them, of course.

      I believe all my best was: ^[\(\u+\l+\d]\.\)+r but it did not work. At least I figured I need one GREP for each subtitle, because my subtitles are all different!

       

      Examples of what subtitles I need is this:

       

      • Body text.... body text...body text...

                subtitle: I. subtitle

               Body text.... body text...body text.

       

      • Body text.... body text...body text...

                subtitle: A. new subtitle   

                Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: 1. new subtitle

                Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: a. new subtitle

               Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: 1) new subtitle

               Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: a) new subtitle

               Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: (1) new subtitle

               Body text.... body text...body text.

       

      • Body text.... body text...body text

                subtitle: (a) new subtitle

               Body text.... body text...body text.

       

      I felt I am close but I just could not make it. So, I said I will ask people who really know this otherwise wonderful function of InDesign, GREP.

       

      Thank you.

        • 1. Re: GREP for Titles
          SJRiegel Adobe Community Professional & MVP

          If I understand your setup, you could do this with Paragraph Styles, each having the next set up as Next Style.

          You can then select the whole thing, right-click on the Style that comes first, and choose Apply {style} then Next Style.

          As long as your paragraphs follow a predictable pattern, you can style the whole thing at once.

          Screenshot 2017-01-27 16.42.43.pngScreenshot 2017-01-27 16.41.01.png

          Screenshot 2017-01-27 16.43.56.png

          1 person found this helpful
          • 2. Re: GREP for Titles
            Obi-wan Kenobi Adobe Community Professional

            Dumitru,

             

            What you seem to need is Grep find/replace to apply para styles to paras with no period at their end and a specific numbering at their beginning.

             

            If right, I suggest you to play with auto-numering para styles!

             

            If manual numbering, here're find requests:

             

            Find: ^[A-Z]\.\h.+[^.]$

            Replace by format: A._ParaStyle

             

            Warning: maybe interferences with next one!

             

            Find: ^[IVX]+\.\h.+[^.]$

            Replace by format: I._ParaStyle

             

            Find: ^\d+\.\h.+[^.]$

            Replace by format: 1._ParaStyle

             

            Find: ^[a-z]+\.\h.+[^.]$

            Replace by format: a._ParaStyle

             

            Find: ^\d+\)\h.+[^.]$

            Replace by format: 1)_ParaStyle

             

            Find: ^[a-z]+\)\h.+[^.]$

            Replace by format: a)_ParaStyle

             

            Find: ^\(\d+\)\h.+[^.]$

            Replace by format: (1)_ParaStyle

             

            Find: ^\([a-z]+\)\h.+[^.]$

            Replace by format: (a)_ParaStyle

             

            To avoid real styling problems (and if right!), I'ld use conditions too [see later!]

             

            (^/)

            1 person found this helpful