Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Organizing subscripts/superscrits in a Chemistry book

New Here ,
Feb 26, 2021 Feb 26, 2021

Hi everyone,

I'm designing a Chemistry coursebook, and dealing with a lot of chemical compounds, anions, cations etc. All of them use subscripts and superscrips - for an amount of elements - O2, Na2, Ca(OH)2, H2SOor cations/anions - ClO4-,Ca+2, Li+.

So far, I've been using GREPs to put all digits as subscripts:

(?<=\l|\u)(\d{1,3})(?<=\))(\d{1,3}) and (?<=\l|\u)(+|2+|3+|4+|-|2-|3-).

But that's not enough when I insert an advanced anions, eg. NH4+, AsO43-PO43-, SO42-. In these examples, digits become subscripts and minuses and pluses stay on a standard level:

Zrzut ekranu 2021-02-26 o 21.18.19.png
I'd like to prepare one, or few, GREP styles to automate the process. There's a list of most popular anions and cations: http://myweb.astate.edu/mdraganj/cationanion.html, is it better to make a one specific GREP, list all of them as 'exceptions' to the rules? Or is there another way to do it?

Thank you for your time and for a help 🙂

TOPICS
How to , InCopy workflow , Type
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 26, 2021 Feb 26, 2021

Unfortunately, you cannot solve this with GREP in all cases.

This is possible, for example:

 

Chemie_01.png

 

 

But there is no general GREP that can differentiate between these cases, for example!

NH4+

Ca2+

 

Chemie_02.png

Sorry.

 

Finally:

Maybe it is possible if you can rewrite your chemical compounds.

  • From NH4+ you make NH41+

Then you set the "1" without fill color with font size 0.1pt and you can identify and edit these cases.

Translate
New Here ,
Feb 26, 2021 Feb 26, 2021

Sorry, the link might not work. Here's a complete list with a proper format:

ion-list-1-638.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2021 Feb 26, 2021

Unfortunately, you cannot solve this with GREP in all cases.

This is possible, for example:

 

Chemie_01.png

 

 

But there is no general GREP that can differentiate between these cases, for example!

NH4+

Ca2+

 

Chemie_02.png

Sorry.

 

Finally:

Maybe it is possible if you can rewrite your chemical compounds.

  • From NH4+ you make NH41+

Then you set the "1" without fill color with font size 0.1pt and you can identify and edit these cases.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 01, 2021 Mar 01, 2021

Of course, you can play your game with Grep styles! …

 

But here you will have to think first as a chemist and surely not as a grepper!  😉

 

(^/)  The Jedi

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2021 Mar 01, 2021

Some things are possible and some are not.

 

But it does not matter. I will first wait and see if the TO will answer.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 01, 2021 Mar 01, 2021

A chemist knows how to write NH4+ or CA2+!

 

(^/)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 01, 2021 Mar 01, 2021
LATEST

😄

The goal is formatting using Grep. Then the chemist should also think a bit as a grepper in order to achieve his goal.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines