Copy link to clipboard
Copied
Use GREP!
Create a subscript character style, then create a Paragraph style that had that character style to be used with this GREP:
(?<=CO)2
Do you have NO2 and H2O as well? You can catch them all in one GREP:
([CN]O)\K2|(H)\K2(?=O)
Copy link to clipboard
Copied
Use GREP!
Create a subscript character style, then create a Paragraph style that had that character style to be used with this GREP:
(?<=CO)2
Do you have NO2 and H2O as well? You can catch them all in one GREP:
([CN]O)\K2|(H)\K2(?=O)
Copy link to clipboard
Copied
How can this be solved so that the "2" is not shown as a subscript but as small capital?
Copy link to clipboard
Copied
When creating the character style, don't choose "position: subscript", but instead choose "Case: small caps". Both options can be found in the Character Styles Options menu, on the Basic Character Formats tab
Copy link to clipboard
Copied
I added ([cn]o)\K2|(h)\K2(?=o) to also apply this to all lowercase instances (co2, no2, h2o) too, but how do I capitalize the letters? Can I alter this GREP, do I make a new GREP?
Copy link to clipboard
Copied
In case anione else wonders, this is how I wound up doing it: I merged Frans' uppercase GREP and my lowercase GREP together into:
((?i)[CN](?i)O)\K2|((?i)H)\K2(?=(?i)O)
and I added a new GREP to capitalize all lowercase instances:
(?i)[cn]o(?=2)|(?i)h(?=2)|(?<=2)o
There might be a more effcient GREP string, but this seems to be working
Find more inspiration, events, and resources on the new Adobe Community
Explore Now