Annotation of researchv10dc/vol2/index/tools/tdist, revision 1.1

1.1     ! root        1: awk '
        !             2: /{\\(em|sl)[ a-zA-Z]*/ {
        !             3:        save=$0
        !             4:        sub(/{\\(em|sl)/,"XX",$0)
        !             5:        i=index($0,"XX")
        !             6:        string = substr(save,i)
        !             7:        save=string
        !             8:        left=gsub(/{\\(em|sl)/,"{",save)
        !             9:        right=gsub(/}/,"}",save)
        !            10:        if(right == 0){
        !            11:                getline
        !            12:                string = string " " $0
        !            13:                right=gsub(/}/,"}",string)
        !            14:                save=string
        !            15:                left = gsub(/{\\(em|sl)/,"{", save)
        !            16:        }
        !            17:        if(left == 1){
        !            18:                findterm(string)
        !            19:                next
        !            20:        }
        !            21:        else {
        !            22:                for(j=1;j<=left;j++){
        !            23:                        findterm(string)
        !            24:                        sub(/{\\(em|sl)/,"YY",string)
        !            25:                        save=string
        !            26:                        sub(/{\\(em|sl)/,"XX",save)
        !            27:                        i=index(save,"XX")
        !            28:                        string = substr(string,i)
        !            29:                }
        !            30:        }
        !            31:        }
        !            32: function findterm(string){
        !            33:        num = split(string,a," ")
        !            34:        term = a[1]
        !            35:        for(i=2;i<=num;i++){
        !            36:                term = term " " a[i]
        !            37:                if(term ~ /}/){
        !            38:                        if(i > 2 || term ~ /[,\.]/)break
        !            39:                        if(length(a[i+1]) > 3 && a[i+1] !~ /\(/){
        !            40:                                term = term " " a[i+1]
        !            41:                                break
        !            42:                        }
        !            43:                        else break
        !            44:                }
        !            45:        }
        !            46:        sub(/[\.,:;]/, "", term)
        !            47:        print term
        !            48: }' $1.tex
        !            49: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.