doc-src/sedindex
author nipkow
Wed, 26 Jan 1994 22:07:06 +0100
changeset 248 0d0a6a17a02f
parent 103 30bd42401ab2
child 357 a2c5cd25906e
permissions -rwxr-xr-x
case was renamed to sum_case

#! /bin/sh
#
#sedindex - shell script to create indexes, preprocessing LaTeX's .idx file
#
#  puts strings prefixed by * into \tt font
#    terminator characters for strings are |!@{}
#
# change *"X"Y"Z"W  to  "X"Y"Z"W@{\tt "X"Y"Z"W}
# change *"X"Y"Z    to  "X"Y"Z@{\tt "X"Y"Z}
# change *"X"Y      to  "X"Y@{\tt "X"Y}
# change *"X        to  "X@{\tt "X}
# change *IDENT  to  IDENT@{\tt IDENT}  
#    where IDENT is any string not containing | ! or @
# FOUR backslashes: to escape the shell AND sed
sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g
s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g
s~\*\(\".\".\)~\1@{\\\\tt \1}~g
s~\*\(\".\)~\1@{\\\\tt \1}~g
s~\*\([^|!@{}][^|!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -q -o $1.ind