Powers of 10 should be entered as 6.2 X 106 or 6.2 X 10-6
Chemical formulas should be entered as Fe2(CrO4)3 or Fe4[Fe(CN)6]3
Ions as Fe(CN)64-
When you are done, highlight the entire block of text (or document if there are a lot of them) and select your macro from the "Macro" menu.
To create the macro copy the text below and follow the directions given in the documentation of either NW Express or NW Pro.
--Enjoy
#Nisus Macro Block
#source front selection
#destination front selection
#Send Text as RTF
#End Nisus Macro Block
@myfile=<STDIN>;
foreach $s (@myfile){
$s=~s/([A-Z][a-z]?[0-9]*)([0-9][+-])/$1\{\\super $2\}/g;
$s=~s/([A-Z][a-z]?)([0-9]*[+-])/$1\{\\super $2\}/g;
$s=~s/\)([+-])/\)\{\\super $1\}/g;
$s=~s/\)([0-9]+)([0-9][+-])/\)\{\\sub $1\}{\\super $2\}/g;
$s=~s/([A-Z][a-z]?)([0-9]+)/$1\{\\sub $2\}/g;
$s=~s/\)([0-9]+)/\)\{\\sub $1\}/g;
$s=~s/\]([0-9]+)/\]\{\\sub $1\}/g;
$s=~s/(\sX\s10|\sx\s10)([+-]?[0-9]*)/$1\{\\super $2\}/g;
print $s;
}
# end of script
Code: Select all