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