10 Replies Latest reply on Jan 4, 2012 11:15 AM by Peter Spier Branched from an earlier discussion.

    Re: how to search for all caps headings using GREP

    tracemb

      I am trying to figure out how to find my category headings and format them. They are in all caps, but not made all caps in word, so when the directory is imported, it will not find all caps. That said, here is what I am trying to change: the small all caps to my paragraphy style that makes them larger and bold. The left is what I am wanting and the right is what I need to locate all of. There are about 700 different category headings. I do have a list of the categories only if there is some way I could run a search for that big list of phrases.

       

      Any ideas?1.jpg

        • 1. Re: how to search for all caps headings using GREP
          Peter Spier Most Valuable Participant (Moderator)

          I've branched this to a new thread as it is a different problem from the thread where you posted.

           

          The way to accomplish this is to assigne a paragraph style, which you can do using find/change, but we're going to need to see some additional information about the formatting of the text as it exists now before we know what to search for. Please turn on visibility of non-printing characters and highlight the last few characters in the heading that neads to be changed, then post another screen shot withteh text highlighted and the control panel visible, as it is now, but in text mode.

          • 2. Re: how to search for all caps headings using GREP
            Joel Cherney Adobe Community Professional & MVP

            They are in all caps, but not made all caps in word, so when the directory is imported, it will not find all caps.

             

            You mean that you can't specify All Caps in Find Format in the Find/Change dialog? If there isn't anything else in the document set in allcaps, and if you're using a version of InDesign that supports it (CS3 or newer) then this may be a case where GREP would be useful. In your sample, I see a bunch of two-letter state abbreviations set in all caps, so go make a CategoryHeads paragraph style and use this GREP query:

             

            Find: \u\u\u+

             

            Change to: $0

             

            Change format: Paragraph Style: CategoryHeads

             

            Probably not the most elegant GREP query of all time - I feel like I once knew a more elegant way of writing this query, but it's long gone now. It should work, though.

            • 3. Re: how to search for all caps headings using GREP
              [Jongware] Most Valuable Participant

              It'll work. For safety reasons I would suggest

               

              ^\u\u\u

               

              where the ^ code makes sure the uppercases start at the beginning of a paragraph, not anywhere inside. There is no reason to scan for any more uppercase after this, so adding that final + is not doing anything useful :D

               

              (It's possible to make it *extremely* safe by making a list of all characters that make up these headings: uppercase, space, hyphen, & ... and then you'll always find it needs just another character to make it work for all possible headings. In this case I wouldn't really be bothered about that. If this style gets applied to a wrong paragraph, you are sure to spot it right away.)

               

              -----

               

              Also note that if you only want to apply formatting in the Change To field, there is no need to insert '$0' in there. In this particular -- rare -- case,  InDesign will do what you meant ('apply the formatting') rather than what you tell it to ('replace with nothing')!

              • 4. Re: how to search for all caps headings using GREP
                tracemb Level 1

                Genius, I tell ya! You all are my new favorite people! 5 years of messing with this junk and I finally got it. I did have to go back and find some formatting that I was able to grab easily with find and replace, but now I can be sure my categories have all been caught!

                 

                I have another difficult one I will post when I am not on deadline that has driven the other designer and I crazy for 5 years!

                • 5. Re: how to search for all caps headings using GREP
                  tracemb Level 1

                  OK. I have another formatting change I'd like to make. I'd like less space after the category headings and a little more before. I have attached images of what I have so far and then a final image of what I am wanting it to look more like. Help!

                  1.jpg2.jpg3.jpg

                  4.jpg

                  • 6. Re: how to search for all caps headings using GREP
                    Peter Spier Most Valuable Participant (Moderator)

                    You've assigned a style, right? Edit the style to have the spacing you want.

                    • 7. Re: how to search for all caps headings using GREP
                      tracemb Level 1

                      How do I make the first line of the category have 18 leading, the second line have 13 (which is what the style is set at), and then the return after the category to have leading of 4?

                      • 8. Re: how to search for all caps headings using GREP
                        Peter Spier Most Valuable Participant (Moderator)

                        You don't do this with leading, you do it by adding space before and space after the paragraph in the Indents and Spacing section of the style definition:

                        Paragraph Style spacing.png

                        • 9. Re: how to search for all caps headings using GREP
                          tracemb Level 1

                          I tried that. But I can't go into negative numbers on the after part like I need to.

                          • 10. Re: how to search for all caps headings using GREP
                            Peter Spier Most Valuable Participant (Moderator)

                            I see you have a bunch of empty paragraphs between listings in the screen shot you posted above. Instead of using empty paragraphs you should be setting spacing using space before or after (if you use space before the listings will space properly, and you can then add whatever additional space, if any, to the headings both before and after and that will get added to the other spacing. The net result will be that unless you add spacing to the headings, the leading of the heading style will set the distance from the listing above, and the space before added to the listings first line will control the spacing both from the heading and the other listings. To increase the space after the heading beyond the normal spacing, add some space after to the heading. To increase the space above it, add some space before. Empty paragraphs are a nightmare in typesetting.