src/Doc/sedindex
author blanchet
Tue Nov 07 15:16:42 2017 +0100 (19 months ago)
changeset 67022 49309fe530fd
parent 48985 5386df44a037
permissions -rwxr-xr-x
more robust parsing for THF proofs (esp. polymorphic Leo-III proofs)
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
# a space terminates the \tt part to allow \index{*NE theorem}, etc.
lcp@357
     9
#
berghofe@3096
    10
# change *"X"Y"Z"W  to  "X"Y"Z"W@{\tt "X"Y"Z"W}
berghofe@3096
    11
# change *"X"Y"Z    to  "X"Y"Z@{\tt "X"Y"Z}
berghofe@3096
    12
# change *"X"Y      to  "X"Y@{\tt "X"Y}
berghofe@3096
    13
# change *"X        to  "X@{\tt "X}
berghofe@3096
    14
# change *IDENT  to  IDENT@{\tt IDENT}  
lcp@103
    15
#    where IDENT is any string not containing | ! or @
lcp@103
    16
# FOUR backslashes: to escape the shell AND sed
berghofe@3096
    17
sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g
berghofe@3096
    18
s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g
berghofe@3096
    19
s~\*\(\".\".\)~\1@{\\\\tt \1}~g
berghofe@3096
    20
s~\*\(\".\)~\1@{\\\\tt \1}~g
berghofe@3096
    21
s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -c -q -o $1.ind