4 Replies Latest reply on Jan 30, 2013 5:18 PM by cc2545

    Do I need to use GREP for this?

    cc2545

      I have set up my TOC for my book just fine. In my Contents, the headings from each chapter are pulled in and used as the entries for the TOC, then followed by its page number.

       

      I would like to add a word (the word "Chapter") before each numbered contents entry. Would I use GREP styles for this?

       

      I'm using CS5.

       

      Thank you!

        • 1. Re: Do I need to use GREP for this?
          [Jongware] Most Valuable Participant

          GREP styles cannot add text; you need a GREP Find-and-replace for this, and thus, you cannot do it inside a paragraph style, you need to do it every time you re-generate your TOC.

           

          Fortunately, it's a doozy, as far as that's an appropriate term for anything GREP. Search for this:

           

          ^\d

           

          and replace with this:

           

          Chapter $0

           

          It will add the text before every paragraph that starts with a digit, so if you only need it to apply to some level (with, obviously, a unique paragraph style of its own), set this paragraph style in the Find Formatting section of the Find GREP dialog.

           

          .. Come to think of it, perhaps there *is* a way to set in in your paragrpah style. Perhaps a custom bullet can do it! Not behind my computer, though, so I cannot try that out. If it works, the obvious advantage is that it's in your style definition, and so it *will* appear automagically if you generate your TOC.

          • 2. Re: Do I need to use GREP for this?
            [Jongware] Most Valuable Participant

            Lo and behold: InDesign's Automagic at work!

             

            Screen Shot 2013-01-31 at 12.16.46 AM.png

             

            (There is a space right after "Chapter".)

            • 3. Re: Do I need to use GREP for this?
              peter minneapolis Level 4

              You can create an autonumbered list format that includes text like "Chapter " along with numbers, for the TOC paragraph style, so no scripting needed. Search Google for terms like "InDesign numbered list format text," without quotes for details.

               

               

              HTH

               

               

              Regards,

               

               

              Peter

              _______________________

              Peter Gold

              KnowHow ProServices

               

              cc2545 wrote:

               

              I have set up my TOC for my book just fine. In my Contents, the headings from each chapter are pulled in and used as the entries for the TOC, then followed by its page number.

               

              I would like to add a word (the word "Chapter") before each numbered contents entry. Would I use GREP styles for this?

               

              I'm using CS5.

               

              Thank you!

              1 person found this helpful
              • 4. Re: Do I need to use GREP for this?
                cc2545 Level 1

                Perfect. This is what I was looking for, thank you both! And no need for GREP, have to learn that in the next project.