Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP styles question

Return to Member Forum

  • Author
    Posts
    • #60451

      Hello

      I am trying to incorporate a GREP style into a paragraph style (as I haven't done it before). I want every instance of a company name, eg. XYZ, to be capitalised. I have managed to get it working to some extent. However, it also applies the style to the web address eg. https://www.XYC.com. Is there a simple way of making it not do that?

      Thanks in advance!

    • #60452

      There is a not-that-simple way :)

      The name in the web address contains periods to its left and right; adding “word breaks” to your name is enough to make the single word version distinctively different:

      bXYZb

      That said, I think it's bad practice to use GREP styles to capitalize phrases that are supposed to be capitals to begin with. It's generally much 'cleaner' to bite the bullet and use Find/Change to have actual capitals in your text. Imagine, for example, what happens if you export this text out of InDesign to re-use in a web page.

    • #60453

      Crap, it doesn't work! And it's your own fault at that. Why is your company name “XYZ” in its stand-alone version but “XYC” in the web address?

      Okay, on to the decidedly-not-simple-anymore solution. The web address contains periods to its left & right, and while there may be a period to the right of the actual name, there never should be one at its left.

      Try this:

      (?<!.|w)XYZb

      Here is, by the way, another reason not to use this trick to capitalize your company name. If the company name is a common word in all caps (“WORD”, for example), all occurrences of that word in lowercase will be automatically picked up as the company name.

    • #60454

      Thanks for those suggestions, I am really just trying things out and figured it would be a good place to start as it was something I had to do. The name isn't common or an actual real word and its not XYZ (or C for that matter!) so the random capitalisation shouldn't be a problem. Although I will probably just do a find/change, as you say, for the actual job.

      Thanks again!

    • #60455

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads