GREP for acronyms with mixed characters
Learn / Forums / InDesign User Groups / GREP for acronyms with mixed characters
Tagged: and acronyms, GREP, small caps
- This topic has 9 replies, 2 voices, and was last updated 6 years, 5 months ago by Ethan Cebulash.
-
AuthorPosts
-
-
October 16, 2017 at 2:41 pm #98993Ethan CebulashMember
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!
-
October 16, 2017 at 2:56 pm #99010David BlatnerKeymaster
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")-
October 16, 2017 at 2:57 pm #99011David BlatnerKeymaster
There should NOT be a space between < and = in that code… sorry… our forum snuck that in.
-
-
October 16, 2017 at 3:11 pm #99012Ethan CebulashMember
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?
-
October 16, 2017 at 3:13 pm #99014Ethan CebulashMember
The above code does the opposite, meaning it leaves the caps, the “M” as caps and makes the lower case “i” a small cap
-
October 16, 2017 at 4:29 pm #99022David BlatnerKeymaster
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.
-
-
October 17, 2017 at 10:10 am #99049Ethan CebulashMember
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?
-
October 18, 2017 at 5:35 am #99061David BlatnerKeymaster
Here’s a different way to accomplish this… two grep styles, one for each “M”
-
October 18, 2017 at 10:20 am #99079Ethan CebulashMember
I will give this a try and report back with results. Thank you, in advance!
-
October 18, 2017 at 10:34 am #99080Ethan CebulashMember
Yes, that worked! Awesome! Thank you very much!
-
-
AuthorPosts
- You must be logged in to reply to this topic.