summaryrefslogtreecommitdiff
path: root/info/examples/tip/ts-wind.tip
blob: fbb94c0c33707f74e7dbaf3edecc59a46d235944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
% This macro source file is from the four volume series
% "TeX in Practice" by Stephan von Bechtolsheim, published
% 1993 by Springer-Verlag, New York.
% Copyright 1993 Stephan von Bechtolsheim.
% No warranty or liability is assumed.
% This macro may be copied freely if no fees other than
% media cost or shipping charges are charged and as long
% as this copyright and the following source code itself
% is not changed. Please see the series for further information.
%
% Version: 1.0
% Date: May 1, 1993
%
%
% This source code is documented in 29.1.5, p. III-492.
% Original source in file "io2.TEX", starting line 209.
\wlog{L: "ts-wind.tip" ["io2.TEX," l. 209, p. III-492]}%
% This file DOES belong to format "texip."
\InputD{verb-bas.tip}
\InputD{cstostr.tip}
\InputD{compst.tip}
\newif\ifIndexSpecial
\IndexSpecialfalse
\catcode`\@ = 11
\newwrite\IdxStream
\newwrite\IdxStreamSource
\newif\if@IndexFilesOpen
\@IndexFilesOpenfalse
\def\OpenIndexFiles #1{%
    \if\EmptyStringConditional{#1}%
        \gdef\@IndexFileBaseName{\jobname}%
    \else
        \gdef\@IndexFileBaseName{#1}%
    \fi
    \if@IndexFilesOpen
        \message{\string\OpenIndexFiles: index files
            already open.}%
        \message{\string\OpenIndexFiles: will close
            old files, open new ones with basename
            "\@IndexFileBaseName".}%
        \immediate\closeout\IdxStream
        \immediate\closeout\IdxStreamSource
    \fi
    \@IndexFilesOpentrue
    \immediate\openout\IdxStream = \@IndexFileBaseName.idx
    \immediate\openout\IdxStreamSource = \@IndexFileBaseName.idx2
    \SetIndexStream{\IdxStream}%
}
\def\CloseIndexFiles{%
    \if@IndexFilesOpen
        \immediate\closeout\IdxStream
        \immediate\closeout\IdxStreamSource
        \@IndexFilesOpenfalse
    \fi
}
\def\SetIndexStream #1{%
    \let\IdxStreamUse = #1%
}
\def\Index{% 
    \begingroup
    \MkOthersNoCB
    \@Index
}
\xdef\@IndexSuffixMod{}%
\def\@Index #1{%
    \let\PrintCounter = \relax
    \xdef\IndexTemp{%
        \write\IdxStreamUse{%
            \string\indexentry{#1\@IndexSuffixMod}%
                {\PrintCounter{SWPageNo}}}%
    }%
    \ifIndexSpecial
        \SideNoteText{I: #1}%
    \fi
    \xdef\@IndexSuffixMod{}%
    \endgroup
    \IndexTemp
}
\def\IndexP #1{% 
    \Index{#1}%
    #1%
}
\def\IndexCS #1{% 
    \CSToString{\@IndexCSTemp}{#1}%
    \expandafter\expandafter\expandafter
        \Index{% 
            \@IndexCSTemp
            @% 
            {% 
                \string\tt
                \string\string
                \string#1% 
            }% 
        }%
}
\def\IndexCSX #1{% 
    \CSToString{\@IndexCSTemp}{#1}%
    \expandafter\expandafter\expandafter
        \Index{% 
            #1% 
            @% 
            {% 
                \string\tt
                \string\string
                \Backslash#1% 
            }% 
        }%
}
\def\IndexCSP #1{%
    \IndexCS{#1}%
    {\tt\string#1}%
}
\def\IndexPrim #1{% 
    \CSToString{\@IndexCSTemp}{#1}%
    \expandafter\expandafter\expandafter
        \Index{\@IndexCSTemp @%
            {\string\tt\string\string\string#1}|PRIMITIVE}%
}
\def\IndexPrimP #1{%
    \IndexPrim{#1}%
    {\tt\string #1}%
}
\def\IndexPar{\Index{par@\string\PrintParPrimitive}}
\def\PrintParPrimitive{\BackslashTt{\tt par}}
\def\IndexBye{\Index{bye@\string\PrintByePrimitive}}
\def\PrintByePrimitive{\BackslashTt{\tt bye}}
\def\IndexIf{\Index{if@\string\PrintIf|PRIMITIVE}}
\def\PrintIf{{\tt\string\if}}
\def\IndexElse{\Index{else@\string\PrintElse|PRIMITIVE}}
\def\PrintElse{{\tt\string\else}}
\def\IndexFi{\Index{fi@\string\PrintFi|PRIMITIVE}}
\def\PrintFi{{\tt\string\fi}}
\def\IndexIfCase{\Index{ifcase@\string\PrintIfCase|PRIMITIVE}}
\def\PrintIfCase{{\tt\string\ifcase}}
\def\IndexIfCat{\Index{ifcat@\string\PrintIfCat|PRIMITIVE}}
\def\PrintIfCat{{\tt\string\ifcat}}
\def\IndexIfX{\Index{ifx@\string\PrintIfX|PRIMITIVE}}
\def\PrintIfX{{\tt\string\ifx}}
\def\IndexIfOdd{\Index{ifodd@\string\PrintIfOdd|PRIMITIVE}}
\def\PrintIfOdd{{\tt\string\ifodd}}
\def\IndexIfHbox{\Index{ifhbox@\string\PrintIfHbox|PRIMITIVE}}
\def\PrintIfHbox{{\tt\string\ifhbox}}
\def\IndexIfVbox{\Index{ifvbox@\string\PrintIfVbox|PRIMITIVE}}
\def\PrintIfVbox{{\tt\string\ifvbox}}
\def\IndexIfVoid{\Index{ifvoid@\string\PrintIfVoid|PRIMITIVE}}
\def\PrintIfVoid{{\tt\string\ifvoid}}
\def\IndexIfNum{\Index{ifnum@\string\PrintIfNum|PRIMITIVE}}
\def\PrintIfNum{{\tt\string\ifnum}}
\def\IndexIfDim{\Index{ifdim@\string\PrintIfDim|PRIMITIVE}}
\def\PrintIfDim{{\tt\string\ifdim}}
\def\IndexIfHmode{\Index{ifhmode@\string\PrintIfHmode|PRIMITIVE}}
\def\PrintIfHmode{{\tt\string\ifhmode}}
\def\IndexIfVmode{\Index{ifvmode@\string\PrintIfVmode|PRIMITIVE}}
\def\PrintIfVmode{{\tt\string\ifvmode}}
\def\IndexIfMmode{\Index{ifvmode@\string\PrintIfMmode|PRIMITIVE}}
\def\PrintIfMmode{{\tt\string\ifvmode}}
\def\IndexIfInner{\Index{ifinner@\string\PrintIfInner|PRIMITIVE}}
\def\PrintIfInner{{\tt\string\ifinner}}
\def\IndexIfEof{\Index{ifeof@\string\PrintIfEof|PRIMITIVE}}
\def\PrintIfEof{{\tt\string\ifeof}}%
\def\IndexIfTrue{\Index{iftrue@\string\PrintIfTrue|PRIMITIVE}}
\def\PrintIfTrue{{\tt\string\iftrue}}%
\def\IndexIfFalse{\Index{iffalse@\string\PrintIfFalse|PRIMITIVE}}
\def\PrintIfFalse{{\tt\string\iffalse}}%
\def\IndexRepeat{\Index{repeat@\string\PrintRepeat}}
\def\PrintRepeat{{\tt\string\repeat}}%
\xdef\@IndexSuffixMod{}%
\def\IndexPSet #1{%
    \CSToString{\@IndexPSetResult}{#1}%
    \xdef\@IndexSuffixMod{|IndexP\@IndexPSetResult}%
}
\def\IndexPit #1{{\it #1}}
\def\IndexPbf #1{{\bf #1}}
\catcode`\@ = 12