3 Replies Latest reply on Nov 8, 2013 8:01 AM by Argonaut777

    GREP to Stylize Footnote Numbers and Convert Blank Spaces to Tabs

    ZenDao Level 1

      I am starting to use more GREP actions in my InDesign layouts. I have to admit it's pretty cool and powerful. Some of the GREP Styles I have created have been straight-forward via Paragraph Style Options>GREP Style. However, I have been trying to figure how to apply GREP Styles to two areas:

       

      1. I have footnote number references appearing at the end of sentences (both in the middle and at end of a paragraph) and after semi-colons. A paragraph style has been applied to the body copy. I do have a character style set for the footnote numbers. When I created a GREP style in the Paragraph Style Options for the footnote numbers, it effects not only the footnote numbers but other numbers (e.g. date, prices) as well in the text. How can I avoid this?

       

      2. The MS Word document that is provided by the client I work with has consistently 6 spaces before the beginning of each paragraph. I usually do a simple search and replace to change the 6 spaces into a Tab (\t). Is there a way to set-up a GREP Style within the Paragraph Style Options so it can do this automatically without needing to do a search and replace operation?

        • 1. Re: GREP to Stylize Footnote Numbers and Convert Blank Spaces to Tabs
          Eugene Tyson Adobe Community Professional & MVP

          1 Your footnotes should have a paragraph style all of it's own. Footnote numbers can be styled using Type>Document Footnote Options

           

          2 No - GREP styles cannot convert spaces to tabs - it can only find a regular pattern and add a character style to it.

           

          But doing a find replace is easy and takes a few seconds.

          • 2. Re: GREP to Stylize Footnote Numbers and Convert Blank Spaces to Tabs
            Mary Posner Level 3

            You can also apply the character style via a GREP style using "~F", but Document Footnote Options is undoubtedly the better way to go. It'll give you a lot more control over the overall appearance of your footnotes.

            • 3. Re: GREP to Stylize Footnote Numbers and Convert Blank Spaces to Tabs
              Argonaut777

              Hi ZenDao,

               

              As Eugene and Mary have already written, Footnote Options are the best way of doing this BUT, from my own experience most people just don't use them/know about them. It seems as if few studios use the built-in Footnote Options as part of their workflow.

               

              Because of that, I was looking at this same problem of how to style footnote numbers that aren't proper 'footnote numbers' just this week and have come up with the following (if cumbersome-looking) GREP which can be used as a GREP style:

               

              ((?<=[\l\u]\.)|(?<=[\l\u]\:)|(?<=[\l\u]))([[:digit:]]+(,|-))*[[:digit:]]+\>

               

              This finds all digits, even those separated by a comma or dash, that are preceded by a letter (either upper- or lower-case), or are preceded by a full stop (or colon) that has a letter (either upper- or lower-case) directly before it, that may or may not be followed by one or more digits, that are at the end of a word.

               

              I've not had a chance to test it to destruction, but it's worked on the short bit of test text I've had.

               

              Oh, and if anyone has a more elegant way of writing this, please show me, I'm still learning!

               

              As to the 6 spaces being converted to a tab, you can't do that as a GREP style, but you can create a GREP style that looks for 6 spaces in a row and applies a Character Style the changes the horizontal scale so that they add up to the same size space that your normal tab would occupy. Not stylish, but it would work!

              Having said that, I'd still go with the standard find/replace for them myself but, needs must and if this helps get you out of a fix, then so be it.

               

              Regards,

               

              Jason