Monday, November 9, 2015

grep - Automatically convert H2 to H₂ when typing in Indesign?


I have to regularly type the word H2 into documents for my job. I always forget to make the 2 subscript


I've been watching David Blatner's Indesign secrets and I figured I could use either, commonly misspelled word or to create a GREP Style.


I tried \d., this works but, when I now type any number on its own it will be formatted to subscript.


Is there a way to only apply the formatting to the letters "H2" for it to read H₂?



Answer




Apply the character style (subscript) to any number 2 preceded by ?< an uppercase character \u


(?<=\u)2

or, apply the character style (subscript) to any number 2 preceded by ?< an uppercase H


(?<=H)2

No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...