annotate man/texinfo.tex @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents 131b0175ea99
children 2d532a89d707
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1 %% TeX macros to handle texinfo files
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4 % 94, 95, 1996 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 %This texinfo.tex file is free software; you can redistribute it and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 %modify it under the terms of the GNU General Public License as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 %published by the Free Software Foundation; either version 2, or (at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 %your option) any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 %This texinfo.tex file is distributed in the hope that it will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 %General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 %You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 %along with this texinfo.tex file; see the file COPYING. If not, write
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
18 %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
19 %Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 %In other words, you are welcome to use, share and improve this program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 %You are forbidden to forbid anyone else to use, share and improve
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 %what you give them. Help stamp out software-hoarding!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 % Send bug reports to bug-texinfo@prep.ai.mit.edu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 % Please include a *precise* test case in each bug report.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 % Make it possible to create a .fmt file just by loading this file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 % if the underlying format is not loaded, start by loading it now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 % Added by gildea November 1993.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 % This automatically updates the version number based on RCS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
38 \deftexinfoversion$Revision: 1.2 $
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 \message{Loading texinfo package [Version \texinfoversion]:}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 % If in a .fmt file, print the version number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 % and turn on active characters that we couldn't do earlier because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 % they might have appeared in the input file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 \everyjob{\message{[Texinfo version \texinfoversion]}\message{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 \catcode`+=\active \catcode`\_=\active}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 % Save some parts of plain tex whose names we will redefine.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
49 \let\ptexb=\b
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
50 \let\ptexbullet=\bullet
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
51 \let\ptexc=\c
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
52 \let\ptexcomma=\,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
53 \let\ptexdot=\.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
54 \let\ptexdots=\dots
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
55 \let\ptexend=\end
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
56 \let\ptexequiv = \equiv
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
57 \let\ptexi=\i
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 \let\ptexlbrace=\{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 \let\ptexrbrace=\}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 \let\ptexstar=\*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 \let\ptext=\t
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
62 \let\ptextilde=\~
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 % Be sure we're in horizontal mode when doing a tie, since we make space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 % equivalent to this in @example-like environments. Otherwise, a space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 % at the beginning of a line will start with \penalty -- and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 % since \penalty is valid in vertical mode, we'd end up putting the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 % penalty on the vertical list instead of in the new paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 {\catcode`@ = 11
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
70 % Avoid using \@M directly, because that causes trouble
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
71 % if the definition is written into an index file.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
72 \global\let\tiepenalty = \@M
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
73 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
75 \let\~ = \tie % And make it available as @~.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 0
diff changeset
76
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
77
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 \message{Basics,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 \chardef\other=12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 % If this character appears in an error message or help string, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 % starts a new line in the output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 \newlinechar = `^^J
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 % Set up fixed words for English.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 \ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 \def\putwordInfo{Info}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 \ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 \ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 \ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 \ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 \ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 \ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 \ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 \ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 \ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 % Ignore a token.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 \def\gobble#1{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 \hyphenation{ap-pen-dix}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 \hyphenation{mini-buf-fer mini-buf-fers}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 \hyphenation{eshell}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 % Margin to add to right of even pages, to left of odd pages.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
107 \newdimen \bindingoffset
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
108 \newdimen \normaloffset
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 \newdimen\pagewidth \newdimen\pageheight
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 % Sometimes it is convenient to have everything in the transcript file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 % and nothing on the terminal. We don't just call \tracingall here,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 % since that produces some useless output on the terminal.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 \def\loggingall{\tracingcommands2 \tracingstats2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 \tracingpages1 \tracingoutput1 \tracinglostchars1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 \showboxbreadth\maxdimen\showboxdepth\maxdimen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
122 %---------------------Begin change-----------------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
124 %%%% For @cropmarks command.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
125 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 \newdimen\cornerlong \newdimen\cornerthick
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
128 \newdimen \topandbottommargin
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
129 \newdimen \outerhsize \newdimen \outervsize
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
130 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 \outerhsize=7in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 %\outervsize=9.5in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 % Alternative @smallbook page size is 9.25in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 \outervsize=9.25in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 \topandbottommargin=.75in
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
136 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
137 %---------------------End change-----------------------
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 % \onepageout takes a vbox as an argument. Note that \pagecontents
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
140 % does insertions, but you have to call it yourself.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
141 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
142 \def\onepageout#1{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
143 \hoffset=\normaloffset
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
144 \ifodd\pageno \advance\hoffset by \bindingoffset
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
145 \else \advance\hoffset by -\bindingoffset\fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
146 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
147 \escapechar = `\\ % use backslash in output files.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
148 \indexdummies
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
149 \shipout\vbox{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
150 {\let\hsize=\pagewidth \makeheadline}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
151 \pagebody{#1}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
152 {\let\hsize=\pagewidth \makefootline}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
153 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
154 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
155 \advancepageno
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
156 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
157 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
158
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
159 %%%% For @cropmarks command %%%%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
160
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
161 % Here is a modification of the main output routine for Near East Publications
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
162 % This provides right-angle cropmarks at all four corners.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
163 % The contents of the page are centerlined into the cropmarks,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
164 % and any desired binding offset is added as an \hskip on either
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
165 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
166 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
167 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
168 {\escapechar=`\\\relax % makes sure backslash is used in output files.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
169 \shipout
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
170 \vbox to \outervsize{\hsize=\outerhsize
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
171 \vbox{\line{\ewtop\hfill\ewtop}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
172 \nointerlineskip
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
173 \line{\vbox{\moveleft\cornerthick\nstop}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
174 \hfill
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
175 \vbox{\moveright\cornerthick\nstop}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
176 \vskip \topandbottommargin
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
177 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
178 \vbox{
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
179 {\let\hsize=\pagewidth \makeheadline}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
180 \pagebody{#1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
181 {\let\hsize=\pagewidth \makefootline}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
182 \ifodd\pageno\else\hskip\bindingoffset\fi}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
183 \vskip \topandbottommargin plus1fill minus1fill
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
184 \boxmaxdepth\cornerthick
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
185 \line{\vbox{\moveleft\cornerthick\nsbot}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
186 \hfill
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
187 \vbox{\moveright\cornerthick\nsbot}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
188 \nointerlineskip
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
189 \vbox{\line{\ewbot\hfill\ewbot}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
190 }}
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 0
diff changeset
191 \advancepageno
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
192 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
193 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
194 % Do @cropmarks to get crop marks
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
195 \def\cropmarks{\let\onepageout=\croppageout }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 \newinsert\margin \dimen\margin=\maxdimen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 {\catcode`\@ =11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 % marginal hacks, juha@viisa.uucp (Juha Takala)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 \ifvoid\margin\else % marginal info is present
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 \dimen@=\dp#1 \unvbox#1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
210 %
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 % Here are the rules for the cropmarks. Note that they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 % offset so that the space between them is truly \outerhsize or \outervsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 % (P. A. MacKay, 12 November, 1986)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 \def\nstop{\vbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 \def\nsbot{\vbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 % Parse an argument, then pass it to #1. The argument is the rest of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 % the input line (except we remove a trailing comment). #1 should be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 % macro which expects an ordinary undelimited TeX argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 \def\parsearg#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 \let\next = #1%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 \obeylines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 \futurelet\temp\parseargx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 % If the next token is an obeyed space (from an @example environment or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 % the like), remove it and recurse. Otherwise, we're done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 \def\parseargx{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 % \obeyedspace is defined far below, after the definition of \sepspaces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 \ifx\obeyedspace\temp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 \expandafter\parseargdiscardspace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 \expandafter\parseargline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 % Remove a single space (as the delimiter token to the macro call).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 {\obeyspaces %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 {\obeylines %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 \gdef\parseargline#1^^M{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 \endgroup % End of the group started in \parsearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 % First remove any @c comment, then any @comment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 % Result of each macro is put in \toks0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 \argremovec #1\c\relax %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 \expandafter\argremovecomment \the\toks0 \comment\relax %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 % Call the caller's macro, saved as \next in \parsearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 \expandafter\next\expandafter{\the\toks0}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 % Since all \c{,omment} does is throw away the argument, we can let TeX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 % do that for us. The \relax here is matched by the \relax in the call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 % in \parseargline; it could be more or less anything, its purpose is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 % just to delimit the argument to the \c.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 % @end itemize @c foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 % will have two active spaces as part of the argument with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 % `itemize'. Here we remove all active spaces from #1, and assign the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 % result to \toks0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 % This loses if there are any *other* active characters besides spaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 % in the argument -- _ ^ +, for example -- since they get expanded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 % Fortunately, Texinfo does not define any such commands. (If it ever
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 % does, the catcode of the characters in questionwill have to be changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 % here.) But this means we cannot call \removeactivespaces as part of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 % that \parsearg gets might well have any character at all in it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 \def\removeactivespaces#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 \ignoreactivespaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 \edef\temp{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 \global\toks0 = \expandafter{\temp}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 % Change the active space to expand to nothing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 \obeyspaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 %% These are used to keep @begin/@end levels from running away
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 %% Call \inENV within environments (after a \begingroup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 \def\ENVcheck{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 \ifENV\errmessage{Still within an environment. Type Return to continue.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 \endgroup\fi} % This is not perfect, but it should reduce lossage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 % @begin foo is the same as @foo, for now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 \newhelp\EMsimple{Type <Return> to continue.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 \outer\def\begin{\parsearg\beginxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 \def\beginxxx #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 \expandafter\ifx\csname #1\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 \csname #1\endcsname\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 % @end foo executes the definition of \Efoo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 \def\end{\parsearg\endxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 \def\endxxx #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 \removeactivespaces{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 \edef\endthing{\the\toks0}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 \expandafter\ifx\csname E\endthing\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 \expandafter\ifx\csname \endthing\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 % There's no \foo, i.e., no ``environment'' foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 \errhelp = \EMsimple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 \errmessage{Undefined command `@end \endthing'}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 \unmatchedenderror\endthing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 % Everything's ok; the right environment has been started.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 \csname E\endthing\endcsname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 % There is an environment #1, but it hasn't been started. Give an error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 \def\unmatchedenderror#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 \errhelp = \EMsimple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 \errmessage{This `@end #1' doesn't have a matching `@#1'}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 % Define the control sequence \E#1 to give an unmatched @end error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 \def\defineunmatchedend#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 % Single-spacing is done by various environments (specifically, in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 % \nonfillstart and \quotations).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 \newskip\singlespaceskip \singlespaceskip = 12.5pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 \def\singlespace{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 % Why was this kern here? It messes up equalizing space above and below
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 % environments. --karl, 6may93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 %{\advance \baselineskip by -\singlespaceskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 %\kern \baselineskip}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 \setleading \singlespaceskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 %% Simple single-character @ commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 % @@ prints an @
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 % Kludge this until the fonts are right (grr).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 \def\@{{\tt \char '100}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 % This is turned off because it was never documented
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 % and you can use @w{...} around a quote to suppress ligatures.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 %% Define @` and @' to be the same as ` and '
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 %% but suppressing ligatures.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 %\def\`{{`}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 %\def\'{{'}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 % Used to generate quoted braces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 \def\mylbrace {{\tt \char '173}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 \def\myrbrace {{\tt \char '175}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 \let\{=\mylbrace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 \let\}=\myrbrace
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
382 \begingroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
383 % Definitions to produce actual \{ & \} command in an index.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
384 \catcode`\{ = 12 \catcode`\} = 12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
385 \catcode`\[ = 1 \catcode`\] = 2
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
386 \catcode`\@ = 0 \catcode`\\ = 12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
387 @gdef@lbracecmd[\{]%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
388 @gdef@rbracecmd[\}]%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
389 @endgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
390
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
391 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
392 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
393 \let\, = \c
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
394 \let\dotaccent = \.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
395 \def\ringaccent#1{{\accent23 #1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
396 \let\tieaccent = \t
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
397 \let\ubaraccent = \b
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
398 \let\udotaccent = \d
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
399
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
400 % Other special characters: @questiondown @exclamdown
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
401 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
402 \def\questiondown{?`}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
403 \def\exclamdown{!`}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
404
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
405 % Dotless i and dotless j, used for accents.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
406 \def\imacro{i}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
407 \def\jmacro{j}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
408 \def\dotless#1{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
409 \def\temp{#1}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
410 \ifx\temp\imacro \ptexi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
411 \else\ifx\temp\jmacro \j
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
412 \else \errmessage{@dotless can be used only with i or j}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
413 \fi\fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
414 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 % @: forces normal size whitespace following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 \def\:{\spacefactor=1000 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 % @* forces a line break.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 \def\*{\hfil\break\hbox{}\ignorespaces}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 % @. is an end-of-sentence period.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 \def\.{.\spacefactor=3000 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 % @enddots{} is an end-of-sentence ellipsis.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 \gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 % @! is an end-of-sentence bang.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 \gdef\!{!\spacefactor=3000 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 % @? is an end-of-sentence query.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 \gdef\?{?\spacefactor=3000 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 % @w prevents a word break. Without the \leavevmode, @w at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 % beginning of a paragraph, when TeX is still in vertical mode, would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 % produce a whole line of output instead of starting the paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 \def\w#1{\leavevmode\hbox{#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 % @group ... @end group forces ... to be all on one page, by enclosing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 % to keep its height that of a normal line. According to the rules for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 % \topskip (p.114 of the TeXbook), the glue inserted is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 % max (\topskip - \ht (first item), 0). If that height is large,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 % therefore, no glue is inserted, and the space between the headline and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 % the text is small, which looks bad.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 \def\group{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 \ifnum\catcode13=\active \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 \errhelp = \groupinvalidhelp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 \errmessage{@group invalid in context where filling is enabled}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 % The \vtop we start below produces a box with normal height and large
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 % depth; thus, TeX puts \baselineskip glue before it, and (when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 % next line of text is done) \lineskip glue after it. (See p.82 of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 % the TeXbook.) Thus, space below is not quite equal to space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 % above. But it's pretty close.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 \def\Egroup{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 \egroup % End the \vtop.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 \endgroup % End the \group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 \vtop\bgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 % We have to put a strut on the last line in case the @group is in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 % the midst of an example, rather than completely enclosing it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 % Otherwise, the interline space between the last line of the group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 % and the first line afterwards is too small. But we can't put the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 % strut in \Egroup, since there it would be on a line by itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 % Hence this just inserts a strut at the beginning of each line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 \everypar = {\strut}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 % Since we have a strut on every line, we don't need any of TeX's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 % normal interline spacing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 \offinterlineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 % OK, but now we have to do something about blank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 % lines in the input in @example-like environments, which normally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 % just turn into \lisppar, which will insert no space now that we've
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 % turned off the interline space. Simplest is to make them be an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 % empty paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 \ifx\par\lisppar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 \edef\par{\leavevmode \par}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 % Reset ^^M's definition to new definition of \par.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 \obeylines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 % Do @comment since we are called inside an environment such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 % @example, where each end-of-line in the input causes an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 % end-of-line in the output. We don't want the end-of-line after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 % the `@group' to put extra space in the output. Since @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 % should appear on a line by itself (according to the Texinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 % manual), we don't worry about eating any user text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 \comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 % message, so this ends up printing `@group can only ...'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 \newhelp\groupinvalidhelp{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 group can only be used in environments such as @example,^^J%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 where each line of input produces a line of output.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 % @need space-in-mils
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 % forces a page break if there is not space-in-mils remaining.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 \newdimen\mil \mil=0.001in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 \def\need{\parsearg\needx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 % Old definition--didn't work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 %\def\needx #1{\par %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 %% This method tries to make TeX break the page naturally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 %% if the depth of the box does not fit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 %{\baselineskip=0pt%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 %\prevdepth=-1000pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 %}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 \def\needx#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 % Go into vertical mode, so we don't make a big box in the middle of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 % paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 \par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 % Don't add any leading before our big empty box, but allow a page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 % break, since the best break might be right here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 \allowbreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 \nointerlineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 \vtop to #1\mil{\vfil}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 % TeX does not even consider page breaks if a penalty added to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 % main vertical list is 10000 or more. But in order to see if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 % empty box we just added fits on the page, we must make it consider
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 % page breaks. On the other hand, we don't want to actually break the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 % page after the empty box. So we use a penalty of 9999.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 % There is an extremely small chance that TeX will actually break the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 % page at this \penalty, if there are no other feasible breakpoints in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 % sight. (If the user is using lots of big @group commands, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 % almost-but-not-quite fill up a page, TeX will have a hard time doing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 % good page breaking, for example.) However, I could not construct an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 % example where a page broke at this \penalty; if it happens in a real
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 % document, then we can reconsider our strategy.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 \penalty9999
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 % Back up by the size of the box, whether we did a page break or not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 \kern -#1\mil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 % Do not allow a page break right after this kern.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 \nobreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 % @br forces paragraph break
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 \let\br = \par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 % @dots{} output some dots
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 \def\dots{$\ldots$}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 % @page forces the start of a new page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 \def\page{\par\vfill\supereject}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 % @exdent text....
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 % outputs text on separate line in roman font, starting at standard page margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 % This records the amount of indent in the innermost environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 % That's how much \exdent should take out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 \newskip\exdentamount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 % This defn is used inside fill environments such as @defun.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 \def\exdent{\parsearg\exdentyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 % This defn is used inside nofill environments such as @example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 \def\nofillexdent{\parsearg\nofillexdentyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 \leftline{\hskip\leftskip{\rm#1}}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
581 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
582
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
583 \def\inmargin#1{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
584 \strut\vadjust{\nobreak\kern-\strutdepth
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
585 \vtop to \strutdepth{\baselineskip\strutdepth\vss
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
586 \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
587 \newskip\inmarginspacing \inmarginspacing=1cm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
588 \def\strutdepth{\dp\strutbox}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
589
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 %\hbox{{\rm#1}}\hfil\break}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 % @include file insert text of that file as input.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
593 % Allow normal characters that we make active in the argument (a file name).
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
594 \def\include{\begingroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
595 \catcode`\\=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
596 \catcode`~=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
597 \catcode`^=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
598 \catcode`_=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
599 \catcode`|=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
600 \catcode`<=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
601 \catcode`>=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
602 \catcode`+=12
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
603 \parsearg\includezzz}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
604 % Restore active chars for included file.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
605 \def\includezzz#1{\endgroup\begingroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
606 % Read the included file in a group so nested @include's work.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
607 \def\thisfile{#1}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
608 \input\thisfile
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 \def\thisfile{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 % @center line outputs that line, centered
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 \def\center{\parsearg\centerzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 \def\centerzzz #1{{\advance\hsize by -\leftskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 \advance\hsize by -\rightskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 \centerline{#1}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 % @sp n outputs n lines of vertical space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 \def\sp{\parsearg\spxxx}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
623 \def\spxxx #1{\vskip #1\baselineskip}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 % @comment ...line which is ignored...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 % @c is the same as @comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 % @ignore ... @end ignore is another way to write a comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 \parsearg \commentxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 \let\c=\comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
636 % @paragraphindent is defined for the Info formatting commands only.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
637 \let\paragraphindent=\comment
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
638
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 % Prevent errors for section commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 % Used in @ignore and in failing conditionals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 \def\ignoresections{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 \let\chapter=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 \let\unnumbered=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 \let\top=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 \let\unnumberedsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 \let\unnumberedsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 \let\unnumberedsubsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 \let\unnumberedsubsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 \let\unnumberedsubsubsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 \let\unnumberedsubsubsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 \let\section=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 \let\subsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 \let\subsubsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 \let\subsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 \let\subsubsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 \let\appendix=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 \let\appendixsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 \let\appendixsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 \let\appendixsubsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 \let\appendixsubsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 \let\appendixsubsubsec=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 \let\appendixsubsubsection=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 \let\contents=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 \let\smallbook=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 \let\titlepage=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 % Used in nested conditionals, where we have to parse the Texinfo source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 % and so want to turn off most commands, in case they are used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 % incorrectly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 \def\ignoremorecommands{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
673 \let\defcodeindex = \relax
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 \let\defcv = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 \let\deffn = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 \let\deffnx = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 \let\defindex = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 \let\defivar = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 \let\defmac = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 \let\defmethod = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 \let\defop = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 \let\defopt = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 \let\defspec = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 \let\deftp = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 \let\deftypefn = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 \let\deftypefun = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 \let\deftypevar = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 \let\deftypevr = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 \let\defun = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 \let\defvar = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 \let\defvr = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 \let\ref = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 \let\xref = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 \let\printindex = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 \let\pxref = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 \let\settitle = \relax
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
697 \let\setchapternewpage = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
698 \let\setchapterstyle = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
699 \let\everyheading = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
700 \let\evenheading = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
701 \let\oddheading = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
702 \let\everyfooting = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
703 \let\evenfooting = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
704 \let\oddfooting = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
705 \let\headings = \relax
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 \let\include = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 \let\lowersections = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 \let\down = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 \let\raisesections = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 \let\up = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 \let\set = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 \let\clear = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 \let\item = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 % Ignore @ignore ... @end ignore.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 \def\ignore{\doignore{ignore}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
720 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 \def\ifinfo{\doignore{ifinfo}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 \def\ifhtml{\doignore{ifhtml}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 \def\html{\doignore{html}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 \def\menu{\doignore{menu}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 \def\direntry{\doignore{direntry}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
728 % Also ignore @macro ... @end macro. The user must run texi2dvi,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
729 % which runs makeinfo to do macro expansion. Ignore @unmacro, too.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
730 \def\macro{\doignore{macro}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
731 \let\unmacro = \comment
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
732
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
733
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
734 % @dircategory CATEGORY -- specify a category of the dir file
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
735 % which this file should belong to. Ignore this in TeX.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
736 \let\dircategory = \comment
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
737
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 % Ignore text until a line `@end #1'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 \def\doignore#1{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 % Don't complain about control sequences we have declared \outer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 \ignoresections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 % Define a command to swallow text until we reach `@end #1'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 \long\def\doignoretext##1\end #1{\enddoignore}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 % Make sure that spaces turn into tokens that match what \doignoretext wants.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 \catcode32 = 10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 % And now expand that command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 \doignoretext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 % What we do to finish off ignored text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 \def\enddoignore{\endgroup\ignorespaces}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 \newif\ifwarnedobs\warnedobsfalse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 \def\obstexwarn{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 \ifwarnedobs\relax\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 % We need to warn folks that they may have trouble with TeX 3.0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 % This uses \immediate\write16 rather than \message to get newlines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 \immediate\write16{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 \immediate\write16{If you are running another version of TeX, relax.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 \immediate\write16{ Then upgrade your TeX installation if you can.}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
769 \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 \immediate\write16{If you are stuck with version 3.0, run the}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 \immediate\write16{ to use a workaround.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 \immediate\write16{}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
774 \global\warnedobstrue
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 % workaround (which requires the file ``dummy.tfm'' to be installed),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 % uncomment the following line:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 % Ignore text, except that we keep track of conditional commands for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 % purposes of nesting, up to an `@end #1' command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 \def\nestedignore#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 \obstexwarn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 % We must actually expand the ignored text to look for the @end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 % command, so that nested ignore constructs work. Thus, we put the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 % text into a \vbox and then do nothing with the result. To minimize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 % the change of memory overflow, we follow the approach outlined on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 % page 401 of the TeXbook: make the current font be a dummy font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 \setbox0 = \vbox\bgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 % Don't complain about control sequences we have declared \outer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 \ignoresections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 % Define `@end #1' to end the box, which will in turn undefine the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 % @end command again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 % We are going to be parsing Texinfo commands. Most cause no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 % trouble when they are used incorrectly, but some commands do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 % complicated argument parsing or otherwise get confused, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 % undefine them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 % We can't do anything about stray @-signs, unfortunately;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 % they'll produce `undefined control sequence' errors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 \ignoremorecommands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 % Set the current font to be \nullfont, a TeX primitive, and define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 % all the font commands to also use \nullfont. We don't use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 % dummy.tfm, as suggested in the TeXbook, because not all sites
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 % might have that installed. Therefore, math mode will still
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 % produce output, but that should be an extremely small amount of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 % stuff compared to the main input.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 \let\tensf = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 % Similarly for index fonts (mostly for their use in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 % smallexample)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 \let\indsf = \nullfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 % Don't complain when characters are missing from the fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 \tracinglostchars = 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 % Don't bother to do space factor calculations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 \frenchspacing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 % Don't report underfull hboxes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 \hbadness = 10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 % Do minimal line-breaking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 \pretolerance = 10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 % Do not execute instructions in @tex
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
841 \def\tex{\doignore{tex}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 % @set VAR sets the variable VAR to an empty value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 % Since we want to separate VAR from REST-OF-LINE (which might be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 % empty), we can't just use \parsearg; we have to insert a space of our
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 % own to delimit the rest of the line, and then take it out again if we
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
850 % didn't need it. Make sure the catcode of space is correct to avoid
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
851 % losing inside @example, for instance.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
853 \def\set{\begingroup\catcode` =10 \parsearg\setxxx}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 \def\setxxx#1{\setyyy#1 \endsetyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 \def\setyyy#1 #2\endsetyyy{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 \def\temp{#2}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 \fi
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
860 \endgroup
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 % \next or other control sequences that we've defined might get us into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 % an infinite loop. Consider `@set foo @cite{bar}'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 % @clear VAR clears (i.e., unsets) the variable VAR.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 \def\clear{\parsearg\clearxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 % @value{foo} gets the text saved in variable foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
874 \def\value#1{\expandafter
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
875 \ifx\csname SET#1\endcsname\relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
876 {\{No value for ``#1''\}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
877 \else \csname SET#1\endcsname \fi}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 % with @set.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 \def\ifset{\parsearg\ifsetxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 \def\ifsetxxx #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 \expandafter\ifx\csname SET#1\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 \expandafter\ifsetfail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 \expandafter\ifsetsucceed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 \def\ifsetsucceed{\conditionalsucceed{ifset}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 \def\ifsetfail{\nestedignore{ifset}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 \defineunmatchedend{ifset}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 % defined with @set, or has been undefined with @clear.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 \def\ifclear{\parsearg\ifclearxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 \def\ifclearxxx #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 \expandafter\ifx\csname SET#1\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 \expandafter\ifclearsucceed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 \expandafter\ifclearfail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 \def\ifclearfail{\nestedignore{ifclear}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 \defineunmatchedend{ifclear}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
909 % @iftex always succeeds; we read the text following, through @end
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
910 % iftex). But `@end iftex' should be valid only after an @iftex.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 \def\iftex{\conditionalsucceed{iftex}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 \defineunmatchedend{iftex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 % We can't just want to start a group at @iftex (for example) and end it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 % at @end iftex, since then @set commands inside the conditional have no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 % effect (they'd get reverted at the end of the group). So we must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 % define \Eiftex to redefine itself to be its previous value. (We can't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 % just define it to fail again with an ``unmatched end'' error, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 % the @ifset might be nested.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 \def\conditionalsucceed#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 \edef\temp{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 % Remember the current value of \E#1.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 \let\nece{prevE#1} = \nece{E#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 % At the `@end #1', redefine \E#1 to be its previous value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 \temp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 % We need to expand lots of \csname's, but we don't want to expand the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 % control sequences after we've constructed them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 % @asis just yields its argument. Used with @table, for example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 \def\asis#1{#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 % @math means output in math mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 % We don't use $'s directly in the definition of \math because control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 % sequences like \math are expanded when the toc file is written. Then,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 % we read the toc file back, the $'s will be normal characters (as they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 % should be, according to the definition of Texinfo). So we must use a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 % control sequence to switch into and out of math mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 % This isn't quite enough for @math to work properly in indices, but it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 % seems unlikely it will ever be needed there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 \let\implicitmath = $
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 \def\math#1{\implicitmath #1\implicitmath}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 % @bullet and @minus need the same treatment as @math, just above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 \def\bullet{\implicitmath\ptexbullet\implicitmath}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 \def\minus{\implicitmath-\implicitmath}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 \def\node{\ENVcheck\parsearg\nodezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 \def\nodezzz#1{\nodexxx [#1,]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 \let\nwnode=\node
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 \let\lastnode=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 \def\donoderef{\ifx\lastnode\relax\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 \global\let\lastnode=\relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 \def\unnumbnoderef{\ifx\lastnode\relax\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 \global\let\lastnode=\relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 \def\appendixnoderef{\ifx\lastnode\relax\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 \global\let\lastnode=\relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
977 % @refill is a no-op.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 \let\refill=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 % @setfilename is done at the beginning of every texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 % So open here the files we need to have open while reading the input.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 % This makes it possible to make a .fmt file for texinfo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 \def\setfilename{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 \readauxfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 \opencontents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 \openindices
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 \fixbackslash % Turn off hack to swallow `\input texinfo'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 \comment % Ignore the actual filename.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
992 % @bye.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
995 % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
996 % \def\macroxxx#1#2 \end macro{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
997 % \expandafter\gdef\macrotemp#1{#2}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
998 % \endgroup}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
999
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1000 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1001 %\def\linemacroxxx#1#2 \end linemacro{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1002 %\let\parsearg=\relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1003 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1004 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1005 %\expandafter\gdef\macrotempx#1{#2}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1006 %\endgroup}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1007
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1008 %\def\butfirst#1{}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1009
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 \message{fonts,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 % Font-change commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 % Texinfo supports the sans serif font style, which plain TeX does not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 % So we set up a \sf analogous to plain's \rm, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 \newfam\sffam
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 \def\sf{\fam=\sffam \tensf}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 \let\li = \sf % Sometimes we call it \li, not \sf.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1021 % We don't need math for this one.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1022 \def\ttsl{\tenttsl}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1023
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1024 %% Try out Computer Modern fonts at \magstephalf
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1025 \let\mainmagstep=\magstephalf
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 % Set the font macro #1 to the font named #2, adding on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 % specified font prefix (normally `cm').
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1029 % #3 is the font's design size, #4 is a scale factor
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1030 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 % Use cm as the default font prefix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 % To specify the font prefix, you must define \fontprefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 % before you read in texinfo.tex.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 \ifx\fontprefix\undefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 \def\fontprefix{cm}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 \fi
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1038 % Support font families that don't use the same naming scheme as CM.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1039 \def\rmshape{r}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1040 \def\rmbshape{bx} %where the normal face is bold
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1041 \def\bfshape{b}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1042 \def\bxshape{bx}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1043 \def\ttshape{tt}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1044 \def\ttbshape{tt}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1045 \def\ttslshape{sltt}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1046 \def\itshape{ti}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1047 \def\itbshape{bxti}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1048 \def\slshape{sl}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1049 \def\slbshape{bxsl}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1050 \def\sfshape{ss}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1051 \def\sfbshape{ss}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1052 \def\scshape{csc}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1053 \def\scbshape{csc}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 \ifx\bigger\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 \let\mainmagstep=\magstep1
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1057 \setfont\textrm\rmshape{12}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1058 \setfont\texttt\ttshape{12}{1000}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 \else
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1060 \setfont\textrm\rmshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1061 \setfont\texttt\ttshape{10}{\mainmagstep}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 % Instead of cmb10, you many want to use cmbx10.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 % cmbx10 is a prettier font on its own, but cmb10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 % looks better when embedded in a line with cmr10.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1066 \setfont\textbf\bfshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1067 \setfont\textit\itshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1068 \setfont\textsl\slshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1069 \setfont\textsf\sfshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1070 \setfont\textsc\scshape{10}{\mainmagstep}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1071 \setfont\textttsl\ttslshape{10}{\mainmagstep}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 \font\texti=cmmi10 scaled \mainmagstep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 \font\textsy=cmsy10 scaled \mainmagstep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 % A few fonts for @defun, etc.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1076 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1077 \setfont\deftt\ttshape{10}{\magstep1}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1080 % Fonts for indices and small examples (9pt).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 % We actually use the slanted font rather than the italic,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 % because texinfo normally uses the slanted fonts for that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 % Do not make many font distinctions in general in the index, since they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 % aren't very useful.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1085 \setfont\ninett\ttshape{9}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1086 \setfont\indrm\rmshape{9}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1087 \setfont\indit\slshape{9}{1000}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 \let\indsl=\indit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 \let\indtt=\ninett
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1090 \let\indttsl=\ninett
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 \let\indsf=\indrm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 \let\indbf=\indrm
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1093 \setfont\indsc\scshape{10}{900}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 \font\indi=cmmi9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 \font\indsy=cmsy9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1097 % Chapter (and unnumbered) fonts (17.28pt).
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1098 \setfont\chaprm\rmbshape{12}{\magstep2}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1099 \setfont\chapit\itbshape{10}{\magstep3}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1100 \setfont\chapsl\slbshape{10}{\magstep3}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1101 \setfont\chaptt\ttbshape{12}{\magstep2}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1102 \setfont\chapttsl\ttslshape{10}{\magstep3}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1103 \setfont\chapsf\sfbshape{12}{\magstep2}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 \let\chapbf=\chaprm
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1105 \setfont\chapsc\scbshape{10}{\magstep3}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 \font\chapi=cmmi12 scaled \magstep2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 \font\chapsy=cmsy10 scaled \magstep3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1109 % Section fonts (14.4pt).
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1110 \setfont\secrm\rmbshape{12}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1111 \setfont\secit\itbshape{10}{\magstep2}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1112 \setfont\secsl\slbshape{10}{\magstep2}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1113 \setfont\sectt\ttbshape{12}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1114 \setfont\secttsl\ttslshape{10}{\magstep2}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1115 \setfont\secsf\sfbshape{12}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1116 \let\secbf\secrm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1117 \setfont\secsc\scbshape{10}{\magstep2}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 \font\seci=cmmi12 scaled \magstep1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 \font\secsy=cmsy10 scaled \magstep2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1121 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1122 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1123 % \setfont\ssecsl\slshape{10}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1124 % \setfont\ssectt\ttshape{10}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1125 % \setfont\ssecsf\sfshape{10}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1126
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1127 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1128 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1129 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1130 %\setfont\ssectt\ttshape{10}{1315}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1131 %\setfont\ssecsf\sfshape{10}{1315}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 %\let\ssecbf=\ssecrm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1135 % Subsection fonts (13.15pt).
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1136 \setfont\ssecrm\rmbshape{12}{\magstephalf}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1137 \setfont\ssecit\itbshape{10}{1315}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1138 \setfont\ssecsl\slbshape{10}{1315}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1139 \setfont\ssectt\ttbshape{12}{\magstephalf}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1140 \setfont\ssecttsl\ttslshape{10}{\magstep1}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1141 \setfont\ssecsf\sfbshape{12}{\magstephalf}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1142 \let\ssecbf\ssecrm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1143 \setfont\ssecsc\scbshape{10}{\magstep1}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 \font\sseci=cmmi12 scaled \magstephalf
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1145 \font\ssecsy=cmsy10 scaled \magstep1
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 % but that is not a standard magnification.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1149 % Fonts for title page:
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1150 \setfont\titlerm\rmbshape{12}{\magstep3}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1151 \let\authorrm = \secrm
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1152
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 % In order for the font changes to affect most math symbols and letters,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 % we have to define the \textfont of the standard families. Since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 % texinfo doesn't allow for producing subscripts and superscripts, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 % don't bother to reset \scriptfont and \scriptscriptfont (which would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 % also require loading a lot more fonts).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 \def\resetmathfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 \textfont\ttfam = \tentt \textfont\sffam = \tensf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 % The font-changing commands redefine the meanings of \tenSTYLE, instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 % of just \STYLE. We do this so that font changes will continue to work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 % in math mode, where it is the current \fam that is relevant in most
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1169 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1170 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1171 % redefine \bf itself.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 \def\textfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1175 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 \resetmathfonts}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 \def\chapfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1180 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1181 \resetmathfonts \setleading{19pt}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 \def\secfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1185 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1186 \resetmathfonts \setleading{16pt}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 \def\subsecfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1190 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1191 \resetmathfonts \setleading{15pt}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1192 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 \def\indexfonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1196 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1197 \resetmathfonts \setleading{12pt}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 % Set up the default fonts, so we can use them for creating boxes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 \textfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 % Count depth in font-changes, for error checks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 \newcount\fontdepth \fontdepth=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 % Fonts for short table of contents.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1207 \setfont\shortcontrm\rmshape{12}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1208 \setfont\shortcontbf\bxshape{12}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1209 \setfont\shortcontsl\slshape{12}{1000}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 %% serif) and @ii for TeX italic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 % unless the following character is such as not to need one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 \let\i=\smartitalic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 \let\var=\smartitalic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 \let\dfn=\smartitalic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 \let\emph=\smartitalic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 \let\cite=\smartitalic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 \def\b#1{{\bf #1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 \let\strong=\b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 % We can't just use \exhyphenpenalty, because that only has effect at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 % the end of a paragraph. Restore normal hyphenation at the end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 % group within which \nohyphenation is presumably called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 \def\restorehyphenation{\hyphenchar\font = `- }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 \def\t#1{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1236 {\tt \rawbackslash \frenchspacing #1}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 \null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 }
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1239 \let\ttfont=\t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 \def\samp #1{`\tclose{#1}'\null}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1241 \setfont\smallrm\rmshape{8}{1000}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1242 \font\smallsy=cmsy9
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1243 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1244 \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1245 \vbox{\hrule\kern-0.4pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1246 \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1247 \kern-0.4pt\hrule}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1248 \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1249 % The old definition, with no lozenge:
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1250 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 \let\file=\samp
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1254 \let\url=\samp % perhaps include a hypertex \special eventually
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1255 \def\email#1{$\langle${\tt #1}$\rangle$}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 % @code is a modification of @t,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 % which makes spaces the same size as normal in the surrounding text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 \def\tclose#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 {%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 % Change normal interword space to be same as for the current font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 \spaceskip = \fontdimen2\font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 % Switch to typewriter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 \tt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 % But `\ ' produces the large typewriter interword space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 \def\ {{\spaceskip = 0pt{} }}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 % Turn off hyphenation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 \nohyphenation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 \rawbackslash
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 \frenchspacing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 #1%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 \null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 % We *must* turn on hyphenation at `-' and `_' in \code.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1281 % Otherwise, it is too hard to avoid overfull hboxes
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 % in the Emacs manual, the Library manual, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 % both hyphenation at - and hyphenation within words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 % We must therefore turn them both off (\tclose does that)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1287 % and arrange explicitly to hyphenate at a dash.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 % -- rms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 \catcode`\-=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 \catcode`\_=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 % The following is used by \doprintindex to insure that long function names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 % wrap around. It is necessary for - and _ to be active before the index is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 % read from the file, as \entry parses the arguments long before \code is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 % ever called. -- mycroft
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1297 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 30
diff changeset
1298 }
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1299
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 \def\realdash{-}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1301 \def\realunder{_}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 \def\codedash{-\discretionary{}{}{}}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1303 \def\codeunder{\normalunderscore\discretionary{}{}{}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 \def\codex #1{\tclose{#1}\endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 %\let\exp=\tclose %Was temporary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 % @kbd is like @code, except that if the argument is just one @key command,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 % then @kbd has no effect.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1310 %
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 \def\xkey{\key}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 \ifx\one\xkey\ifx\threex\three \key{#2}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1314 \else{\tclose{\ttsl\look}}\fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1315 \else{\tclose{\ttsl\look}}\fi}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1316
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1317 % Check if we are currently using a typewriter font. Since all the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1318 % Computer Modern typewriter fonts have zero interword stretch (and
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1319 % shrink), and it is reasonable to expect all typewriter fonts to have
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1320 % this property, we can check that font parameter.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1321 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1322 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 % argument is to make the input look right: @dmn{pt} instead of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 % @dmn{}pt.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 \def\dmn#1{\thinspace #1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1332 % @l was never documented to mean ``switch to the Lisp font'',
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1333 % and it is not used as such in any manual I can find. We need it for
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1334 % Polish suppressed-l. --karl, 22sep96.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1335 %\def\l#1{{\li #1}\null}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1336
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1337 \def\r#1{{\rm #1}} % roman font
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 % Use of \lowercase was suggested.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1339 \def\sc#1{{\smallcaps#1}} % smallcaps font
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1340 \def\ii#1{{\it #1}} % italic font
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1341
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1342 % @pounds{} is a sterling sign.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1343 \def\pounds{{\it\$}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1344
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 \message{page headings,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 % First the title page. Must do @settitle before @titlepage.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1352 \def\titlefont#1{{\titlerm #1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1353
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 \newif\ifseenauthor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 \newif\iffinishedtitlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1359 \endgroup\page\hbox{}\page}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 \def\titlepage{\begingroup \parindent=0pt \textfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 \let\subtitlerm=\tenrm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 % I deinstalled the following change because \cmr12 is undefined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 % This change was not in the ChangeLog anyway. --rms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 % \let\subtitlerm=\cmr12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 % Leave some space at the very top of the page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 \vglue\titlepagetopglue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 % Now you can print the title using @title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 \def\title{\parsearg\titlezzz}%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1375 \def\titlezzz##1{\leftline{\titlefont{##1}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1376 % print a rule at the page bottom also.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1377 \finishedtitlepagefalse
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1378 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 % No rule at page bottom unless we print one at the top with @title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 \finishedtitlepagetrue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 % Now you can put text using @subtitle.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 \def\subtitle{\parsearg\subtitlezzz}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 % @author should come last, but may come many times.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 \def\author{\parsearg\authorzzz}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 {\authorfont \leftline{##1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 % Most title ``pages'' are actually two pages long, with space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 % at the top of the second. We don't want the ragged left on the second.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 \let\oldpage = \page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 \def\page{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 \iffinishedtitlepage\else
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1396 \finishtitlepage
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 \oldpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 \let\page = \oldpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 \hbox{}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 % \def\page{\oldpage \hbox{}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 \def\Etitlepage{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 \iffinishedtitlepage\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 \finishtitlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 % It is important to do the page break before ending the group,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 % because the headline and footline are only empty inside the group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 % If we use the new definition of \page, we always get a blank page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 % after the title page, which we certainly don't want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 \oldpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 \HEADINGSon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 \def\finishtitlepage{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 \vskip4pt \hrule height 2pt width \hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 \vskip\titlepagebottomglue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 \finishedtitlepagetrue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 %%% Set up page headings and footings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 \let\thispage=\folio
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 \newtoks \evenheadline % Token sequence for heading line of even pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 \newtoks \oddheadline % Token sequence for heading line of odd pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 \newtoks \evenfootline % Token sequence for footing line of even pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 \newtoks \oddfootline % Token sequence for footing line of odd pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 % Now make Tex use those variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 \else \the\evenheadline \fi}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 \else \the\evenfootline \fi}\HEADINGShook}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 \let\HEADINGShook=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 % Commands to set those variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 % For example, this is what @headings on does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 % @evenheading @thistitle|@thispage|@thischapter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 % @oddheading @thischapter|@thispage|@thistitle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 % @evenfooting @thisfile||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 % @oddfooting ||@thisfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 \def\evenheading{\parsearg\evenheadingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 \def\oddheading{\parsearg\oddheadingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 \def\everyheading{\parsearg\everyheadingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 \def\evenfooting{\parsearg\evenfootingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 \def\oddfooting{\parsearg\oddfootingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 \def\everyfooting{\parsearg\everyfootingxxx}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 {\catcode`\@=0 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1464 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1465 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1466 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1467 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1475 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1476
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1477 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1478 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1479 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1480 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 }% unbind the catcode of @.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1484 % @headings double turns headings on for double-sided printing.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1485 % @headings single turns headings on for single-sided printing.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1486 % @headings off turns them off.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1487 % @headings on same as @headings double, retained for compatibility.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1488 % @headings after turns on double-sided headings after this page.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1489 % @headings doubleafter turns on double-sided headings after this page.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 % @headings singleafter turns on single-sided headings after this page.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1491 % By default, they are off at the start of a document,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1492 % and turned `on' after @end titlepage.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 \def\headings #1 {\csname HEADINGS#1\endcsname}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 \def\HEADINGSoff{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 \HEADINGSoff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 % When we turn headings on, set the page number to 1.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 % For double-sided printing, put current file name in lower left corner,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 % chapter name on inside top of right hand pages, document
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 % title on inside top of left hand pages, and page numbers on outside top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 % edge of all pages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 \def\HEADINGSdouble{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 \global\pageno=1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 \global\evenfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 \global\oddfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 \global\evenheadline={\line{\folio\hfil\thistitle}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 \global\oddheadline={\line{\thischapter\hfil\folio}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1511 \global\let\contentsalignmacro = \chapoddpage
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 }
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1513 \let\contentsalignmacro = \chappager
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1514
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 % For single-sided printing, chapter title goes across top left of page,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 % page number on top right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 \def\HEADINGSsingle{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 \global\pageno=1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 \global\evenfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 \global\oddfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 \global\evenheadline={\line{\thischapter\hfil\folio}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 \global\oddheadline={\line{\thischapter\hfil\folio}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1523 \global\let\contentsalignmacro = \chappager
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 \def\HEADINGSon{\HEADINGSdouble}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 \let\HEADINGSdoubleafter=\HEADINGSafter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 \def\HEADINGSdoublex{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 \global\evenfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 \global\oddfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 \global\evenheadline={\line{\folio\hfil\thistitle}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 \global\oddheadline={\line{\thischapter\hfil\folio}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1534 \global\let\contentsalignmacro = \chapoddpage
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 \def\HEADINGSsinglex{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 \global\evenfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 \global\oddfootline={\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 \global\evenheadline={\line{\thischapter\hfil\folio}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 \global\oddheadline={\line{\thischapter\hfil\folio}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1543 \global\let\contentsalignmacro = \chappager
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 % Subroutines used in generating headings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 % Produces Day Month Year style of output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 \def\today{\number\day\space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 \ifcase\month\or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 January\or February\or March\or April\or May\or June\or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 July\or August\or September\or October\or November\or December\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 \space\number\year}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 % Use this if you want the Month Day, Year style of output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 %\def\today{\ifcase\month\or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 %January\or February\or March\or April\or May\or June\or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 %July\or August\or September\or October\or November\or December\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 %\space\number\day, \number\year}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 % @settitle line... specifies the title of the document, for headings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 % It generates no output of its own
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 \def\thistitle{No Title}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 \def\settitle{\parsearg\settitlezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 \def\settitlezzz #1{\gdef\thistitle{#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1567
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 \message{tables,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 % @tabs -- simple alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 % These don't work. For one thing, \+ is defined as outer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 % So these macros cannot even be defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 %\def\tabs{\parsearg\tabszzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 %\def\tabszzz #1{\settabs\+#1\cr}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 %\def\tabline{\parsearg\tablinezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 %\def\tablinezzz #1{\+#1\cr}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 %\def\&{&}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 % default indentation of table text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 \newdimen\tableindent \tableindent=.8in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 % default indentation of @itemize and @enumerate text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 \newdimen\itemindent \itemindent=.3in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 % margin between end of table item and start of table text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 \newdimen\itemmargin \itemmargin=.1in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 % used internally for \itemindent minus \itemmargin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 \newdimen\itemmax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 % these defs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 % They also define \itemindex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 % to index the item name in whatever manner is desired (perhaps none).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 \newif\ifitemxneedsnegativevskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1600 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 \def\internalBitem{\smallbreak \parsearg\itemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 \itemzzz {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 \itemzzz {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 \def\itemzzz #1{\begingroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 \advance\hsize by -\rightskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 \advance\hsize by -\tableindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 \setbox0=\hbox{\itemfont{#1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 \itemindex{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 \nobreak % This prevents a break before @itemx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 % Be sure we are not still in the middle of a paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 %{\parskip = 0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 %\par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 %}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 % If the item text does not fit in the space we have, put it on a line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 % by itself, and do not allow a page break either before or after that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 % line. We do not start a paragraph here because then if the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 % command is, e.g., @kindex, the whatsit would get put into the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 % horizontal list on a line by itself, resulting in extra blank space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 \ifdim \wd0>\itemmax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 % Make this a paragraph so we get the \parskip glue and wrapping,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 % but leave it ragged-right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 \advance\leftskip by-\tableindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 \advance\hsize by\tableindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 \advance\rightskip by0pt plus1fil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 \leavevmode\unhbox0\par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 % We're going to be starting a paragraph, but we don't want the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 % \parskip glue -- logically it's part of the @item we just started.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 \nobreak \vskip-\parskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 % Stop a page break at the \parskip glue coming up. Unfortunately
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 % we can't prevent a possible page break at the following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 % \baselineskip glue.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 \nobreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 \itemxneedsnegativevskipfalse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 % The item text fits into the space. Start a paragraph, so that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 % following text (if any) will end up on the same line. Since that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 % text will be indented by \tableindent, we make the item text be in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 % a zero-width box.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 \noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 \rlap{\hskip -\tableindent\box0}\ignorespaces%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 \endgroup%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 \itemxneedsnegativevskiptrue%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 \def\item{\errmessage{@item while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 \def\itemx{\errmessage{@itemx while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 \def\kitem{\errmessage{@kitem while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 \def\kitemx{\errmessage{@kitemx while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 \def\xitem{\errmessage{@xitem while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 \def\xitemx{\errmessage{@xitemx while not in a table}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 %% Contains a kludge to get @end[description] to work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 {\obeylines\obeyspaces%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 \gdef\tablex #1^^M{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 \tabley\dontindex#1 \endtabley}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 {\obeylines\obeyspaces%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 \gdef\ftablex #1^^M{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 \tabley\fnitemindex#1 \endtabley
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 \let\Etable=\relax}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 {\obeylines\obeyspaces%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 \gdef\vtablex #1^^M{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 \tabley\vritemindex#1 \endtabley
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 \let\Etable=\relax}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 \def\dontindex #1{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 {\obeyspaces %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 \def\tablez #1#2#3#4#5#6{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 \aboveenvbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 \begingroup %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1707 \def\Edescription{\Etable}% Necessary kludge.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 \let\itemindex=#1%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 \ifnum 0#4>0 \tableindent=#4\mil \fi %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 \def\itemfont{#2}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 \itemmax=\tableindent %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 \advance \itemmax by -\itemmargin %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 \advance \leftskip by \tableindent %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 \exdentamount=\tableindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 \parindent = 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 \parskip = \smallskipamount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 \ifdim \parskip=0pt \parskip=2pt \fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 \def\Etable{\endgraf\afterenvbreak\endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 \let\item = \internalBitem %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 \let\itemx = \internalBitemx %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 \let\kitem = \internalBkitem %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 \let\kitemx = \internalBkitemx %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 \let\xitem = \internalBxitem %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 \let\xitemx = \internalBxitemx %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 % This is the counter used by @enumerate, which is really @itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 \newcount \itemno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 \def\itemize{\parsearg\itemizezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 \def\itemizezzz #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 \begingroup % ended by the @end itemsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 \itemizey {#1}{\Eitemize}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 \def\itemizey #1#2{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 \aboveenvbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 \itemmax=\itemindent %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 \advance \itemmax by -\itemmargin %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 \advance \leftskip by \itemindent %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 \exdentamount=\itemindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 \parindent = 0pt %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 \parskip = \smallskipamount %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 \ifdim \parskip=0pt \parskip=2pt \fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 \def#2{\endgraf\afterenvbreak\endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 \def\itemcontents{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 \let\item=\itemizeitem}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 % Set sfcode to normal for the chars that usually have another value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 % These are `.?!:;,'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 % \splitoff TOKENS\endmark defines \first to be the first token in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 % TOKENS, and \rest to be the remainder.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 % Allow an optional argument of an uppercase letter, lowercase letter,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 % or number, to specify the first label in the enumerated list. No
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 % argument is the same as `1'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 \def\enumerate{\parsearg\enumeratezzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 \def\enumeratey #1 #2\endenumeratey{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 \begingroup % ended by the @end enumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 % If we were given no argument, pretend we were given `1'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 \def\thearg{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 \ifx\thearg\empty \def\thearg{1}\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 % Detect if the argument is a single token. If so, it might be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 % letter. Otherwise, the only valid thing it can be is a number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 % (We will always have one token, because of the test we just made.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 % This is a good thing, since \splitoff doesn't work given nothing at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 % all -- the first parameter is undelimited.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 \expandafter\splitoff\thearg\endmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 \ifx\rest\empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 % Only one token in the argument. It could still be anything.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 % A ``lowercase letter'' is one whose \lccode is nonzero.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 % not equal to itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 % Otherwise, we assume it's a number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 % We need the \relax at the end of the \ifnum lines to stop TeX from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 % continuing to look for a <number>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 \ifnum\lccode\expandafter`\thearg=0\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 \numericenumerate % a number (we hope)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 % It's a letter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 \lowercaseenumerate % lowercase letter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 \uppercaseenumerate % uppercase letter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 % Multiple tokens in the argument. We hope it's a number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 \numericenumerate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 % An @enumerate whose labels are integers. The starting integer is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 % given in \thearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 \def\numericenumerate{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 \itemno = \thearg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 \startenumeration{\the\itemno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 % The starting (lowercase) letter is in \thearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 \def\lowercaseenumerate{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 \itemno = \expandafter`\thearg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 \startenumeration{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 % Be sure we're not beyond the end of the alphabet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 \ifnum\itemno=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 \errmessage{No more lowercase letters in @enumerate; get a bigger
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 alphabet}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 \char\lccode\itemno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 % The starting (uppercase) letter is in \thearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 \def\uppercaseenumerate{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 \itemno = \expandafter`\thearg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 \startenumeration{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 % Be sure we're not beyond the end of the alphabet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 \ifnum\itemno=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 \errmessage{No more uppercase letters in @enumerate; get a bigger
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 alphabet}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 \char\uccode\itemno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 % Call itemizey, adding a period to the first argument and supplying the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 % common last two arguments. Also subtract one from the initial value in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 % \itemno, since @item increments \itemno.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 \def\startenumeration#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 \advance\itemno by -1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 \itemizey{#1.}\Eenumerate\flushcr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 % to @enumerate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 \def\alphaenumerate{\enumerate{a}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 \def\capsenumerate{\enumerate{A}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 \def\Ealphaenumerate{\Eenumerate}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 \def\Ecapsenumerate{\Eenumerate}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 % Definition of @item while inside @itemize.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 \def\itemizeitem{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 \advance\itemno by 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 {\let\par=\endgraf \smallbreak}%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1864 \ifhmode \errmessage{\in hmode at itemizeitem}\fi
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 {\parskip=0in \hskip 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 \vadjust{\penalty 1200}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 \flushcr}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 % @multitable macros
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1871 % Amy Hendrickson, 8/18/94, 3/6/96
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1873 % @multitable ... @end multitable will make as many columns as desired.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1874 % Contents of each column will wrap at width given in preamble. Width
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 % can be specified either with sample text given in a template line,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 % or in percent of \hsize, the current width of text on page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 % Table can continue over pages but will only break between lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 % To make preamble:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1882 % Either define widths of columns in terms of percent of \hsize:
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1883 % @multitable @columnfractions .25 .3 .45
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 % @item ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1886 % Numbers following @columnfractions are the percent of the total
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 % current hsize to be used for each column. You may use as many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 % columns as desired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1890
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 % Or use a template:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 % @item ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 % using the widest term desired in each column.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1895 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1896 % For those who want to use more than one line's worth of words in
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1897 % the preamble, break the line within one argument and it
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1898 % will parse correctly, i.e.,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1899 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1900 % @multitable {Column 1 template} {Column 2 template} {Column 3
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1901 % template}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1902 % Not:
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1903 % @multitable {Column 1 template} {Column 2 template}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1904 % {Column 3 template}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1905
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1906 % Each new table line starts with @item, each subsequent new column
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 % starts with @tab. Empty columns may be produced by supplying @tab's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 % with nothing between them for as many times as empty columns are needed,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 % ie, @tab@tab@tab will produce two empty columns.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1911 % @item, @tab, @multitable or @end multitable do not need to be on their
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 % own lines, but it will not hurt if they are.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 % Sample multitable:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 % @item first col stuff @tab second col stuff @tab third col
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1918 % @item
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1919 % first col stuff
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1920 % @tab
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1921 % second col stuff
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1922 % @tab
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1923 % third col
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1924 % @item first col stuff @tab second col stuff
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 % @tab Many paragraphs of text may be used in any column.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1926 %
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 % They will wrap at the width determined by the template.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 % @item@tab@tab This will be in third column.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1929 % @end multitable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 % Default dimensions may be reset by user.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1932 % @multitableparskip is vertical space between paragraphs in table.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1933 % @multitableparindent is paragraph indent in table.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1934 % @multitablecolmargin is horizontal space to be left between columns.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1935 % @multitablelinespace is space to leave between table items, baseline
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1936 % to baseline.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1937 % 0pt means it depends on current normal line spacing.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 %%%%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1940 % Dimensions
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
1941
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1942 \newskip\multitableparskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1943 \newskip\multitableparindent
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1944 \newdimen\multitablecolspace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1945 \newskip\multitablelinespace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1946 \multitableparskip=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1947 \multitableparindent=6pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1948 \multitablecolspace=12pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1949 \multitablelinespace=0pt
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 %%%%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 % Macros used to set up halign preamble:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 \let\endsetuptable\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 \def\xendsetuptable{\endsetuptable}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1955 \let\columnfractions\relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1956 \def\xcolumnfractions{\columnfractions}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 \newif\ifsetpercent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1959 %% 2/1/96, to allow fractions to be given with more than one digit.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1960 \def\pickupwholefraction#1 {\global\advance\colcount by1 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1961 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1962 \setuptable}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1963
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 \newcount\colcount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 \def\setuptable#1{\def\firstarg{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 \ifx\firstarg\xendsetuptable\let\go\relax%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 \else
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1968 \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 \ifsetpercent
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1971 \let\go\pickupwholefraction % In this case arg of setuptable
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1972 % is the decimal point before the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1973 % number given in percent of hsize.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1974 % We don't need this so we don't use it.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 \global\advance\colcount by1
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1977 \setbox0=\hbox{#1 }% Add a normal word space as a separator;
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1978 % typically that is always in the input, anyway.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 \fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 \fi%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1982 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 \fi\go}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1984
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 %%%%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 % multitable syntax
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1987 \def\tab{&\hskip1sp\relax} % 2/2/96
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1988 % tiny skip here makes sure this column space is
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1989 % maintained, even if it is never used.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1990
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 %%%%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1993 % @multitable ... @end multitable definitions:
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1994
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1995 \def\multitable{\parsearg\dotable}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1996
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
1997 \def\dotable#1{\bgroup
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 \let\item\cr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 \tolerance=9500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 \hbadness=9500
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2001 \setmultitablespacing
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2002 \parskip=\multitableparskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2003 \parindent=\multitableparindent
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 \overfullrule=0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 \global\colcount=0\relax%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 % To parse everything between @multitable and @item :
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2008 \setuptable#1 \endsetuptable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 % Need to reset this to 0 after \setuptable.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2010 \global\colcount=0\relax%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 % This preamble sets up a generic column definition, which will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 % be used as many times as user calls for columns.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2014 % \vtop will set a single line and will also let text wrap and
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 % continue for many paragraphs if desired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 \halign\bgroup&\global\advance\colcount by 1\relax%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2017 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 % In order to keep entries from bumping into each other
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2019 % we will add a \leftskip of \multitablecolspace to all columns after
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 % the first one.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2021 % If a template has been used, we will add \multitablecolspace
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 % to the width of each template entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 % If user has set preamble in terms of percent of \hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 % we will use that dimension as the width of the column, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 % the \leftskip will keep entries from bumping into each other.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 % Table will start at left margin and final column will justify at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 % right margin.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 \ifnum\colcount=1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 \ifsetpercent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 % If user has <not> set preamble in terms of percent of \hsize
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2033 % we will advance \hsize by \multitablecolspace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2034 \advance\hsize by \multitablecolspace
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 \fi
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2036 % In either case we will make \leftskip=\multitablecolspace:
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2037 \leftskip=\multitablecolspace
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 \fi
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2039 \noindent##\multistrut}\cr%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 % \everycr will reset column counter, \colcount, at the end of
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2041 % each line. Every column entry will cause \colcount to advance by one.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 % The table preamble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 % looks at the current \colcount to find the correct column width.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2044 \global\everycr{\noalign{%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2045 \filbreak%% keeps underfull box messages off when table breaks over pages.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2046 \global\colcount=0\relax}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2047 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2048
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2049 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2050 % If so, do nothing. If not, give it an appropriate dimension based on
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2051 % current baselineskip.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2052 \ifdim\multitablelinespace=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2053 %% strut to put in table in case some entry doesn't have descenders,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2054 %% to keep lines equally spaced
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2055 \let\multistrut = \strut
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2056 %% Test to see if parskip is larger than space between lines of
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2057 %% table. If not, do nothing.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2058 %% If so, set to same dimension as multitablelinespace.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2059 \else
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2060 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2061 width0pt\relax} \fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2062 \ifdim\multitableparskip>\multitablelinespace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2063 \global\multitableparskip=\multitablelinespace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2064 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2065 %% than skip between lines in the table.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2066 \fi%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2067 \ifdim\multitableparskip=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2068 \global\multitableparskip=\multitablelinespace
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2069 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2070 %% than skip between lines in the table.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2071 \fi}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2072
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 \message{indexing,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 % Index generation facilities
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 % Define \newwrite to be identical to plain tex's \newwrite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 % except not \outer, so it can be used within \newindex.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 {\catcode`\@=11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 % \newindex {foo} defines an index named foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 % It automatically defines \fooindex such that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 % \fooindex ...rest of line... puts an entry in the index foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 % It also defines \fooindfile to be the number of the output channel for
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2086 % the file that accumulates this index. The file's extension is foo.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 % The name of an index should be no more than 2 characters long
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 % for the sake of vms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 \def\newindex #1{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2092 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2093 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 \noexpand\doindex {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 % @defindex foo == \newindex{foo}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 \def\defindex{\parsearg\newindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 % Define @defcodeindex, like @defindex except put all entries in @code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 \def\newcodeindex #1{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2105 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2106 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 \noexpand\docodeindex {#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 \def\defcodeindex{\parsearg\newcodeindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 % @synindex foo bar makes index foo feed into index bar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 % Do this instead of @defindex foo if you don't want it as a separate index.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 \def\synindex #1 #2 {%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2117 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 \noexpand\doindex {#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 % @syncodeindex foo bar similar, but put all entries made for index foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 % inside @code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 \def\syncodeindex #1 #2 {%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2126 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 \noexpand\docodeindex {#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 % Define \doindex, the driver for all \fooindex macros.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 % Argument #1 is generated by the calling \fooindex macro,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 % and it is "foo", the name of the index.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 % \doindex just uses \parsearg; it calls \doind for the actual work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 % This is because \doind is more useful to call from other macros.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 % There is also \dosubind {index}{topic}{subtopic}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 % which makes an entry in a two-level index such as the operation index.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 \def\singleindexer #1{\doind{\indexname}{#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 % like the previous two, but they put @code around the argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 \def\indexdummies{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 % Take care of the plain tex accent commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 \def\"{\realbackslash "}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 \def\`{\realbackslash `}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 \def\'{\realbackslash '}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 \def\^{\realbackslash ^}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 \def\~{\realbackslash ~}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 \def\={\realbackslash =}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 \def\b{\realbackslash b}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 \def\c{\realbackslash c}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 \def\d{\realbackslash d}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 \def\u{\realbackslash u}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 \def\v{\realbackslash v}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 \def\H{\realbackslash H}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 % Take care of the plain tex special European modified letters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 \def\oe{\realbackslash oe}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 \def\ae{\realbackslash ae}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 \def\aa{\realbackslash aa}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 \def\OE{\realbackslash OE}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 \def\AE{\realbackslash AE}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 \def\AA{\realbackslash AA}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 \def\o{\realbackslash o}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 \def\O{\realbackslash O}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 \def\l{\realbackslash l}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 \def\L{\realbackslash L}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 \def\ss{\realbackslash ss}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 % Take care of texinfo commands likely to appear in an index entry.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2174 % (Must be a way to avoid doing expansion at all, and thus not have to
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2175 % laboriously list every single command here.)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2176 \def\@{@}% will be @@ when we switch to @ as escape char.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2177 %\let\{ = \lbracecmd
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2178 %\let\} = \rbracecmd
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 \def\_{{\realbackslash _}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 \def\w{\realbackslash w }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 \def\bf{\realbackslash bf }%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2182 %\def\rm{\realbackslash rm }%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 \def\sl{\realbackslash sl }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 \def\sf{\realbackslash sf}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 \def\tt{\realbackslash tt}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 \def\gtr{\realbackslash gtr}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 \def\less{\realbackslash less}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 \def\hat{\realbackslash hat}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2189 %\def\char{\realbackslash char}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 \def\TeX{\realbackslash TeX}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 \def\dots{\realbackslash dots }%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2192 \def\copyright{\realbackslash copyright }%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 \def\tclose##1{\realbackslash tclose {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 \def\code##1{\realbackslash code {##1}}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2195 \def\dotless##1{\realbackslash dotless {##1}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 \def\samp##1{\realbackslash samp {##1}}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2197 \def\,##1{\realbackslash ,{##1}}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2198 \def\t##1{\realbackslash t {##1}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 \def\r##1{\realbackslash r {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 \def\i##1{\realbackslash i {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 \def\b##1{\realbackslash b {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 \def\cite##1{\realbackslash cite {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 \def\key##1{\realbackslash key {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 \def\file##1{\realbackslash file {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 \def\var##1{\realbackslash var {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 \def\kbd##1{\realbackslash kbd {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 \def\dfn##1{\realbackslash dfn {##1}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 \def\emph##1{\realbackslash emph {##1}}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2209 \unsepspaces
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2212 % If an index command is used in an @example environment, any spaces
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2213 % therein should become regular spaces in the raw index file, not the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2214 % expansion of \tie (\\leavevmode \penalty \@M \ ).
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2215 {\obeyspaces
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2216 \gdef\unsepspaces{\obeyspaces\let =\space}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2217
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 % \indexnofonts no-ops all font-change commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 % This is used when outputting the strings to sort the index by.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 \def\indexdummyfont#1{#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 \def\indexdummytex{TeX}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 \def\indexdummydots{...}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 \def\indexnofonts{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 % Just ignore accents.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2226 \let\,=\indexdummyfont
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 \let\"=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 \let\`=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 \let\'=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 \let\^=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 \let\~=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 \let\==\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 \let\b=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 \let\c=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 \let\d=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 \let\u=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 \let\v=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 \let\H=\indexdummyfont
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2239 \let\dotless=\indexdummyfont
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 % Take care of the plain tex special European modified letters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 \def\oe{oe}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 \def\ae{ae}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 \def\aa{aa}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 \def\OE{OE}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 \def\AE{AE}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 \def\AA{AA}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 \def\o{o}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 \def\O{O}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 \def\l{l}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 \def\L{L}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 \def\ss{ss}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 \let\w=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 \let\t=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 \let\r=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 \let\i=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 \let\b=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 \let\emph=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 \let\strong=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 \let\cite=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 \let\sc=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 %Don't no-op \tt, since it isn't a user-level command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 % and is used in the definitions of the active chars like <, >, |...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 %\let\tt=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 \let\tclose=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 \let\code=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 \let\file=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 \let\samp=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 \let\kbd=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 \let\key=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 \let\var=\indexdummyfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 \let\TeX=\indexdummytex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 \let\dots=\indexdummydots
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2273 \def\@{@}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 % To define \realbackslash, we must make \ not be an escape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 % We must first make another character (@) an escape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 % so we do not become unable to do a definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 {\catcode`\@=0 \catcode`\\=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 @gdef@realbackslash{\}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 \let\indexbackslash=0 %overridden during \printindex.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 \let\SETmarginindex=\relax %initialize!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 % workhorse for all \fooindexes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 % #1 is name of index, #2 is stuff to put there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 \def\doind #1#2{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2289 % Put the index entry in the margin if desired.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2290 \ifx\SETmarginindex\relax\else
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2291 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2292 \fi
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2293 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2294 \count255=\lastpenalty
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2295 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2296 \indexdummies % Must do this here, since \bf, etc expand at this stage
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2297 \escapechar=`\\
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2298 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2299 \let\folio=0 % We will expand all macros now EXCEPT \folio.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2300 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2301 % so it will be output as is; and it will print as backslash.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2302 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2303 % First process the index-string with all font commands turned off
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2304 % to get the string to sort by.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2305 {\indexnofonts \xdef\indexsorttmp{#2}}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2306 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2307 % Now produce the complete index entry, with both the sort key and the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2308 % original text, including any font commands.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2309 \toks0 = {#2}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2310 \edef\temp{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2311 \write\csname#1indfile\endcsname{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2312 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2313 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2314 \temp
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2315 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2316 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2317 \penalty\count255
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2318 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2319 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 \def\dosubind #1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 {\count10=\lastpenalty %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 {\indexdummies % Must do this here, since \bf, etc expand at this stage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 {\let\folio=0%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 \def\rawbackslashxx{\indexbackslash}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 % Now process the index-string once, with all font commands turned off,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 % to get the string to sort the index by.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 {\indexnofonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 \xdef\temp1{#2 #3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 % Now produce the complete index entry. We process the index-string again,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 % this time with font commands expanded, to get what to print in the index.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 \edef\temp{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 \write \csname#1indfile\endcsname{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 \temp }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 }\penalty\count10}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 % The index entry written in the file actually looks like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 % \entry {sortstring}{page}{topic}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 % or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 % \entry {sortstring}{page}{topic}{subtopic}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 % The texindex program reads in these files and writes files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 % containing these kinds of lines:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 % \initial {c}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 % before the first topic whose initial is c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 % \entry {topic}{pagelist}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 % for a topic that is used without subtopics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 % \primary {topic}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 % for the beginning of a topic that is used with subtopics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 % \secondary {subtopic}{pagelist}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 % for each subtopic.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 % Define the user-accessible indexing commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 % @findex, @vindex, @kindex, @cindex.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 \def\findex {\fnindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 \def\kindex {\kyindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 \def\cindex {\cpindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 \def\vindex {\vrindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 \def\tindex {\tpindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 \def\pindex {\pgindex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 \def\cindexsub {\begingroup\obeylines\cindexsub}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 {\obeylines %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 \gdef\cindexsub "#1" #2^^M{\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 \dosubind{cp}{#2}{#1}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 % Define the macros used in formatting output of the sorted index material.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2373 % This is what you call to cause a particular index to get printed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2374 % Write
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2375 % @unnumbered Function Index
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2376 % @printindex fn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2377
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 \def\printindex{\parsearg\doprintindex}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2379
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2380 \def\doprintindex#1{\begingroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2381 \dobreak \chapheadingskip{10000}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2383 \indexfonts \rm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2384 \tolerance = 9500
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2385 \indexbreaks
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2386 \def\indexbackslash{\rawbackslashxx}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2387 % Index files are almost Texinfo source, but we use \ as the escape
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2388 % character. It would be better to use @, but that's too big a change
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2389 % to make right now.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2390 \catcode`\\ = 0
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2391 \catcode`\@ = 11
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2392 \escapechar = `\\
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2393 \begindoublecolumns
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 % See if the index file exists and is nonempty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 \openin 1 \jobname.#1s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 \ifeof 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 % \enddoublecolumns gets confused if there is no text in the index,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 % and it loses the chapter title and the aux file entries for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 % index. The easiest way to prevent this problem is to make sure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 % there is some text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 (Index is nonexistent)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2403 \else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 % If the index file exists but is empty, then \openin leaves \ifeof
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 % false. We have to make TeX try to read something from the file, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 % it can discover if there is anything in it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 \read 1 to \temp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 \ifeof 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 (Index is empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 \input \jobname.#1s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 \closein 1
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2416 \enddoublecolumns
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2417 \endgroup}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 % These macros are used by the sorted index file itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 % Change them to control the appearance of the index.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 % Same as \bigskipamount except no shrink.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 % \balancecolumns gets confused if there is any shrink.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 \newskip\initialskipamount \initialskipamount 12pt plus4pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 \def\initial #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 \ifdim\lastskip<\initialskipamount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 \removelastskip \penalty-200 \vskip \initialskipamount\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 % This typesets a paragraph consisting of #1, dot leaders, and then #2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 % flush to the right margin. It is used for index and table of contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 % entries. The paragraph is indented by \leftskip.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 \def\entry #1#2{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 % Start a new paragraph if necessary, so our assignments below can't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 % affect previous text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 \par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 % Do not fill out the last line with white space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 \parfillskip = 0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 % No extra space above this paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 \parskip = 0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 % Do not prefer a separate line ending with a hyphen to fewer lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 \finalhyphendemerits = 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 % \hangindent is only relevant when the entry text and page number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 % don't both fit on one line. In that case, bob suggests starting the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 % dots pretty far over on the line. Unfortunately, a large
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 % indentation looks wrong when the entry text itself is broken across
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 % lines. So we use a small indentation and put up with long leaders.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 % \hangafter is reset to 1 (which is the value we want) at the start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 % of each paragraph, so we need not do anything with that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 \hangindent=2em
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 % When the entry text needs to be broken, just fill out the first line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 % with blank space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 \rightskip = 0pt plus1fil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 % Start a ``paragraph'' for the index entry so the line breaking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 % parameters we've set above will have an effect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 \noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 % Insert the text of the index entry. TeX will do line-breaking on it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 #1%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2471 % The following is kludged to not output a line of dots in the index if
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 % there are no page numbers. The next person who breaks this will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 % cursed by a Unix daemon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 \def\tempa{{\rm }}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 \def\tempb{#2}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 \edef\tempc{\tempa}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 \edef\tempd{\tempb}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 \ifx\tempc\tempd\ \else%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 % If we must, put the page number on a line of its own, and fill out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 % this line with blank space. (The \hfil is overwhelmed with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 % fill leaders glue in \indexdotfill if the page number does fit.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 \hfil\penalty50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 \null\nobreak\indexdotfill % Have leaders before the page number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 % The `\ ' here is removed by the implicit \unskip that TeX does as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 % part of (the primitive) \par. Without it, a spurious underfull
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 % \hbox ensues.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 \ #2% The page number ends the paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 \fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 \par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 % Like \dotfill except takes at least 1 em.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 \def\indexdotfill{\cleaders
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 \def\primary #1{\line{#1\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 \newskip\secondaryindent \secondaryindent=0.5cm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 \def\secondary #1#2{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 {\parfillskip=0in \parskip=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 \hangindent =1in \hangafter=1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2508 % Define two-column mode, which we use to typeset indexes.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2509 % Adapted from the TeXbook, page 416, which is to say,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2510 % the manmac.tex format used to print the TeXbook itself.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2511 \catcode`\@=11
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 \newbox\partialpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 \newdimen\doublecolumnhsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2516 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 % Grab any single-column material above us.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2518 \output = {\global\setbox\partialpage
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2519 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 \eject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2522 % Now switch to the double-column output routine.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2523 \output={\doublecolumnout}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 % Change the page size parameters. We could do this once outside this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 % format, but then we repeat the same computation. Repeating a couple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 % of assignments once per index is clearly meaningless for the
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2529 % execution time, so we may as well do it once.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 % First we halve the line length, less a little for the gutter between
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 % the columns. We compute the gutter based on the line length, so it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 % changes automatically with the paper format. The magic constant
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2534 % below is chosen so that the gutter has the same value (well, +- <
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2535 % 1pt) as it did when we hard-coded it.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 % We put the result in a separate register, \doublecolumhsize, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 % can restore it in \pagesofar, after \hsize itself has (potentially)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 % been clobbered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 \doublecolumnhsize = \hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 \advance\doublecolumnhsize by -.04154\hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 \divide\doublecolumnhsize by 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 \hsize = \doublecolumnhsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 % Double the \vsize as well. (We don't need a separate register here,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 % since nobody clobbers \vsize.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 \vsize = 2\vsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2550 \def\doublecolumnout{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2551 \splittopskip=\topskip \splitmaxdepth=\maxdepth
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2552 % Get the available space for the double columns -- the normal
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2553 % (undoubled) page height minus any material left over from the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2554 % previous page.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2555 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2556 % box0 will be the left-hand column, box1 the right.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2557 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2558 \onepageout\pagesofar
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2559 \unvbox255 \penalty\outputpenalty
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2560 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2561 \def\pagesofar{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2562 % The contents of the output page -- any previous material,
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2563 % followed by the two boxes we just split.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2564 \unvbox\partialpage
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2565 \hsize = \doublecolumnhsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2566 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 0
diff changeset
2567 }
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2568 \def\enddoublecolumns{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2569 \output={\balancecolumns}\eject % split what we have
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2570 \endgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2571 % Back to normal single-column typesetting, but take account of the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2572 % fact that we just accumulated some stuff on the output page.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2573 \pagegoal=\vsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2574 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2575 \def\balancecolumns{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2576 % Called on the last page of the double column material.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2577 \setbox0=\vbox{\unvbox255}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2578 \dimen@ = \ht0
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2579 \advance\dimen@ by \topskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2580 \advance\dimen@ by-\baselineskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2581 \divide\dimen@ by 2
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2582 \splittopskip = \topskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2583 % Loop until we get a decent breakpoint.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2584 {\vbadness=10000 \loop \global\setbox3=\copy0
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2585 \global\setbox1=\vsplit3 to\dimen@
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2586 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2587 \setbox0=\vbox to\dimen@{\unvbox1}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2588 \setbox2=\vbox to\dimen@{\unvbox3}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2589 \pagesofar
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2590 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2591 \catcode `\@=\other
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2592
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2593
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 \message{sectioning,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 % Define chapters, sections, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2597 \newcount \chapno
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2598 \newcount \secno \secno=0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2599 \newcount \subsecno \subsecno=0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2600 \newcount \subsubsecno \subsubsecno=0
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 % This counter is funny since it counts through charcodes of letters A, B, ...
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2603 \newcount \appendixno \appendixno = `\@
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 \def\appendixletter{\char\the\appendixno}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2606 \newwrite \contentsfile
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 % This is called from \setfilename.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2608 \def\opencontents{\openout \contentsfile = \jobname.toc}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 % Each @chapter defines this as the name of the chapter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 % page headings and footings can use it. @section does likewise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 \def\thischapter{} \def\thissection{}
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2614 \def\seccheck#1{\if \pageno<0 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2615 \errmessage{@#1 not allowed after generating table of contents}\fi
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2616 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2617 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 \def\chapternofonts{%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2620 \let\rawbackslash=\relax%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2621 \let\frenchspacing=\relax%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2622 \def\result{\realbackslash result}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2623 \def\equiv{\realbackslash equiv}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2624 \def\expansion{\realbackslash expansion}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2625 \def\print{\realbackslash print}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2626 \def\TeX{\realbackslash TeX}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2627 \def\dots{\realbackslash dots}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2628 \def\copyright{\realbackslash copyright}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2629 \def\tt{\realbackslash tt}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2630 \def\bf{\realbackslash bf }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2631 \def\w{\realbackslash w}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2632 \def\less{\realbackslash less}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2633 \def\gtr{\realbackslash gtr}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2634 \def\hat{\realbackslash hat}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2635 \def\char{\realbackslash char}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2636 \def\tclose##1{\realbackslash tclose {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2637 \def\code##1{\realbackslash code {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2638 \def\samp##1{\realbackslash samp {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2639 \def\r##1{\realbackslash r {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2640 \def\b##1{\realbackslash b {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2641 \def\key##1{\realbackslash key {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2642 \def\file##1{\realbackslash file {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2643 \def\kbd##1{\realbackslash kbd {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2644 % These are redefined because @smartitalic wouldn't work inside xdef.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2645 \def\i##1{\realbackslash i {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2646 \def\cite##1{\realbackslash cite {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2647 \def\var##1{\realbackslash var {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2648 \def\emph##1{\realbackslash emph {##1}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2649 \def\dfn##1{\realbackslash dfn {##1}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 \newcount\absseclevel % used to calculate proper heading level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 % @raisesections: treat @section as chapter, @subsection as section, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 \def\raisesections{\global\advance\secbase by -1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 \let\up=\raisesections % original BFox name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 % @lowersections: treat @chapter as section, @section as subsection, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 \def\lowersections{\global\advance\secbase by 1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 \let\down=\lowersections % original BFox name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 % Choose a numbered-heading macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 % #1 is heading level if unmodified by @raisesections or @lowersections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 % #2 is text for heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 \ifcase\absseclevel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 \chapterzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 \seczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 \numberedsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 \numberedsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 \ifnum \absseclevel<0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 \chapterzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 \numberedsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 % like \numhead, but chooses appendix heading levels
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 \ifcase\absseclevel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 \appendixzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 \appendixsectionzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 \appendixsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 \appendixsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 \ifnum \absseclevel<0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 \appendixzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 \appendixsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 % like \numhead, but chooses numberless heading levels
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 \ifcase\absseclevel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 \unnumberedzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 \unnumberedseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 \unnumberedsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 \or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 \unnumberedsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 \ifnum \absseclevel<0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 \unnumberedzzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 \unnumberedsubsubseczzz{#2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 \def\thischaptername{No Chapter Title}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 \outer\def\chapter{\parsearg\chapteryyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 \def\chapterzzz #1{\seccheck{chapter}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 \secno=0 \subsecno=0 \subsubsecno=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 \global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 \chapmacro {#1}{\the\chapno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 \gdef\thissection{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 \gdef\thischaptername{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 % We don't substitute the actual chapter name into \thischapter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 % because we don't want its macros evaluated now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2736 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 \donoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 \global\let\section = \numberedsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 \global\let\subsection = \numberedsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 \global\let\subsubsection = \numberedsubsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 \outer\def\appendix{\parsearg\appendixyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 \def\appendixzzz #1{\seccheck{appendix}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 \secno=0 \subsecno=0 \subsubsecno=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 \gdef\thissection{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 \gdef\thischaptername{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2755 \edef\temp{{\realbackslash chapentry
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2756 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 \appendixnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 \global\let\section = \appendixsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 \global\let\subsection = \appendixsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 \global\let\subsubsection = \appendixsubsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2765 % @centerchap is like @unnumbered, but the heading is centered.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2766 \outer\def\centerchap{\parsearg\centerchapyyy}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2767 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2768
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 \outer\def\top{\parsearg\unnumberedyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 \outer\def\unnumbered{\parsearg\unnumberedyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 \def\unnumberedzzz #1{\seccheck{unnumbered}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 \secno=0 \subsecno=0 \subsubsecno=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 % This used to be simply \message{#1}, but TeX fully expands the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 % argument to \message. Therefore, if #1 contained @-commands, TeX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 % expanded @cite (which turns out to cause errors because \cite is meant
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 % to be executed, not expanded).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 % Anyway, we don't want the fully-expanded definition of @cite to appear
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 % as a result of the \message, we just want `@cite' itself. We use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 % simply yielding the contents of the <toks register>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 \toks0 = {#1}\message{(\the\toks0)}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 \unnumbchapmacro {#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 \gdef\thischapter{#1}\gdef\thissection{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2790 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 \unnumbnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 \global\let\section = \unnumberedsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 \global\let\subsection = \unnumberedsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 \global\let\subsubsection = \unnumberedsubsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 \outer\def\numberedsec{\parsearg\secyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 \def\seczzz #1{\seccheck{section}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 {\chapternofonts%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 \edef\temp{{\realbackslash secentry %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2806 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 \donoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2813 \outer\def\appendixsection{\parsearg\appendixsecyyy}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 \outer\def\appendixsec{\parsearg\appendixsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 {\chapternofonts%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 \edef\temp{{\realbackslash secentry %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2821 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 \appendixnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 \plainsecheading {#1}\gdef\thissection{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2833 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 \unnumbnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 \def\numberedsubseczzz #1{\seccheck{subsection}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 {\chapternofonts%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 \edef\temp{{\realbackslash subsecentry %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2847 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 \donoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 {\chapternofonts%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 \edef\temp{{\realbackslash subsecentry %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2861 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 \appendixnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2871 \plainsubsecheading {#1}\gdef\thissection{#1}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2873 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 \unnumbnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 \subsubsecheading {#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2887 \edef\temp{{\realbackslash subsubsecentry %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2888 {#1}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 {\noexpand\folio}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 \donoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 \subsubsecheading {#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2904 \edef\temp{{\realbackslash subsubsecentry{#1}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 {\appendixletter}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 \appendixnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2916 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 {\chapternofonts%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
2918 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 \escapechar=`\\%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 \write \contentsfile \temp %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 \unnumbnoderef %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 \penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 % These are variants which are not "outer", so they can appear in @ifinfo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 % Actually, they should now be obsolete; ordinary section commands should work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 \def\infotop{\parsearg\unnumberedzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 \def\infounnumbered{\parsearg\unnumberedzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 \def\infoappendix{\parsearg\appendixzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 \def\infoappendixsec{\parsearg\appendixseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 \def\infochapter{\parsearg\chapterzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 \def\infosection{\parsearg\sectionzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 \def\infosubsection{\parsearg\subsectionzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 \def\infosubsubsection{\parsearg\subsubsectionzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 % These macros control what the section commands do, according
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 % Define them by default for a numbered chapter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 \global\let\section = \numberedsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 \global\let\subsection = \numberedsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 \global\let\subsubsection = \numberedsubsubsec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 % Define @majorheading, @heading and @subheading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 % NOTE on use of \vbox for chapter headings, section headings, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 % such:
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2954 % 1) We use \vbox rather than the earlier \line to permit
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2955 % overlong headings to fold.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2956 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2957 % heading is obnoxious; this forbids it.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 % 3) Likewise, headings look best if no \parindent is used, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 % if justification is not attempted. Hence \raggedright.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 \def\majorheading{\parsearg\majorheadingzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 \def\majorheadingzzz #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 {\advance\chapheadingskip by 10pt \chapbreak }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 \parindent=0pt\raggedright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 \rm #1\hfill}}\bigskip \par\penalty 200}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 \def\chapheading{\parsearg\chapheadingzzz}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 \def\chapheadingzzz #1{\chapbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 \parindent=0pt\raggedright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 \rm #1\hfill}}\bigskip \par\penalty 200}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2975 % @heading, @subheading, @subsubheading.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2976 \def\heading{\parsearg\plainsecheading}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2977 \def\subheading{\parsearg\plainsubsecheading}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2978 \def\subsubheading{\parsearg\plainsubsubsecheading}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 % These macros generate a chapter, section, etc. heading only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 % (including whitespace, linebreaking, etc. around it),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 % given all the information in convenient, parsed form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 %%% Args are the skip and penalty (usually negative)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 %%% Define plain chapter starts, and page on/off switching for it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 % Parameter controlling skip before chapter headings (if needed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
2992 \newskip\chapheadingskip
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 \def\chappager{\par\vfill\supereject}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 \def\CHAPPAGoff{
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3001 \global\let\contentsalignmacro = \chappager
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 \global\let\pchapsepmacro=\chapbreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 \global\let\pagealignmacro=\chappager}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 \def\CHAPPAGon{
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3006 \global\let\contentsalignmacro = \chappager
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 \global\let\pchapsepmacro=\chappager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 \global\let\pagealignmacro=\chappager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 \global\def\HEADINGSon{\HEADINGSsingle}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 \def\CHAPPAGodd{
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3012 \global\let\contentsalignmacro = \chapoddpage
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 \global\let\pchapsepmacro=\chapoddpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 \global\let\pagealignmacro=\chapoddpage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 \global\def\HEADINGSon{\HEADINGSdouble}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 \CHAPPAGon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 \def\CHAPFplain{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 \global\let\chapmacro=\chfplain
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3021 \global\let\unnumbchapmacro=\unnchfplain
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3022 \global\let\centerchapmacro=\centerchfplain}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3023
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3024 % Plain chapter opening.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3025 % #1 is the text, #2 the chapter number or empty if unnumbered.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3026 \def\chfplain#1#2{%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 \pchapsepmacro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 {%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3029 \chapfonts \rm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3030 \def\chapnum{#2}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3031 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3032 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3033 \hangindent = \wd0 \centerparametersmaybe
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3034 \unhbox0 #1\par}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 }%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3036 \nobreak\bigskip % no page break after a chapter title
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3037 \nobreak
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3040 % Plain opening for unnumbered.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3041 \def\unnchfplain#1{\chfplain{#1}{}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3042
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3043 % @centerchap -- centered and unnumbered.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3044 \let\centerparametersmaybe = \relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3045 \def\centerchfplain#1{{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3046 \def\centerparametersmaybe{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3047 \advance\rightskip by 3\rightskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3048 \leftskip = \rightskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3049 \parfillskip = 0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3050 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3051 \chfplain{#1}{}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3052 }}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3053
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 \CHAPFplain % The default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 \def\unnchfopen #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 \parindent=0pt\raggedright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 \rm #1\hfill}}\bigskip \par\penalty 10000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 \def\chfopen #1#2{\chapoddpage {\chapfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 \par\penalty 5000 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3067 \def\centerchfopen #1{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3068 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3069 \parindent=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3070 \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3071 }
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3072
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 \def\CHAPFopen{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 \global\let\chapmacro=\chfopen
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3075 \global\let\unnumbchapmacro=\unnchfopen
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3076 \global\let\centerchapmacro=\centerchfopen}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3077
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3078
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3079 % Section titles.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3080 \newskip\secheadingskip
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3081 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3082 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3083 \def\plainsecheading#1{\sectionheading{sec}{}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3084
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3085 % Subsection titles.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3086 \newskip \subsecheadingskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3087 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3088 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3089 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3090
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3091 % Subsubsection titles.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3092 \let\subsubsecheadingskip = \subsecheadingskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3093 \let\subsubsecheadingbreak = \subsecheadingbreak
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3094 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3095 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3096
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3097
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3098 % Print any size section title.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3099 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3100 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3101 % number (maybe empty), #3 the text.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3102 \def\sectionheading#1#2#3{%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3103 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3104 \expandafter\advance\csname #1headingskip\endcsname by \parskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3105 \csname #1headingbreak\endcsname
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3106 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3107 {%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3108 % Switch to the right set of fonts.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3109 \csname #1fonts\endcsname \rm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3110 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3111 % Only insert the separating space if we have a section number.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3112 \def\secnum{#2}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3113 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3114 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3115 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3116 \hangindent = \wd0 % zero if no section number
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3117 \unhbox0 #3}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3118 }%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3119 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3120 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 \message{toc printing,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 % Finish up the main text and prepare to read what we've written
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 % to \contentsfile.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 \newskip\contentsrightmargin \contentsrightmargin=1in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 \def\startcontents#1{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3129 % If @setchapternewpage on, and @headings double, the contents should
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3130 % start on an odd page, unlike chapters. Thus, we maintain
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3131 % \contentsalignmacro in parallel with \pagealignmacro.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3132 % From: Torbjorn Granlund <tege@matematik.su.se>
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3133 \contentsalignmacro
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 \immediate\closeout \contentsfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 \ifnum \pageno>0
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3136 \pageno = -1 % Request roman numbered pages.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 % Don't need to put `Contents' or `Short Contents' in the headline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 % It is abundantly clear what they are.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 \unnumbchapmacro{#1}\def\thischapter{}%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3141 \begingroup % Set up to handle contents files properly.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3143 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 \raggedbottom % Worry more about breakpoints than the bottom.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 % Normal (long) toc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 \outer\def\contents{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 \startcontents{\putwordTableofContents}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 \input \jobname.toc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 \vfill \eject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 % And just the chapters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 \outer\def\summarycontents{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 \startcontents{\putwordShortContents}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 \let\chapentry = \shortchapentry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 \let\unnumbchapentry = \shortunnumberedentry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 % We want a true roman here for the page numbers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 \secfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 \rm
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3167 \hyphenpenalty = 10000
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 \advance\baselineskip by 1pt % Open it up a little.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 \def\secentry ##1##2##3##4{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 \def\unnumbsecentry ##1##2{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 \def\subsecentry ##1##2##3##4##5{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 \def\unnumbsubsecentry ##1##2{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 \def\subsubsecentry ##1##2##3##4##5##6{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 \def\unnumbsubsubsecentry ##1##2{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 \input \jobname.toc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 \vfill \eject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 \let\shortcontents = \summarycontents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 % These macros generate individual entries in the table of contents.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 % The first argument is the chapter or section name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 % The last argument is the page number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 % The arguments in between are the chapter number, section number, ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 % Chapter-level things, for both the long and short contents.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 % See comments in \dochapentry re vbox and related settings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 \def\shortchapentry#1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 % Typeset the label for a chapter or appendix for the short contents.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 % We could simplify the code here by writing out an \appendixentry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 % command in the toc file for appendices, instead of using \chapentry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 % for both, but it doesn't seem worth it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 \setbox0 = \hbox{\shortcontrm \putwordAppendix }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 \newdimen\shortappendixwidth \shortappendixwidth = \wd0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 \def\shortchaplabel#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 % We typeset #1 in a box of constant width, regardless of the text of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 % #1, so the chapter titles will come out aligned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 \setbox0 = \hbox{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 % This space should be plenty, since a single number is .5em, and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 % widest letter (M) is 1em, at least in the Computer Modern fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 % (This space doesn't include the extra space that gets added after
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3211 % the label; that gets put in by \shortchapentry above.)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 \advance\dimen0 by 1.1em
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 \hbox to \dimen0{#1\hfil}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 % Sections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 % Subsections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 % And subsubsections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 \def\subsubsecentry#1#2#3#4#5#6{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 % This parameter controls the indentation of the various levels.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 \newdimen\tocindent \tocindent = 3pc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 % page number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3238 % If the toc has to be broken over pages, we want it to be at chapters
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 % if at all possible; hence the \penalty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 \def\dochapentry#1#2{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3241 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 \chapentryfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 \tocentry{#1}{\dopageno{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 \endgroup
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3246 \nobreak\vskip .25\baselineskip plus.1\baselineskip
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 \def\dosecentry#1#2{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 \secentryfonts \leftskip=\tocindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 \tocentry{#1}{\dopageno{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 \def\dosubsecentry#1#2{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 \subsecentryfonts \leftskip=2\tocindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 \tocentry{#1}{\dopageno{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 \def\dosubsubsecentry#1#2{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 \subsubsecentryfonts \leftskip=3\tocindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 \tocentry{#1}{\dopageno{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 % Final typesetting of a toc entry; we use the same \entry macro as for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 % the index entries, but we want to suppress hyphenation here. (We
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 % can't do that in the \entry macro, since index entries might consist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3269 % \turnoffactive is for the sake of @" used for umlauts.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 \def\tocentry#1#2{\begingroup
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3271 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3272 \entry{\turnoffactive #1}{\turnoffactive #2}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 % Space between chapter (or whatever) number and the title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 \def\labelspace{\hskip1em \relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 \def\dopageno#1{{\rm #1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 \def\doshortpageno#1{{\rm #1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 \def\chapentryfonts{\secfonts \rm}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 \def\secentryfonts{\textfonts}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 \let\subsecentryfonts = \textfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 \let\subsubsecentryfonts = \textfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 \message{environments,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 % Since these characters are used in examples, it should be an even number of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 % \tt widths. Each \tt character is 1en, so two makes it 1em.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 % Furthermore, these definitions must come after we define our fonts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 \newbox\dblarrowbox \newbox\longdblarrowbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 \newbox\pushcharbox \newbox\bullbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 \newbox\equivbox \newbox\errorbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 %{\tentt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 % Adapted from the manmac format (p.420 of TeXbook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 % depth .1ex\hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 %}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3306 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307 \def\point{$\star$}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 % Adapted from the TeXbook's \boxit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 {\tentt \global\dimen0 = 3em}% Width of the box.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 \dimen2 = .55pt % Thickness of rules
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 \global\setbox\errorbox=\hbox to \dimen0{\hfil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321 \advance\hsize by -2\dimen2 % Rules.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 \vbox{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 \hrule height\dimen2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 \kern3pt\vrule width\dimen2}% Space to right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 \hrule height\dimen2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 \hfil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 % The @error{} command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 \def\error{\leavevmode\lower.7ex\copy\errorbox}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 % @tex ... @end tex escapes into raw Tex temporarily.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 % One exception: @ is still an escape character, so that @end tex works.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 % But \@ or @@ will get a plain tex @ character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 \def\tex{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 \catcode `\%=14
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3342 \catcode 43=12 % plus
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 \catcode`\"=12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 \catcode`\==12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 \catcode`\|=12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 \catcode`\<=12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 \catcode`\>=12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 \escapechar=`\\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3350 \let\,=\ptexcomma
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3351 \let\~=\ptextilde
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 \let\{=\ptexlbrace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 \let\}=\ptexrbrace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 \let\.=\ptexdot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 \let\*=\ptexstar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 \let\dots=\ptexdots
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3357 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3358 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 \def\@{@}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 \let\bullet=\ptexbullet
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3361 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 \let\Etex=\endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 % Define @lisp ... @endlisp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 % @lisp does a \begingroup so it can rebind things,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 % including the definition of @endlisp (which normally is erroneous).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 % Amount to narrow the margins by for @lisp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370 \newskip\lispnarrowing \lispnarrowing=0.4in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 % This is the definition that ^^M gets inside @lisp, @example, and other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 % such environments. \null is better than a space, since it doesn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 % have any width.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 \def\lisppar{\null\endgraf}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 % Make each space character in the input produce a normal interword
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 % space in the output. Don't allow a line break at this space, as this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 % is used only in environments like @example, where each line of input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380 % should produce a line of output anyway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 {\obeyspaces %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383 \gdef\sepspaces{\obeyspaces\let =\tie}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385 % Define \obeyedspace to be our active space, whatever it is. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 % for use in \parsearg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 {\sepspaces%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 \global\let\obeyedspace= }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 % This space is always present above and below environments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 \newskip\envskipamount \envskipamount = 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 % Make spacing and below environment symmetrical. We use \parskip here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 % to help in doing that, since in @example-like environments \parskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 % start of the next paragraph will insert \parskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 \def\aboveenvbreak{{\advance\envskipamount by \parskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399 \endgraf \ifdim\lastskip<\envskipamount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 \let\afterenvbreak = \aboveenvbreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 \let\nonarrowing=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408 % \cartouche: draw rectangle w/rounded corners around argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409 \font\circle=lcircle10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410 \newdimen\circthick
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 \newdimen\cartouter\newdimen\cartinner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 \newskip\normbskip\newskip\normpskip\newskip\normlskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 \circthick=\fontdimen8\circle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 \def\ctr{{\hskip 6pt\circle\char'010}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 \def\cbl{{\circle\char'012\hskip -6pt}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 \def\cbr{{\hskip 6pt\circle\char'011}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 \def\carttop{\hbox to \cartouter{\hskip\lskip
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3420 \ctl\leaders\hrule height\circthick\hfil\ctr
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3421 \hskip\rskip}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 \def\cartbot{\hbox to \cartouter{\hskip\lskip
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3423 \cbl\leaders\hrule height\circthick\hfil\cbr
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3424 \hskip\rskip}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426 \newskip\lskip\newskip\rskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 \long\def\cartouche{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 \begingroup
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3430 \lskip=\leftskip \rskip=\rightskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3431 \leftskip=0pt\rightskip=0pt %we want these *outside*.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3432 \cartinner=\hsize \advance\cartinner by-\lskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3433 \advance\cartinner by-\rskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3434 \cartouter=\hsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3435 \advance\cartouter by 18pt % allow for 3pt kerns on either
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3436 % side, and for 6pt waste from
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3437 % each corner char
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3438 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3439 % Flag to tell @lisp, etc., not to narrow margin.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3440 \let\nonarrowing=\comment
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3441 \vbox\bgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3442 \baselineskip=0pt\parskip=0pt\lineskip=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3443 \carttop
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3444 \hbox\bgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3445 \hskip\lskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3446 \vrule\kern3pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3447 \vbox\bgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3448 \hsize=\cartinner
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3449 \kern3pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3450 \begingroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3451 \baselineskip=\normbskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3452 \lineskip=\normlskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3453 \parskip=\normpskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3454 \vskip -\parskip
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 \def\Ecartouche{%
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3456 \endgroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3457 \kern3pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3458 \egroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3459 \kern3pt\vrule
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3460 \hskip\rskip
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3461 \egroup
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3462 \cartbot
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3463 \egroup
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464 \endgroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 % This macro is called at the beginning of all the @example variants,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 % inside a group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470 \def\nonfillstart{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 \aboveenvbreak
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472 \inENV % This group ends at the end of the body
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3473 \hfuzz = 12pt % Don't be fussy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474 \sepspaces % Make spaces be word-separators rather than space tokens.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475 \singlespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 \let\par = \lisppar % don't ignore blank lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477 \obeylines % each line of input is a line of output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478 \parskip = 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 \parindent = 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480 \emergencystretch = 0pt % don't try to avoid overfull boxes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 % @cartouche defines \nonarrowing to inhibit narrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482 % at next level down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 \ifx\nonarrowing\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 \advance \leftskip by \lispnarrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 \exdentamount=\lispnarrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 \let\exdent=\nofillexdent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 \let\nonarrowing=\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491 % To ending an @example-like environment, we first end the paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3492 % (via \afterenvbreak's vertical glue), and then the group. That way we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 % keep the zero \parskip that the environments set -- \parskip glue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3494 % will be inserted at the beginning of the next paragraph in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 % document, after the environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 \def\nonfillfinish{\afterenvbreak\endgroup}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3499 % This macro is
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500 \def\lisp{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3502 \let\Elisp = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3503 \tt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504 \rawbackslash % have \ input char produce \ char from current font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505 \gobble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 % Define the \E... control sequence only if we are inside the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 % environment, so the error checking in \end will work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 % We must call \lisp last in the definition, since it reads the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 % return following the @example (or whatever) command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515 \def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 \def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518 % @smallexample and @smalllisp. This is not used unless the @smallbook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3519 % command is given. Originally contributed by Pavel@xerox.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3520 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 \def\smalllispx{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 \let\Esmalllisp = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 \let\Esmallexample = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525 %
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
3526 % Smaller fonts for small examples.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 \indexfonts \tt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 \rawbackslash % make \ output the \ character from the current font (tt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 \gobble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532 % This is @display; same as @lisp except use roman font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 \def\display{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 \let\Edisplay = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 \gobble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540 % This is @format; same as @display except don't narrow margins.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542 \def\format{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543 \let\nonarrowing = t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545 \let\Eformat = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546 \gobble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3549 % @flushleft (same as @format) and @flushright.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 \def\flushleft{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552 \let\nonarrowing = t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554 \let\Eflushleft = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3555 \gobble
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3556 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 \def\flushright{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3558 \let\nonarrowing = t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 \nonfillstart
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560 \let\Eflushright = \nonfillfinish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 \advance\leftskip by 0pt plus 1fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 \gobble}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565 % and narrows the margins.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3566 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3567 \def\quotation{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568 \begingroup\inENV %This group ends at the end of the @quotation body
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3570 \singlespace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3571 \parindent=0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572 % We have retained a nonzero parskip for the environment, since we're
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3573 % doing normal filling. So to avoid extra space below the environment...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3574 \def\Equotation{\parskip = 0pt \nonfillfinish}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3575 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3576 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3577 \ifx\nonarrowing\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3578 \advance\leftskip by \lispnarrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3579 \advance\rightskip by \lispnarrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3580 \exdentamount = \lispnarrowing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3581 \let\nonarrowing = \relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585 \message{defuns,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586 % Define formatter for defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 % First, allow user to change definition object font (\df) internally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3588 \def\setdeffont #1 {\csname DEF#1\endcsname}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3590 \newskip\defbodyindent \defbodyindent=.4in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3591 \newskip\defargsindent \defargsindent=50pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3592 \newskip\deftypemargin \deftypemargin=12pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3593 \newskip\deflastargmargin \deflastargmargin=18pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3595 \newcount\parencount
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3596 % define \functionparens, which makes ( and ) and & do special things.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3597 % \functionparens affects the group it is contained in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3598 \def\activeparens{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3599 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3600 \catcode`\[=\active \catcode`\]=\active}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 % Make control sequences which act like normal parenthesis chars.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3603 \let\lparen = ( \let\rparen = )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3605 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3607 % Be sure that we always have a definition for `(', etc. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3608 % if the fn name has parens in it, \boldbrax will not be in effect yet,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3609 % so TeX would otherwise complain about undefined control sequence.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3610 \global\let(=\lparen \global\let)=\rparen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3611 \global\let[=\lbrack \global\let]=\rbrack
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3613 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3614 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3615 % This is used to turn on special parens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3616 % but make & act ordinary (given that it's active).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3617 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3619 % Definitions of (, ) and & used in args for functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3620 % This is the definition of ( outside of all parentheses.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3621 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3622 \global\advance\parencount by 1 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3623 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3624 % This is the definition of ( when already inside a level of parens.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3625 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3626 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3627 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3628 % also in that case restore the outer-level definition of (.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3629 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3630 \global\advance \parencount by -1 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3631 % If we encounter &foo, then turn on ()-hacking afterwards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3632 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3633 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3634 \gdef\normalparens{\boldbrax\let&=\ampnr}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3635 } % End of definition inside \activeparens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3636 %% These parens (in \boldbrax) actually are a little bolder than the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3637 %% contained text. This is especially needed for [ and ]
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3638 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3639 \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3641 % First, defname, which formats the header line itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3642 % #1 should be the function name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3643 % #2 should be the type of definition, such as "Function".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3645 \def\defname #1#2{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646 % Get the values of \leftskip and \rightskip as they were
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647 % outside the @def...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648 \dimen2=\leftskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649 \advance\dimen2 by -\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650 \dimen3=\rightskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 \advance\dimen3 by -\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3652 \noindent %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3653 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3654 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3655 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3656 \parshape 2 0in \dimen0 \defargsindent \dimen1 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3657 % Now output arg 2 ("Function" or some such)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3658 % ending at \deftypemargin from the right margin,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3659 % but stuck inside a box of width 0 so it does not interfere with linebreaking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3660 {% Adjust \hsize to exclude the ambient margins,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3661 % so that \rightline will obey them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3662 \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3663 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3664 % Make all lines underfull and no complaints:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3665 \tolerance=10000 \hbadness=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3666 \advance\leftskip by -\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3667 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3668 {\df #1}\enskip % Generate function name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3669 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3671 % Actually process the body of a definition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3672 % #1 should be the terminating control sequence, such as \Edefun.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3673 % #2 should be the "another name" control sequence, such as \defunx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3674 % #3 should be the control sequence that actually processes the header,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3675 % such as \defunheader.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3676
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3677 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3678 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3679 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3680 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3681 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3682 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3683 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3684 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3685 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3686 \begingroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3687 \catcode 61=\active % 61 is `='
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3688 \obeylines\activeparens\spacesplit#3}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3690 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3691 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3692 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3693 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3694 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3695 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3696 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3697 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3698 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3699 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3701 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3702 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3703 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3704 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3705 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3706 \def#2##1 ##2 {\def#4{##1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3707 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3708 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3709 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3710 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3711 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3713 % These parsing functions are similar to the preceding ones
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3714 % except that they do not make parens into active characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3715 % These are used for "variables" since they have no arguments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3717 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3718 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3719 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3720 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3721 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3722 \def#2{\begingroup\obeylines\spacesplit#3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3723 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3724 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3725 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3726 \begingroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3727 \catcode 61=\active %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3728 \obeylines\spacesplit#3}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3730 % This is used for \def{tp,vr}parsebody. It could probably be used for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3731 % some of the others, too, with some judicious conditionals.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3732 %
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3733 \def\parsebodycommon#1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3734 \begingroup\inENV %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3735 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3736 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3737 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739 \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743 \begingroup\obeylines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 \def\defvrparsebody#1#2#3#4 {%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747 \parsebodycommon{#1}{#2}{#3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748 \spacesplit{#3{#4}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752 % type is just `struct', because we lose the braces in `{struct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753 % termios}' when \spacesplit reads its undelimited argument. Sigh.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3754 % \let\deftpparsebody=\defvrparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 % So, to get around this, we put \empty in with the type name. That
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757 % way, TeX won't find exactly `{...}' as an undelimited argument, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758 % won't strip off the braces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760 \def\deftpparsebody #1#2#3#4 {%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 \parsebodycommon{#1}{#2}{#3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765 % Fine, but then we have to eventually remove the \empty *and* the
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3766 % braces (if any). That's what this does, putting the result in \tptemp.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3767 %
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3768 \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3770 % After \spacesplit has done its work, this is called -- #1 is the final
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 % thing to call, #2 the type name (which starts with \empty), and #3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772 % (which might be empty) the arguments.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3773 %
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774 \def\parsetpheaderline#1#2#3{%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3775 \removeemptybraces#2\relax
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3776 #1{\tptemp}{#3}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3779 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3780 \medbreak %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 % Define the end token that this defining construct specifies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782 % so that it will exit this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783 \def#1{\endgraf\endgroup\medbreak}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3784 \def#2##1 ##2 {\def#4{##1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 \begingroup\obeylines\spacesplit{#3{##2}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 \parindent=0in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3788 \exdentamount=\defbodyindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789 \begingroup\obeylines\spacesplit{#3{#5}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 % Split up #2 at the first space token.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3792 % call #1 with two arguments:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3793 % the first is all of #2 before the space token,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3794 % the second is all of #2 after that space token.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 % If #2 contains no space token, all of it is passed as the first arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 % and the second is passed as empty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798 {\obeylines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 \ifx\relax #3%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802 #1{#2}{}\else #1{#2}{#3#4}\fi}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804 % So much for the things common to all kinds of definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 % Define @defun.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808 % First, define the processing that is wanted for arguments of \defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809 % Use this to expand the args and terminate the paragraph they make up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 \def\defunargs #1{\functionparens \sl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812 % Expand, preventing hyphenation at `-' chars.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813 % Note that groups don't affect changes in \hyphenchar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814 \hyphenchar\tensl=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 #1%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 \hyphenchar\tensl=45
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
3817 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818 \interlinepenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819 \advance\rightskip by 0pt plus 1fil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823 \def\deftypefunargs #1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824 % Expand, preventing hyphenation at `-' chars.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 % Note that groups don't affect changes in \hyphenchar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827 \boldbraxnoamp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828 \tclose{#1}% avoid \code because of side effects on active chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829 \interlinepenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 \advance\rightskip by 0pt plus 1fil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834 % Do complete processing of one @defun or @defunx line already parsed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 % @deffn Command forward-char nchars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845 % @defun == @deffn Function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847 \def\defun{\defparsebody\Edefun\defunx\defunheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 \begingroup\defname {#1}{Function}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 \defunargs {#2}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3852 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3853 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3855 % @deftypefun int foobar (int @var{foo}, float @var{bar})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3857 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3859 % #1 is the data type. #2 is the name and args.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3860 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 % #1 is the data type, #2 the name, #3 the args.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862 \def\deftypefunheaderx #1#2 #3\relax{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863 \doind {fn}{\code{#2}}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 \deftypefunargs {#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3870
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873 % \defheaderxcond#1\relax$$$
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3874 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877 % #1 is the classification. #2 is the data type. #3 is the name and args.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3880 \def\deftypefnheaderx #1#2#3 #4\relax{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 \doind {fn}{\code{#3}}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882 \begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3883 \normalparens % notably, turn off `&' magic, which prevents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3884 % at least some C++ text from working
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3885 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 \deftypefunargs {#4}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3890 % @defmac == @deffn Macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3891
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3892 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3894 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3895 \begingroup\defname {#1}{Macro}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 \defunargs {#2}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3897 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3898 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3900 % @defspec == @deffn Special Form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3902 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3904 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3905 \begingroup\defname {#1}{Special Form}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 \defunargs {#2}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3907 \catcode 61=\other % Turn off change made in \defparsebody
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3908 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3910 % This definition is run if you use @defunx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 % anywhere other than immediately after a @defun or @defunx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3913 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3914 \def\defunx #1 {\errmessage{@defunx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3915 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3917 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3918 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920 % @defmethod, and so on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922 % @defop {Funny Method} foo-class frobnicate argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924 \def\defop #1 {\def\defoptype{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 \defopparsebody\Edefop\defopx\defopheader\defoptype}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3927 \def\defopheader #1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3928 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3929 \begingroup\defname {#2}{\defoptype{} on #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3930 \defunargs {#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3931 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3933 % @defmethod == @defop Method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3937 \def\defmethodheader #1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938 \dosubind {fn}{\code{#2}}{on #1}% entry in function index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939 \begingroup\defname {#2}{Method on #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3940 \defunargs {#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943 % @defcv {Class Option} foo-class foo-flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3945 \def\defcv #1 {\def\defcvtype{#1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3948 \def\defcvarheader #1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3949 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3950 \begingroup\defname {#2}{\defcvtype{} of #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3951 \defvarargs {#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3952 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954 % @defivar == @defcv {Instance Variable}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3958 \def\defivarheader #1#2#3{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3959 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3960 \begingroup\defname {#2}{Instance Variable of #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3961 \defvarargs {#3}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3962 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964 % These definitions are run if you use @defmethodx, etc.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965 % anywhere other than immediately after a @defmethod, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3966
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3967 \def\defopx #1 {\errmessage{@defopx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3968 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3969 \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3970 \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3971
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3972 % Now @defvar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3973
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3974 % First, define the processing that is wanted for arguments of @defvar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3975 % This is actually simple: just print them in roman.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3976 % This must expand the args and terminate the paragraph they make up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3977 \def\defvarargs #1{\normalparens #1%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3978 \interlinepenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3979 \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3981 % @defvr Counter foo-count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3983 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3984
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3985 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3986 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988 % @defvar == @defvr Variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3990 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993 \begingroup\defname {#1}{Variable}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3994 \defvarargs {#2}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3995 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3997 % @defopt == @defvr {User Option}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3999 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4001 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4002 \begingroup\defname {#1}{User Option}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4003 \defvarargs {#2}\endgroup %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4004 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4006 % @deftypevar int foobar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4008 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4009
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4010 % #1 is the data type. #2 is the name.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4011 \def\deftypevarheader #1#2{%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4012 \doind {vr}{\code{#2}}% Make entry in variables index
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4013 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4014 \interlinepenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4015 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4016 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4017
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4018 % @deftypevr {Global Flag} int enable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4020 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4021
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4022 \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4023 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4024 \interlinepenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4025 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4026 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4027
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4028 % This definition is run if you use @defvarx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4029 % anywhere other than immediately after a @defvar or @defvarx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4031 \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4032 \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4033 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4034 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4035 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4037 % Now define @deftp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4038 % Args are printed in bold, a slight difference from @defvar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4039
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4040 \def\deftpargs #1{\bf \defvarargs{#1}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4042 % @deftp Class window height width ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4044 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4045
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4046 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4047 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4049 % This definition is run if you use @deftpx, etc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4050 % anywhere other than immediately after a @deftp, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4052 \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4053
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4054
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4055 \message{cross reference,}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4056 % Define cross-reference macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4057 \newwrite \auxfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4059 \newif\ifhavexrefs % True if xref values are known.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4060 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4061
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4062 % @inforef is simple.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4063 \def\inforef #1{\inforefzzz #1,,,,**}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4064 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4065 node \samp{\ignorespaces#1{}}}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4066
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4067 % \setref{foo} defines a cross-reference point named foo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4069 \def\setref#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4070 \dosetq{#1-title}{Ytitle}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4071 \dosetq{#1-pg}{Ypagenumber}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4072 \dosetq{#1-snt}{Ysectionnumberandtype}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4074 \def\unnumbsetref#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4075 \dosetq{#1-title}{Ytitle}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4076 \dosetq{#1-pg}{Ypagenumber}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4077 \dosetq{#1-snt}{Ynothing}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4079 \def\appendixsetref#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4080 \dosetq{#1-title}{Ytitle}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4081 \dosetq{#1-pg}{Ypagenumber}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4082 \dosetq{#1-snt}{Yappendixletterandtype}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4084 % \xref, \pxref, and \ref generate cross-references to specified points.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4085 % For \xrefX, #1 is the node name, #2 the name of the Info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4086 % cross-reference, #3 the printed node name, #4 the name of the Info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4087 % file, #5 the name of the printed manual. All but the node name can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4088 % omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4089 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4090 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4091 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4092 \def\ref#1{\xrefX[#1,,,,,,,]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4093 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4094 \def\printedmanual{\ignorespaces #5}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4095 \def\printednodename{\ignorespaces #3}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4096 \setbox1=\hbox{\printedmanual}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4097 \setbox0=\hbox{\printednodename}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4098 \ifdim \wd0 = 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4099 % No printed node name was explicitly given.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4100 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4101 % Use the node name inside the square brackets.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4102 \def\printednodename{\ignorespaces #1}%
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4103 \else
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4104 % Use the actual chapter/section title appear inside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4105 % the square brackets. Use the real section title if we have it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4106 \ifdim \wd1>0pt%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4107 % It is in another manual, so we don't have it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4108 \def\printednodename{\ignorespaces #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4109 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4110 \ifhavexrefs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4111 % We know the real title if we have the xref values.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4112 \def\printednodename{\refx{#1-title}{}}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4113 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4114 % Otherwise just copy the Info node name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4115 \def\printednodename{\ignorespaces #1}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116 \fi%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4118 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4121 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122 % insert empty discretionaries after hyphens, which means that it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4123 % not find a line break at a hyphen in a node names. Since some manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4124 % are best written with fairly long node names, containing hyphens, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4125 % is a loss. Therefore, we give the text of the node name again, so it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126 % is as if TeX is seeing it for the first time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 \ifdim \wd1 > 0pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4128 \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4129 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4130 % _ (for example) has to be the character _ for the purposes of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131 % control sequence corresponding to the node, but it has to expand
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 % into the usual \leavevmode...\vrule stuff for purposes of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4133 % printing. So we \turnoffactive for the \refx-snt, back on for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4134 % printing, back off for the \refx-pg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4135 {\turnoffactive \refx{#1-snt}{}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4136 \space [\printednodename],\space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4137 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4138 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4141 % \dosetq is the interface for calls from other macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4143 % Use \turnoffactive so that punctuation chars such as underscore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4144 % work in node names.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4145 \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4147 \next}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4149 % \internalsetq {foo}{page} expands into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4150 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4151 % When the aux file is read, ' is the escape character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4153 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4155 % Things to be expanded by \internalsetq
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4157 \def\Ypagenumber{\folio}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4159 \def\Ytitle{\thissection}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4161 \def\Ynothing{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4163 \def\Ysectionnumberandtype{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4164 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4165 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4166 \else \ifnum \subsubsecno=0 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4167 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 \else %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 \fi \fi \fi }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 \def\Yappendixletterandtype{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4175 \else \ifnum \subsubsecno=0 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4176 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4177 \else %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4178 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 \fi \fi \fi }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181 \gdef\xreftie{'tie}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4183 % Use TeX 3.0's \inputlineno to get the line number, for better error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4184 % messages, but if we're using an old version of TeX, don't do anything.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4185 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4186 \ifx\inputlineno\thisisundefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4187 \let\linenumber = \empty % Non-3.0.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4188 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4189 \def\linenumber{\the\inputlineno:\space}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4190 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4192 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4193 % If its value is nonempty, SUFFIX is output afterward.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4195 \def\refx#1#2{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4196 \expandafter\ifx\csname X#1\endcsname\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4197 % If not defined, say something at least.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4198 $\langle$un\-de\-fined$\rangle$%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4199 \ifhavexrefs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4200 \message{\linenumber Undefined cross reference `#1'.}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4201 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4202 \ifwarnedxrefs\else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4203 \global\warnedxrefstrue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4204 \message{Cross reference values unknown; you must run TeX again.}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4205 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4206 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4207 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4208 % It's defined, so just use it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4209 \csname X#1\endcsname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4210 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4211 #2% Output the suffix in any case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4212 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4213
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4214 % Read the last existing aux file, if any. No error if none exists.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4215
50
ee648375d8d6 Import from CVS: tag r19-16b91
cvs
parents: 30
diff changeset
4216 % This is the macro invoked by entries in the aux file.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4217 \def\xrdef #1#2{
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4218 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4219
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4220 \def\readauxfile{%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4221 \begingroup
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4222 \catcode `\^^@=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4223 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4224 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4225 \catcode `\^^C=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4226 \catcode `\^^D=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4227 \catcode `\^^E=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4228 \catcode `\^^F=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4229 \catcode `\^^G=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4230 \catcode `\^^H=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4231 \catcode `\ =\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4232 \catcode `\^^L=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4233 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4234 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4235 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4236 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4237 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4238 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4239 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4240 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4241 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4242 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4243 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4244 \catcode `\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4245 \catcode 26=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4246 \catcode `\^^[=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4247 \catcode `\^^\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4248 \catcode `\^^]=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4249 \catcode `\^^^=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4250 \catcode `\^^_=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4251 \catcode `\@=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4252 \catcode `\^=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4253 \catcode `\~=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4254 \catcode `\[=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4255 \catcode `\]=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4256 \catcode`\"=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4257 \catcode`\_=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4258 \catcode`\|=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4259 \catcode`\<=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4260 \catcode`\>=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4261 \catcode `\$=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4262 \catcode `\#=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4263 \catcode `\&=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4264 % `\+ does not work, so use 43.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4265 \catcode 43=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4266 % Make the characters 128-255 be printing characters
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4267 {%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4268 \count 1=128
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4269 \def\loop{%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4270 \catcode\count 1=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4271 \advance\count 1 by 1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4272 \ifnum \count 1<256 \loop \fi
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4273 }%
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4274 }%
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4275 % the aux file uses ' as the escape.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4276 % Turn off \ as an escape so we do not lose on
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4277 % entries which were dumped with control sequences in their names.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4278 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4279 % Reference to such entries still does not work the way one would wish,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4280 % but at least they do not bomb out when the aux file is read in.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4281 \catcode `\{=1 \catcode `\}=2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4282 \catcode `\%=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4283 \catcode `\'=0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4284 \catcode`\^=7 % to make ^^e4 etc usable in xref tags
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4285 \catcode `\\=\other
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4286 \openin 1 \jobname.aux
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4287 \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4288 \global\warnedobstrue
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4289 \fi
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4290 % Open the new aux file. Tex will close it automatically at exit.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4291 \openout \auxfile=\jobname.aux
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4292 \endgroup}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4295 % Footnotes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4297 \newcount \footnoteno
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4299 % The trailing space in the following definition for supereject is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4300 % vital for proper filling; pages come out unaligned when you do a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4301 % pagealignmacro call if that space before the closing brace is
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4302 % removed. (Generally, numeric constants should always be followed by a
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4303 % space to prevent strange expansion errors.)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4304 \def\supereject{\par\penalty -20000\footnoteno =0 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4305
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4306 % @footnotestyle is meaningful for info output only..
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4307 \let\footnotestyle=\comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4309 \let\ptexfootnote=\footnote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4311 {\catcode `\@=11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4312 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4313 % Auto-number footnotes. Otherwise like plain.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4314 \gdef\footnote{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4315 \global\advance\footnoteno by \@ne
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4316 \edef\thisfootno{$^{\the\footnoteno}$}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4317 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4318 % In case the footnote comes at the end of a sentence, preserve the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4319 % extra spacing after we do the footnote number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4320 \let\@sf\empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4321 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4322 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4323 % Remove inadvertent blank space before typesetting the footnote number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4324 \unskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4325 \thisfootno\@sf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4326 \footnotezzz
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4327 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4329 % Don't bother with the trickery in plain.tex to not require the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4330 % footnote text as a parameter. Our footnotes don't need to be so general.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4331 %
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4332 \long\gdef\footnotezzz#1{\insert\footins{%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4333 % We want to typeset this text as a normal paragraph, even if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4334 % footnote reference occurs in (for example) a display environment.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4335 % So reset some parameters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4336 \interlinepenalty\interfootnotelinepenalty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4337 \splittopskip\ht\strutbox % top baseline for broken footnotes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4338 \splitmaxdepth\dp\strutbox
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4339 \floatingpenalty\@MM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4340 \leftskip\z@skip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4341 \rightskip\z@skip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4342 \spaceskip\z@skip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4343 \xspaceskip\z@skip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4344 \parindent\defaultparindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4345 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4346 % Hang the footnote text off the number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4347 \hang
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4348 \textindent{\thisfootno}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4349 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4350 % Don't crash into the line above the footnote text. Since this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4351 % expands into a box, it must come within the paragraph, lest it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4352 % provide a place where TeX can split the footnote.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4353 \footstrut
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4354 #1\strut}%
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4355 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4357 }%end \catcode `\@=11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4359 % Set the baselineskip to #1, and the lineskip and strut size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4360 % correspondingly. There is no deep meaning behind these magic numbers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4361 % used as factors; they just match (closely enough) what Knuth defined.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4362 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4363 \def\lineskipfactor{.08333}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4364 \def\strutheightpercent{.70833}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4365 \def\strutdepthpercent {.29167}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4366 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4367 \def\setleading#1{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4368 \normalbaselineskip = #1\relax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4369 \normallineskip = \lineskipfactor\normalbaselineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4370 \normalbaselines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4371 \setbox\strutbox =\hbox{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4372 \vrule width0pt height\strutheightpercent\baselineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4373 depth \strutdepthpercent \baselineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4374 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4375 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4377 % @| inserts a changebar to the left of the current line. It should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4378 % surround any changed text. This approach does *not* work if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4379 % change spans more than two lines of output. To handle that, we would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4380 % have adopt a much more difficult approach (putting marks into the main
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4381 % vertical list for the beginning and end of each change).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4382 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4383 \def\|{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4384 % \vadjust can only be used in horizontal mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4385 \leavevmode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4386 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4387 % Append this vertical mode material after the current line in the output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4388 \vadjust{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4389 % We want to insert a rule with the height and depth of the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4390 % leading; that is exactly what \strutbox is supposed to record.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4391 \vskip-\baselineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4392 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4393 % \vadjust-items are inserted at the left edge of the type. So
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4394 % the \llap here moves out into the left-hand margin.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4395 \llap{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4396 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4397 % For a thicker or thinner bar, change the `1pt'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4398 \vrule height\baselineskip width1pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4399 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4400 % This is the space between the bar and the text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4401 \hskip 12pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4402 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4403 }%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4404 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4406 % For a final copy, take out the rectangles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4407 % that mark overfull boxes (in case you have decided
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4408 % that the text looks ok even though it passes the margin).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4409 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4410 \def\finalout{\overfullrule=0pt}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4413 % End of control word definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4415 \message{and turning on texinfo input format.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4417 \def\openindices{%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4418 \newindex{cp}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4419 \newcodeindex{fn}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4420 \newcodeindex{vr}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4421 \newcodeindex{tp}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4422 \newcodeindex{ky}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4423 \newcodeindex{pg}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4424 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4426 % Set some numeric style parameters, for 8.5 x 11 format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4427
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4428 \hsize = 6in
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4429 \hoffset = .25in
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4430 \newdimen\defaultparindent \defaultparindent = 15pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4431 \parindent = \defaultparindent
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4432 \parskip 3pt plus 2pt minus 1pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4433 \setleading{13.2pt}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4434 \advance\topskip by 1.2cm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4435
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4436 \chapheadingskip = 15pt plus 4pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4437 \secheadingskip = 12pt plus 3pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4438 \subsecheadingskip = 9pt plus 2pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4439
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4440 % Prevent underfull vbox error messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4441 \vbadness=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4443 % Following George Bush, just get rid of widows and orphans.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4444 \widowpenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4445 \clubpenalty=10000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4447 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4448 % using an old version of TeX, don't do anything. We want the amount of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4449 % stretch added to depend on the line length, hence the dependence on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4450 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4451 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4452 \ifx\emergencystretch\thisisundefined
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4453 % Allow us to assign to \emergencystretch anyway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4454 \def\emergencystretch{\dimen0}%
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4455 \else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4456 \emergencystretch = \hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4457 \divide\emergencystretch by 45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4458 \fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4460 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4461 \def\smallbook{
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4462 \global\chapheadingskip = 15pt plus 4pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4463 \global\secheadingskip = 12pt plus 3pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4464 \global\subsecheadingskip = 9pt plus 2pt minus 2pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4465 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4466 \global\lispnarrowing = 0.3in
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4467 \setleading{12pt}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4468 \advance\topskip by -1cm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4469 \global\parskip 2pt plus 1pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4470 \global\hsize = 5in
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4471 \global\vsize=7.5in
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4472 \global\tolerance=700
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4473 \global\hfuzz=1pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4474 \global\contentsrightmargin=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4475 \global\deftypemargin=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4476 \global\defbodyindent=.5cm
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4477 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4478 \global\pagewidth=\hsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4479 \global\pageheight=\vsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4480 %
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4481 \global\let\smalllisp=\smalllispx
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4482 \global\let\smallexample=\smalllispx
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4483 \global\def\Esmallexample{\Esmalllisp}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4484 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4486 % Use @afourpaper to print on European A4 paper.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4487 \def\afourpaper{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4488 \global\tolerance=700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4489 \global\hfuzz=1pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4490 \setleading{12pt}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4491 \global\parskip 15pt plus 1pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4493 \global\vsize= 53\baselineskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4494 \advance\vsize by \topskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4495 %\global\hsize= 5.85in % A4 wide 10pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4496 \global\hsize= 6.5in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4497 \global\outerhsize=\hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4498 \global\advance\outerhsize by 0.5in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4499 \global\outervsize=\vsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4500 \global\advance\outervsize by 0.6in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4502 \global\pagewidth=\hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4503 \global\pageheight=\vsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4504 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4505
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4506 \bindingoffset=0pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4507 \normaloffset=\hoffset
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4508 \pagewidth=\hsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4509 \pageheight=\vsize
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4510
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4511 % Allow control of the text dimensions. Parameters in order: textheight;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4512 % textwidth; voffset; hoffset; binding offset; topskip.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4513 % All require a dimension;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4514 % header is additional; added length extends the bottom of the page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4515
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4516 \def\changepagesizes#1#2#3#4#5#6{
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4517 \global\vsize= #1
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4518 \global\topskip= #6
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4519 \advance\vsize by \topskip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4520 \global\voffset= #3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4521 \global\hsize= #2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4522 \global\outerhsize=\hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4523 \global\advance\outerhsize by 0.5in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4524 \global\outervsize=\vsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4525 \global\advance\outervsize by 0.6in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4526 \global\pagewidth=\hsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4527 \global\pageheight=\vsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4528 \global\normaloffset= #4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4529 \global\bindingoffset= #5}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4530
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4531 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4532 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4533 \def\afourlatex
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4534 {\global\tolerance=700
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4535 \global\hfuzz=1pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4536 \setleading{12pt}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4537 \global\parskip 15pt plus 1pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4538 \advance\baselineskip by 1.6pt
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4539 \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4540 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4542 % Use @afourwide to print on European A4 paper in wide format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4543 \def\afourwide{\afourpaper
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4544 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4546 % Define macros to output various characters with catcode for normal text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4547 \catcode`\"=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4548 \catcode`\~=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4549 \catcode`\^=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4550 \catcode`\_=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4551 \catcode`\|=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4552 \catcode`\<=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4553 \catcode`\>=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4554 \catcode`\+=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4555 \def\normaldoublequote{"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4556 \def\normaltilde{~}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4557 \def\normalcaret{^}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4558 \def\normalunderscore{_}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4559 \def\normalverticalbar{|}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4560 \def\normalless{<}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4561 \def\normalgreater{>}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4562 \def\normalplus{+}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4564 % This macro is used to make a character print one way in ttfont
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4565 % where it can probably just be output, and another way in other fonts,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4566 % where something hairier probably needs to be done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4567 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4568 % #1 is what to print if we are indeed using \tt; #2 is what to print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4569 % otherwise. Since all the Computer Modern typewriter fonts have zero
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4570 % interword stretch (and shrink), and it is reasonable to expect all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4571 % typewriter fonts to have this, we can check that font parameter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4572 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4573 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4575 % Turn off all special characters except @
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4576 % (and those which the user can use as if they were ordinary).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4577 % Most of these we simply print from the \tt font, but for some, we can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4578 % use math or other variants that look better in normal text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4580 \catcode`\"=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4581 \def\activedoublequote{{\tt \char '042}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4582 \let"=\activedoublequote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4583 \catcode`\~=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4584 \def~{{\tt \char '176}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4585 \chardef\hat=`\^
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4586 \catcode`\^=\active
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 50
diff changeset
4587 \def\auxhat{\def^{'hat}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4588 \def^{{\tt \hat}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4590 \catcode`\_=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4591 \def_{\ifusingtt\normalunderscore\_}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4592 % Subroutine for the previous macro.
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
4593 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4595 \catcode`\|=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4596 \def|{{\tt \char '174}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4597 \chardef \less=`\<
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4598 \catcode`\<=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4599 \def<{{\tt \less}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4600 \chardef \gtr=`\>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4601 \catcode`\>=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4602 \def>{{\tt \gtr}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4603 \catcode`\+=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4604 \def+{{\tt \char 43}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4605 %\catcode 27=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4606 %\def^^[{$\diamondsuit$}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4608 % Set up an active definition for =, but don't enable it most of the time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4609 {\catcode`\==\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4610 \global\def={{\tt \char 61}}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4612 \catcode`+=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4613 \catcode`\_=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4615 % If a .fmt file is being used, characters that might appear in a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4616 % name cannot be active until we have parsed the command line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4617 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4618 % \otherifyactive is called near the end of this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4619 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4621 \catcode`\@=0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4623 % \rawbackslashxx output one backslash character in current font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4624 \global\chardef\rawbackslashxx=`\\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4625 %{\catcode`\\=\other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4626 %@gdef@rawbackslashxx{\}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4627
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4628 % \rawbackslash redefines \ as input to do \rawbackslashxx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4629 {\catcode`\\=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4630 @gdef@rawbackslash{@let\=@rawbackslashxx }}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4632 % \normalbackslash outputs one backslash in fixed width font.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4633 \def\normalbackslash{{\tt\rawbackslashxx}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4635 % Say @foo, not \foo, in error messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4636 \escapechar=`\@
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4638 % \catcode 17=0 % Define control-q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4639 \catcode`\\=\active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4641 % Used sometimes to turn off (effectively) the active characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4642 % even after parsing them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4643 @def@turnoffactive{@let"=@normaldoublequote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4644 @let\=@realbackslash
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4645 @let~=@normaltilde
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4646 @let^=@normalcaret
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4647 @let_=@normalunderscore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4648 @let|=@normalverticalbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4649 @let<=@normalless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4650 @let>=@normalgreater
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4651 @let+=@normalplus}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4653 @def@normalturnoffactive{@let"=@normaldoublequote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4654 @let\=@normalbackslash
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4655 @let~=@normaltilde
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4656 @let^=@normalcaret
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4657 @let_=@normalunderscore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4658 @let|=@normalverticalbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4659 @let<=@normalless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4660 @let>=@normalgreater
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4661 @let+=@normalplus}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4663 % Make _ and + \other characters, temporarily.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4664 % This is canceled by @fixbackslash.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4665 @otherifyactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4667 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4668 % That is what \eatinput is for; after that, the `\' should revert to printing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4669 % a backslash.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4670 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4671 @gdef@eatinput input texinfo{@fixbackslash}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4672 @global@let\ = @eatinput
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4674 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4675 % the first `\{ in the file would cause an error. This macro tries to fix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4676 % that, assuming it is called before the first `\' could plausibly occur.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4677 % Also back turn on active characters that might appear in the input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4678 % file name, in case not using a pre-dumped format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4679 %
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4680 @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4681 @catcode`+=@active @catcode`@_=@active}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4683 %% These look ok in all fonts, so just make them not special. The @rm below
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4684 %% makes sure that the current font starts out as the newly loaded cmr10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4685 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4687 @textfonts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4688 @rm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4690 @c Local variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4691 @c page-delimiter: "^\\\\message"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4692 @c End: