#!/usr/local/bin/perl -i # Scans through and replaces H. G by H\ G # also H.~G -> H\ G # # but avoids killing J. R. (Stat Soc) by checking for \em # How to override min and max values with command line eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; while( <> ) { if ( /\\em/ || /\\bf/ ) { # assume there are no names on this line $j++; } elsif ( s/([A-Z])\.[~ ]([A-Z])/$1\\ $2/g || /^\{[A-Z][a-z]* [A-Z]/ ) { do {} while ( s/([A-Z])\.[~ ]([A-Z])/$1\\ $2/g ) ; s/([a-z])( [A-Z]\\)/$1\\$2/g ; } print ; }