Debian Codegraph @

texmf-dist/doc/otherformats/texsis/base/TXSsects.doc

raw
1 %% TXSsects.doc - Chapters and Sections - TeXsis version 2.18
2 %% @(#) $Id: TXSsects.doc,v 18.3 2001/04/06 21:54:45 myers Exp $
3 %======================================================================*
4 % (C) Copyright 1989-1998 by Eric Myers and Frank E. Paige
5 % This file is a part of TeXsis. Distribution and/or modifications
6 % are allowed under the terms of the LaTeX Project Public License (LPPL).
7 % See the file COPYING or ftp://ftp.texsis.org/texsis/LPPL
8 %======================================================================*
9 \ifx\undefined\bs \texsis\input TXSdocM.doc\draft\input Manual.aux\fi
10
11 \section{Typesetting Complete Papers\label{sect.papers}}
12
13 The commands described so far are useful for creating the body of a
14 simple physics paper, but they are not enough to typeset a complete
15 paper. A physics paper generally has a title, one or more authors and
16 their addresses or professional affiliations, and perhaps an abstract.
17 Longer documents may be divided into sections, or even chapters, and
18 there might even be a table of contents or an index. This section
19 describes the commands for creating the basic structural elements of a
20 complete paper: the title material and divisions into chapters,
21 sections, and subsections. It also includes a discussion of more
22 advanced topics, such as how to create a table of contents or an index,
23 and how to control the running headlines at the top of the page. Later,
24 \Sect{fmts} discusses more specialized document layouts for conference
25 proceedings or for papers submitted to specific journals, while
26 \Sect{letr} describes the commands for producing letters, memos, referee
27 reports, and similar specialized documents.
28
29 It is often convenient to be able to typeset the same document in more
30 than one format. Therefore, all complete papers in \TeXsis\ use the
31 same general structure, and one can select the particular document
32 format to be used by changing only one or two commands at the beginning
33 of the manuscript file. The commands to typeset the title page and
34 to break the paper up into sections are still the same, even if they
35 behave slightly differently
36 according to the particular format selected. For example, if you give
37 the \cs{paper} command then the title page material will appear at the
38 top of the first page, and the text of the paper will also begin on that
39 page. If you simply change \cs{paper} to \cs{preprint} the title page
40 material will appear on a page by itself, with a banner (defined by
41 \cs{banner}) across the top of the page, and the text will begin on the
42 next page. Using any of the other document formats described in
43 \Sect{fmts} will cause the title page material to be formatted
44 slightly differently.
45
46 At this point an example may be more instructive than more discussion.
47 Here is how a famous paper\reference{BCS} J.~Bardeen, L.~N.~Cooper, and
48 J.~R.~Schrieffer,
49 \journal Phys. Rev.;108,1175(1957)
50 \endreference
51 would have begun had it been typeset with \TeXsis:
52 \TeXexample
53 |smalltt\texsis
54 \preprint
55 \pubdate{July 8, 1957}
56 \pubcode{hep-cats/yymmnnn}
57 \titlepage
58 \title
59 Theory of Superconductivity
60 \endtitle
61 \author
62 J.~Bardeen
63 Department of Physics
64 University of Illinois
65 Urbana, Illinois 61801
66 \endauthor
67 \and
68 \author
69 L.~N.~Cooper
70 Department of Physics and Astronomy
71 The Ohio State University
72 Columbus, OH 43210
73 \endauthor
74 \and
75 \author
76 J.~R.~Schrieffer
77 Department of Theoretical Physics
78 University of Birmingham
79 Birmingham, England B15 2TT
80 \endauthor
81 \abstract
82 A theory of superconductivity is presented, based on
83 the fact that...
84
85 \endabstract
86 \toappear{Physical Review}
87 \endtitlepage
88
89 \section{Introduction}
90 The main facts which a theory of superconductivity
91 must explain are...
92 |endTeXexample
93 \noindent
94 A more complete example paper is given in the file |Example.tex|, which
95 is included in the standard distribution of \TeXsis.
96 In the rest of this section each of the elements in these examples and
97 several others related to the overall structure of a complete paper will be
98 explained.
99
100
101 %==================================================*
102 \subsection{Types of Documents \label{sect.types}}
103
104 A complete \TeXsis\ paper should start with the \cs{texsis} macro
105 described in \Sect{start}. (While this is not required if you also use
106 one of the macros listed below, it does serve to indicate unambiguously
107 that the document is
108 to be typeset with \TeXsis.) The \cs{texsis} macro can be followed by a
109 command to specify whether the document should be typeset as a simple
110 paper or conference proceeding, a preprint, a book, etc. This macro
111 will provide sensible defaults for the layout, although additional
112 commands can be given to override them. The following basic document
113 types are included in \TeXsis:
114
115 \description{XManuscript\quad}\clump
116 %
117 \itm{\CS{paper}}
118 Produces a paper with the title and abstract at the top of the first
119 page, such as for submission to a conference proceeding.
120 The text begins on the first page, below the title and abstract.
121 %
122 \itm{\CS{preprint}}
123 Produces a paper in a preprint format, with the title material by
124 itself on the first page. A \cs{banner} is put across the top of the
125 title page, and the text begins on the page following.
126 %
127 \itm{\CS{eprint}}
128 Produces a paper in a format suitable for submission to the Los Alamos
129 preprint archives (the ``e-print bulletin boards,'' such as hep-ph,
130 hep-th, hep-lat, or qc-gr).
131 %
132 \itm{\CS{Manuscript}}
133 Similar to \CS{preprint}, but with true double spacing for manuscripts
134 submitted for publication in journals such as the {\sl Physical
135 Review}, which require this.
136 %
137 \itm{\CS{book}}
138 A book or other long document with a separate title page, running
139 headlines, a table of contents, etc. Page numbers are printed in
140 opposite corners on left and right handed pages.
141 %
142 \itm{\CS{thesis}}
143 Similar to \CS{book}, this format is for typesetting a doctoral
144 dissertation or similar document.
145 It may be customized for your own university.
146 %
147 \enddescription
148
149 After the command defining the type of document you can add optional
150 commands to modify the default layout. For example, you might want to
151 use
152 \example
153 |\texsis| \n
154 |\paper| \n
155 |\hsize=|\meta{dimen} \n
156 |\vsize=|\meta{dimen} \n
157 |\singlespaced|
158 \endexample
159 to produce a single-spaced conference proceeding of a specified
160 size. Macros to create more specialized documents in some of the common
161 formats used by physics journals and conferences are described in
162 \Sect{fmts}. Since \TeXsis\ obviously cannot include all
163 the possible formats, that section also contains some hints about how
164 to modify a format to fit your needs.
165
166 %==================================================*
167 \subsection{The Title ``Page'' \label{sect.title}}
168
169 A complete paper almost always starts with a title. Most probably it
170 will also include the names of the authors, and often it will include
171 an abstract. Sometimes the title, author's name(s) and abstract
172 appear on a separate page, while sometimes they simply appear at the
173 top of the first page of the paper. In any case we will refer to all
174 this material together as the ``title page'' material.
175
176 \TeXsis\ has a standardized method for entering the title page
177 material, whether it will actually appear on a page by itself or not.
178 You begin the title page material with \CS{titlepage} and end it with
179 \CS{endtitlepage}.
180 Between these two control sequences you can use any of the commands
181 listed below to enter the various parts of the title page material.
182 (An example appears at the beginning of this section).
183
184 \description{Xendauthor}\clump\tolerance=1700
185 %
186 \itm{\CS{title}}
187 Begins the title of the paper. All lines up to a following
188 \cs{endtitle} are centered and printed in \cs{Tbf} type.
189 Line endings in the input file {\sl are} respected, just as with
190 \cs{obeylines}.
191 %
192 \itm{\CS{author}}
193 Begins an entry for an author's name and address, which should
194 appear on the lines that follow. Line endings in the input file
195 {\it are} respected. The first line to follow is the author's
196 name, which is printed centered in |\bf| type. All subsequent
197 lines are centered in normal type. End with |\endauthor|.
198 %
199 \itm{\CS{and}}
200 Prints the word "and," centered and with appropriate vertical
201 separation. It can be used either between sets of |\author|
202 \dots\ |\endauthor| or between multiple addresses for the same
203 author.
204 %
205 \itm{\CS{authors}}
206 An alternative to |\author| for papers with many authors. Here
207 line endings are not respected; instead, the list of authors is
208 divided into lines as evenly as possible, and each line is
209 centered and printed in Roman type. End with \cs{endauthors}.
210 %
211 \itm{\CS{institution}\arg{symbol}\arg{address}} Prints the symbol and
212 the institution address centered on a line. A |\medskip| is placed
213 before the first address to separate the names and addresses.
214 |\institution| should be placed after the author list but before
215 |\endauthors| to work correctly.
216 %
217 \itm{\CS{abstract}}
218 Begins the abstract. The word "ABSTRACT" is centered above the
219 abstract. The left and right margins are brought in relative to
220 the text of the paper. End with |\endabstract|.
221 %
222 \itm{\CS{pacs}\arg{codes}}
223 Prints the PACS (Physics and Astronomy Classification Scheme) codes
224 on the title page.
225 %
226 \itm{\CS{submitted}\arg{Journal}}
227 Prints the phrase ``Submitted to {\sl Journal}'' centered on the page,
228 with the name of the journal printed in |\sl| type.
229 %
230 \itm{\CS{toappear}\arg{Journal}}
231 Similar to |\submitted|, this prints the phrase
232 ``To appear in {\sl Journal}'' on the title page,
233 with the name of the journal printed in |\sl| type.
234 %
235 \itm{\CS{disclaimer}\arg{contract}}
236 Prints a standard DOE disclaimer for contract number
237 \meta{contract}, printed in 10~pt.\ type, as a footnote.
238 %
239 \enddescription
240
241 The advantage to entering the title page material this way is that if
242 you change the overall document format, either from \cs{paper} to
243 \CS{preprint} or to one of the more specialized formats described in
244 \Sect{fmts}, then the title page material will automatically be changed
245 to match the document format selected.
246
247 \bigskip
248
249 The \cs{banner} macro is called in the \CS{preprint} document format to
250 put the date, a preprint code number, and the name of your institution
251 or organization at the top of the title page. The name of the
252 institution can be changed by saying
253 \example
254 |\def\ORGANIZATION{|\meta{name}|}|
255 \endexample
256 and this change can be made permanent by putting it into the file
257 |TXSsite.tex| when \TeXsis\ is being installed.
258 \def\tmp{}\ifx\ORGANIZATION\tmp
259 (When this manual was printed, the \CS{ORGANIZATION} macro was
260 empty.)
261 \else
262 When this manual was printed, the \CS{ORGANIZATION} macro was:
263 \example
264 \ORGANIZATION
265 \endexample
266 \fi
267 The preprint date and document number can be specified by putting
268 \example\obeylines
269 \CS{pubdate}\arg{date}
270 \CS{pubcode}\arg{code-number}
271 \endexample
272 before the \cs{titlepage}. If these are omitted, the date defaults to
273 the current month and year and the document number defaults either to
274 something set as the default when \TeXsis\ was installed or to the
275 current \TeXsis\ version number. The default at this installation is
276 \ATunlock "\@DOCcode".
277 \ATlock
278 If you really want to customize the look of your paper you can create
279 your own \cs{banner} macro.
280
281 \bigskip
282
283 If you are submitting your paper to one of the \idx{preprint archives}
284 at Los Alamos, such as |hep-lat|, |hep-ph|, or |hep-th|, you can have
285 the archive server automatically insert the preprint number it assigns
286 your document when it is submitted.
287 To do this put
288 % Important: putting \relax here and below inhibits any such substitutions
289 % in this manual if it gets put out on such a server.
290 \example
291 \CS{pubcode}|{hep-lat|\relax|/yymmnnn}|
292 \endexample
293 near the top of the document (change ``\idx{hep-lat}'' as appropriate
294 to the archive you are using).
295 When you submit a paper to an archive with the ``put'' command the
296 server will translate any occurrence in the input file of the sequence
297 ``|hep-lat|\relax|/yymmnnn|'' to ``|hep-lat/|'' followed by the 7
298 digit paper number.
299 You must use the exact string of characters ``|yymmnnn|'' for this to
300 work.
301 When someone else gets your paper from the server and prints a copy it
302 will have the assigned document code in the banner at the top of the
303 title page.
304
305 \bigbreak
306
307 The standard \cs{footnote} macro cannot be used to make footnotes to
308 titles and authors's names, because these special fields
309 use internal vertical mode, where footnotes are not allowed. You
310 should instead use the \cs{vfootnote} macro of plain \TeX\ for such
311 purposes. In this case you must put the reference mark in the title or
312 author list yourself (for example, with |${}^*$|), and then say
313 |\vfootnote*{The footnote}| somewhere else on the page, outside of the
314 internal vertical mode material (the author or title blocks).
315
316 ``Footnotes'' identifying institutions in a long list of authors
317 are often centered on lines immediately below the author list.
318 \CS{authors} and \CS{institution} can be used for this. For example,
319 the author list of one well known paper\reference{DIS} E.D. Bloom, et al.,
320 Phys.\ Rev.\ Letters \vol{23}, 930 (1969) \endreference
321 could be typed as follows:
322 \TeXexample
323 |smalltt\authors
324 E.D.~Bloom,$^a$ M.~Breidenback,$^b$ D.H.~Coward,$^a$
325 H.~DeStaebler,$^a$ J.~Drees,$^a$ J.I.~Friedman,$^b$
326 G.C.~Hartmann,$^{b,c}$ H.W.~Kendall,$^b$ G.~Miller,$^a$
327 L.W.~Mo,$^a$ R.E.~Taylor$^a$
328 \institution{a}{Stanford Linear Accelerator Center,
329 Stanford, CA 94305}
330 \institution{b}{Department of Physics and Laboratory for Nuclear
331 Science, Massachusetts Institute of Technology,
332 Cambridge MA 02139}
333 \institution{c}{Xerox Corporation, Rochester, NY}
334 \endauthors
335 |endTeXexample
336 This produces
337 \authors
338 E.D.~Bloom,$^a$ M.~Breidenback,$^b$ D.H.~Coward,$^a$
339 H.~DeStaebler,$^a$ J.~Drees,$^a$ J.I.~Friedman,$^b$
340 G.C.~Hartmann,$^{b,c}$ H.W.~Kendall,$^b$ G.~Miller,$^a$
341 L.W.~Mo,$^a$ R.E.~Taylor$^a$
342 \institution{a}{Stanford Linear Accelerator Center,
343 Stanford, CA 94305}
344 \institution{b}{Department of Physics and Laboratory for Nuclear
345 Science, Massachusetts Institute of Technology,
346 Cambridge MA 02139}
347 \institution{c}{Xerox Corporation, Rochester, NY}
348 \endauthors
349 \noindent Note that \cs{institution} must come {\sl before} the
350 \cs{endauthors}.
351
352 %==================================================*
353
354 \subsection{Chapters and Sections \label{sect.sects}}
355
356 The following commands can be used to create and automatically number
357 the divisions of a document, including chapters, sections, and
358 appendices:
359
360 \singlelinetrue % make label overhang
361 \description{\hskip 3cm}\clump
362
363 \itm{\CS{chapter}\arg{title}\quad}
364 Begins a chapter with \meta{title} printed in |\Tbf|
365 type on a new page.
366
367 \itm{\CS{section}\arg{title}\quad}
368 Begins a section with the \meta{title} printed in |\tbf|
369 type. This does {\it not} begin on a new page (although you
370 certainly can start a section on a new page by saying
371 |\vfill\supereject| first.)
372
373 \itm{\CS{subsection}\arg{title}\quad}
374 Begins a subsection with the \meta{title} printed in |\bf|
375 type.
376
377 \itm{\CS{subsubsection}\arg{title}\quad}
378 Begins a sub-subsection entitled \meta{title}. This is a lower
379 level than even a subsection and should only be used when truly appropriate.
380
381 \itm{\CS{Appendix}\arg{label}\arg{title}}
382 Begins a chapter-like appendix labeled by the letter \meta{label}
383 (generally A, B, C, \dots or I, II, III, \dots). The \meta{title}
384 is printed in |\Tbf| type at the top of a new page.
385
386 \itm{\CS{appendix}\arg{label}\arg{title}}
387 Begins a section-like appendix labeled by the letter \meta{label}
388 (generally A, B, C, \dots or I, II, III, \dots). The \meta{title}
389 is printed in |\tbf| type.
390
391 \itm{\CS{nosechead}\arg{title}}
392 The \meta{title} is typeset like a subsection headline, but without a
393 subsection number. This is suitable for acknowledgments, lists of
394 references and such.
395
396 \enddescription
397 The title appears at the top of the section or subsection, left
398 justified in the appropriate typestyle for the document type and with
399 an appropriate amount of vertical spacing below. These and other
400 details of the layout vary with the document format.
401 In general \CS{chapter} is appropriate mainly
402 for books or theses; the manual you are reading now uses only
403 \CS{section} and \CS{subsection} divisions.
404
405 As you may have noticed from this manual, the first paragraph of a
406 section or subsection is not indented.
407 This is the usual practice for most well-designed books, though it may
408 seem odd at first.
409 It isn't that strange if you think of the indentation of a paragraph
410 as a way to mark a {\sl separation between} paragraphs, rather than as
411 a way to mark the beginning of a paragraph.
412 But if you really want to indent that first paragraph, just begin it
413 with \cs{par}.
414 On the other hand, if you put any kind of commands or macro
415 definitions between the \CS{section} or \CS{subsection} and the first
416 paragraph then this will interfere with the suppression of the
417 indentation.
418 You can easily fix this by either moving your macro definitions
419 elsewhere or putting in a \cs{noindent} by hand.
420
421
422
423 By default chapter, section, and subsection numbers are printed with
424 the titles, and the chapter and section numbers are also attached to
425 equation, figure and table numbers in the form ``$cc.ss.nn$'', where
426 $cc$ is the chapter number, $ss$ the section number, and $nn$ the
427 equation number. The inclusion of the chapter and section numbers can
428 be turned on or off with the commands
429 \description{~showchaptIDfalse\qquad}
430 \itm{\CS{showchaptIDtrue}} Display chapter numbers.
431 \itm{\CS{showchaptIDfalse}} Do not display chapter numbers.
432 \itm{\CS{showsectIDtrue}} Display section numbers.
433 \itm{\CS{showsectIDfalse}} Do not display section numbers.
434 \enddescription
435
436 \bigskip
437
438 \CS{Appendix} and \CS{appendix} give chapter-like and
439 section-like appendices, respectively. The chapter or section number is
440 replaced by a letter, which is given as the first argument, and the
441 title, which is the second argument, is printed in the same format as a
442 chapter or section title. For example,
443 \TeXexample
444 \appendix{A}{Review of Functional Integration}
445 |endTeXexample
446 \noindent
447 The letter labeling the appendix is attached to the equation
448 numbers if \CS{showchaptIDtrue} or \CS{showsectIDtrue} is used. You can
449 omit the letter by using an empty first argument, as in
450 \TeXexample
451 \appendix{}{Leading logarithm approximation}
452 |endTeXexample
453 \noindent
454 in which case the result is the same as setting
455 \CS{showchaptIDfalse} or \CS{showsectIDfalse}.
456
457 \bigskip
458
459 A skip called \CS{sectionskip} is used before the title of any
460 section-like division (i.e., a |\section| or an |\appendix)|; a skip
461 called \CS{subsectionskip} is used for any lower-level division, that is, a
462 \CS{subsection}, \CS{subsubsection}, or a \CS{nosechead}. Of course these
463 are all removed by \TeX\ if the section starts on a new page.
464 Furthermore, any of these divisions will start on a new page if less
465 than a minimum length given by \CS{sectionminspace} remains on the
466 current page.
467 The defaults for these parameters are
468 \TeXexample
469 \sectionskip=2cm plus 8pt minus 8pt % skip before \section
470 \subsectionskip=1cm plus 4pt minus 4pt % skip before \subsection
471 \sectionminspace=0.25\vsize % new page if less left
472 |endTeXexample
473 but they can be changed to any legal \TeX\ skip or dimension either
474 throughout the document or in a local group. For example, you could
475 use
476 \TeXexample
477 \begingroup
478 \subsectionskip=\sectionskip
479 \fourteenpoint
480 \nosechead{Acknowledgments}
481 \endgroup
482 |endTeXexample
483 to make a \CS{nosechead} which looks like a |\section|.
484
485 \bigskip
486
487 Ordinarily the order of appearance of the sections of a document
488 are not changed, so there is no automatic mechanism for labeling the
489 sections. Any of the divisions described above can be labeled by
490 inserting \cs{label}\arg{label} into the title text. The \meta{label}
491 should have the form \meta{type.name}, where \meta{type} is |chap|,
492 |sect|, etc., to avoid possible conflicts with other kinds of labels.
493 The corresponding numbers can then be referred to with
494 |\use{|\meta{type.name}|}|, as described in \Sect{labels}.
495
496 If the title of a chapter or section is too long, a break in
497 the line can be inserted with the \cs{n} command. This will also
498 break the line in the title when it appears in the table of contents.
499 If running headlines are being used (see \Sect{headline}) then only the
500 first part of the title, up to the \cs{n}, will be used for the running
501 headline.
502 You can always reset the headline by hand with |\setHeadline|
503 (see \Sect{headline}).
504
505 You can customize the behavior of the section-making macros by
506 adding your own definitions for the macros
507 \index{customization!chapters and sections}%
508 \example
509 \CS{everychapter}, \CS{everysection}, \CS{everysubsection},
510 \CS{everysubsubsection},
511 \endexample
512 which are called immediately before making the corresponding
513 division of the document, or for the macros
514 \example
515 \CS{afterchapter}, \CS{aftersection}, \CS{aftersubsection},
516 \CS{aftersubsubsection},
517 \endexample
518 which are called immediately afterwards. By default all of these macros
519 do nothing. As an example, if you wanted every section to begin on a
520 new page, and you wanted numbered footnotes created by \cs{NFootnote} to
521 start over counting from one at the begining of each section, you
522 could define:
523 \TeXexample
524 \def\everysection{\vfill\supereject \footnum=0}
525 |endTeXexample
526
527 The full text of the title of the current chapter, section, and
528 subsection is saved in \CS{ChapterTitle}, \CS{SectionTitle}, and
529 \CS{SubsectionTitle}, so that you may do whatever you want with these
530 later in the chapter or section. An example of how these might be
531 used with \CS{aftersubsection} to change the running headlines is
532 given in \Sect{headline}.
533
534
535 Another way you can control the results produced by \CS{chapter} and
536 \CS{section} is to change the way the chapter or section number is
537 printed, by changing the definitions of the macros \CS{ChapterStyle},
538 \CS{SectionStyle}, or \CS{SubsectionStyle}. These macros take
539 one argument, the chapter or section number, and by default they simply
540 return that argument. By substituting your own definition you can do
541 almost anything you like to the section number. For example, it is
542 often desired that the section number printed as a Roman numeral
543 rather than as an Arabic numeral. The following definition will convert
544 the section number to an upper-case Roman numeral:
545 \TeXexample
546 \def\SectionStyle#1{\uppercase\expandafter{\romannumeral #1}}
547 |endTeXexample
548
549 Even more customized behavior of the section-making macros is possible.
550 For example, \cs{Tbf} and \cs{tbf} can also be defined as macros which
551 take a single argument, which is arranged to be the title of the
552 section or chapter.
553 To see how this works it may be best to look at the definitions of
554 \CS{chapter} and \CS{section} and the like in the source file
555 |TXSsects.tex|. For very specialized applications you could even copy
556 the definitions in this file to the TXSmods.tex file or your own
557 personal style file and then alter them however you like.
558
559
560 %==================================================*
561
562 \subsection{The Master File}
563
564 An useful concept for typesetting a long document is that of
565 the\index{master file} {\em Master File}.
566 The idea is to create one small file which initializes \TeXsis\ with
567 \cs{texsis}, makes any special definitions or sets parameters, and
568 then reads in the actual text of the document in sections using the
569 |\input| command.
570 As a simple example consider a manuscript called MUONS.
571 The master file is called |MUONS.tex|, and contains the following:
572 \TeXexample
573 |smalltt\texsis % initialize TeXsis
574 \input MyMacros % special macros for this paper
575 \input MUONSr % references for the paper
576 \input MUONS0 % title page for the paper
577 \input MUONS1 % first section of manuscript
578 \input MUONS2 % second section of manuscript
579 \ListReferences % print the reference list
580 \end
581 |endTeXexample
582 The file |MyMacros.tex| contains any special macro definitions used
583 in this paper. (If there are none, leave this line out.) The
584 file |MUONSr.tex| contains the references used in this paper,
585 beginning with |\referencelist| and ending with
586 |\endreferencelist|, as described in \Sect{refs}. The
587 file |MUONS0.tex| contains the commands for producing the title
588 page of the paper, as described in \Sect{fmts}. The
589 actual text of the manuscript is divided into two parts, which
590 are kept in the files |MUONS1.tex| and |MUONS2.tex|. To process the
591 entire document one simply runs \TeXsis\ on the master file with
592 the command
593 \TeXexample
594 texsis MUONS
595 |endTeXexample
596 \noindent
597 If you are familiar with computer programming you may think of
598 the master file as the main program and the other files as
599 subroutines called by the main program.
600
601 One of the great advantages of using a master file, aside from
602 keeping the manuscript organized, is that it lets you work on a single
603 section of the paper at a time. For example, suppose you want to
604 run off a draft of just the first section of the paper called MUONS
605 above. You don't need to process the references, the title page,
606 or the second section of the paper. Recall that the percent sign
607 (|%|) is the comment character in \TeX\ --- anything appearing on
608 a line after a |%| is ignored by \TeX. Thus we simply edit the
609 master file and put a |%| in front of certain lines, like this:
610 \TeXexample
611 |smalltt\texsis % initialize TeXsis
612 \draft % optional draft mode
613 \input MyMacros % special macros for this paper
614 % \input MUONSr % references for the paper
615 % \input MUONS0 % title page for the paper
616 \input MUONS1 % first section of manuscript
617 % \input MUONS2 % section section of manuscript
618 % \ListReferences % print the references
619 \end
620 |endTeXexample
621 Now when you run \TeXsis\ on this file only the first section of
622 the paper will be processed, but it will use the macros defined
623 in |MyMacros.tex|, as well as any other definitions that you might
624 add to the master file. Once the first section is error free you
625 can repeat the process on the second section of the paper,
626 without rerunning the first section. After both sections are
627 correct you can reinstate all lines in the master file and
628 process the whole document.
629
630 %==================================================*
631
632 \subsection{Table of Contents \label{sect.conts}}
633
634 The section-making macros just described automatically make an entry in
635 a \idx{table of contents} for the document being prepared. The title of
636 the chapter or section and the page number are stored in a table of
637 contents file (which ends with the extension ``|.toc|'') until needed,
638 then the table of contents is created simply
639 by saying \CS{Contents}.
640 If your document is divided into chapters,
641 like a book, the table of contents should appear on a page with a Roman
642 numeral page number (which is obtained by setting \cs{pageno} to a
643 negative value). For example:
644 \TeXexample
645 \book % document format for a book
646 \input Chapt1 % input chapters...
647 ...
648 \vfill\supereject % eject last page, including figures
649 \pageno=-3 % print on pages iii, iv, ...
650 \nosechead{Contents} % label TOC without section #
651 \Contents % generate table of contents
652 |endTeXexample
653
654 The table of contents is usually printed at the {\sl end\/} of the
655 document so that all the page numbers are correct. You then
656 simply move these pages to the front of the document by hand.
657 Alternately, you can say \CS{Contents} at the beginning of your document
658 to read in the table of contents file produced by a previous run of
659 \TeXsis, although then you must process the document twice to be sure
660 that the page numbers are correct.
661
662 It is important to note that nothing is written to the table of contents
663 file unless \CS{Contentstrue} is set. The default for most documents
664 is \CS{Contentsfalse}, since one usually does not want a table of
665 contents for a short paper or a memo or a letter. The exceptions are
666 \cs{book} and \cs{thesis}, which automatically set
667 \CS{Contentstrue}. In any case, if you want a table of contents
668 you can explicitly state \CS{Contentstrue}.
669
670 While an entry in the table of contents is created by
671 \cs{chapter} or \cs{section}, no entry is made for \cs{nosechead}. In
672 this case, or in any case, you can insert an entry into the table of
673 contents ``by hand'' by saying
674 \example
675 \CS{addTOC}\arg{level}\arg{title}\arg{page}
676 \endexample
677 where \meta{level} is the level of division for the entry being made,
678 with 0 for chapters, 1 for sections and 2 for subsections. This
679 controls how much vertical space is put around the table of contents
680 entry and how much the entry is indented in the list.
681 %
682 The \meta{title} is the text of the title as it should appear in the
683 table of contents. Text which is too long for one line will be split
684 over several lines, but you can force a line break where you want one
685 with \cs{n}. The \meta{page} is the page number for the entry you are
686 making. Generally you'll use \cs{folio} here to just use the current
687 page number, whatever that may be. Thus to make a section level entry
688 in the table of contents having the title ``Acknowledgments'' you would
689 simply say
690 \TeXexample
691 \addTOC{1}{Acknowledgments}{\folio}
692 |endTeXexample
693
694 Entries made in the table of contents by \cs{chapter}, \cs{section},
695 etc. will optionally begin with the chapter or section number, depending
696 upon whether \cs{showchaptIDtrue} and \cs{showsectIDtrue} are selected.
697 The decision whether or not to show the chapter or section number is
698 made when the table of contents is printed by \CS{Contents}, not when
699 the \cs{chapter} or \cs{section} is begun. Thus it is possible to have
700 the section numbers showing at the beginning of the section, but to then
701 have no section numbers in the table of contents by saying
702 \cs{showsectIDfalse} immediately before saying \CS{Contents}.
703
704 \bigbreak
705
706 It is possible to write commands or other text to the table of contents
707 file while it is being created, using the command
708 \CS{TOCwrite}\arg{stuff}.
709 For example, the heading separating the appendices from the rest of
710 the entries in the table of contents of this Manual was created by
711 saying
712 \TeXexample
713 \TOCwrite{\bigskip\noexpand\nosechead{Appendices:}}
714 |endTeXexample
715 \noindent
716 before the appendices were created. The \cs{noexpand} prevents the
717 |\nosechead| from being expanded until later, after the table of contents
718 file is read back in by \CS{Contents}
719
720
721 \bigbreak
722
723 What if you want the table of contents to appear in the table
724 of contents itself!? Naturally it should appear first (even though it
725 may be printed at the end of the document). You can use the tagging
726 mechanism described in \Sect{labels} to make a ``forward reference''
727 to the page number. At the beginning of the document you can create
728 the table of contents entry by saying
729 \TeXexample
730 \addTOC{0}{Table of Contents}{\noexpand\use{page.TOC}}
731 |endTeXexample
732 \noindent
733 The \cs{noexpand} prevents the \cs{use} from being expanded until later,
734 after the table of contents file is read back in. Later, when you actually
735 print the table of contents you would first tag the page number, then
736 invoke \CS{Contents}, like so:
737 \TeXexample
738 \nosechead{Table of Contents}
739 \tag{page.TOC}{\folio}
740 \Contents
741 |endTeXexample
742
743 \Ignore % NO, WE DON'T DO IT
744 \noindent
745 As a demonstration of this we have done this for the table of contents
746 for this manual. For more information about \cs{tag} and \cs{use} see
747 \Sect{labels}.\relax
748 \endIgnore
749
750 %======================================================================*
751
752 \subsection{Running Headlines and Footlines \label{sect.headline}}
753
754 In Plain \TeX, whenever a page is output an optional headline
755 and footline are added at the top and bottom of the page. In \TeXsis\
756 the footline is normally blank, while the headline contains the page
757 number in the upper right corner. The \cs{book} and \cs{thesis} formats
758 also display a running headline, centered in 10~pt.\ italic type,
759 containing the chapter or section title.
760 Running headlines and page numbers are {\bf not} printed on any
761 page containing a \cs{title} or a new \cs{chapter}.
762 For an example of running headlines look at the top of
763 any page in this Manual.
764
765 \CS{nopagenumbers} turns off the running headlines and
766 footlines, just as it does in Plain \TeX. In \TeXsis\ saying
767 \CS{pagenumbers} restores the standard headlines and footlines.
768 Saying \CS{bookpagenumbers} puts odd page numbers in the upper right
769 corner and even page numbers in the upper left corner, the normal
770 convention for books. This is the default for \cs{book}.
771
772 \CS{RunningHeadstrue}, the default for \cs{book} (and
773 \cs{thesis}), displays the running headline text \cs{HeadText}, as well
774 as the page number. |\RunningHeadsfalse| turns off the running
775 headlines but leaves the page numbers. \cs{HeadText} is defined by
776 \cs{chapter} to be the chapter title in 10~pt.\ italic type; if no
777 chapters are used, then it is defined by \cs{section} to be the section
778 title. You can change the running headline yourself with the command
779 \CS{setHeadline}\arg{text}. For example, the headline at the top of
780 this page could have been created by saying
781 \example\tt
782 \CS{setHeadline}|{|\HeadText|}|
783 \endexample
784 The headline text appears in typestyle \CS{HeadFont}, which
785 you can change to suit your tastes. The default is
786 |\tenit|,
787 but for this manual we used |\def\HeadFont{\tensl}|.
788
789
790 Running headlines are not normally affected by \cs{subsection}, but it
791 is easy to have each subsection change the runing headlines by
792 defining \cs{aftersubsection} to include a \CS{setHeadline} command.
793 As a useful example, suppose that each subsection is to have a running
794 headline composed of both the title of the section and the title of
795 the subsection. You could have this done automatically by defining
796 something like:
797 \TeXexample
798 \def\aftersubsection{\setHeadline{\SectionTitle: \SubsectionTitle}}
799 |endTeXexample
800 The rest of this section will have such running headlines as an
801 example.
802 \def\aftersubsection{\setHeadline{\SectionTitle: \SubsectionTitle}}
803 \bigskip %<-- needed to force page break before next section!
804
805
806 %======================================================================*
807
808 \subsection{How to Make an Index \label{sect.index}}
809
810 The traditional way to make an index for a book was to write key~words
811 on 3$\times$5 ``index'' cards, and to then write on these card the
812 numbers of the pages on which the key words occurred.
813 The cards were then sorted by hand and then their contents also sorted
814 and typed in order to make the index.
815 This was a tedious and time consuming task.
816 Fortunately this whole process has been modernized so that an index
817 can be made almost automatically.
818 Still, it takes a certain amount of care to create a useful, well
819 constructed index.
820 An important part of designing a good index is deciding which
821 key~words will be useful in the index and which key~words will not.
822 A computer cannot make these decisions for you.
823
824 Making an index with \TeX\ still involves collecting the index entries,
825 sorting them (and removing duplicate references), and then producing the
826 final index. The first and last steps are accomplished with a set of
827 plain \TeX\ macros known as |index.tex|, while the sorting and collating
828 of the index entries is done by a separate computer program called
829 |makeindex|.\index{makeindex}\ This is how we made the index for this
830 Manual, which starts on page~\use{pg.index}.
831
832 To create an entry in the index you can say \CS{index}\arg{key}, where
833 \meta{key} is the key~word to be entered into the index, or more simply
834 you can say \CS{idx}\arg{word}, which both includes the word in the
835 text and makes an index entry for it; saying ``\CS{idx}|{Frisbee}|''
836 is the same as saying ``|Frisbee|\CS{index}|{Frisbee}|''.
837 Either of these indexing commands writes the index entry to a file
838 with the name extension ``|.idx|''.
839 Once your document has been processed by \TeX\ this file will contain
840 all of the ``raw'' index entries.
841
842 The entries in the raw index file are not sorted, and there may be many
843 duplications. The |makeindex|\index{makeindex} program will sort the
844 index entries and reformat them in a form appropriate for printing the
845 index. The output from the |makeindex| program is a file with the
846 extension ``|.ind|''. So if your
847 manuscript file is called |myfile.tex| and you have run it through
848 \TeXsis\ you should find a file called |myfile.idx| containing the raw
849 index entries. You would run the |makeindex| program like so,
850 \example
851 |makeindex myfile.idx|
852 \endexample
853 to produce the processed index file |myfile.ind|.
854 (You can leave off the |.idx| extension for the raw file and |makeindex|
855 will assume it.)
856
857 To print the index you can either include it in another pass of the full
858 document, by saying
859 \TeXexample
860 \input \jobname.ind
861 |endTeXexample
862 \noindent
863 in the manuscript file, or you can print it separately by adding
864 ``|\input index|'' to the begining of the |myfile.ind| file and running
865 it through \TeX\ or \TeXsis.
866
867 If you set \CS{markindextrue} then indexed words selected with \CS{idx}
868 will appear in the printed output inside a ruled box
869 like so:
870 \begingroup
871 \markindextrue \idx{Frisbee}.
872 \endgroup
873 The box does not interfere with or change the word or line spacing.
874 These ``proof marks'' are useful for draft copies when you are putting
875 together the index, but obviously you do not want them to appear in the
876 final copy, so the default is |\markindexfalse|.
877
878 The |index.tex| macros are distributed with \TeXsis, but |makeindex|
879 is not.
880 If you do not have the |makeindex| program you can get the C source
881 code for it from the \TeXsis\ anonymous ftp site,
882 |ftp.texsis.org|.
883 It is a well-known program, and is also available from CTAN in the
884 directory {\tt indexing/makeindex}.
885 Note that the |index.tex| macros work with plain \TeX\ as well as
886 \TeXsis, and they work with |makeindex| in its default mode, even
887 though that default mode was originally intended for \LaTeX\ code.
888
889 For more information about how to make full use of |makeindex| see the
890 file |index.tex|, the Unix man page for makeindex(1), and the original
891 paper by Chen and Harrison\reference{makeindex} Pehong Chen and
892 Michael A. Harrison, ``Index Preparation and Processing'', in {\sl
893 Software: Practice and Experience}, \vol{19}, 897-915 (1988)
894 \endreference
895 describing how they designed the |makeindex| program.
896
897 \def\aftersubsection{\relax}
898
899 %>>> EOF TXSsects.doc <<<