GREP for acronyms with mixed characters

Learn / Forums / InDesign User Groups / GREP for acronyms with mixed characters

Viewing 7 reply threads
  • Author
    Posts
    • #98993

      I have a InDesign file that uses a GREP expression that converts all acronyms to Open Type small caps, however, I have one acronym that has mixed character (upper and lower case characters). I would like to convert that upper case characters to Open Type small caps and leave the lower case letter untouched (MiM). What is the correct GREP expression that will work for this? Thanks!

    • #99010
      David Blatner
      Keymaster

      How are you applying the small caps? Is it with a grep style? Or are you using Find/Chang to apply it?

      One idea might be to apply a 2nd style just to (?<=m|M)i(?=m|M)
      (which is "the letter i between two m characters, either upper or lowercase")

      • #99011
        David Blatner
        Keymaster

        There should NOT be a space between < and = in that code… sorry… our forum snuck that in.

    • #99012

      I am applying the small caps using a GREP Style with the “Apply Style” referencing a Character Style that includes the use of OpenType small caps (not InDesign small caps). This works great for all acronyms with all caps but not with mixed case characters. The GREP is \u\u\u* and the Apply Styles refers to “small caps” that I created. Make sense?

    • #99014

      The above code does the opposite, meaning it leaves the caps, the “M” as caps and makes the lower case “i” a small cap

      • #99022
        David Blatner
        Keymaster

        You could make a new character style that removes the small caps style (turns it off) and then apply that to the “i” with my code.

    • #99049

      I’m not sure I follow this suggestion? I am trying to format both “M” in MiM as small caps and leave the “i” as a lower case character? I will try what you suggested but how will affect, or not, the small cap formatting needed for each M?

    • #99061
      David Blatner
      Keymaster

      Here’s a different way to accomplish this… two grep styles, one for each “M”

    • #99079

      I will give this a try and report back with results. Thank you, in advance!

    • #99080

      Yes, that worked! Awesome! Thank you very much!

Viewing 7 reply threads
  • You must be logged in to reply to this topic.
>