3 #sedindex - shell script to create indexes, preprocessing LaTeX's .idx file |
3 #sedindex - shell script to create indexes, preprocessing LaTeX's .idx file |
4 # |
4 # |
5 # puts strings prefixed by * into \tt font |
5 # puts strings prefixed by * into \tt font |
6 # terminator characters for strings are |!@{} |
6 # terminator characters for strings are |!@{} |
7 # |
7 # |
8 # uses \ptt instead of \tt since that happens to explicit \tt's |
|
9 # a space terminates the \tt part to allow \index{*NE theorem}, etc. |
8 # a space terminates the \tt part to allow \index{*NE theorem}, etc. |
10 # |
9 # |
11 # change *"X"Y"Z"W to "X"Y"Z"W@{\ptt "X"Y"Z"W} |
10 # change *"X"Y"Z"W to "X"Y"Z"W@{\tt "X"Y"Z"W} |
12 # change *"X"Y"Z to "X"Y"Z@{\ptt "X"Y"Z} |
11 # change *"X"Y"Z to "X"Y"Z@{\tt "X"Y"Z} |
13 # change *"X"Y to "X"Y@{\ptt "X"Y} |
12 # change *"X"Y to "X"Y@{\tt "X"Y} |
14 # change *"X to "X@{\ptt "X} |
13 # change *"X to "X@{\tt "X} |
15 # change *IDENT to IDENT@{\ptt IDENT} |
14 # change *IDENT to IDENT@{\tt IDENT} |
16 # where IDENT is any string not containing | ! or @ |
15 # where IDENT is any string not containing | ! or @ |
17 # FOUR backslashes: to escape the shell AND sed |
16 # FOUR backslashes: to escape the shell AND sed |
18 sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\ptt \1}~g |
17 sed -e "s~\*\(\".\".\".\".\)~\1@{\\\\tt \1}~g |
19 s~\*\(\".\".\".\)~\1@{\\\\ptt \1}~g |
18 s~\*\(\".\".\".\)~\1@{\\\\tt \1}~g |
20 s~\*\(\".\".\)~\1@{\\\\ptt \1}~g |
19 s~\*\(\".\".\)~\1@{\\\\tt \1}~g |
21 s~\*\(\".\)~\1@{\\\\ptt \1}~g |
20 s~\*\(\".\)~\1@{\\\\tt \1}~g |
22 s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\ptt \1}~g" $1.idx | makeindex -c -q -o $1.ind |
21 s~\*\([^ |!@{}][^ |!@{}]*\)~\1@{\\\\tt \1}~g" $1.idx | makeindex -c -q -o $1.ind |