Skip to main content
Participant
January 24, 2023
Question

Subscript trough text search

  • January 24, 2023
  • 3 replies
  • 1010 views

I have a BIG indesign file in which CO2 is mentioned a bunch of times. The problem is that the 2 needs to be in subscript. When I use the text search function i can opt to selecte every word that is written as CO2, the only problem is that I can't change the 2 to a subscript 2, because the typing window doesn't seem to support it. Any advice on how to go about this problem? 

3 replies

pixxxelschubser
Community Expert
Community Expert
January 24, 2023

Hi @defaultierels3upfei 

do you only have CO2 in your document? Then I would also prefer the Grep shown by @Peter Kahrel 


Or more chemical terms like that? Info: Do not use such Grep styles in large documents -> performance goes down the drain!

 

 

Peter Kahrel
Community Expert
Community Expert
January 24, 2023

all instances of capital O followed by 2, such as H2O and O2

Well, H2O isn't an instance of O followed by 2 🙂

 

And I would use a one-off replacement rather than a grep style: the style is executed every time a story recomposes (which happens a lot),so you can get lags.

 

So, in the GREP tab of the Find/Change window:

Find what: \bCO\K2

Change to: <leave empty>

Change format: subscript (or a subscript character style)

 

P.

Robert at ID-Tasker
Legend
January 24, 2023

You can either use GREP in Find&Change - or use GREP as part of ParaStyle options - but you need to wait for someone else to give you the phrase 😞

 

David NMI Crowe
Participant
January 24, 2023

I’d go for the GREP style.

You need a character style called (for example) Sub, which makes the character subscript. Then use the GREP style panel in the Paragraph Style to apply it to all occurences of (?<=O)2.

Note that it will apply subscript to all instance of capital O followed by 2, such as H2O and O2. But I guess you would want that anyway.

 

David NMI Crowe
Participant
January 24, 2023

Sorry for the typos. Occurrences and instances I meant, of course.