doc-src/sedindex
author blanchet
Tue, 27 Apr 2010 11:24:47 +0200
changeset 36473 8a5c99a1c965
parent 3096 ccc2c92bb232
permissions -rwxr-xr-x
remove "higher_order" option from Sledgehammer -- the "smart" default is good enough
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
# a space terminates the \tt part to allow \index{*NE theorem}, etc.
a2c5cd25906e post-CRC corrections
lcp
parents: 103
diff changeset
     9
#
3096
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    10
# change *"X"Y"Z"W  to  "X"Y"Z"W@{\tt "X"Y"Z"W}
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    11
# change *"X"Y"Z    to  "X"Y"Z@{\tt "X"Y"Z}
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    12
# change *"X"Y      to  "X"Y@{\tt "X"Y}
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    13
# change *"X        to  "X@{\tt "X}
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    14
# change *IDENT  to  IDENT@{\tt IDENT}  
103
30bd42401ab2 Initial revision
lcp
parents:
diff changeset
    15
#    where IDENT is any string not containing | ! or @
30bd42401ab2 Initial revision
lcp
parents:
diff changeset
    16
# FOUR backslashes: to escape the shell AND sed
3096
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    17
sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    18
s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    19
s~\*\(\".\".\)~\1@{\\\\tt \1}~g
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    20
s~\*\(\".\)~\1@{\\\\tt \1}~g
ccc2c92bb232 Updated to LaTeX 2e
berghofe
parents: 357
diff changeset
    21
s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -c -q -o $1.ind