summaryrefslogtreecommitdiff
path: root/obsolete/macros/inrstex/inrsdoc/thtoc.tex
blob: 301c5a4e045c7604af81f94c48389c84b7efa1ed (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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
%-*-tex-*-
\ifundefined{writestatus} \input status \relax \fi %
\chcode{toc}

\def\cqu{\line{}\vfill\vbox{\hsize 3.2in \rightskip=0pt \leftskip=0pt
         \centerline{\sheadfont List of Figures}
         \bigskip
         \makefiglist\bigskip 
         This is given by \par
         \def\2{\char'173}\def\3{\char'175} % lazy 
         \tt
         \1centerline\2\1sheadfont List of Figures\3\par
         \1bigskip\par
         \1makefiglist\par
              }
}

\chapterhead{toc}{TABLES\cr of CONTENTS\cr and FIGURES}
\vskip -2.8ex 
\intex\ is able to generate tables of contents, figures, and tables
automatically. It also has general capabilities to create files that can be
used to generate other lists that involve page numbers. 

\shead{toccomlist}{Command List}
\beginthreecolumn
\ext|\chtoc|
\ext|\chtocout|
\ext|\dssshtoc|
\ext|\dssshtocout|
\ext|\figtoc|
\ext|\figtocout|
\ext|\inputfigfiles|
\ext|\inputtblfiles|
\ext|\inputtocfiles|
\ext|\intdssshtoc|
\ext|\intssshtoc|
\ext|\makefiglist|
\ext|\maketbllist|
\ext|\maketoclist|
\ext|\newtocfile|
\ext|\openlistfile|
\ext|\prtoc|
\ext|\prtocout|
\ext|\shtoc|
\ext|\shtocout|
\ext|\sshtoc|
\ext|\ssshtoc|
\ext|\ssshtocout|
\ext|\tbltoc|
\ext|\tbltocout|
\ext|\tocbox|
\ext|\tocfill|
\ext|\writelistfile|
\endthreecolumn

\shead{toclists}{Making Lists of Contents, Figures, Tables}
The distinguishing feature of  |list| files in \intex\ is that they contain
a combination of commands, section or figure numbers, and page numbers.
\intex\ creates these files by the command \@|\openlistfile{<file extension>}|
and gives them the name |\jobname.<file extension>|. 
This command effectively initializes the building process for the particular
list.
|<file extension>| must
be one to three  characters.  The file extensions for tables of contents,
figures, and tables are |.toc|, |.fig|, and |.tbl|. 

The command |\writelistfile| is used to actually put information into the
file and the |\make<file extension>list| is used to bring it back in.
Currently |\maketoclist|, |\makefiglist|, and |\maketbllist| are defined. 

These files will contain a list of commands, in the correct order for
eventually making the actual list. A typical command, in this case generated
by the |\chead| at the beginning of the chapter would be

|\chtoc{<chapter number>}{<chapter title>}{<page number>}|

Actually the |\chead| command does this in two steps. The actual form
executed inside the |\chead| is the command |\chtocout|. This is defaulted in
{\tt inrsdef.tex} to be |\def\chtocout{\string\chtoc}|. A modification of the
definition of |\chtocout| will change the initial command string that is
written to the |.toc| file. Theoretically, a different string could be
written for each chapter if required. This same facility exists for all  the
|.toc| output forms. 

\intex\ has already defined all of the |\<type>toc| commands listed in
Section \ref{toccomlist}. However, all of these commands may be redefined for
different formats. For instance \intex\ has defined |\dssstoc| and |\ssstoc|
to be effectively null. This means that subsubsections and diminished
subsections will not be automatically listed in the table of contents
although the |\ssstoc| and |\dssstoc| commands are in the |.toc| file. 

If a |.toc| file is open, whether or not |autonumbering| is on, the |\chead|,
|\shead|, |\sshead|, |\ssshead|, |\dssshead|, and |\preludehead| commands write to
the |.toc| file. The |\figure| command writes a |\figtoc| command to the
|.fig| file and the |\table| command writes a |\tbltoc| command to the |.tbl|
file. 

Creating, writing, and inputting a new list file is not terribly difficult
but uses moderately advanced macro techniques. Most of the recipe is given 
in the description of |\writelistfile| below. The rest can be determined by
examination of |\makefiglist| and |\inputfigfiles|. 

\shead{toccomforms}{Command Forms}
\beginblockmode
\ext\@|\chtoc{<number>}{<title>}{<page number>}|
\nbr
This creates a chapter entry in the table of contents as given in the table
of contents for this book.

\mbr
\ext\@|\chtocout|
\nbr
Its default definition is
|\def\chtocout{\string\chtoc}| and is 
the command executed in a |\chead| while producing a |.toc| entry. 


\mbr
\ext\@|\dssshtoc{<number>}{<title>}{<page number>}|
\nbr
This would create table of contents entry for a diminished section heading.
Although |\dssshtoc| commands are written to the |\jobname.toc| file, they
are defined as null in \intex. If you want them to appear in a table of
contents place the command |\let\dssshtoc = \intdssshtoc| in the file just
before the |\maketoclist| is called. \@|\intdssshtoc| is |\dssshtoc| in
disguise.

\mbr
\ext\@|\dssshtocout|
\nbr
Its default definition is
|\def\dssshtocout{\string\dssshtoc}| and is 
the command executed in a |\dssshead| while producing a |.toc| entry. 


\mbr
\ext\@|\figtoc{<number>}{<title>}{<page number>}|
\nbr
This would create table of figures  entry for a figure.
\intex\ makes it identical to |\shtoc|

\mbr
\ext\@|\figtocout|
\nbr
Its default definition is
|\def\figtocout{\string\figtoc}| and is 
the command executed in a |\figureform| or 
|\figureinsert| while producing a |.toc| entry. 


\mbr
\ext\@|\inputfigfiles| 
\nbr
This is a token list, including the |\inputwithcheck| of the files that are
used to make the figure list. \intex\ default is 
|\inputwithcheck{\jobname.fig}|. |\the\inputfigfiles| will actually cause the
token list to be executed, {\it ie} in the default case the |\jobname.fig|
will be read in.


\mbr
\ext\@|\inputtblfiles|
\nbr
This is a token list, including the |\inputwithcheck| of the files that are
used to make the table list. \intex\ default is 
|\inputwithcheck{\jobname.tbl}|. |\the\inputtblfiles| will actually cause the
token list to be executed, {\it ie} in the default case the |\jobname.tbl|
will be read in.

\mbr
\ext\@|\inputtocfiles|
\nbr
This is a token list, including the |\inputwithcheck| of the files that are
used to make the figure list. \intex\ default is 
|\inputwithcheck{\newtocfile}|. If a |\jobname.toc| file is open,
|\newtocfile| becomes the {\bf previous} version. If it is not, it is the
most recent version.


\mbr
\ext\@|\makefiglist|
\nbr
This executes |\the\inputfigfiles| which inserts 
the list of |\figtoc| commands into the text.
All required |\beginlist ... \endlist| commands should
be put around it.

\mbr
\ext\@|\maketbllist|
\nbr
This executes |\the\inputtblfiles| which inserts 
the list of |\tbltoc| commands into the text.
All required |\beginlist ... \endlist| commands should
be put around it.

\mbr
\ext\@|\maketoclist|
\nbr
This inserts the list of |\<type>toc| commands into the text by executing
|\the\inputtocfiles|. All required |\beginlist ... \endlist| commands should
be put around it.

\mbr
\ext\@|\newtocfile|
\nbr
If a |\jobname.toc| file is open,
|\newtocfile| becomes the {\bf previous} version. If it is not, it is the
most recent version. This allows for the table of contents to contain a
reference to itself.

\mbr
\ext\@|\prtoc{<title>}{<page number>}|
\nbr
This is the command form written into the |.toc| file by |\preludeheader|.
The output format may be seen by looking at the {\it Preface} listing in the
Table of Contents for this book.

\mbr
\ext\@|\prtocout|
\nbr
Its default definition is
|\def\prtocout{\string\prtoc}| and is 
the command executed in a |\preludehead|
while producing a |.toc| entry. 


\mbr
\ext\@|\shtoc{<number>}{<title>}{<page number>}|
\nbr
\ext\@|\sshtoc{<number>}{<title>}{<page number>}|
\nbr
\ext\@|\ssshtoc{<number>}{<title>}{<page number>}|
\nbr
These three commands are written by the |\shead|, |\sshead| and |\ssshead| to
the |\jobname.toc| file.  Examples of the default \intex\ format
for |\shtoc| may be seen in the Table of Contents.
Although |\ssshtoc| commands are written to the |\jobname.toc| file, they
are defined as null in \intex. If you want them to appear in a table of
contents place the command |\let\ssshtoc = \intssshtoc| in the file just
before the |\maketoclist| is called. \@|\intssshtoc| is |\ssshtoc| in
disguise.

\mbr
\ext\@|\shtocout|
\nbr
\ext\@|\sshtocout|
\nbr
\ext\@|\ssshtocout|
\nbr
These three commands are executed by the |\shead|, |\sshead| and |\ssshead| 
when writing to 
the |\jobname.toc| file.  The defaults are defined in {\tt inrsdef.tex} as
\begintt
\def\shtocout{\string\shtoc}
\def\sshtocout{\string\sshtoc}
\def\ssshtocout{\string\ssshtoc}
\endtt 

\mbr
\ext\@|\tbltoc<number>}{<title>}{<page number>}|
\nbr
This would create table of figures  entry for a figure.
\intex\ makes it identical to |\shtoc|

\mbr
\ext\@|\tbltocout|
\nbr
Its default definition is
|\def\tbltocout{\string\tbltoc}| and is 
the command executed in a |\tableinsert| or |\tableform|
while producing a |.toc| entry. 

\mbr
\ext\@|\tocbox{<indent>}{<number>}{<title>}{<pagenumber>}|
\nbr
This is the general form for producing an entry for a table of contents list.
|<indent>| is a dimension and is the indentation from the left margin;
|<number>|  is the number form; |<title>| is the title  of the
item; and |<pagenumber>| is where it occurred. There is no interitem spacing
as part of the definition. Thus 
$$
\tocbox{4em}{3.7.9}{This is an incredibly long title to show you
        what happens when there is more than one line}{375}
$$
was produced by 
\begintt
\tocbox{4em}{3.7.9}{This is an incredibly long title to show you
        what happens when there is more than one line}{375}
\endtt 

\mbr
\ext\@|\tocfill|
\nbr
This creates the dots across the page in the |\..toc| macros. It is useful
for designing stylistically consistent new ones.

\mbr
\ext\@|\writelistfile{<file extension}{\string\..toc}{<number>}{<arg>}|
\nbr
This is the basic command for writing to a |list| file. The |\string|
allows the |\..toc| to be written into the file without ever being executed.
|{<number>}| is expanded before it is written out while |{<arg>}| is not.
|\writelistfile| adds one more argument, namely 
|{<page number>}|,  to this command before actually writing it to the file.
The complete command written is
\begintt
\..toc{<number>}{<arg>}{<page number>}
\endtt
An example for the first chapter of this book is 
\begintt
\chtoc {Chapter 1}{\tex \cr and\cr INRS\tex }{1}
\endtt
Note that |\tex| is not expanded. 
An examination of any of the |list| files created by \intex\ will show some
more examples.
This command should be used whenever a write to a |list| file is required. It
is used by \intex\ in all of the section and chapter heads, along with
|\figure| and |\table|.

\endblockmode
\ejectpage

\done