doc-src/sedindex
author lcp
Tue, 03 May 1994 18:27:30 +0200
changeset 357 a2c5cd25906e
parent 103 30bd42401ab2
child 3096 ccc2c92bb232
permissions -rwxr-xr-x
post-CRC corrections
lcp@103
     1
#! /bin/sh
lcp@103
     2
#
lcp@103
     3
#sedindex - shell script to create indexes, preprocessing LaTeX's .idx file
lcp@103
     4
#
lcp@103
     5
#  puts strings prefixed by * into \tt font
lcp@103
     6
#    terminator characters for strings are |!@{}
lcp@103
     7
#
lcp@357
     8
# uses \ptt instead of \tt since that happens to explicit \tt's 
lcp@357
     9
# a space terminates the \tt part to allow \index{*NE theorem}, etc.
lcp@357
    10
#
lcp@357
    11
# change *"X"Y"Z"W  to  "X"Y"Z"W@{\ptt "X"Y"Z"W}
lcp@357
    12
# change *"X"Y"Z    to  "X"Y"Z@{\ptt "X"Y"Z}
lcp@357
    13
# change *"X"Y      to  "X"Y@{\ptt "X"Y}
lcp@357
    14
# change *"X        to  "X@{\ptt "X}
lcp@357
    15
# change *IDENT  to  IDENT@{\ptt IDENT}  
lcp@103
    16
#    where IDENT is any string not containing | ! or @
lcp@103
    17
# FOUR backslashes: to escape the shell AND sed
lcp@357
    18
sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\ptt \1}~g
lcp@357
    19
s~\*\(\".\".\".\)~\1@{\\\\ptt \1}~g
lcp@357
    20
s~\*\(\".\".\)~\1@{\\\\ptt \1}~g
lcp@357
    21
s~\*\(\".\)~\1@{\\\\ptt \1}~g
lcp@357
    22
s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\ptt \1}~g" $1.idx | makeindex -c -q -o $1.ind