Skip to main content
Participant
November 4, 2020
Question

Automation of Chemical Formulas

  • November 4, 2020
  • 1 reply
  • 1346 views

Hello Everyone,

I've many chemical formulas in my brochure. I've to manually superscript and subscript the nos. 

Screenshot attached

eg. 

(NH4)2[Pt(SCN)6]
(NH4)2[PtCl6]
(NH4)2C2O4
(NH4)2Ce(NO3)6
(NH4)2CO3
(NH4)2Cr2O7
(NH4)2CrO4
(NH4)2Hg(SCN)4
(NH4)2SO4
(NH4)3N
(NH4)3PO4
(NH4)H2ASO4
[Cu(H2O)4]SO4 · H2O

and many more...

 

Can I automate all the formulas using a script or GREP express or any other method to avoid manual work?

 

Thank you,

Swati

This topic has been closed for replies.

1 reply

Scott Falkner
Community Expert
Community Expert
November 4, 2020

You certainly can. You can make a character style for the subscripts. I suggest, of there isn’t already a subscript available in the font you bump the weight up a bit. I also suggest using horizontal and vertical sclaing rather than changing the point size. You get finer control and the scaling will scale with the point size.

 

In the bleow image I have three columns. On the left is your supplied text with no formatting applied. In the middle I have changed all the numbers to use the Subscript/Inferior form included in the font Minion Pro I applied this style using GREP Styles. On the right I created a character style for the subscript by adjusting the baseline, horizontal and vertical scale, and weight. I applied the subscript using GREP.

You can view the GREP expression below. I just used the wildcard for any digit.

You can view the InDesign file here.

https://www.dropbox.com/s/c8ntjhypps5comd/Subscripts.idml?dl=0

Swati0101Author
Participant
November 6, 2020

Hi Scott,

Thanks for the reply!

 

But my problem is still not solved...

I have a document which has nos. init but they are not a part of chemical formulas. Example: we have category nos (A297C12, N3034F1) which I don't need any subscript and we have the chemical formulas all over the document, and it's around a 100-page brochure.