3 Replies Latest reply on Jun 21, 2012 8:51 AM by [Jongware]

    GREP style for one specific paragraph

    wouterschoutteten

      Hi all,

      I'm faced with the following problem in a textdocument I've got to rework in InDesign.

      The text is based on 3 'groups' of information. First there is a title, beginning with:

      "1.1. Title (so two digits and a paragraph),

      a body text,

      and a source, starting with: 'source: This is the source' and

      '*: this is the source'.

       

      Now I want all paragraphs starting with two digits in the same style, and all lines starting with 'Source' or '*' in the same style.

       

      I'm pretty new with GREP, but I believe that might be the solution. Or any other ideas to to this fast and automated?

      Is there a code that specifies a style for a whole paragraph?

       

      All help is very much appreciated since this is a very laaaarge document.

      Thanks!

        • 1. Re: GREP style for one specific paragraph
          [Jongware] Most Valuable Participant

          GREP styles (which you seem to think of) only apply character styles. So that's out for entire paragraphs.

           

          woutergeeftvorm wrote:

          Now I want all paragraphs starting with two digits in the same style, and all lines starting with 'Source' or '*' in the same style.

           

          Select all text and assign it your Body text paragraph style. Then use this in the Find/Replace dialog, GREP section. Find:

           

          ^\d+\.\d+

           

          Replace: leave blank, but select the name of the title style in the Change To formatting fiend.

          Press Change All. Done.

          • 2. Re: GREP style for one specific paragraph
            wouterschoutteten Level 1

            Works great, thanks for that line.

            Any ideas on the 'source' and '*' lines? By using GREP i've highlighted those words and signs so I can easily find them in the long texts and manualy assign the paragraph style, but there must be an easier way...

            • 3. Re: GREP style for one specific paragraph
              [Jongware] Most Valuable Participant

              Ah, sorry -- I thought the three you mentioned were all of your text. So the text "Soucre" or the asterisk are always at the start of these paragraphs? Then search for this:

               

              ^(Source|\*)

               

              and 'replace' with a style, the same way as you did with the numbered headings.