Copy link to clipboard
Copied
Underline Molecular formulae of Chemistry like H2SO4, H2O which subscript
Copy link to clipboard
Copied
Find: (?<=[A-Z]|[a-z])\d{1,2}
Change: Apply subscript
Copy link to clipboard
Copied
Thanks for reply.
OK. In Grep I have to find and change. I thought there may be easy way which I don't know.
Currently I am anchoring rule.
If Adobe add one button in underline options. If tick will give plane underline if untick usual.
Thanks
Suryakant
Copy link to clipboard
Copied
Thanks for reply.
OK. In Grep I have to find and change. I thought there may be easy way which I don't know.
Currently I am anchoring rule.
If Adobe add one button in underline options. If tick will give plane underline if untick usual.
Thanks
Suryakant
By @suryakant256115023evw
You can set is as a GREP rule in ParaStyle.
Copy link to clipboard
Copied
Perhaps I'm not understanding what you want to do, but it seems to me as if you want to underline formulas EXCEPT the subscript characters.
If that's the case, I think a GREP style added to the paragraph style , as suggested by Robert, should do it. Since, as I recall, subscripts would only be digits and would follow only capital letters, you could look for (?<=\u)\d+ and set the style to turn off underline.
Copy link to clipboard
Copied
You might actually need two GREP styles, depending on how you are applying the underline to start with.
First style \u+\d* should find sequences of capital letters mixed with digits and can be used to apply the underline and then the second grep, as above, to remove from the digits.
Copy link to clipboard
Copied
and as a further thought, the same expression used to remove the underline can be used to make the digits subscript...
Copy link to clipboard
Copied
If I have to underline this, I thought there could be simple solution, which I may not know.
Presently I am Anchoring rule below it.
Copy link to clipboard
Copied
Find:
\b((Ac|Ag|Al|Am|Ar|As|At|Au|B|Ba|Be|Bh|Bi|Bk|Br|C|Ca|Cd|Ce|Cf|Cl|Cm|Co|Cr|Cs|Cu|Ds|Db|Dy|Er|Es|Eu|F|Fe|Fm|Fr|Ga|Gd|Ge|H|He|Hf|Hg|Ho|Hs|I|In|Ir|K|Kr|La|Li|Lr|Lu|Md|Mg|Mn|Mo|Mt|N|Na|Nb|Nd|Ne|Ni|No|Np|O|Os|P|Pa|Pb|Pd|Pm|Po|Pr|Pt|Pu|Ra|Rb|Re|Rf|Rg|Rh|Rn|Ru|S|Sb|Sc|Se|Sg|Si|Sm|Sn|Sr|Ta|Tb|Tc|Te|Th|Ti|Tl|Tm|U|V|W|Xe|Y|Yb|Zn|Zr)\d*)+\b
ChangeTo: apply underline character style.
Copy link to clipboard
Copied
Thanks for immediate reply.
Nice solution. But I am comfortable with Anchoring rule.
Thanks again
Suryakant
Copy link to clipboard
Copied
That first expression, as it turns out on furhter testing, also finds some uppercase letters that you don't want to underline, like the first character at the start of a sentence or a proper name, and at the moment I'm at a loss for how to fix that.
I'd also forgotten about the two-character symbols which renders the other expression useless. Sorry.