doc-src/sedindex
author lcp
Tue, 09 Nov 1993 16:47:38 +0100
changeset 103 30bd42401ab2
child 357 a2c5cd25906e
permissions -rwxr-xr-x
Initial revision
     1 #! /bin/sh
     2 #
     3 #sedindex - shell script to create indexes, preprocessing LaTeX's .idx file
     4 #
     5 #  puts strings prefixed by * into \tt font
     6 #    terminator characters for strings are |!@{}
     7 #
     8 # change *"X"Y"Z"W  to  "X"Y"Z"W@{\tt "X"Y"Z"W}
     9 # change *"X"Y"Z    to  "X"Y"Z@{\tt "X"Y"Z}
    10 # change *"X"Y      to  "X"Y@{\tt "X"Y}
    11 # change *"X        to  "X@{\tt "X}
    12 # change *IDENT  to  IDENT@{\tt IDENT}  
    13 #    where IDENT is any string not containing | ! or @
    14 # FOUR backslashes: to escape the shell AND sed
    15 sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g
    16 s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g
    17 s~\*\(\".\".\)~\1@{\\\\tt \1}~g
    18 s~\*\(\".\)~\1@{\\\\tt \1}~g
    19 s~\*\([^|!@{}][^|!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -q -o $1.ind