| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # lowercase all lines without an @ symbol |
| 3 | awkscip-shell system . . awk. '$0 !~ /@/ {$0=tolower($0)} {print}' $1.idx >$1.idl |
| 4 | |
| 5 | # call makeindex to sort indexentries and produce an index |
| 6 | # ... this *needs* manual.mst to be in place, otherwise we'll end |
| 7 | # up with a LaTeX style index with \begin{index} .. \end{index} |
| 8 | makeindex -l $1.idl |
| 9 | |
| 10 | # put hyphenation help into long commands |
| 11 | echoscip-shell system . . echo. "Hyphenating long index entries" |
| 12 | echoscip-shell system . . echo. '{a=index($0,"`"); |
| 13 | if (a==0) {print $0;} |
| 14 | else { |
| 15 | b=index($0,"'"'"'"); |
| 16 | if (b-a>40) { |
| 17 | anf=substr($0,1,a); |
| 18 | mid=substr($0,a+1,b-a-1); |
| 19 | end=substr($0,b); |
| 20 | b=length(mid); |
| 21 | i=1; |
| 22 | cap=1; |
| 23 | mid2=substr(mid,1,i-1); |
| 24 | while (i<=length(mid)) { |
| 25 | c=substr(mid,i,1); |
| 26 | if (c!=tolower(c)){ |
| 27 | if (cap==0) mid2 = mid2 "\\\-"; |
| 28 | cap=1; |
| 29 | } |
| 30 | else cap=0; |
| 31 | mid2=mid2 c; |
| 32 | i=i+1; |
| 33 | } |
| 34 | print anf mid2 end; |
| 35 | } |
| 36 | else print $0; |
| 37 | } |
| 38 | }' >mh.awk |
| 39 | cpscip-shell system . . cp. $1.ind $1.idl |
| 40 | awkscip-shell system . . awk. -f mh.awk $1.idl >$1.ind |
| 41 | |
| 42 | # clean up |
| 43 | rmscip-shell system . . rm. $1.idl mh.awk |