doc-src/sedindex
author wenzelm
Sun, 20 Mar 2011 17:40:45 +0100
changeset 42003 6e45dc518ebb
parent 3096 ccc2c92bb232
permissions -rwxr-xr-x
replaced File.check by specific File.check_file, File.check_dir; clarified File.full_path -- include parts of former Thy_Load.get_file; simplified Thy_Load.check_file -- do not read/digest yet; merged Thy_Load.check_thy/deps_thy -- always read text and parse header; clarified Thy_Header.read -- NB: partial Path.explode outside of args parser combinator; Thy_Info.check_deps etc.: File.read exactly once;
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