Mercurial > hg > xemacs-beta
comparison man/texinfo.tex @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | ee648375d8d6 |
children | 360340f9fd5f |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
1 %% TeX macros to handle Texinfo files. | 1 %% TeX macros to handle texinfo files |
2 %% $Id: texinfo.tex,v 1.3 1997/08/30 03:56:39 steve Exp $ | 2 |
3 | 3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. |
4 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, | |
5 % 94, 95, 96, 97 Free Software Foundation, Inc. | |
6 | 4 |
7 %This texinfo.tex file is free software; you can redistribute it and/or | 5 %This texinfo.tex file is free software; you can redistribute it and/or |
8 %modify it under the terms of the GNU General Public License as | 6 %modify it under the terms of the GNU General Public License as |
9 %published by the Free Software Foundation; either version 2, or (at | 7 %published by the Free Software Foundation; either version 2, or (at |
10 %your option) any later version. | 8 %your option) any later version. |
14 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 %General Public License for more details. | 13 %General Public License for more details. |
16 | 14 |
17 %You should have received a copy of the GNU General Public License | 15 %You should have received a copy of the GNU General Public License |
18 %along with this texinfo.tex file; see the file COPYING. If not, write | 16 %along with this texinfo.tex file; see the file COPYING. If not, write |
19 %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, |
20 %Boston, MA 02111-1307, USA. | 18 %USA. |
21 | 19 |
22 | 20 |
23 %In other words, you are welcome to use, share and improve this program. | 21 %In other words, you are welcome to use, share and improve this program. |
24 %You are forbidden to forbid anyone else to use, share and improve | 22 %You are forbidden to forbid anyone else to use, share and improve |
25 %what you give them. Help stamp out software-hoarding! | 23 %what you give them. Help stamp out software-hoarding! |
34 % Added by gildea November 1993. | 32 % Added by gildea November 1993. |
35 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 33 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
36 | 34 |
37 % This automatically updates the version number based on RCS. | 35 % This automatically updates the version number based on RCS. |
38 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} | 36 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} |
39 \deftexinfoversion$Revision: 1.3 $ | 37 \deftexinfoversion$Revision: 1.1.1.1 $ |
40 \message{Loading texinfo package [Version \texinfoversion]:} | 38 \message{Loading texinfo package [Version \texinfoversion]:} |
41 | 39 |
42 % If in a .fmt file, print the version number | 40 % If in a .fmt file, print the version number |
43 % and turn on active characters that we couldn't do earlier because | 41 % and turn on active characters that we couldn't do earlier because |
44 % they might have appeared in the input file name. | 42 % they might have appeared in the input file name. |
45 \everyjob{\message{[Texinfo version \texinfoversion]}\message{} | 43 \everyjob{\message{[Texinfo version \texinfoversion]}\message{} |
46 \catcode`+=\active \catcode`\_=\active} | 44 \catcode`+=\active \catcode`\_=\active} |
47 | 45 |
48 % Save some parts of plain tex whose names we will redefine. | 46 % Save some parts of plain tex whose names we will redefine. |
49 | 47 |
50 \let\ptexb=\b | 48 \let\ptextilde=\~ |
51 \let\ptexbullet=\bullet | |
52 \let\ptexc=\c | |
53 \let\ptexcomma=\, | |
54 \let\ptexdot=\. | |
55 \let\ptexdots=\dots | |
56 \let\ptexend=\end | |
57 \let\ptexequiv = \equiv | |
58 \let\ptexi=\i | |
59 \let\ptexlbrace=\{ | 49 \let\ptexlbrace=\{ |
60 \let\ptexrbrace=\} | 50 \let\ptexrbrace=\} |
51 \let\ptexdots=\dots | |
52 \let\ptexdot=\. | |
61 \let\ptexstar=\* | 53 \let\ptexstar=\* |
54 \let\ptexend=\end | |
55 \let\ptexbullet=\bullet | |
56 \let\ptexb=\b | |
57 \let\ptexc=\c | |
58 \let\ptexi=\i | |
62 \let\ptext=\t | 59 \let\ptext=\t |
60 \let\ptexl=\l | |
61 \let\ptexL=\L | |
63 | 62 |
64 % Be sure we're in horizontal mode when doing a tie, since we make space | 63 % Be sure we're in horizontal mode when doing a tie, since we make space |
65 % equivalent to this in @example-like environments. Otherwise, a space | 64 % equivalent to this in @example-like environments. Otherwise, a space |
66 % at the beginning of a line will start with \penalty -- and | 65 % at the beginning of a line will start with \penalty -- and |
67 % since \penalty is valid in vertical mode, we'd end up putting the | 66 % since \penalty is valid in vertical mode, we'd end up putting the |
68 % penalty on the vertical list instead of in the new paragraph. | 67 % penalty on the vertical list instead of in the new paragraph. |
69 {\catcode`@ = 11 | 68 {\catcode`@ = 11 |
70 % Avoid using \@M directly, because that causes trouble | 69 \gdef\tie{\leavevmode\penalty\@M\ } |
71 % if the definition is written into an index file. | 70 } |
72 \global\let\tiepenalty = \@M | 71 \let\~ = \tie % And make it available as @~. |
73 \gdef\tie{\leavevmode\penalty\tiepenalty\ } | |
74 } | |
75 | |
76 | 72 |
77 \message{Basics,} | 73 \message{Basics,} |
78 \chardef\other=12 | 74 \chardef\other=12 |
79 | 75 |
80 % If this character appears in an error message or help string, it | 76 % If this character appears in an error message or help string, it |
99 \def\gobble#1{} | 95 \def\gobble#1{} |
100 | 96 |
101 \hyphenation{ap-pen-dix} | 97 \hyphenation{ap-pen-dix} |
102 \hyphenation{mini-buf-fer mini-buf-fers} | 98 \hyphenation{mini-buf-fer mini-buf-fers} |
103 \hyphenation{eshell} | 99 \hyphenation{eshell} |
104 \hyphenation{white-space} | |
105 | 100 |
106 % Margin to add to right of even pages, to left of odd pages. | 101 % Margin to add to right of even pages, to left of odd pages. |
107 \newdimen \bindingoffset | 102 \newdimen \bindingoffset \bindingoffset=0pt |
108 \newdimen \normaloffset | 103 \newdimen \normaloffset \normaloffset=\hoffset |
109 \newdimen\pagewidth \newdimen\pageheight | 104 \newdimen\pagewidth \newdimen\pageheight |
105 \pagewidth=\hsize \pageheight=\vsize | |
110 | 106 |
111 % Sometimes it is convenient to have everything in the transcript file | 107 % Sometimes it is convenient to have everything in the transcript file |
112 % and nothing on the terminal. We don't just call \tracingall here, | 108 % and nothing on the terminal. We don't just call \tracingall here, |
113 % since that produces some useless output on the terminal. | 109 % since that produces some useless output on the terminal. |
114 % | 110 % |
117 \tracingpages1 \tracingoutput1 \tracinglostchars1 | 113 \tracingpages1 \tracingoutput1 \tracinglostchars1 |
118 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 | 114 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 |
119 \showboxbreadth\maxdimen\showboxdepth\maxdimen | 115 \showboxbreadth\maxdimen\showboxdepth\maxdimen |
120 }% | 116 }% |
121 | 117 |
122 % For @cropmarks command. | 118 %---------------------Begin change----------------------- |
123 % Do @cropmarks to get crop marks. | 119 % |
124 % | 120 %%%% For @cropmarks command. |
125 \newif\ifcropmarks | 121 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 |
126 \let\cropmarks = \cropmarkstrue | |
127 % | |
128 % Dimensions to add cropmarks at corners. | |
129 % Added by P. A. MacKay, 12 Nov. 1986 | |
130 % | 122 % |
131 \newdimen\cornerlong \newdimen\cornerthick | 123 \newdimen\cornerlong \newdimen\cornerthick |
132 \newdimen\topandbottommargin | 124 \newdimen \topandbottommargin |
133 \newdimen\outerhsize \newdimen\outervsize | 125 \newdimen \outerhsize \newdimen \outervsize |
134 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks | 126 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks |
135 \outerhsize=7in | 127 \outerhsize=7in |
136 %\outervsize=9.5in | 128 %\outervsize=9.5in |
137 % Alternative @smallbook page size is 9.25in | 129 % Alternative @smallbook page size is 9.25in |
138 \outervsize=9.25in | 130 \outervsize=9.25in |
139 \topandbottommargin=.75in | 131 \topandbottommargin=.75in |
140 | 132 % |
141 % Main output routine. | 133 %---------------------End change----------------------- |
142 \chardef\PAGE = 255 | |
143 \output = {\onepageout{\pagecontents\PAGE}} | |
144 | |
145 \newbox\headlinebox | |
146 \newbox\footlinebox | |
147 | 134 |
148 % \onepageout takes a vbox as an argument. Note that \pagecontents | 135 % \onepageout takes a vbox as an argument. Note that \pagecontents |
149 % does insertions, but you have to call it yourself. | 136 % does insertions itself, but you have to call it yourself. |
150 \def\onepageout#1{% | 137 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} |
151 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi | 138 \def\onepageout#1{\hoffset=\normaloffset |
152 % | 139 \ifodd\pageno \advance\hoffset by \bindingoffset |
153 \ifodd\pageno \advance\hoffset by \bindingoffset | 140 \else \advance\hoffset by -\bindingoffset\fi |
154 \else \advance\hoffset by -\bindingoffset\fi | 141 {\escapechar=`\\\relax % makes sure backslash is used in output files. |
155 % | 142 \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% |
156 % Do this outside of the \shipout so @code etc. will be expanded in | 143 {\let\hsize=\pagewidth \makefootline}}}% |
157 % the headline as they should be, not taken literally (outputting ''code). | 144 \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} |
158 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% | 145 |
159 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% | 146 %%%% For @cropmarks command %%%% |
160 % | 147 |
161 {% | 148 % Here is a modification of the main output routine for Near East Publications |
162 % Have to do this stuff outside the \shipout because we want it to | 149 % This provides right-angle cropmarks at all four corners. |
163 % take effect in \write's, yet the group defined by the \vbox ends | 150 % The contents of the page are centerlined into the cropmarks, |
164 % before the \shipout runs. | 151 % and any desired binding offset is added as an \hskip on either |
165 % | 152 % site of the centerlined box. (P. A. MacKay, 12 November, 1986) |
166 \escapechar = `\\ % use backslash in output files. | 153 % |
167 \indexdummies % don't expand commands in the output. | 154 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up |
168 \normalturnoffactive % \ in index entries must not stay \, e.g., if | 155 {\escapechar=`\\\relax % makes sure backslash is used in output files. |
169 % the page break happens to be in the middle of an example. | 156 \shipout |
170 \shipout\vbox{% | 157 \vbox to \outervsize{\hsize=\outerhsize |
171 \ifcropmarks \vbox to \outervsize\bgroup | 158 \vbox{\line{\ewtop\hfill\ewtop}} |
172 \hsize = \outerhsize | 159 \nointerlineskip |
173 \line{\ewtop\hfil\ewtop}% | 160 \line{\vbox{\moveleft\cornerthick\nstop} |
174 \nointerlineskip | 161 \hfill |
175 \line{% | 162 \vbox{\moveright\cornerthick\nstop}} |
176 \vbox{\moveleft\cornerthick\nstop}% | 163 \vskip \topandbottommargin |
177 \hfill | 164 \centerline{\ifodd\pageno\hskip\bindingoffset\fi |
178 \vbox{\moveright\cornerthick\nstop}% | 165 \vbox{ |
179 }% | 166 {\let\hsize=\pagewidth \makeheadline} |
180 \vskip\topandbottommargin | 167 \pagebody{#1} |
181 \line\bgroup | 168 {\let\hsize=\pagewidth \makefootline}} |
182 \hfil % center the page within the outer (page) hsize. | 169 \ifodd\pageno\else\hskip\bindingoffset\fi} |
183 \ifodd\pageno\hskip\bindingoffset\fi | 170 \vskip \topandbottommargin plus1fill minus1fill |
184 \vbox\bgroup | 171 \boxmaxdepth\cornerthick |
185 \fi | 172 \line{\vbox{\moveleft\cornerthick\nsbot} |
186 % | 173 \hfill |
187 \unvbox\headlinebox | 174 \vbox{\moveright\cornerthick\nsbot}} |
188 \pagebody{#1}% | 175 \nointerlineskip |
189 \ifdim\ht\footlinebox > 0pt | 176 \vbox{\line{\ewbot\hfill\ewbot}} |
190 % Only leave this space if the footline is nonempty. | 177 }} |
191 % (We lessened \vsize for it in \oddfootingxxx.) | |
192 % The \baselineskip=24pt in plain's \makefootline has no effect. | |
193 \vskip 2\baselineskip | |
194 \unvbox\footlinebox | |
195 \fi | |
196 % | |
197 \ifcropmarks | |
198 \egroup % end of \vbox\bgroup | |
199 \hfil\egroup % end of (centering) \line\bgroup | |
200 \vskip\topandbottommargin plus1fill minus1fill | |
201 \boxmaxdepth = \cornerthick | |
202 \line{% | |
203 \vbox{\moveleft\cornerthick\nsbot}% | |
204 \hfill | |
205 \vbox{\moveright\cornerthick\nsbot}% | |
206 }% | |
207 \nointerlineskip | |
208 \line{\ewbot\hfil\ewbot}% | |
209 \egroup % \vbox from first cropmarks clause | |
210 \fi | |
211 }% end of \shipout\vbox | |
212 }% end of group with \turnoffactive | |
213 \advancepageno | 178 \advancepageno |
214 \ifnum\outputpenalty>-20000 \else\dosupereject\fi | 179 \ifnum\outputpenalty>-20000 \else\dosupereject\fi} |
215 } | 180 % |
181 % Do @cropmarks to get crop marks | |
182 \def\cropmarks{\let\onepageout=\croppageout } | |
216 | 183 |
217 \newinsert\margin \dimen\margin=\maxdimen | 184 \newinsert\margin \dimen\margin=\maxdimen |
218 | 185 |
219 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} | 186 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} |
220 {\catcode`\@ =11 | 187 {\catcode`\@ =11 |
225 \dimen@=\dp#1 \unvbox#1 | 192 \dimen@=\dp#1 \unvbox#1 |
226 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi | 193 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi |
227 \ifr@ggedbottom \kern-\dimen@ \vfil \fi} | 194 \ifr@ggedbottom \kern-\dimen@ \vfil \fi} |
228 } | 195 } |
229 | 196 |
197 % | |
230 % Here are the rules for the cropmarks. Note that they are | 198 % Here are the rules for the cropmarks. Note that they are |
231 % offset so that the space between them is truly \outerhsize or \outervsize | 199 % offset so that the space between them is truly \outerhsize or \outervsize |
232 % (P. A. MacKay, 12 November, 1986) | 200 % (P. A. MacKay, 12 November, 1986) |
233 % | 201 % |
234 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} | 202 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} |
392 %% but suppressing ligatures. | 360 %% but suppressing ligatures. |
393 %\def\`{{`}} | 361 %\def\`{{`}} |
394 %\def\'{{'}} | 362 %\def\'{{'}} |
395 | 363 |
396 % Used to generate quoted braces. | 364 % Used to generate quoted braces. |
365 | |
397 \def\mylbrace {{\tt \char '173}} | 366 \def\mylbrace {{\tt \char '173}} |
398 \def\myrbrace {{\tt \char '175}} | 367 \def\myrbrace {{\tt \char '175}} |
399 \let\{=\mylbrace | 368 \let\{=\mylbrace |
400 \let\}=\myrbrace | 369 \let\}=\myrbrace |
401 \begingroup | |
402 % Definitions to produce actual \{ & \} command in an index. | |
403 \catcode`\{ = 12 \catcode`\} = 12 | |
404 \catcode`\[ = 1 \catcode`\] = 2 | |
405 \catcode`\@ = 0 \catcode`\\ = 12 | |
406 @gdef@lbracecmd[\{]% | |
407 @gdef@rbracecmd[\}]% | |
408 @endgroup | |
409 | |
410 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | |
411 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. | |
412 \let\, = \c | |
413 \let\dotaccent = \. | |
414 \def\ringaccent#1{{\accent23 #1}} | |
415 \let\tieaccent = \t | |
416 \let\ubaraccent = \b | |
417 \let\udotaccent = \d | |
418 | |
419 % Other special characters: @questiondown @exclamdown | |
420 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. | |
421 \def\questiondown{?`} | |
422 \def\exclamdown{!`} | |
423 | |
424 % Dotless i and dotless j, used for accents. | |
425 \def\imacro{i} | |
426 \def\jmacro{j} | |
427 \def\dotless#1{% | |
428 \def\temp{#1}% | |
429 \ifx\temp\imacro \ptexi | |
430 \else\ifx\temp\jmacro \j | |
431 \else \errmessage{@dotless can be used only with i or j}% | |
432 \fi\fi | |
433 } | |
434 | 370 |
435 % @: forces normal size whitespace following. | 371 % @: forces normal size whitespace following. |
436 \def\:{\spacefactor=1000 } | 372 \def\:{\spacefactor=1000 } |
437 | 373 |
438 % @* forces a line break. | 374 % @* forces a line break. |
595 % This defn is used inside nofill environments such as @example. | 531 % This defn is used inside nofill environments such as @example. |
596 \def\nofillexdent{\parsearg\nofillexdentyyy} | 532 \def\nofillexdent{\parsearg\nofillexdentyyy} |
597 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount | 533 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount |
598 \leftline{\hskip\leftskip{\rm#1}}}} | 534 \leftline{\hskip\leftskip{\rm#1}}}} |
599 | 535 |
600 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. | |
601 | |
602 \def\inmargin#1{% | |
603 \strut\vadjust{\nobreak\kern-\strutdepth | |
604 \vtop to \strutdepth{\baselineskip\strutdepth\vss | |
605 \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} | |
606 \newskip\inmarginspacing \inmarginspacing=1cm | |
607 \def\strutdepth{\dp\strutbox} | |
608 | |
609 %\hbox{{\rm#1}}\hfil\break}} | 536 %\hbox{{\rm#1}}\hfil\break}} |
610 | 537 |
611 % @include file insert text of that file as input. | 538 % @include file insert text of that file as input. |
612 % Allow normal characters that we make active in the argument (a file name). | 539 |
613 \def\include{\begingroup | 540 \def\include{\parsearg\includezzz} |
614 \catcode`\\=12 | 541 %Use \input\thisfile to avoid blank after \input, which may be an active |
615 \catcode`~=12 | 542 %char (in which case the blank would become the \input argument). |
616 \catcode`^=12 | 543 %The grouping keeps the value of \thisfile correct even when @include |
617 \catcode`_=12 | 544 %is nested. |
618 \catcode`|=12 | 545 \def\includezzz #1{\begingroup |
619 \catcode`<=12 | 546 \def\thisfile{#1}\input\thisfile |
620 \catcode`>=12 | |
621 \catcode`+=12 | |
622 \parsearg\includezzz} | |
623 % Restore active chars for included file. | |
624 \def\includezzz#1{\endgroup\begingroup | |
625 % Read the included file in a group so nested @include's work. | |
626 \def\thisfile{#1}% | |
627 \input\thisfile | |
628 \endgroup} | 547 \endgroup} |
629 | 548 |
630 \def\thisfile{} | 549 \def\thisfile{} |
631 | 550 |
632 % @center line outputs that line, centered | 551 % @center line outputs that line, centered |
637 \centerline{#1}}} | 556 \centerline{#1}}} |
638 | 557 |
639 % @sp n outputs n lines of vertical space | 558 % @sp n outputs n lines of vertical space |
640 | 559 |
641 \def\sp{\parsearg\spxxx} | 560 \def\sp{\parsearg\spxxx} |
642 \def\spxxx #1{\vskip #1\baselineskip} | 561 \def\spxxx #1{\par \vskip #1\baselineskip} |
643 | 562 |
644 % @comment ...line which is ignored... | 563 % @comment ...line which is ignored... |
645 % @c is the same as @comment | 564 % @c is the same as @comment |
646 % @ignore ... @end ignore is another way to write a comment | 565 % @ignore ... @end ignore is another way to write a comment |
647 | 566 |
649 \parsearg \commentxxx} | 568 \parsearg \commentxxx} |
650 | 569 |
651 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } | 570 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } |
652 | 571 |
653 \let\c=\comment | 572 \let\c=\comment |
654 | |
655 % @paragraphindent is defined for the Info formatting commands only. | |
656 \let\paragraphindent=\comment | |
657 | 573 |
658 % Prevent errors for section commands. | 574 % Prevent errors for section commands. |
659 % Used in @ignore and in failing conditionals. | 575 % Used in @ignore and in failing conditionals. |
660 \def\ignoresections{% | 576 \def\ignoresections{% |
661 \let\chapter=\relax | 577 \let\chapter=\relax |
687 % Used in nested conditionals, where we have to parse the Texinfo source | 603 % Used in nested conditionals, where we have to parse the Texinfo source |
688 % and so want to turn off most commands, in case they are used | 604 % and so want to turn off most commands, in case they are used |
689 % incorrectly. | 605 % incorrectly. |
690 % | 606 % |
691 \def\ignoremorecommands{% | 607 \def\ignoremorecommands{% |
692 \let\defcodeindex = \relax | |
693 \let\defcv = \relax | 608 \let\defcv = \relax |
694 \let\deffn = \relax | 609 \let\deffn = \relax |
695 \let\deffnx = \relax | 610 \let\deffnx = \relax |
696 \let\defindex = \relax | 611 \let\defindex = \relax |
697 \let\defivar = \relax | 612 \let\defivar = \relax |
711 \let\ref = \relax | 626 \let\ref = \relax |
712 \let\xref = \relax | 627 \let\xref = \relax |
713 \let\printindex = \relax | 628 \let\printindex = \relax |
714 \let\pxref = \relax | 629 \let\pxref = \relax |
715 \let\settitle = \relax | 630 \let\settitle = \relax |
716 \let\setchapternewpage = \relax | |
717 \let\setchapterstyle = \relax | |
718 \let\everyheading = \relax | |
719 \let\evenheading = \relax | |
720 \let\oddheading = \relax | |
721 \let\everyfooting = \relax | |
722 \let\evenfooting = \relax | |
723 \let\oddfooting = \relax | |
724 \let\headings = \relax | |
725 \let\include = \relax | 631 \let\include = \relax |
726 \let\lowersections = \relax | 632 \let\lowersections = \relax |
727 \let\down = \relax | 633 \let\down = \relax |
728 \let\raisesections = \relax | 634 \let\raisesections = \relax |
729 \let\up = \relax | 635 \let\up = \relax |
730 \let\set = \relax | 636 \let\set = \relax |
731 \let\clear = \relax | 637 \let\clear = \relax |
732 \let\item = \relax | 638 \let\item = \relax |
639 \let\message = \relax | |
733 } | 640 } |
734 | 641 |
735 % Ignore @ignore ... @end ignore. | 642 % Ignore @ignore ... @end ignore. |
736 % | 643 % |
737 \def\ignore{\doignore{ignore}} | 644 \def\ignore{\doignore{ignore}} |
738 | 645 |
739 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. | 646 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. |
740 % | 647 % |
741 \def\ifinfo{\doignore{ifinfo}} | 648 \def\ifinfo{\doignore{ifinfo}} |
742 \def\ifhtml{\doignore{ifhtml}} | 649 \def\ifhtml{\doignore{ifhtml}} |
743 \def\ifnottex{\doignore{ifnottex}} | |
744 \def\html{\doignore{html}} | 650 \def\html{\doignore{html}} |
745 \def\menu{\doignore{menu}} | 651 \def\menu{\doignore{menu}} |
746 \def\direntry{\doignore{direntry}} | 652 \def\direntry{\doignore{direntry}} |
747 | |
748 % Also ignore @macro ... @end macro. The user must run texi2dvi, | |
749 % which runs makeinfo to do macro expansion. Ignore @unmacro, too. | |
750 \def\macro{\doignore{macro}} | |
751 \let\unmacro = \comment | |
752 | |
753 | |
754 % @dircategory CATEGORY -- specify a category of the dir file | |
755 % which this file should belong to. Ignore this in TeX. | |
756 \let\dircategory = \comment | |
757 | 653 |
758 % Ignore text until a line `@end #1'. | 654 % Ignore text until a line `@end #1'. |
759 % | 655 % |
760 \def\doignore#1{\begingroup | 656 \def\doignore#1{\begingroup |
761 % Don't complain about control sequences we have declared \outer. | 657 % Don't complain about control sequences we have declared \outer. |
764 % Define a command to swallow text until we reach `@end #1'. | 660 % Define a command to swallow text until we reach `@end #1'. |
765 \long\def\doignoretext##1\end #1{\enddoignore}% | 661 \long\def\doignoretext##1\end #1{\enddoignore}% |
766 % | 662 % |
767 % Make sure that spaces turn into tokens that match what \doignoretext wants. | 663 % Make sure that spaces turn into tokens that match what \doignoretext wants. |
768 \catcode32 = 10 | 664 \catcode32 = 10 |
769 % | |
770 % Ignore braces, too, so mismatched braces don't cause trouble. | |
771 \catcode`\{ = 9 | |
772 \catcode`\} = 9 | |
773 % | 665 % |
774 % And now expand that command. | 666 % And now expand that command. |
775 \doignoretext | 667 \doignoretext |
776 } | 668 } |
777 | 669 |
788 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} | 680 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} |
789 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} | 681 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} |
790 \immediate\write16{If you are running another version of TeX, relax.} | 682 \immediate\write16{If you are running another version of TeX, relax.} |
791 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} | 683 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} |
792 \immediate\write16{ Then upgrade your TeX installation if you can.} | 684 \immediate\write16{ Then upgrade your TeX installation if you can.} |
793 \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} | |
794 \immediate\write16{If you are stuck with version 3.0, run the} | 685 \immediate\write16{If you are stuck with version 3.0, run the} |
795 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} | 686 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} |
796 \immediate\write16{ to use a workaround.} | 687 \immediate\write16{ to use a workaround.} |
797 \immediate\write16{} | 688 \immediate\write16{} |
798 \global\warnedobstrue | 689 \warnedobstrue |
799 \fi | 690 \fi |
800 } | 691 } |
801 | 692 |
802 % **In TeX 3.0, setting text in \nullfont hangs tex. For a | 693 % **In TeX 3.0, setting text in \nullfont hangs tex. For a |
803 % workaround (which requires the file ``dummy.tfm'' to be installed), | 694 % workaround (which requires the file ``dummy.tfm'' to be installed), |
860 % | 751 % |
861 % Do minimal line-breaking. | 752 % Do minimal line-breaking. |
862 \pretolerance = 10000 | 753 \pretolerance = 10000 |
863 % | 754 % |
864 % Do not execute instructions in @tex | 755 % Do not execute instructions in @tex |
865 \def\tex{\doignore{tex}}% | 756 \def\tex{\doignore{tex}} |
866 } | 757 } |
867 | 758 |
868 % @set VAR sets the variable VAR to an empty value. | 759 % @set VAR sets the variable VAR to an empty value. |
869 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. | 760 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. |
870 % | 761 % |
871 % Since we want to separate VAR from REST-OF-LINE (which might be | 762 % Since we want to separate VAR from REST-OF-LINE (which might be |
872 % empty), we can't just use \parsearg; we have to insert a space of our | 763 % empty), we can't just use \parsearg; we have to insert a space of our |
873 % own to delimit the rest of the line, and then take it out again if we | 764 % own to delimit the rest of the line, and then take it out again if we |
874 % didn't need it. Make sure the catcode of space is correct to avoid | 765 % didn't need it. |
875 % losing inside @example, for instance. | 766 % |
876 % | 767 \def\set{\parsearg\setxxx} |
877 \def\set{\begingroup\catcode` =10 | |
878 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. | |
879 \parsearg\setxxx} | |
880 \def\setxxx#1{\setyyy#1 \endsetyyy} | 768 \def\setxxx#1{\setyyy#1 \endsetyyy} |
881 \def\setyyy#1 #2\endsetyyy{% | 769 \def\setyyy#1 #2\endsetyyy{% |
882 \def\temp{#2}% | 770 \def\temp{#2}% |
883 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty | 771 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty |
884 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. | 772 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. |
885 \fi | 773 \fi |
886 \endgroup | |
887 } | 774 } |
888 % Can't use \xdef to pre-expand #2 and save some time, since \temp or | 775 % Can't use \xdef to pre-expand #2 and save some time, since \temp or |
889 % \next or other control sequences that we've defined might get us into | 776 % \next or other control sequences that we've defined might get us into |
890 % an infinite loop. Consider `@set foo @cite{bar}'. | 777 % an infinite loop. Consider `@set foo @cite{bar}'. |
891 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} | 778 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} |
895 \def\clear{\parsearg\clearxxx} | 782 \def\clear{\parsearg\clearxxx} |
896 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} | 783 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} |
897 | 784 |
898 % @value{foo} gets the text saved in variable foo. | 785 % @value{foo} gets the text saved in variable foo. |
899 % | 786 % |
900 \def\value{\begingroup | 787 \def\value#1{\expandafter |
901 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. | 788 \ifx\csname SET#1\endcsname\relax |
902 \valuexxx} | 789 {\{No value for ``#1''\}} |
903 \def\valuexxx#1{% | 790 \else \csname SET#1\endcsname \fi} |
904 \expandafter\ifx\csname SET#1\endcsname\relax | |
905 {\{No value for ``#1''\}}% | |
906 \else | |
907 \csname SET#1\endcsname | |
908 \fi | |
909 \endgroup} | |
910 | 791 |
911 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined | 792 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined |
912 % with @set. | 793 % with @set. |
913 % | 794 % |
914 \def\ifset{\parsearg\ifsetxxx} | 795 \def\ifset{\parsearg\ifsetxxx} |
936 } | 817 } |
937 \def\ifclearsucceed{\conditionalsucceed{ifclear}} | 818 \def\ifclearsucceed{\conditionalsucceed{ifclear}} |
938 \def\ifclearfail{\nestedignore{ifclear}} | 819 \def\ifclearfail{\nestedignore{ifclear}} |
939 \defineunmatchedend{ifclear} | 820 \defineunmatchedend{ifclear} |
940 | 821 |
941 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text | 822 % @iftex always succeeds; we read the text following, through @end |
942 % following, through the first @end iftex (etc.). Make `@end iftex' | 823 % iftex). But `@end iftex' should be valid only after an @iftex. |
943 % (etc.) valid only after an @iftex. | |
944 % | 824 % |
945 \def\iftex{\conditionalsucceed{iftex}} | 825 \def\iftex{\conditionalsucceed{iftex}} |
946 \def\ifnothtml{\conditionalsucceed{ifnothtml}} | |
947 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} | |
948 \defineunmatchedend{iftex} | 826 \defineunmatchedend{iftex} |
949 \defineunmatchedend{ifnothtml} | |
950 \defineunmatchedend{ifnotinfo} | |
951 | 827 |
952 % We can't just want to start a group at @iftex (for example) and end it | 828 % We can't just want to start a group at @iftex (for example) and end it |
953 % at @end iftex, since then @set commands inside the conditional have no | 829 % at @end iftex, since then @set commands inside the conditional have no |
954 % effect (they'd get reverted at the end of the group). So we must | 830 % effect (they'd get reverted at the end of the group). So we must |
955 % define \Eiftex to redefine itself to be its previous value. (We can't | 831 % define \Eiftex to redefine itself to be its previous value. (We can't |
1009 | 885 |
1010 \def\appendixnoderef{\ifx\lastnode\relax\else | 886 \def\appendixnoderef{\ifx\lastnode\relax\else |
1011 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi | 887 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi |
1012 \global\let\lastnode=\relax} | 888 \global\let\lastnode=\relax} |
1013 | 889 |
1014 % @refill is a no-op. | |
1015 \let\refill=\relax | 890 \let\refill=\relax |
1016 | 891 |
1017 % @setfilename is done at the beginning of every texinfo file. | 892 % @setfilename is done at the beginning of every texinfo file. |
1018 % So open here the files we need to have open while reading the input. | 893 % So open here the files we need to have open while reading the input. |
1019 % This makes it possible to make a .fmt file for texinfo. | 894 % This makes it possible to make a .fmt file for texinfo. |
1021 \readauxfile | 896 \readauxfile |
1022 \opencontents | 897 \opencontents |
1023 \openindices | 898 \openindices |
1024 \fixbackslash % Turn off hack to swallow `\input texinfo'. | 899 \fixbackslash % Turn off hack to swallow `\input texinfo'. |
1025 \global\let\setfilename=\comment % Ignore extra @setfilename cmds. | 900 \global\let\setfilename=\comment % Ignore extra @setfilename cmds. |
1026 % | |
1027 % If texinfo.cnf is present on the system, read it. | |
1028 % Useful for site-wide @afourpaper, etc. | |
1029 % Just to be on the safe side, close the input stream before the \input. | |
1030 \openin 1 texinfo.cnf | |
1031 \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi | |
1032 \closein1 | |
1033 \temp | |
1034 % | |
1035 \comment % Ignore the actual filename. | 901 \comment % Ignore the actual filename. |
1036 } | 902 } |
1037 | 903 |
1038 % @bye. | |
1039 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} | 904 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} |
1040 | 905 |
1041 % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} | 906 \def\inforef #1{\inforefzzz #1,,,,**} |
1042 % \def\macroxxx#1#2 \end macro{% | 907 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, |
1043 % \expandafter\gdef\macrotemp#1{#2}% | 908 node \samp{\ignorespaces#1{}}} |
1044 % \endgroup} | |
1045 | |
1046 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} | |
1047 %\def\linemacroxxx#1#2 \end linemacro{% | |
1048 %\let\parsearg=\relax | |
1049 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% | |
1050 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}% | |
1051 %\expandafter\gdef\macrotempx#1{#2}% | |
1052 %\endgroup} | |
1053 | |
1054 %\def\butfirst#1{} | |
1055 | |
1056 | 909 |
1057 \message{fonts,} | 910 \message{fonts,} |
1058 | 911 |
1059 % Font-change commands. | 912 % Font-change commands. |
1060 | 913 |
1062 % So we set up a \sf analogous to plain's \rm, etc. | 915 % So we set up a \sf analogous to plain's \rm, etc. |
1063 \newfam\sffam | 916 \newfam\sffam |
1064 \def\sf{\fam=\sffam \tensf} | 917 \def\sf{\fam=\sffam \tensf} |
1065 \let\li = \sf % Sometimes we call it \li, not \sf. | 918 \let\li = \sf % Sometimes we call it \li, not \sf. |
1066 | 919 |
1067 % We don't need math for this one. | 920 %% Try out Computer Modern fonts at \magstephalf |
1068 \def\ttsl{\tenttsl} | 921 \let\mainmagstep=\magstephalf |
1069 | |
1070 % Use Computer Modern fonts at \magstephalf (11pt). | |
1071 \newcount\mainmagstep | |
1072 \mainmagstep=\magstephalf | |
1073 | 922 |
1074 % Set the font macro #1 to the font named #2, adding on the | 923 % Set the font macro #1 to the font named #2, adding on the |
1075 % specified font prefix (normally `cm'). | 924 % specified font prefix (normally `cm'). |
1076 % #3 is the font's design size, #4 is a scale factor | 925 \def\setfont#1#2{\font#1=\fontprefix#2} |
1077 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} | |
1078 | 926 |
1079 % Use cm as the default font prefix. | 927 % Use cm as the default font prefix. |
1080 % To specify the font prefix, you must define \fontprefix | 928 % To specify the font prefix, you must define \fontprefix |
1081 % before you read in texinfo.tex. | 929 % before you read in texinfo.tex. |
1082 \ifx\fontprefix\undefined | 930 \ifx\fontprefix\undefined |
1083 \def\fontprefix{cm} | 931 \def\fontprefix{cm} |
1084 \fi | 932 \fi |
1085 % Support font families that don't use the same naming scheme as CM. | |
1086 \def\rmshape{r} | |
1087 \def\rmbshape{bx} %where the normal face is bold | |
1088 \def\bfshape{b} | |
1089 \def\bxshape{bx} | |
1090 \def\ttshape{tt} | |
1091 \def\ttbshape{tt} | |
1092 \def\ttslshape{sltt} | |
1093 \def\itshape{ti} | |
1094 \def\itbshape{bxti} | |
1095 \def\slshape{sl} | |
1096 \def\slbshape{bxsl} | |
1097 \def\sfshape{ss} | |
1098 \def\sfbshape{ss} | |
1099 \def\scshape{csc} | |
1100 \def\scbshape{csc} | |
1101 | 933 |
1102 \ifx\bigger\relax | 934 \ifx\bigger\relax |
1103 \let\mainmagstep=\magstep1 | 935 \let\mainmagstep=\magstep1 |
1104 \setfont\textrm\rmshape{12}{1000} | 936 \setfont\textrm{r12} |
1105 \setfont\texttt\ttshape{12}{1000} | 937 \setfont\texttt{tt12} |
1106 \else | 938 \else |
1107 \setfont\textrm\rmshape{10}{\mainmagstep} | 939 \setfont\textrm{r10 scaled \mainmagstep} |
1108 \setfont\texttt\ttshape{10}{\mainmagstep} | 940 \setfont\texttt{tt10 scaled \mainmagstep} |
1109 \fi | 941 \fi |
1110 % Instead of cmb10, you many want to use cmbx10. | 942 % Instead of cmb10, you many want to use cmbx10. |
1111 % cmbx10 is a prettier font on its own, but cmb10 | 943 % cmbx10 is a prettier font on its own, but cmb10 |
1112 % looks better when embedded in a line with cmr10. | 944 % looks better when embedded in a line with cmr10. |
1113 \setfont\textbf\bfshape{10}{\mainmagstep} | 945 \setfont\textbf{b10 scaled \mainmagstep} |
1114 \setfont\textit\itshape{10}{\mainmagstep} | 946 \setfont\textit{ti10 scaled \mainmagstep} |
1115 \setfont\textsl\slshape{10}{\mainmagstep} | 947 \setfont\textsl{sl10 scaled \mainmagstep} |
1116 \setfont\textsf\sfshape{10}{\mainmagstep} | 948 \setfont\textsf{ss10 scaled \mainmagstep} |
1117 \setfont\textsc\scshape{10}{\mainmagstep} | 949 \setfont\textsc{csc10 scaled \mainmagstep} |
1118 \setfont\textttsl\ttslshape{10}{\mainmagstep} | |
1119 \font\texti=cmmi10 scaled \mainmagstep | 950 \font\texti=cmmi10 scaled \mainmagstep |
1120 \font\textsy=cmsy10 scaled \mainmagstep | 951 \font\textsy=cmsy10 scaled \mainmagstep |
1121 | 952 |
1122 % A few fonts for @defun, etc. | 953 % A few fonts for @defun, etc. |
1123 \setfont\defbf\bxshape{10}{\magstep1} %was 1314 | 954 \setfont\defbf{bx10 scaled \magstep1} %was 1314 |
1124 \setfont\deftt\ttshape{10}{\magstep1} | 955 \setfont\deftt{tt10 scaled \magstep1} |
1125 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} | 956 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} |
1126 | 957 |
1127 % Fonts for indices and small examples (9pt). | 958 % Fonts for indices and small examples. |
1128 % We actually use the slanted font rather than the italic, | 959 % We actually use the slanted font rather than the italic, |
1129 % because texinfo normally uses the slanted fonts for that. | 960 % because texinfo normally uses the slanted fonts for that. |
1130 % Do not make many font distinctions in general in the index, since they | 961 % Do not make many font distinctions in general in the index, since they |
1131 % aren't very useful. | 962 % aren't very useful. |
1132 \setfont\ninett\ttshape{9}{1000} | 963 \setfont\ninett{tt9} |
1133 \setfont\indrm\rmshape{9}{1000} | 964 \setfont\indrm{r9} |
1134 \setfont\indit\slshape{9}{1000} | 965 \setfont\indit{sl9} |
1135 \let\indsl=\indit | 966 \let\indsl=\indit |
1136 \let\indtt=\ninett | 967 \let\indtt=\ninett |
1137 \let\indttsl=\ninett | |
1138 \let\indsf=\indrm | 968 \let\indsf=\indrm |
1139 \let\indbf=\indrm | 969 \let\indbf=\indrm |
1140 \setfont\indsc\scshape{10}{900} | 970 \setfont\indsc{csc10 at 9pt} |
1141 \font\indi=cmmi9 | 971 \font\indi=cmmi9 |
1142 \font\indsy=cmsy9 | 972 \font\indsy=cmsy9 |
1143 | 973 |
1144 % Fonts for title page: | 974 % Fonts for headings |
1145 \setfont\titlerm\rmbshape{12}{\magstep3} | 975 \setfont\chaprm{bx12 scaled \magstep2} |
1146 \setfont\titleit\itbshape{10}{\magstep4} | 976 \setfont\chapit{ti12 scaled \magstep2} |
1147 \setfont\titlesl\slbshape{10}{\magstep4} | 977 \setfont\chapsl{sl12 scaled \magstep2} |
1148 \setfont\titlett\ttbshape{12}{\magstep3} | 978 \setfont\chaptt{tt12 scaled \magstep2} |
1149 \setfont\titlettsl\ttslshape{10}{\magstep4} | 979 \setfont\chapsf{ss12 scaled \magstep2} |
1150 \setfont\titlesf\sfbshape{17}{\magstep1} | |
1151 \let\titlebf=\titlerm | |
1152 \setfont\titlesc\scbshape{10}{\magstep4} | |
1153 \font\titlei=cmmi12 scaled \magstep3 | |
1154 \font\titlesy=cmsy10 scaled \magstep4 | |
1155 \def\authorrm{\secrm} | |
1156 | |
1157 % Chapter (and unnumbered) fonts (17.28pt). | |
1158 \setfont\chaprm\rmbshape{12}{\magstep2} | |
1159 \setfont\chapit\itbshape{10}{\magstep3} | |
1160 \setfont\chapsl\slbshape{10}{\magstep3} | |
1161 \setfont\chaptt\ttbshape{12}{\magstep2} | |
1162 \setfont\chapttsl\ttslshape{10}{\magstep3} | |
1163 \setfont\chapsf\sfbshape{17}{1000} | |
1164 \let\chapbf=\chaprm | 980 \let\chapbf=\chaprm |
1165 \setfont\chapsc\scbshape{10}{\magstep3} | 981 \setfont\chapsc{csc10 scaled\magstep3} |
1166 \font\chapi=cmmi12 scaled \magstep2 | 982 \font\chapi=cmmi12 scaled \magstep2 |
1167 \font\chapsy=cmsy10 scaled \magstep3 | 983 \font\chapsy=cmsy10 scaled \magstep3 |
1168 | 984 |
1169 % Section fonts (14.4pt). | 985 \setfont\secrm{bx12 scaled \magstep1} |
1170 \setfont\secrm\rmbshape{12}{\magstep1} | 986 \setfont\secit{ti12 scaled \magstep1} |
1171 \setfont\secit\itbshape{10}{\magstep2} | 987 \setfont\secsl{sl12 scaled \magstep1} |
1172 \setfont\secsl\slbshape{10}{\magstep2} | 988 \setfont\sectt{tt12 scaled \magstep1} |
1173 \setfont\sectt\ttbshape{12}{\magstep1} | 989 \setfont\secsf{ss12 scaled \magstep1} |
1174 \setfont\secttsl\ttslshape{10}{\magstep2} | 990 \setfont\secbf{bx12 scaled \magstep1} |
1175 \setfont\secsf\sfbshape{12}{\magstep1} | 991 \setfont\secsc{csc10 scaled\magstep2} |
1176 \let\secbf\secrm | |
1177 \setfont\secsc\scbshape{10}{\magstep2} | |
1178 \font\seci=cmmi12 scaled \magstep1 | 992 \font\seci=cmmi12 scaled \magstep1 |
1179 \font\secsy=cmsy10 scaled \magstep2 | 993 \font\secsy=cmsy10 scaled \magstep2 |
1180 | 994 |
1181 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. | 995 % \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. |
1182 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. | 996 % \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. |
1183 % \setfont\ssecsl\slshape{10}{\magstep1} | 997 % \setfont\ssecsl{sl10 scaled \magstep1} |
1184 % \setfont\ssectt\ttshape{10}{\magstep1} | 998 % \setfont\ssectt{tt10 scaled \magstep1} |
1185 % \setfont\ssecsf\sfshape{10}{\magstep1} | 999 % \setfont\ssecsf{ss10 scaled \magstep1} |
1186 | 1000 |
1187 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. | 1001 %\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. |
1188 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than | 1002 %\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than |
1189 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. | 1003 %\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. |
1190 %\setfont\ssectt\ttshape{10}{1315} | 1004 %\setfont\ssectt{tt10 scaled 1315} |
1191 %\setfont\ssecsf\sfshape{10}{1315} | 1005 %\setfont\ssecsf{ss10 scaled 1315} |
1192 | 1006 |
1193 %\let\ssecbf=\ssecrm | 1007 %\let\ssecbf=\ssecrm |
1194 | 1008 |
1195 % Subsection fonts (13.15pt). | 1009 \setfont\ssecrm{bx12 scaled \magstephalf} |
1196 \setfont\ssecrm\rmbshape{12}{\magstephalf} | 1010 \setfont\ssecit{ti12 scaled \magstephalf} |
1197 \setfont\ssecit\itbshape{10}{1315} | 1011 \setfont\ssecsl{sl12 scaled \magstephalf} |
1198 \setfont\ssecsl\slbshape{10}{1315} | 1012 \setfont\ssectt{tt12 scaled \magstephalf} |
1199 \setfont\ssectt\ttbshape{12}{\magstephalf} | 1013 \setfont\ssecsf{ss12 scaled \magstephalf} |
1200 \setfont\ssecttsl\ttslshape{10}{1315} | 1014 \setfont\ssecbf{bx12 scaled \magstephalf} |
1201 \setfont\ssecsf\sfbshape{12}{\magstephalf} | 1015 \setfont\ssecsc{csc10 scaled \magstep1} |
1202 \let\ssecbf\ssecrm | |
1203 \setfont\ssecsc\scbshape{10}{\magstep1} | |
1204 \font\sseci=cmmi12 scaled \magstephalf | 1016 \font\sseci=cmmi12 scaled \magstephalf |
1205 \font\ssecsy=cmsy10 scaled 1315 | 1017 \font\ssecsy=cmsy10 scaled \magstep1 |
1206 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, | 1018 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, |
1207 % but that is not a standard magnification. | 1019 % but that is not a standard magnification. |
1020 | |
1021 % Fonts for title page: | |
1022 \setfont\titlerm{bx12 scaled \magstep3} | |
1023 \let\authorrm = \secrm | |
1208 | 1024 |
1209 % In order for the font changes to affect most math symbols and letters, | 1025 % In order for the font changes to affect most math symbols and letters, |
1210 % we have to define the \textfont of the standard families. Since | 1026 % we have to define the \textfont of the standard families. Since |
1211 % texinfo doesn't allow for producing subscripts and superscripts, we | 1027 % texinfo doesn't allow for producing subscripts and superscripts, we |
1212 % don't bother to reset \scriptfont and \scriptscriptfont (which would | 1028 % don't bother to reset \scriptfont and \scriptscriptfont (which would |
1220 | 1036 |
1221 | 1037 |
1222 % The font-changing commands redefine the meanings of \tenSTYLE, instead | 1038 % The font-changing commands redefine the meanings of \tenSTYLE, instead |
1223 % of just \STYLE. We do this so that font changes will continue to work | 1039 % of just \STYLE. We do this so that font changes will continue to work |
1224 % in math mode, where it is the current \fam that is relevant in most | 1040 % in math mode, where it is the current \fam that is relevant in most |
1225 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam | 1041 % cases, not the current. Plain TeX does, for example, |
1226 % \tenbf}, for example. By redefining \tenbf, we obviate the need to | 1042 % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need |
1227 % redefine \bf itself. | 1043 % to redefine \bf itself. |
1228 \def\textfonts{% | 1044 \def\textfonts{% |
1229 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | 1045 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl |
1230 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc | 1046 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc |
1231 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl | 1047 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy |
1232 \resetmathfonts} | 1048 \resetmathfonts} |
1233 \def\titlefonts{% | |
1234 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl | |
1235 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc | |
1236 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy | |
1237 \let\tenttsl=\titlettsl | |
1238 \resetmathfonts \setleading{25pt}} | |
1239 \def\titlefont#1{{\titlefonts #1}} | |
1240 \def\chapfonts{% | 1049 \def\chapfonts{% |
1241 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl | 1050 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl |
1242 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc | 1051 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc |
1243 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl | 1052 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy |
1244 \resetmathfonts \setleading{19pt}} | 1053 \resetmathfonts} |
1245 \def\secfonts{% | 1054 \def\secfonts{% |
1246 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl | 1055 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl |
1247 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc | 1056 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc |
1248 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl | 1057 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy |
1249 \resetmathfonts \setleading{16pt}} | 1058 \resetmathfonts} |
1250 \def\subsecfonts{% | 1059 \def\subsecfonts{% |
1251 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl | 1060 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl |
1252 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc | 1061 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc |
1253 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl | 1062 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy |
1254 \resetmathfonts \setleading{15pt}} | 1063 \resetmathfonts} |
1255 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? | |
1256 \def\indexfonts{% | 1064 \def\indexfonts{% |
1257 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl | 1065 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl |
1258 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc | 1066 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc |
1259 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl | 1067 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy |
1260 \resetmathfonts \setleading{12pt}} | 1068 \resetmathfonts} |
1261 | 1069 |
1262 % Set up the default fonts, so we can use them for creating boxes. | 1070 % Set up the default fonts, so we can use them for creating boxes. |
1263 % | 1071 % |
1264 \textfonts | 1072 \textfonts |
1265 | 1073 |
1266 % Count depth in font-changes, for error checks | 1074 % Count depth in font-changes, for error checks |
1267 \newcount\fontdepth \fontdepth=0 | 1075 \newcount\fontdepth \fontdepth=0 |
1268 | 1076 |
1269 % Fonts for short table of contents. | 1077 % Fonts for short table of contents. |
1270 \setfont\shortcontrm\rmshape{12}{1000} | 1078 \setfont\shortcontrm{r12} |
1271 \setfont\shortcontbf\bxshape{12}{1000} | 1079 \setfont\shortcontbf{bx12} |
1272 \setfont\shortcontsl\slshape{12}{1000} | 1080 \setfont\shortcontsl{sl12} |
1273 | 1081 |
1274 %% Add scribe-like font environments, plus @l for inline lisp (usually sans | 1082 %% Add scribe-like font environments, plus @l for inline lisp (usually sans |
1275 %% serif) and @ii for TeX italic | 1083 %% serif) and @ii for TeX italic |
1276 | 1084 |
1277 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction | 1085 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction |
1294 % | 1102 % |
1295 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} | 1103 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} |
1296 \def\restorehyphenation{\hyphenchar\font = `- } | 1104 \def\restorehyphenation{\hyphenchar\font = `- } |
1297 | 1105 |
1298 \def\t#1{% | 1106 \def\t#1{% |
1299 {\tt \rawbackslash \frenchspacing #1}% | 1107 {\tt \nohyphenation \rawbackslash \frenchspacing #1}% |
1300 \null | 1108 \null |
1301 } | 1109 } |
1302 \let\ttfont=\t | 1110 \let\ttfont = \t |
1111 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null} | |
1303 \def\samp #1{`\tclose{#1}'\null} | 1112 \def\samp #1{`\tclose{#1}'\null} |
1304 \setfont\smallrm\rmshape{8}{1000} | 1113 \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} |
1305 \font\smallsy=cmsy9 | |
1306 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% | |
1307 \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% | |
1308 \vbox{\hrule\kern-0.4pt | |
1309 \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% | |
1310 \kern-0.4pt\hrule}% | |
1311 \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} | |
1312 % The old definition, with no lozenge: | |
1313 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} | |
1314 \def\ctrl #1{{\tt \rawbackslash \hat}#1} | 1114 \def\ctrl #1{{\tt \rawbackslash \hat}#1} |
1315 | 1115 |
1316 \let\file=\samp | 1116 \let\file=\samp |
1317 | 1117 |
1318 % @code is a modification of @t, | 1118 % @code is a modification of @t, |
1337 }% | 1137 }% |
1338 \null | 1138 \null |
1339 } | 1139 } |
1340 | 1140 |
1341 % We *must* turn on hyphenation at `-' and `_' in \code. | 1141 % We *must* turn on hyphenation at `-' and `_' in \code. |
1342 % Otherwise, it is too hard to avoid overfull hboxes | 1142 % Otherwise, it is too hard to avoid overful hboxes |
1343 % in the Emacs manual, the Library manual, etc. | 1143 % in the Emacs manual, the Library manual, etc. |
1344 | 1144 |
1345 % Unfortunately, TeX uses one parameter (\hyphenchar) to control | 1145 % Unfortunately, TeX uses one parameter (\hyphenchar) to control |
1346 % both hyphenation at - and hyphenation within words. | 1146 % both hyphenation at - and hyphenation within words. |
1347 % We must therefore turn them both off (\tclose does that) | 1147 % We must therefore turn them both off (\tclose does that) |
1348 % and arrange explicitly to hyphenate at a dash. | 1148 % and arrange explicitly to hyphenate an a dash. |
1349 % -- rms. | 1149 % -- rms. |
1350 { | 1150 { |
1351 \catcode`\-=\active | 1151 \catcode`\-=\active |
1352 \catcode`\_=\active | 1152 \catcode`\_=\active |
1353 \catcode`\|=\active | |
1354 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} | 1153 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} |
1355 % The following is used by \doprintindex to insure that long function names | 1154 % The following is used by \doprintindex to insure that long function names |
1356 % wrap around. It is necessary for - and _ to be active before the index is | 1155 % wrap around. It is necessary for - and _ to be active before the index is |
1357 % read from the file, as \entry parses the arguments long before \code is | 1156 % read from the file, as \entry parses the arguments long before \code is |
1358 % ever called. -- mycroft | 1157 % ever called. -- mycroft |
1359 % _ is always active; and it shouldn't be \let = to an _ that is a | 1158 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} |
1360 % subscript character anyway. Then, @cindex @samp{_} (for example) | 1159 } |
1361 % fails. --karl | |
1362 \global\def\indexbreaks{% | |
1363 \catcode`\-=\active \let-\realdash | |
1364 } | |
1365 } | |
1366 | |
1367 \def\realdash{-} | 1160 \def\realdash{-} |
1161 \def\realunder{_} | |
1368 \def\codedash{-\discretionary{}{}{}} | 1162 \def\codedash{-\discretionary{}{}{}} |
1369 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} | 1163 \def\codeunder{\normalunderscore\discretionary{}{}{}} |
1370 \def\codex #1{\tclose{#1}\endgroup} | 1164 \def\codex #1{\tclose{#1}\endgroup} |
1371 | 1165 |
1372 %\let\exp=\tclose %Was temporary | 1166 %\let\exp=\tclose %Was temporary |
1373 | 1167 |
1374 % @kbd is like @code, except that if the argument is just one @key command, | 1168 % @kbd is like @code, except that if the argument is just one @key command, |
1375 % then @kbd has no effect. | 1169 % then @kbd has no effect. |
1376 | |
1377 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | |
1378 % `example' (@kbd uses ttsl only inside of @example and friends), | |
1379 % or `code' (@kbd uses normal tty font always). | |
1380 \def\kbdinputstyle{\parsearg\kbdinputstylexxx} | |
1381 \def\kbdinputstylexxx#1{% | |
1382 \def\arg{#1}% | |
1383 \ifx\arg\worddistinct | |
1384 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% | |
1385 \else\ifx\arg\wordexample | |
1386 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% | |
1387 \else\ifx\arg\wordcode | |
1388 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% | |
1389 \fi\fi\fi | |
1390 } | |
1391 \def\worddistinct{distinct} | |
1392 \def\wordexample{example} | |
1393 \def\wordcode{code} | |
1394 | |
1395 % Default is kbdinputdistinct. (Too much of a hassle to call the macro, | |
1396 % the catcodes are wrong for parsearg to work.) | |
1397 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} | |
1398 | 1170 |
1399 \def\xkey{\key} | 1171 \def\xkey{\key} |
1400 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | 1172 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% |
1401 \ifx\one\xkey\ifx\threex\three \key{#2}% | 1173 \ifx\one\xkey\ifx\threex\three \key{#2}% |
1402 \else{\tclose{\kbdfont\look}}\fi | 1174 \else\tclose{\look}\fi |
1403 \else{\tclose{\kbdfont\look}}\fi} | 1175 \else\tclose{\look}\fi} |
1404 | |
1405 % @url. Quotes do not seem necessary, so use \code. | |
1406 \let\url=\code | |
1407 | |
1408 % @uref (abbreviation for `urlref') takes an optional second argument | |
1409 % specifying the text to display. First (mandatory) arg is the url. | |
1410 % Perhaps eventually put in a hypertex \special here. | |
1411 % | |
1412 \def\uref#1{\urefxxx #1,,\finish} | |
1413 \def\urefxxx#1,#2,#3\finish{% | |
1414 \setbox0 = \hbox{\ignorespaces #2}% | |
1415 \ifdim\wd0 > 0pt | |
1416 \unhbox0\ (\code{#1})% | |
1417 \else | |
1418 \code{#1}% | |
1419 \fi | |
1420 } | |
1421 | |
1422 % rms does not like the angle brackets --karl, 17may97. | |
1423 % So now @email is just like @uref. | |
1424 %\def\email#1{$\langle${\tt #1}$\rangle$} | |
1425 \let\email=\uref | |
1426 | |
1427 % Check if we are currently using a typewriter font. Since all the | |
1428 % Computer Modern typewriter fonts have zero interword stretch (and | |
1429 % shrink), and it is reasonable to expect all typewriter fonts to have | |
1430 % this property, we can check that font parameter. | |
1431 % | |
1432 \def\ifmonospace{\ifdim\fontdimen3\font=0pt } | |
1433 | 1176 |
1434 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the | 1177 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the |
1435 % argument is to make the input look right: @dmn{pt} instead of | 1178 % argument is to make the input look right: @dmn{pt} instead of |
1436 % @dmn{}pt. | 1179 % @dmn{}pt. |
1437 % | 1180 % |
1438 \def\dmn#1{\thinspace #1} | 1181 \def\dmn#1{\thinspace #1} |
1439 | 1182 |
1440 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} | 1183 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} |
1441 | 1184 |
1442 % @l was never documented to mean ``switch to the Lisp font'', | 1185 \def\l#1{{\li #1}\null} % |
1443 % and it is not used as such in any manual I can find. We need it for | 1186 |
1444 % Polish suppressed-l. --karl, 22sep96. | 1187 \def\r#1{{\rm #1}} % roman font |
1445 %\def\l#1{{\li #1}\null} | |
1446 | |
1447 \def\r#1{{\rm #1}} % roman font | |
1448 % Use of \lowercase was suggested. | 1188 % Use of \lowercase was suggested. |
1449 \def\sc#1{{\smallcaps#1}} % smallcaps font | 1189 \def\sc#1{{\smallcaps#1}} % smallcaps font |
1450 \def\ii#1{{\it #1}} % italic font | 1190 \def\ii#1{{\it #1}} % italic font |
1451 | |
1452 % @pounds{} is a sterling sign. | |
1453 \def\pounds{{\it\$}} | |
1454 | |
1455 | 1191 |
1456 \message{page headings,} | 1192 \message{page headings,} |
1457 | 1193 |
1458 \newskip\titlepagetopglue \titlepagetopglue = 1.5in | 1194 \newskip\titlepagetopglue \titlepagetopglue = 1.5in |
1459 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc | 1195 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc |
1460 | 1196 |
1461 % First the title page. Must do @settitle before @titlepage. | 1197 % First the title page. Must do @settitle before @titlepage. |
1198 \def\titlefont#1{{\titlerm #1}} | |
1199 | |
1462 \newif\ifseenauthor | 1200 \newif\ifseenauthor |
1463 \newif\iffinishedtitlepage | 1201 \newif\iffinishedtitlepage |
1464 | 1202 |
1465 \def\shorttitlepage{\parsearg\shorttitlepagezzz} | 1203 \def\shorttitlepage{\parsearg\shorttitlepagezzz} |
1466 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% | 1204 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% |
1467 \endgroup\page\hbox{}\page} | 1205 \endgroup\page\hbox{}\page} |
1468 | 1206 |
1469 \def\titlepage{\begingroup \parindent=0pt \textfonts | 1207 \def\titlepage{\begingroup \parindent=0pt \textfonts |
1470 \let\subtitlerm=\tenrm | 1208 \let\subtitlerm=\tenrm |
1471 % I deinstalled the following change because \cmr12 is undefined. | 1209 % I deinstalled the following change because \cmr12 is undefined. |
1472 % This change was not in the ChangeLog anyway. --rms. | 1210 % This change was not in the ChangeLog anyway. --rms. |
1478 % Leave some space at the very top of the page. | 1216 % Leave some space at the very top of the page. |
1479 \vglue\titlepagetopglue | 1217 \vglue\titlepagetopglue |
1480 % | 1218 % |
1481 % Now you can print the title using @title. | 1219 % Now you can print the title using @title. |
1482 \def\title{\parsearg\titlezzz}% | 1220 \def\title{\parsearg\titlezzz}% |
1483 \def\titlezzz##1{\leftline{\titlefonts\rm ##1} | 1221 \def\titlezzz##1{\leftline{\titlefont{##1}} |
1484 % print a rule at the page bottom also. | 1222 % print a rule at the page bottom also. |
1485 \finishedtitlepagefalse | 1223 \finishedtitlepagefalse |
1486 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% | 1224 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% |
1487 % No rule at page bottom unless we print one at the top with @title. | 1225 % No rule at page bottom unless we print one at the top with @title. |
1488 \finishedtitlepagetrue | 1226 \finishedtitlepagetrue |
1489 % | 1227 % |
1490 % Now you can put text using @subtitle. | 1228 % Now you can put text using @subtitle. |
1491 \def\subtitle{\parsearg\subtitlezzz}% | 1229 \def\subtitle{\parsearg\subtitlezzz}% |
1499 % Most title ``pages'' are actually two pages long, with space | 1237 % Most title ``pages'' are actually two pages long, with space |
1500 % at the top of the second. We don't want the ragged left on the second. | 1238 % at the top of the second. We don't want the ragged left on the second. |
1501 \let\oldpage = \page | 1239 \let\oldpage = \page |
1502 \def\page{% | 1240 \def\page{% |
1503 \iffinishedtitlepage\else | 1241 \iffinishedtitlepage\else |
1504 \finishtitlepage | 1242 \finishtitlepage |
1505 \fi | 1243 \fi |
1506 \oldpage | 1244 \oldpage |
1507 \let\page = \oldpage | 1245 \let\page = \oldpage |
1508 \hbox{}}% | 1246 \hbox{}}% |
1509 % \def\page{\oldpage \hbox{}} | 1247 % \def\page{\oldpage \hbox{}} |
1567 | 1305 |
1568 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} | 1306 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} |
1569 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% | 1307 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% |
1570 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | 1308 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} |
1571 | 1309 |
1572 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% | 1310 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} |
1311 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{% | |
1312 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} | |
1313 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | |
1573 | 1314 |
1574 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} | 1315 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} |
1575 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% | 1316 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% |
1576 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | 1317 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} |
1577 | 1318 |
1578 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} | 1319 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} |
1579 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% | 1320 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% |
1580 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% | 1321 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} |
1581 % | 1322 |
1582 % Leave some space for the footline. Hopefully ok to assume | 1323 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} |
1583 % @evenfooting will not be used by itself. | 1324 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% |
1584 \global\advance\pageheight by -\baselineskip | 1325 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} |
1585 \global\advance\vsize by -\baselineskip | 1326 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} |
1586 } | |
1587 | |
1588 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} | |
1589 % | 1327 % |
1590 }% unbind the catcode of @. | 1328 }% unbind the catcode of @. |
1591 | 1329 |
1592 % @headings double turns headings on for double-sided printing. | 1330 % @headings double turns headings on for double-sided printing. |
1593 % @headings single turns headings on for single-sided printing. | 1331 % @headings single turns headings on for single-sided printing. |
1594 % @headings off turns them off. | 1332 % @headings off turns them off. |
1595 % @headings on same as @headings double, retained for compatibility. | 1333 % @headings on same as @headings double, retained for compatibility. |
1596 % @headings after turns on double-sided headings after this page. | 1334 % @headings after turns on double-sided headings after this page. |
1597 % @headings doubleafter turns on double-sided headings after this page. | 1335 % @headings doubleafter turns on double-sided headings after this page. |
1598 % @headings singleafter turns on single-sided headings after this page. | 1336 % @headings singleafter turns on single-sided headings after this page. |
1599 % By default, they are off at the start of a document, | 1337 % By default, they are off. |
1600 % and turned `on' after @end titlepage. | |
1601 | 1338 |
1602 \def\headings #1 {\csname HEADINGS#1\endcsname} | 1339 \def\headings #1 {\csname HEADINGS#1\endcsname} |
1603 | 1340 |
1604 \def\HEADINGSoff{ | 1341 \def\HEADINGSoff{ |
1605 \global\evenheadline={\hfil} \global\evenfootline={\hfil} | 1342 \global\evenheadline={\hfil} \global\evenfootline={\hfil} |
1609 % For double-sided printing, put current file name in lower left corner, | 1346 % For double-sided printing, put current file name in lower left corner, |
1610 % chapter name on inside top of right hand pages, document | 1347 % chapter name on inside top of right hand pages, document |
1611 % title on inside top of left hand pages, and page numbers on outside top | 1348 % title on inside top of left hand pages, and page numbers on outside top |
1612 % edge of all pages. | 1349 % edge of all pages. |
1613 \def\HEADINGSdouble{ | 1350 \def\HEADINGSdouble{ |
1351 %\pagealignmacro | |
1614 \global\pageno=1 | 1352 \global\pageno=1 |
1615 \global\evenfootline={\hfil} | 1353 \global\evenfootline={\hfil} |
1616 \global\oddfootline={\hfil} | 1354 \global\oddfootline={\hfil} |
1617 \global\evenheadline={\line{\folio\hfil\thistitle}} | 1355 \global\evenheadline={\line{\folio\hfil\thistitle}} |
1618 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1356 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1619 \global\let\contentsalignmacro = \chapoddpage | 1357 } |
1620 } | |
1621 \let\contentsalignmacro = \chappager | |
1622 | |
1623 % For single-sided printing, chapter title goes across top left of page, | 1358 % For single-sided printing, chapter title goes across top left of page, |
1624 % page number on top right. | 1359 % page number on top right. |
1625 \def\HEADINGSsingle{ | 1360 \def\HEADINGSsingle{ |
1361 %\pagealignmacro | |
1626 \global\pageno=1 | 1362 \global\pageno=1 |
1627 \global\evenfootline={\hfil} | 1363 \global\evenfootline={\hfil} |
1628 \global\oddfootline={\hfil} | 1364 \global\oddfootline={\hfil} |
1629 \global\evenheadline={\line{\thischapter\hfil\folio}} | 1365 \global\evenheadline={\line{\thischapter\hfil\folio}} |
1630 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1366 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1631 \global\let\contentsalignmacro = \chappager | |
1632 } | 1367 } |
1633 \def\HEADINGSon{\HEADINGSdouble} | 1368 \def\HEADINGSon{\HEADINGSdouble} |
1634 | 1369 |
1635 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} | 1370 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} |
1636 \let\HEADINGSdoubleafter=\HEADINGSafter | 1371 \let\HEADINGSdoubleafter=\HEADINGSafter |
1637 \def\HEADINGSdoublex{% | 1372 \def\HEADINGSdoublex{% |
1638 \global\evenfootline={\hfil} | 1373 \global\evenfootline={\hfil} |
1639 \global\oddfootline={\hfil} | 1374 \global\oddfootline={\hfil} |
1640 \global\evenheadline={\line{\folio\hfil\thistitle}} | 1375 \global\evenheadline={\line{\folio\hfil\thistitle}} |
1641 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1376 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1642 \global\let\contentsalignmacro = \chapoddpage | |
1643 } | 1377 } |
1644 | 1378 |
1645 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} | 1379 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} |
1646 \def\HEADINGSsinglex{% | 1380 \def\HEADINGSsinglex{% |
1647 \global\evenfootline={\hfil} | 1381 \global\evenfootline={\hfil} |
1648 \global\oddfootline={\hfil} | 1382 \global\oddfootline={\hfil} |
1649 \global\evenheadline={\line{\thischapter\hfil\folio}} | 1383 \global\evenheadline={\line{\thischapter\hfil\folio}} |
1650 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1384 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1651 \global\let\contentsalignmacro = \chappager | |
1652 } | 1385 } |
1653 | 1386 |
1654 % Subroutines used in generating headings | 1387 % Subroutines used in generating headings |
1655 % Produces Day Month Year style of output. | 1388 % Produces Day Month Year style of output. |
1656 \def\today{\number\day\space | 1389 \def\today{\number\day\space |
1670 | 1403 |
1671 \def\thistitle{No Title} | 1404 \def\thistitle{No Title} |
1672 \def\settitle{\parsearg\settitlezzz} | 1405 \def\settitle{\parsearg\settitlezzz} |
1673 \def\settitlezzz #1{\gdef\thistitle{#1}} | 1406 \def\settitlezzz #1{\gdef\thistitle{#1}} |
1674 | 1407 |
1675 | |
1676 \message{tables,} | 1408 \message{tables,} |
1677 | 1409 |
1678 % @tabs -- simple alignment | 1410 % @tabs -- simple alignment |
1679 | 1411 |
1680 % These don't work. For one thing, \+ is defined as outer. | 1412 % These don't work. For one thing, \+ is defined as outer. |
1703 % They also define \itemindex | 1435 % They also define \itemindex |
1704 % to index the item name in whatever manner is desired (perhaps none). | 1436 % to index the item name in whatever manner is desired (perhaps none). |
1705 | 1437 |
1706 \newif\ifitemxneedsnegativevskip | 1438 \newif\ifitemxneedsnegativevskip |
1707 | 1439 |
1708 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} | 1440 \def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} |
1709 | 1441 |
1710 \def\internalBitem{\smallbreak \parsearg\itemzzz} | 1442 \def\internalBitem{\smallbreak \parsearg\itemzzz} |
1711 \def\internalBitemx{\itemxpar \parsearg\itemzzz} | 1443 \def\internalBitemx{\itemxpar \parsearg\itemzzz} |
1712 | 1444 |
1713 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} | 1445 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} |
1810 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} | 1542 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} |
1811 | 1543 |
1812 \def\tablez #1#2#3#4#5#6{% | 1544 \def\tablez #1#2#3#4#5#6{% |
1813 \aboveenvbreak % | 1545 \aboveenvbreak % |
1814 \begingroup % | 1546 \begingroup % |
1815 \def\Edescription{\Etable}% Necessary kludge. | 1547 \def\Edescription{\Etable}% Neccessary kludge. |
1816 \let\itemindex=#1% | 1548 \let\itemindex=#1% |
1817 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % | 1549 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % |
1818 \ifnum 0#4>0 \tableindent=#4\mil \fi % | 1550 \ifnum 0#4>0 \tableindent=#4\mil \fi % |
1819 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % | 1551 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % |
1820 \def\itemfont{#2}% | 1552 \def\itemfont{#2}% |
1967 % Definition of @item while inside @itemize. | 1699 % Definition of @item while inside @itemize. |
1968 | 1700 |
1969 \def\itemizeitem{% | 1701 \def\itemizeitem{% |
1970 \advance\itemno by 1 | 1702 \advance\itemno by 1 |
1971 {\let\par=\endgraf \smallbreak}% | 1703 {\let\par=\endgraf \smallbreak}% |
1972 \ifhmode \errmessage{In hmode at itemizeitem}\fi | 1704 \ifhmode \errmessage{\in hmode at itemizeitem}\fi |
1973 {\parskip=0in \hskip 0pt | 1705 {\parskip=0in \hskip 0pt |
1974 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% | 1706 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% |
1975 \vadjust{\penalty 1200}}% | 1707 \vadjust{\penalty 1200}}% |
1976 \flushcr} | 1708 \flushcr} |
1977 | 1709 |
1978 % @multitable macros | 1710 % @multitable macros |
1979 % Amy Hendrickson, 8/18/94, 3/6/96 | 1711 % Amy Hendrickson, 8/18/94 |
1980 % | 1712 % |
1981 % @multitable ... @end multitable will make as many columns as desired. | 1713 % @multitable ... @endmultitable will make as many columns as desired. |
1982 % Contents of each column will wrap at width given in preamble. Width | 1714 % Contents of each column will wrap at width given in preamble. Width |
1983 % can be specified either with sample text given in a template line, | 1715 % can be specified either with sample text given in a template line, |
1984 % or in percent of \hsize, the current width of text on page. | 1716 % or in percent of \hsize, the current width of text on page. |
1985 | 1717 |
1986 % Table can continue over pages but will only break between lines. | 1718 % Table can continue over pages but will only break between lines. |
1987 | 1719 |
1988 % To make preamble: | 1720 % To make preamble: |
1989 % | 1721 % |
1990 % Either define widths of columns in terms of percent of \hsize: | 1722 % Either define widths of columns in terms of percent of \hsize: |
1991 % @multitable @columnfractions .25 .3 .45 | 1723 % @multitable @percentofhsize .2 .3 .5 |
1992 % @item ... | 1724 % @item ... |
1993 % | 1725 % |
1994 % Numbers following @columnfractions are the percent of the total | 1726 % Numbers following @percentofhsize are the percent of the total |
1995 % current hsize to be used for each column. You may use as many | 1727 % current hsize to be used for each column. You may use as many |
1996 % columns as desired. | 1728 % columns as desired. |
1997 | |
1998 | 1729 |
1999 % Or use a template: | 1730 % Or use a template: |
2000 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | 1731 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} |
2001 % @item ... | 1732 % @item ... |
2002 % using the widest term desired in each column. | 1733 % using the widest term desired in each column. |
2003 % | 1734 |
2004 % For those who want to use more than one line's worth of words in | 1735 |
2005 % the preamble, break the line within one argument and it | 1736 % Each new table line starts with @item, each subsequent new column |
2006 % will parse correctly, i.e., | |
2007 % | |
2008 % @multitable {Column 1 template} {Column 2 template} {Column 3 | |
2009 % template} | |
2010 % Not: | |
2011 % @multitable {Column 1 template} {Column 2 template} | |
2012 % {Column 3 template} | |
2013 | |
2014 % Each new table line starts with @item, each subsequent new column | |
2015 % starts with @tab. Empty columns may be produced by supplying @tab's | 1737 % starts with @tab. Empty columns may be produced by supplying @tab's |
2016 % with nothing between them for as many times as empty columns are needed, | 1738 % with nothing between them for as many times as empty columns are needed, |
2017 % ie, @tab@tab@tab will produce two empty columns. | 1739 % ie, @tab@tab@tab will produce two empty columns. |
2018 | 1740 |
2019 % @item, @tab, @multitable or @end multitable do not need to be on their | 1741 % @item, @tab, @multicolumn or @endmulticolumn do not need to be on their |
2020 % own lines, but it will not hurt if they are. | 1742 % own lines, but it will not hurt if they are. |
2021 | 1743 |
2022 % Sample multitable: | 1744 % Sample multitable: |
2023 | 1745 |
2024 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | 1746 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} |
2025 % @item first col stuff @tab second col stuff @tab third col | 1747 % @item first col stuff @tab second col stuff @tab third col |
2026 % @item | 1748 % @item |
2027 % first col stuff | 1749 % first col stuff |
2028 % @tab | 1750 % @tab |
2029 % second col stuff | 1751 % second col stuff |
2030 % @tab | 1752 % @tab |
2031 % third col | 1753 % third col |
2032 % @item first col stuff @tab second col stuff | 1754 % @item first col stuff @tab second col stuff |
2033 % @tab Many paragraphs of text may be used in any column. | 1755 % @tab Many paragraphs of text may be used in any column. |
2034 % | 1756 % |
2035 % They will wrap at the width determined by the template. | 1757 % They will wrap at the width determined by the template. |
2036 % @item@tab@tab This will be in third column. | 1758 % @item@tab@tab This will be in third column. |
2037 % @end multitable | 1759 % @endmultitable |
2038 | 1760 |
2039 % Default dimensions may be reset by user. | 1761 % Default dimensions may be reset by user. |
2040 % @multitableparskip is vertical space between paragraphs in table. | 1762 % @intableparskip will set vertical space between paragraphs in table. |
2041 % @multitableparindent is paragraph indent in table. | 1763 % @intableparindent will set paragraph indent in table. |
2042 % @multitablecolmargin is horizontal space to be left between columns. | 1764 % @spacebetweencols will set horizontal space to be left between columns. |
2043 % @multitablelinespace is space to leave between table items, baseline | 1765 % @spacebetweenlines will set vertical space to be left between lines. |
2044 % to baseline. | |
2045 % 0pt means it depends on current normal line spacing. | |
2046 | 1766 |
2047 %%%% | 1767 %%%% |
2048 % Dimensions | 1768 % Dimensions |
2049 | 1769 |
2050 \newskip\multitableparskip | 1770 \newdimen\intableparskip |
2051 \newskip\multitableparindent | 1771 \newdimen\intableparindent |
2052 \newdimen\multitablecolspace | 1772 \newdimen\spacebetweencols |
2053 \newskip\multitablelinespace | 1773 \newdimen\spacebetweenlines |
2054 \multitableparskip=0pt | 1774 \intableparskip=0pt |
2055 \multitableparindent=6pt | 1775 \intableparindent=6pt |
2056 \multitablecolspace=12pt | 1776 \spacebetweencols=12pt |
2057 \multitablelinespace=0pt | 1777 \spacebetweenlines=12pt |
2058 | 1778 |
2059 %%%% | 1779 %%%% |
2060 % Macros used to set up halign preamble: | 1780 % Macros used to set up halign preamble: |
2061 \let\endsetuptable\relax | 1781 \let\endsetuptable\relax |
2062 \def\xendsetuptable{\endsetuptable} | 1782 \def\xendsetuptable{\endsetuptable} |
2063 \let\columnfractions\relax | 1783 \let\percentofhsize\relax |
2064 \def\xcolumnfractions{\columnfractions} | 1784 \def\xpercentofhsize{\percentofhsize} |
2065 \newif\ifsetpercent | 1785 \newif\ifsetpercent |
2066 | |
2067 %% 2/1/96, to allow fractions to be given with more than one digit. | |
2068 \def\pickupwholefraction#1 {\global\advance\colcount by1 % | |
2069 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% | |
2070 \setuptable} | |
2071 | 1786 |
2072 \newcount\colcount | 1787 \newcount\colcount |
2073 \def\setuptable#1{\def\firstarg{#1}% | 1788 \def\setuptable#1{\def\firstarg{#1}% |
2074 \ifx\firstarg\xendsetuptable\let\go\relax% | 1789 \ifx\firstarg\xendsetuptable\let\go\relax% |
2075 \else | 1790 \else |
2076 \ifx\firstarg\xcolumnfractions\global\setpercenttrue% | 1791 \ifx\firstarg\xpercentofhsize\global\setpercenttrue% |
2077 \else | 1792 \else |
2078 \ifsetpercent | 1793 \ifsetpercent |
2079 \let\go\pickupwholefraction % In this case arg of setuptable | 1794 \if#1.\else% |
2080 % is the decimal point before the | 1795 \global\advance\colcount by1 % |
2081 % number given in percent of hsize. | 1796 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% |
2082 % We don't need this so we don't use it. | 1797 \fi |
2083 \else | 1798 \else |
2084 \global\advance\colcount by1 | 1799 \global\advance\colcount by1 |
2085 \setbox0=\hbox{#1 }% Add a normal word space as a separator; | 1800 \setbox0=\hbox{#1}% |
2086 % typically that is always in the input, anyway. | |
2087 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% | 1801 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% |
2088 \fi% | 1802 \fi% |
2089 \fi% | 1803 \fi% |
2090 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% | 1804 \let\go\setuptable% |
2091 \fi\go} | 1805 \fi\go} |
2092 | |
2093 %%%% | 1806 %%%% |
2094 % multitable syntax | 1807 % multitable syntax |
2095 \def\tab{&\hskip1sp\relax} % 2/2/96 | 1808 \def\tab{&} |
2096 % tiny skip here makes sure this column space is | |
2097 % maintained, even if it is never used. | |
2098 | |
2099 | 1809 |
2100 %%%% | 1810 %%%% |
2101 % @multitable ... @end multitable definitions: | 1811 % @multitable ... @endmultitable definitions: |
2102 | 1812 |
2103 \def\multitable{\parsearg\dotable} | 1813 \def\multitable#1\item{\bgroup |
2104 | |
2105 \def\dotable#1{\bgroup | |
2106 \let\item\cr | 1814 \let\item\cr |
2107 \tolerance=9500 | 1815 \tolerance=9500 |
2108 \hbadness=9500 | 1816 \hbadness=9500 |
2109 \setmultitablespacing | 1817 \parskip=\intableparskip |
2110 \parskip=\multitableparskip | 1818 \parindent=\intableparindent |
2111 \parindent=\multitableparindent | |
2112 \overfullrule=0pt | 1819 \overfullrule=0pt |
2113 \global\colcount=0\relax% | 1820 \global\colcount=0\relax% |
2114 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% | 1821 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% |
2115 % To parse everything between @multitable and @item : | 1822 % To parse everything between @multitable and @item : |
2116 \setuptable#1 \endsetuptable | 1823 \def\one{#1}\expandafter\setuptable\one\endsetuptable |
2117 % Need to reset this to 0 after \setuptable. | 1824 % Need to reset this to 0 after \setuptable. |
2118 \global\colcount=0\relax% | 1825 \global\colcount=0\relax% |
2119 % | 1826 % |
2120 % This preamble sets up a generic column definition, which will | 1827 % This preamble sets up a generic column definition, which will |
2121 % be used as many times as user calls for columns. | 1828 % be used as many times as user calls for columns. |
2122 % \vtop will set a single line and will also let text wrap and | 1829 % \vtop will set a single line and will also let text wrap and |
2123 % continue for many paragraphs if desired. | 1830 % continue for many paragraphs if desired. |
2124 \halign\bgroup&\global\advance\colcount by 1\relax% | 1831 \halign\bgroup&\global\advance\colcount by 1\relax% |
2125 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname | 1832 \vtop{\hsize=\expandafter\csname col\the\colcount\endcsname |
2126 % In order to keep entries from bumping into each other | 1833 % In order to keep entries from bumping into each other |
2127 % we will add a \leftskip of \multitablecolspace to all columns after | 1834 % we will add a \leftskip of \spacebetweencols to all columns after |
2128 % the first one. | 1835 % the first one. |
2129 % If a template has been used, we will add \multitablecolspace | 1836 % If a template has been used, we will add \spacebetweencols |
2130 % to the width of each template entry. | 1837 % to the width of each template entry. |
2131 % If user has set preamble in terms of percent of \hsize | 1838 % If user has set preamble in terms of percent of \hsize |
2132 % we will use that dimension as the width of the column, and | 1839 % we will use that dimension as the width of the column, and |
2133 % the \leftskip will keep entries from bumping into each other. | 1840 % the \leftskip will keep entries from bumping into each other. |
2134 % Table will start at left margin and final column will justify at | 1841 % Table will start at left margin and final column will justify at |
2136 \ifnum\colcount=1 | 1843 \ifnum\colcount=1 |
2137 \else | 1844 \else |
2138 \ifsetpercent | 1845 \ifsetpercent |
2139 \else | 1846 \else |
2140 % If user has <not> set preamble in terms of percent of \hsize | 1847 % If user has <not> set preamble in terms of percent of \hsize |
2141 % we will advance \hsize by \multitablecolspace | 1848 % we will advance \hsize by \spacebetweencols |
2142 \advance\hsize by \multitablecolspace | 1849 \advance\hsize by \spacebetweencols |
2143 \fi | 1850 \fi |
2144 % In either case we will make \leftskip=\multitablecolspace: | 1851 % In either case we will make \leftskip=\spacebetweencols: |
2145 \leftskip=\multitablecolspace | 1852 \leftskip=\spacebetweencols |
2146 \fi | 1853 \fi |
2147 % Ignoring space at the beginning and end avoids an occasional spurious | 1854 \noindent##}\cr% |
2148 % blank line, when TeX decides to break the line at the space before the | |
2149 % box from the multistrut, so the strut ends up on a line by itself. | |
2150 % For example: | |
2151 % @multitable @columnfractions .11 .89 | |
2152 % @item @code{#} | |
2153 % @tab Legal holiday which is valid in major parts of the whole country. | |
2154 % Is automatically provided with highlighting sequences respectively marking | |
2155 % characters. | |
2156 \noindent\ignorespaces##\unskip\multistrut}\cr | |
2157 % \everycr will reset column counter, \colcount, at the end of | 1855 % \everycr will reset column counter, \colcount, at the end of |
2158 % each line. Every column entry will cause \colcount to advance by one. | 1856 % each line. Every column entry will cause \colcount to advance by one. |
2159 % The table preamble | 1857 % The table preamble |
2160 % looks at the current \colcount to find the correct column width. | 1858 % looks at the current \colcount to find the correct column width. |
2161 \global\everycr{\noalign{% | 1859 \global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines |
2162 % \filbreak%% keeps underfull box messages off when table breaks over pages. | 1860 \filbreak%% keeps underfull box messages off when table breaks over pages. |
2163 % Maybe so, but it also creates really weird page breaks when the table | 1861 \global\colcount=0\relax}}} |
2164 % breaks over pages Wouldn't \vfil be better? Wait until the problem | |
2165 % manifests itself, so it can be fixed for real --karl. | |
2166 \global\colcount=0\relax}} | |
2167 } | |
2168 | |
2169 \def\setmultitablespacing{% test to see if user has set \multitablelinespace. | |
2170 % If so, do nothing. If not, give it an appropriate dimension based on | |
2171 % current baselineskip. | |
2172 \ifdim\multitablelinespace=0pt | |
2173 %% strut to put in table in case some entry doesn't have descenders, | |
2174 %% to keep lines equally spaced | |
2175 \let\multistrut = \strut | |
2176 %% Test to see if parskip is larger than space between lines of | |
2177 %% table. If not, do nothing. | |
2178 %% If so, set to same dimension as multitablelinespace. | |
2179 \else | |
2180 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 | |
2181 width0pt\relax} \fi | |
2182 \ifdim\multitableparskip>\multitablelinespace | |
2183 \global\multitableparskip=\multitablelinespace | |
2184 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | |
2185 %% than skip between lines in the table. | |
2186 \fi% | |
2187 \ifdim\multitableparskip=0pt | |
2188 \global\multitableparskip=\multitablelinespace | |
2189 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | |
2190 %% than skip between lines in the table. | |
2191 \fi} | |
2192 | |
2193 | 1862 |
2194 \message{indexing,} | 1863 \message{indexing,} |
2195 % Index generation facilities | 1864 % Index generation facilities |
2196 | 1865 |
2197 % Define \newwrite to be identical to plain tex's \newwrite | 1866 % Define \newwrite to be identical to plain tex's \newwrite |
2201 | 1870 |
2202 % \newindex {foo} defines an index named foo. | 1871 % \newindex {foo} defines an index named foo. |
2203 % It automatically defines \fooindex such that | 1872 % It automatically defines \fooindex such that |
2204 % \fooindex ...rest of line... puts an entry in the index foo. | 1873 % \fooindex ...rest of line... puts an entry in the index foo. |
2205 % It also defines \fooindfile to be the number of the output channel for | 1874 % It also defines \fooindfile to be the number of the output channel for |
2206 % the file that accumulates this index. The file's extension is foo. | 1875 % the file that accumulates this index. The file's extension is foo. |
2207 % The name of an index should be no more than 2 characters long | 1876 % The name of an index should be no more than 2 characters long |
2208 % for the sake of vms. | 1877 % for the sake of vms. |
2209 | 1878 |
2210 \def\newindex #1{ | 1879 \def\newindex #1{ |
2211 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file | 1880 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file |
2212 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file | 1881 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file |
2213 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 1882 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
2214 \noexpand\doindex {#1}} | 1883 \noexpand\doindex {#1}} |
2215 } | 1884 } |
2216 | 1885 |
2217 % @defindex foo == \newindex{foo} | 1886 % @defindex foo == \newindex{foo} |
2218 | 1887 |
2220 | 1889 |
2221 % Define @defcodeindex, like @defindex except put all entries in @code. | 1890 % Define @defcodeindex, like @defindex except put all entries in @code. |
2222 | 1891 |
2223 \def\newcodeindex #1{ | 1892 \def\newcodeindex #1{ |
2224 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file | 1893 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file |
2225 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file | 1894 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file |
2226 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 1895 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
2227 \noexpand\docodeindex {#1}} | 1896 \noexpand\docodeindex {#1}} |
2228 } | 1897 } |
2229 | 1898 |
2230 \def\defcodeindex{\parsearg\newcodeindex} | 1899 \def\defcodeindex{\parsearg\newcodeindex} |
2231 | 1900 |
2232 % @synindex foo bar makes index foo feed into index bar. | 1901 % @synindex foo bar makes index foo feed into index bar. |
2233 % Do this instead of @defindex foo if you don't want it as a separate index. | 1902 % Do this instead of @defindex foo if you don't want it as a separate index. |
2234 \def\synindex #1 #2 {% | 1903 \def\synindex #1 #2 {% |
2235 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname | 1904 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname |
2236 \expandafter\let\csname#1indfile\endcsname=\synindexfoo | 1905 \expandafter\let\csname#1indfile\endcsname=\synindexfoo |
2237 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 1906 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
2238 \noexpand\doindex {#2}}% | 1907 \noexpand\doindex {#2}}% |
2239 } | 1908 } |
2240 | 1909 |
2241 % @syncodeindex foo bar similar, but put all entries made for index foo | 1910 % @syncodeindex foo bar similar, but put all entries made for index foo |
2242 % inside @code. | 1911 % inside @code. |
2243 \def\syncodeindex #1 #2 {% | 1912 \def\syncodeindex #1 #2 {% |
2244 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname | 1913 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname |
2245 \expandafter\let\csname#1indfile\endcsname=\synindexfoo | 1914 \expandafter\let\csname#1indfile\endcsname=\synindexfoo |
2246 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 1915 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
2247 \noexpand\docodeindex {#2}}% | 1916 \noexpand\docodeindex {#2}}% |
2248 } | 1917 } |
2249 | 1918 |
2250 % Define \doindex, the driver for all \fooindex macros. | 1919 % Define \doindex, the driver for all \fooindex macros. |
2251 % Argument #1 is generated by the calling \fooindex macro, | 1920 % Argument #1 is generated by the calling \fooindex macro, |
2289 \def\O{\realbackslash O}% | 1958 \def\O{\realbackslash O}% |
2290 \def\l{\realbackslash l}% | 1959 \def\l{\realbackslash l}% |
2291 \def\L{\realbackslash L}% | 1960 \def\L{\realbackslash L}% |
2292 \def\ss{\realbackslash ss}% | 1961 \def\ss{\realbackslash ss}% |
2293 % Take care of texinfo commands likely to appear in an index entry. | 1962 % Take care of texinfo commands likely to appear in an index entry. |
2294 % (Must be a way to avoid doing expansion at all, and thus not have to | |
2295 % laboriously list every single command here.) | |
2296 \def\@{@}% will be @@ when we switch to @ as escape char. | |
2297 %\let\{ = \lbracecmd | |
2298 %\let\} = \rbracecmd | |
2299 \def\_{{\realbackslash _}}% | 1963 \def\_{{\realbackslash _}}% |
2300 \def\w{\realbackslash w }% | 1964 \def\w{\realbackslash w }% |
2301 \def\bf{\realbackslash bf }% | 1965 \def\bf{\realbackslash bf }% |
2302 %\def\rm{\realbackslash rm }% | 1966 \def\rm{\realbackslash rm }% |
2303 \def\sl{\realbackslash sl }% | 1967 \def\sl{\realbackslash sl }% |
2304 \def\sf{\realbackslash sf}% | 1968 \def\sf{\realbackslash sf}% |
2305 \def\tt{\realbackslash tt}% | 1969 \def\tt{\realbackslash tt}% |
2306 \def\gtr{\realbackslash gtr}% | 1970 \def\gtr{\realbackslash gtr}% |
2307 \def\less{\realbackslash less}% | 1971 \def\less{\realbackslash less}% |
2308 \def\hat{\realbackslash hat}% | 1972 \def\hat{\realbackslash hat}% |
2309 %\def\char{\realbackslash char}% | 1973 \def\char{\realbackslash char}% |
2310 \def\TeX{\realbackslash TeX}% | 1974 \def\TeX{\realbackslash TeX}% |
2311 \def\dots{\realbackslash dots }% | 1975 \def\dots{\realbackslash dots }% |
2312 \def\result{\realbackslash result}% | 1976 \def\copyright{\realbackslash copyright }% |
2313 \def\equiv{\realbackslash equiv}% | |
2314 \def\expansion{\realbackslash expansion}% | |
2315 \def\print{\realbackslash print}% | |
2316 \def\error{\realbackslash error}% | |
2317 \def\point{\realbackslash point}% | |
2318 \def\copyright{\realbackslash copyright}% | |
2319 \def\tclose##1{\realbackslash tclose {##1}}% | 1977 \def\tclose##1{\realbackslash tclose {##1}}% |
2320 \def\code##1{\realbackslash code {##1}}% | 1978 \def\code##1{\realbackslash code {##1}}% |
2321 \def\dotless##1{\realbackslash dotless {##1}}% | |
2322 \def\samp##1{\realbackslash samp {##1}}% | 1979 \def\samp##1{\realbackslash samp {##1}}% |
2323 \def\,##1{\realbackslash ,{##1}}% | 1980 \def\t##1{\realbackslash r {##1}}% |
2324 \def\t##1{\realbackslash t {##1}}% | |
2325 \def\r##1{\realbackslash r {##1}}% | 1981 \def\r##1{\realbackslash r {##1}}% |
2326 \def\i##1{\realbackslash i {##1}}% | 1982 \def\i##1{\realbackslash i {##1}}% |
2327 \def\b##1{\realbackslash b {##1}}% | 1983 \def\b##1{\realbackslash b {##1}}% |
2328 \def\sc##1{\realbackslash sc {##1}}% | |
2329 \def\cite##1{\realbackslash cite {##1}}% | 1984 \def\cite##1{\realbackslash cite {##1}}% |
2330 \def\key##1{\realbackslash key {##1}}% | 1985 \def\key##1{\realbackslash key {##1}}% |
2331 \def\file##1{\realbackslash file {##1}}% | 1986 \def\file##1{\realbackslash file {##1}}% |
2332 \def\var##1{\realbackslash var {##1}}% | 1987 \def\var##1{\realbackslash var {##1}}% |
2333 \def\kbd##1{\realbackslash kbd {##1}}% | 1988 \def\kbd##1{\realbackslash kbd {##1}}% |
2334 \def\dfn##1{\realbackslash dfn {##1}}% | 1989 \def\dfn##1{\realbackslash dfn {##1}}% |
2335 \def\emph##1{\realbackslash emph {##1}}% | 1990 \def\emph##1{\realbackslash emph {##1}}% |
2336 \def\value##1{\realbackslash value {##1}}% | 1991 } |
2337 \unsepspaces | |
2338 } | |
2339 | |
2340 % If an index command is used in an @example environment, any spaces | |
2341 % therein should become regular spaces in the raw index file, not the | |
2342 % expansion of \tie (\\leavevmode \penalty \@M \ ). | |
2343 {\obeyspaces | |
2344 \gdef\unsepspaces{\obeyspaces\let =\space}} | |
2345 | 1992 |
2346 % \indexnofonts no-ops all font-change commands. | 1993 % \indexnofonts no-ops all font-change commands. |
2347 % This is used when outputting the strings to sort the index by. | 1994 % This is used when outputting the strings to sort the index by. |
2348 \def\indexdummyfont#1{#1} | 1995 \def\indexdummyfont#1{#1} |
2349 \def\indexdummytex{TeX} | 1996 \def\indexdummytex{TeX} |
2350 \def\indexdummydots{...} | 1997 \def\indexdummydots{...} |
2351 | 1998 |
2352 \def\indexnofonts{% | 1999 \def\indexnofonts{% |
2353 % Just ignore accents. | 2000 % Just ignore accents. |
2354 \let\,=\indexdummyfont | |
2355 \let\"=\indexdummyfont | 2001 \let\"=\indexdummyfont |
2356 \let\`=\indexdummyfont | 2002 \let\`=\indexdummyfont |
2357 \let\'=\indexdummyfont | 2003 \let\'=\indexdummyfont |
2358 \let\^=\indexdummyfont | 2004 \let\^=\indexdummyfont |
2359 \let\~=\indexdummyfont | 2005 \let\~=\indexdummyfont |
2362 \let\c=\indexdummyfont | 2008 \let\c=\indexdummyfont |
2363 \let\d=\indexdummyfont | 2009 \let\d=\indexdummyfont |
2364 \let\u=\indexdummyfont | 2010 \let\u=\indexdummyfont |
2365 \let\v=\indexdummyfont | 2011 \let\v=\indexdummyfont |
2366 \let\H=\indexdummyfont | 2012 \let\H=\indexdummyfont |
2367 \let\dotless=\indexdummyfont | |
2368 % Take care of the plain tex special European modified letters. | 2013 % Take care of the plain tex special European modified letters. |
2369 \def\oe{oe}% | 2014 \def\oe{oe}% |
2370 \def\ae{ae}% | 2015 \def\ae{ae}% |
2371 \def\aa{aa}% | 2016 \def\aa{aa}% |
2372 \def\OE{OE}% | 2017 \def\OE{OE}% |
2396 \let\kbd=\indexdummyfont | 2041 \let\kbd=\indexdummyfont |
2397 \let\key=\indexdummyfont | 2042 \let\key=\indexdummyfont |
2398 \let\var=\indexdummyfont | 2043 \let\var=\indexdummyfont |
2399 \let\TeX=\indexdummytex | 2044 \let\TeX=\indexdummytex |
2400 \let\dots=\indexdummydots | 2045 \let\dots=\indexdummydots |
2401 \def\@{@}% | |
2402 } | 2046 } |
2403 | 2047 |
2404 % To define \realbackslash, we must make \ not be an escape. | 2048 % To define \realbackslash, we must make \ not be an escape. |
2405 % We must first make another character (@) an escape | 2049 % We must first make another character (@) an escape |
2406 % so we do not become unable to do a definition. | 2050 % so we do not become unable to do a definition. |
2412 | 2056 |
2413 \let\SETmarginindex=\relax %initialize! | 2057 \let\SETmarginindex=\relax %initialize! |
2414 % workhorse for all \fooindexes | 2058 % workhorse for all \fooindexes |
2415 % #1 is name of index, #2 is stuff to put there | 2059 % #1 is name of index, #2 is stuff to put there |
2416 \def\doind #1#2{% | 2060 \def\doind #1#2{% |
2417 % Put the index entry in the margin if desired. | 2061 % Put the index entry in the margin if desired. |
2418 \ifx\SETmarginindex\relax\else | 2062 \ifx\SETmarginindex\relax\else% |
2419 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% | 2063 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% |
2420 \fi | 2064 \fi% |
2421 {% | 2065 {\count10=\lastpenalty % |
2422 \count255=\lastpenalty | 2066 {\indexdummies % Must do this here, since \bf, etc expand at this stage |
2423 {% | 2067 \escapechar=`\\% |
2424 \indexdummies % Must do this here, since \bf, etc expand at this stage | 2068 {\let\folio=0% Expand all macros now EXCEPT \folio |
2425 \escapechar=`\\ | 2069 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now |
2426 {% | 2070 % so it will be output as is; and it will print as backslash in the indx. |
2427 \let\folio=0% We will expand all macros now EXCEPT \folio. | 2071 % |
2428 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now | 2072 % Now process the index-string once, with all font commands turned off, |
2429 % so it will be output as is; and it will print as backslash. | 2073 % to get the string to sort the index by. |
2430 % | 2074 {\indexnofonts |
2431 % First process the index-string with all font commands turned off | 2075 \xdef\temp1{#2}% |
2432 % to get the string to sort by. | 2076 }% |
2433 {\indexnofonts \xdef\indexsorttmp{#2}}% | 2077 % Now produce the complete index entry. We process the index-string again, |
2434 % | 2078 % this time with font commands expanded, to get what to print in the index. |
2435 % Now produce the complete index entry, with both the sort key and the | 2079 \edef\temp{% |
2436 % original text, including any font commands. | 2080 \write \csname#1indfile\endcsname{% |
2437 \toks0 = {#2}% | 2081 \realbackslash entry {\temp1}{\folio}{#2}}}% |
2438 \edef\temp{% | 2082 \temp }% |
2439 \write\csname#1indfile\endcsname{% | 2083 }\penalty\count10}} |
2440 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% | |
2441 }% | |
2442 \temp | |
2443 }% | |
2444 }% | |
2445 \penalty\count255 | |
2446 }% | |
2447 } | |
2448 | 2084 |
2449 \def\dosubind #1#2#3{% | 2085 \def\dosubind #1#2#3{% |
2450 {\count10=\lastpenalty % | 2086 {\count10=\lastpenalty % |
2451 {\indexdummies % Must do this here, since \bf, etc expand at this stage | 2087 {\indexdummies % Must do this here, since \bf, etc expand at this stage |
2452 \escapechar=`\\% | 2088 \escapechar=`\\% |
2496 \gdef\cindexsub "#1" #2^^M{\endgroup % | 2132 \gdef\cindexsub "#1" #2^^M{\endgroup % |
2497 \dosubind{cp}{#2}{#1}}} | 2133 \dosubind{cp}{#2}{#1}}} |
2498 | 2134 |
2499 % Define the macros used in formatting output of the sorted index material. | 2135 % Define the macros used in formatting output of the sorted index material. |
2500 | 2136 |
2501 % @printindex causes a particular index (the ??s file) to get printed. | 2137 % This is what you call to cause a particular index to get printed. |
2502 % It does not print any chapter heading (usually an @unnumbered). | 2138 % Write |
2503 % | 2139 % @unnumbered Function Index |
2140 % @printindex fn | |
2141 | |
2504 \def\printindex{\parsearg\doprintindex} | 2142 \def\printindex{\parsearg\doprintindex} |
2505 \def\doprintindex#1{\begingroup | 2143 |
2506 \dobreak \chapheadingskip{10000}% | 2144 \def\doprintindex#1{% |
2145 \tex | |
2146 \dobreak \chapheadingskip {10000} | |
2147 \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other | |
2148 \catcode`\$=\other | |
2149 \catcode`\~=\other | |
2150 \indexbreaks | |
2507 % | 2151 % |
2508 \indexfonts \rm | 2152 % The following don't help, since the chars were translated |
2509 \tolerance = 9500 | 2153 % when the raw index was written, and their fonts were discarded |
2510 \indexbreaks | 2154 % due to \indexnofonts. |
2155 %\catcode`\"=\active | |
2156 %\catcode`\^=\active | |
2157 %\catcode`\_=\active | |
2158 %\catcode`\|=\active | |
2159 %\catcode`\<=\active | |
2160 %\catcode`\>=\active | |
2161 % % | |
2162 \def\indexbackslash{\rawbackslashxx} | |
2163 \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt | |
2164 \begindoublecolumns | |
2511 % | 2165 % |
2512 % See if the index file exists and is nonempty. | 2166 % See if the index file exists and is nonempty. |
2513 \openin 1 \jobname.#1s | 2167 \openin 1 \jobname.#1s |
2514 \ifeof 1 | 2168 \ifeof 1 |
2515 % \enddoublecolumns gets confused if there is no text in the index, | 2169 % \enddoublecolumns gets confused if there is no text in the index, |
2516 % and it loses the chapter title and the aux file entries for the | 2170 % and it loses the chapter title and the aux file entries for the |
2517 % index. The easiest way to prevent this problem is to make sure | 2171 % index. The easiest way to prevent this problem is to make sure |
2518 % there is some text. | 2172 % there is some text. |
2519 (Index is nonexistent) | 2173 (Index is nonexistent) |
2520 \else | 2174 \else |
2521 % | 2175 % |
2522 % If the index file exists but is empty, then \openin leaves \ifeof | 2176 % If the index file exists but is empty, then \openin leaves \ifeof |
2523 % false. We have to make TeX try to read something from the file, so | 2177 % false. We have to make TeX try to read something from the file, so |
2524 % it can discover if there is anything in it. | 2178 % it can discover if there is anything in it. |
2525 \read 1 to \temp | 2179 \read 1 to \temp |
2526 \ifeof 1 | 2180 \ifeof 1 |
2527 (Index is empty) | 2181 (Index is empty) |
2528 \else | 2182 \else |
2529 % Index files are almost Texinfo source, but we use \ as the escape | |
2530 % character. It would be better to use @, but that's too big a change | |
2531 % to make right now. | |
2532 \def\indexbackslash{\rawbackslashxx}% | |
2533 \catcode`\\ = 0 | |
2534 \catcode`\@ = 11 | |
2535 \escapechar = `\\ | |
2536 \begindoublecolumns | |
2537 \input \jobname.#1s | 2183 \input \jobname.#1s |
2538 \enddoublecolumns | |
2539 \fi | 2184 \fi |
2540 \fi | 2185 \fi |
2541 \closein 1 | 2186 \closein 1 |
2542 \endgroup} | 2187 \enddoublecolumns |
2188 \Etex | |
2189 } | |
2543 | 2190 |
2544 % These macros are used by the sorted index file itself. | 2191 % These macros are used by the sorted index file itself. |
2545 % Change them to control the appearance of the index. | 2192 % Change them to control the appearance of the index. |
2546 | 2193 |
2547 % Same as \bigskipamount except no shrink. | 2194 % Same as \bigskipamount except no shrink. |
2591 % parameters we've set above will have an effect. | 2238 % parameters we've set above will have an effect. |
2592 \noindent | 2239 \noindent |
2593 % | 2240 % |
2594 % Insert the text of the index entry. TeX will do line-breaking on it. | 2241 % Insert the text of the index entry. TeX will do line-breaking on it. |
2595 #1% | 2242 #1% |
2596 % The following is kludged to not output a line of dots in the index if | 2243 % The following is kluged to not output a line of dots in the index if |
2597 % there are no page numbers. The next person who breaks this will be | 2244 % there are no page numbers. The next person who breaks this will be |
2598 % cursed by a Unix daemon. | 2245 % cursed by a Unix daemon. |
2599 \def\tempa{{\rm }}% | 2246 \def\tempa{{\rm }}% |
2600 \def\tempb{#2}% | 2247 \def\tempb{#2}% |
2601 \edef\tempc{\tempa}% | 2248 \edef\tempc{\tempa}% |
2628 {\parfillskip=0in \parskip=0in | 2275 {\parfillskip=0in \parskip=0in |
2629 \hangindent =1in \hangafter=1 | 2276 \hangindent =1in \hangafter=1 |
2630 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par | 2277 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par |
2631 }} | 2278 }} |
2632 | 2279 |
2633 % Define two-column mode, which we use to typeset indexes. | 2280 %% Define two-column mode, which is used in indexes. |
2634 % Adapted from the TeXbook, page 416, which is to say, | 2281 %% Adapted from the TeXbook, page 416. |
2635 % the manmac.tex format used to print the TeXbook itself. | 2282 \catcode `\@=11 |
2636 \catcode`\@=11 | |
2637 | 2283 |
2638 \newbox\partialpage | 2284 \newbox\partialpage |
2285 | |
2639 \newdimen\doublecolumnhsize | 2286 \newdimen\doublecolumnhsize |
2640 | 2287 |
2641 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns | 2288 \def\begindoublecolumns{\begingroup |
2642 % Grab any single-column material above us. | 2289 % Grab any single-column material above us. |
2643 \output = {\global\setbox\partialpage = \vbox{% | 2290 \output = {\global\setbox\partialpage |
2644 % | 2291 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% |
2645 % Here is a possibility not foreseen in manmac: if we accumulate a | |
2646 % whole lot of material, we might end up calling this \output | |
2647 % routine twice in a row (see the doublecol-lose test, which is | |
2648 % essentially a couple of indexes with @setchapternewpage off). In | |
2649 % that case, we must prevent the second \partialpage from | |
2650 % simply overwriting the first, causing us to lose the page. | |
2651 % This will preserve it until a real output routine can ship it | |
2652 % out. Generally, \partialpage will be empty when this runs and | |
2653 % this will be a no-op. | |
2654 \unvbox\partialpage | |
2655 % | |
2656 % Unvbox the main output page. | |
2657 \unvbox255 | |
2658 \kern-\topskip \kern\baselineskip | |
2659 }}% | |
2660 \eject | 2292 \eject |
2661 % | 2293 % |
2662 % Use the double-column output routine for subsequent pages. | 2294 % Now switch to the double-column output routine. |
2663 \output = {\doublecolumnout}% | 2295 \output={\doublecolumnout}% |
2664 % | 2296 % |
2665 % Change the page size parameters. We could do this once outside this | 2297 % Change the page size parameters. We could do this once outside this |
2666 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 | 2298 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 |
2667 % format, but then we repeat the same computation. Repeating a couple | 2299 % format, but then we repeat the same computation. Repeating a couple |
2668 % of assignments once per index is clearly meaningless for the | 2300 % of assignments once per index is clearly meaningless for the |
2669 % execution time, so we may as well do it in one place. | 2301 % execution time, so we may as well do it once. |
2670 % | 2302 % |
2671 % First we halve the line length, less a little for the gutter between | 2303 % First we halve the line length, less a little for the gutter between |
2672 % the columns. We compute the gutter based on the line length, so it | 2304 % the columns. We compute the gutter based on the line length, so it |
2673 % changes automatically with the paper format. The magic constant | 2305 % changes automatically with the paper format. The magic constant |
2674 % below is chosen so that the gutter has the same value (well, +-<1pt) | 2306 % below is chosen so that the gutter has the same value (well, +- < |
2675 % as it did when we hard-coded it. | 2307 % 1pt) as it did when we hard-coded it. |
2676 % | 2308 % |
2677 % We put the result in a separate register, \doublecolumhsize, so we | 2309 % We put the result in a separate register, \doublecolumhsize, so we |
2678 % can restore it in \pagesofar, after \hsize itself has (potentially) | 2310 % can restore it in \pagesofar, after \hsize itself has (potentially) |
2679 % been clobbered. | 2311 % been clobbered. |
2680 % | 2312 % |
2684 \hsize = \doublecolumnhsize | 2316 \hsize = \doublecolumnhsize |
2685 % | 2317 % |
2686 % Double the \vsize as well. (We don't need a separate register here, | 2318 % Double the \vsize as well. (We don't need a separate register here, |
2687 % since nobody clobbers \vsize.) | 2319 % since nobody clobbers \vsize.) |
2688 \vsize = 2\vsize | 2320 \vsize = 2\vsize |
2689 } | 2321 \doublecolumnpagegoal |
2322 } | |
2323 | |
2324 \def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} | |
2325 | |
2326 \def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth | |
2327 \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage | |
2328 \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} | |
2329 \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} | |
2330 \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi | |
2331 \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi | |
2332 } | |
2333 \def\doublecolumnpagegoal{% | |
2334 \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ | |
2335 } | |
2336 \def\pagesofar{\unvbox\partialpage % | |
2337 \hsize=\doublecolumnhsize % have to restore this since output routine | |
2338 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} | |
2690 \def\doublecolumnout{% | 2339 \def\doublecolumnout{% |
2691 \splittopskip=\topskip \splitmaxdepth=\maxdepth | 2340 \setbox5=\copy255 |
2692 % Get the available space for the double columns -- the normal | 2341 {\vbadness=10000 \doublecolumnsplit} |
2693 % (undoubled) page height minus any material left over from the | 2342 \ifvbox255 |
2694 % previous page. | 2343 \setbox0=\vtop to\dimen@{\unvbox0} |
2695 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage | 2344 \setbox2=\vtop to\dimen@{\unvbox2} |
2696 % box0 will be the left-hand column, box2 the right. | 2345 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty |
2697 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ | 2346 \else |
2698 \onepageout\pagesofar | 2347 \setbox0=\vbox{\unvbox5} |
2699 \unvbox255 | 2348 \ifvbox0 |
2700 \penalty\outputpenalty | 2349 \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip |
2701 } | 2350 \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth |
2702 \def\pagesofar{% | 2351 {\vbadness=10000 |
2703 % Re-output the contents of the output page -- any previous material, | 2352 \loop \global\setbox5=\copy0 |
2704 % followed by the two boxes we just split. | 2353 \setbox1=\vsplit5 to\dimen@ |
2705 \unvbox\partialpage | 2354 \setbox3=\vsplit5 to\dimen@ |
2706 \hsize = \doublecolumnhsize | 2355 \ifvbox5 \global\advance\dimen@ by1pt \repeat |
2707 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% | 2356 \setbox0=\vbox to\dimen@{\unvbox1} |
2708 } | 2357 \setbox2=\vbox to\dimen@{\unvbox3} |
2709 \def\enddoublecolumns{% | 2358 \global\setbox\partialpage=\vbox{\pagesofar} |
2710 \output = {\balancecolumns}\eject % split what we have | 2359 \doublecolumnpagegoal |
2711 \endgroup % started in \begindoublecolumns | 2360 } |
2712 % | 2361 \fi |
2713 % Back to normal single-column typesetting, but take account of the | 2362 \fi |
2714 % fact that we just accumulated some stuff on the output page. | 2363 } |
2715 \pagegoal = \vsize | 2364 |
2716 } | 2365 \catcode `\@=\other |
2717 \def\balancecolumns{% | |
2718 % Called at the end of the double column material. | |
2719 \setbox0 = \vbox{\unvbox255}% | |
2720 \dimen@ = \ht0 | |
2721 \advance\dimen@ by \topskip | |
2722 \advance\dimen@ by-\baselineskip | |
2723 \divide\dimen@ by 2 | |
2724 \splittopskip = \topskip | |
2725 % Loop until we get a decent breakpoint. | |
2726 {\vbadness=10000 \loop | |
2727 \global\setbox3=\copy0 | |
2728 \global\setbox1=\vsplit3 to\dimen@ | |
2729 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt | |
2730 \repeat}% | |
2731 \setbox0=\vbox to\dimen@{\unvbox1}% | |
2732 \setbox2=\vbox to\dimen@{\unvbox3}% | |
2733 \pagesofar | |
2734 } | |
2735 \catcode`\@ = \other | |
2736 | |
2737 | |
2738 \message{sectioning,} | 2366 \message{sectioning,} |
2739 % Define chapters, sections, etc. | 2367 % Define chapters, sections, etc. |
2740 | 2368 |
2741 \newcount\chapno | 2369 \newcount \chapno |
2742 \newcount\secno \secno=0 | 2370 \newcount \secno \secno=0 |
2743 \newcount\subsecno \subsecno=0 | 2371 \newcount \subsecno \subsecno=0 |
2744 \newcount\subsubsecno \subsubsecno=0 | 2372 \newcount \subsubsecno \subsubsecno=0 |
2745 | 2373 |
2746 % This counter is funny since it counts through charcodes of letters A, B, ... | 2374 % This counter is funny since it counts through charcodes of letters A, B, ... |
2747 \newcount\appendixno \appendixno = `\@ | 2375 \newcount \appendixno \appendixno = `\@ |
2748 \def\appendixletter{\char\the\appendixno} | 2376 \def\appendixletter{\char\the\appendixno} |
2749 | 2377 |
2750 \newwrite\contentsfile | 2378 \newwrite \contentsfile |
2751 % This is called from \setfilename. | 2379 % This is called from \setfilename. |
2752 \def\opencontents{\openout\contentsfile = \jobname.toc } | 2380 \def\opencontents{\openout \contentsfile = \jobname.toc} |
2753 | 2381 |
2754 % Each @chapter defines this as the name of the chapter. | 2382 % Each @chapter defines this as the name of the chapter. |
2755 % page headings and footings can use it. @section does likewise | 2383 % page headings and footings can use it. @section does likewise |
2756 | 2384 |
2757 \def\thischapter{} \def\thissection{} | 2385 \def\thischapter{} \def\thissection{} |
2758 \def\seccheck#1{\ifnum \pageno<0 | 2386 \def\seccheck#1{\if \pageno<0 % |
2759 \errmessage{@#1 not allowed after generating table of contents}% | 2387 \errmessage{@#1 not allowed after generating table of contents}\fi |
2760 \fi} | 2388 % |
2389 } | |
2761 | 2390 |
2762 \def\chapternofonts{% | 2391 \def\chapternofonts{% |
2763 \let\rawbackslash=\relax | 2392 \let\rawbackslash=\relax% |
2764 \let\frenchspacing=\relax | 2393 \let\frenchspacing=\relax% |
2765 \def\result{\realbackslash result}% | 2394 \def\result{\realbackslash result} |
2766 \def\equiv{\realbackslash equiv}% | 2395 \def\equiv{\realbackslash equiv} |
2767 \def\expansion{\realbackslash expansion}% | 2396 \def\expansion{\realbackslash expansion} |
2768 \def\print{\realbackslash print}% | 2397 \def\print{\realbackslash print} |
2769 \def\TeX{\realbackslash TeX}% | 2398 \def\TeX{\realbackslash TeX} |
2770 \def\dots{\realbackslash dots}% | 2399 \def\dots{\realbackslash dots} |
2771 \def\result{\realbackslash result}% | 2400 \def\copyright{\realbackslash copyright} |
2772 \def\equiv{\realbackslash equiv}% | 2401 \def\tt{\realbackslash tt} |
2773 \def\expansion{\realbackslash expansion}% | 2402 \def\bf{\realbackslash bf } |
2774 \def\print{\realbackslash print}% | 2403 \def\w{\realbackslash w} |
2775 \def\error{\realbackslash error}% | 2404 \def\less{\realbackslash less} |
2776 \def\point{\realbackslash point}% | 2405 \def\gtr{\realbackslash gtr} |
2777 \def\copyright{\realbackslash copyright}% | 2406 \def\hat{\realbackslash hat} |
2778 \def\tt{\realbackslash tt}% | 2407 \def\char{\realbackslash char} |
2779 \def\bf{\realbackslash bf}% | 2408 \def\tclose##1{\realbackslash tclose {##1}} |
2780 \def\w{\realbackslash w}% | 2409 \def\code##1{\realbackslash code {##1}} |
2781 \def\less{\realbackslash less}% | 2410 \def\samp##1{\realbackslash samp {##1}} |
2782 \def\gtr{\realbackslash gtr}% | 2411 \def\r##1{\realbackslash r {##1}} |
2783 \def\hat{\realbackslash hat}% | 2412 \def\b##1{\realbackslash b {##1}} |
2784 \def\char{\realbackslash char}% | 2413 \def\key##1{\realbackslash key {##1}} |
2785 \def\tclose##1{\realbackslash tclose{##1}}% | 2414 \def\file##1{\realbackslash file {##1}} |
2786 \def\code##1{\realbackslash code{##1}}% | 2415 \def\kbd##1{\realbackslash kbd {##1}} |
2787 \def\samp##1{\realbackslash samp{##1}}% | 2416 % These are redefined because @smartitalic wouldn't work inside xdef. |
2788 \def\r##1{\realbackslash r{##1}}% | 2417 \def\i##1{\realbackslash i {##1}} |
2789 \def\b##1{\realbackslash b{##1}}% | 2418 \def\cite##1{\realbackslash cite {##1}} |
2790 \def\key##1{\realbackslash key{##1}}% | 2419 \def\var##1{\realbackslash var {##1}} |
2791 \def\file##1{\realbackslash file{##1}}% | 2420 \def\emph##1{\realbackslash emph {##1}} |
2792 \def\kbd##1{\realbackslash kbd{##1}}% | 2421 \def\dfn##1{\realbackslash dfn {##1}} |
2793 % These are redefined because @smartitalic wouldn't work inside xdef. | |
2794 \def\i##1{\realbackslash i{##1}}% | |
2795 \def\cite##1{\realbackslash cite{##1}}% | |
2796 \def\var##1{\realbackslash var{##1}}% | |
2797 \def\emph##1{\realbackslash emph{##1}}% | |
2798 \def\dfn##1{\realbackslash dfn{##1}}% | |
2799 } | 2422 } |
2800 | 2423 |
2801 \newcount\absseclevel % used to calculate proper heading level | 2424 \newcount\absseclevel % used to calculate proper heading level |
2802 \newcount\secbase\secbase=0 % @raise/lowersections modify this count | 2425 \newcount\secbase\secbase=0 % @raise/lowersections modify this count |
2803 | 2426 |
2880 \gdef\thischaptername{#1}% | 2503 \gdef\thischaptername{#1}% |
2881 % We don't substitute the actual chapter name into \thischapter | 2504 % We don't substitute the actual chapter name into \thischapter |
2882 % because we don't want its macros evaluated now. | 2505 % because we don't want its macros evaluated now. |
2883 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% | 2506 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% |
2884 {\chapternofonts% | 2507 {\chapternofonts% |
2885 \toks0 = {#1}% | 2508 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% |
2886 \edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}% | |
2887 \escapechar=`\\% | 2509 \escapechar=`\\% |
2888 \write \contentsfile \temp % | 2510 \write \contentsfile \temp % |
2889 \donoderef % | 2511 \donoderef % |
2890 \global\let\section = \numberedsec | 2512 \global\let\section = \numberedsec |
2891 \global\let\subsection = \numberedsubsec | 2513 \global\let\subsection = \numberedsubsec |
2900 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% | 2522 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% |
2901 \gdef\thissection{#1}% | 2523 \gdef\thissection{#1}% |
2902 \gdef\thischaptername{#1}% | 2524 \gdef\thischaptername{#1}% |
2903 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% | 2525 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% |
2904 {\chapternofonts% | 2526 {\chapternofonts% |
2905 \toks0 = {#1}% | 2527 \edef\temp{{\realbackslash chapentry |
2906 \edef\temp{{\realbackslash chapentry{\the\toks0}% | 2528 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% |
2907 {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% | |
2908 \escapechar=`\\% | 2529 \escapechar=`\\% |
2909 \write \contentsfile \temp % | 2530 \write \contentsfile \temp % |
2910 \appendixnoderef % | 2531 \appendixnoderef % |
2911 \global\let\section = \appendixsec | 2532 \global\let\section = \appendixsec |
2912 \global\let\subsection = \appendixsubsec | 2533 \global\let\subsection = \appendixsubsec |
2913 \global\let\subsubsection = \appendixsubsubsec | 2534 \global\let\subsubsection = \appendixsubsubsec |
2914 }} | 2535 }} |
2915 | 2536 |
2916 % @centerchap is like @unnumbered, but the heading is centered. | |
2917 \outer\def\centerchap{\parsearg\centerchapyyy} | |
2918 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} | |
2919 | |
2920 \outer\def\top{\parsearg\unnumberedyyy} | 2537 \outer\def\top{\parsearg\unnumberedyyy} |
2921 \outer\def\unnumbered{\parsearg\unnumberedyyy} | 2538 \outer\def\unnumbered{\parsearg\unnumberedyyy} |
2922 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz | 2539 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz |
2923 \def\unnumberedzzz #1{\seccheck{unnumbered}% | 2540 \def\unnumberedzzz #1{\seccheck{unnumbered}% |
2924 \secno=0 \subsecno=0 \subsubsecno=0 | 2541 \secno=0 \subsecno=0 \subsubsecno=0 |
2936 \toks0 = {#1}\message{(\the\toks0)}% | 2553 \toks0 = {#1}\message{(\the\toks0)}% |
2937 % | 2554 % |
2938 \unnumbchapmacro {#1}% | 2555 \unnumbchapmacro {#1}% |
2939 \gdef\thischapter{#1}\gdef\thissection{#1}% | 2556 \gdef\thischapter{#1}\gdef\thissection{#1}% |
2940 {\chapternofonts% | 2557 {\chapternofonts% |
2941 \toks0 = {#1}% | 2558 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% |
2942 \edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}% | |
2943 \escapechar=`\\% | 2559 \escapechar=`\\% |
2944 \write \contentsfile \temp % | 2560 \write \contentsfile \temp % |
2945 \unnumbnoderef % | 2561 \unnumbnoderef % |
2946 \global\let\section = \unnumberedsec | 2562 \global\let\section = \unnumberedsec |
2947 \global\let\subsection = \unnumberedsubsec | 2563 \global\let\subsection = \unnumberedsubsec |
2952 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz | 2568 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz |
2953 \def\seczzz #1{\seccheck{section}% | 2569 \def\seczzz #1{\seccheck{section}% |
2954 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | 2570 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % |
2955 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% | 2571 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% |
2956 {\chapternofonts% | 2572 {\chapternofonts% |
2957 \toks0 = {#1}% | |
2958 \edef\temp{{\realbackslash secentry % | 2573 \edef\temp{{\realbackslash secentry % |
2959 {\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}% | 2574 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% |
2960 \escapechar=`\\% | 2575 \escapechar=`\\% |
2961 \write \contentsfile \temp % | 2576 \write \contentsfile \temp % |
2962 \donoderef % | 2577 \donoderef % |
2963 \penalty 10000 % | 2578 \penalty 10000 % |
2964 }} | 2579 }} |
2965 | 2580 |
2966 \outer\def\appendixsection{\parsearg\appendixsecyyy} | 2581 \outer\def\appenixsection{\parsearg\appendixsecyyy} |
2967 \outer\def\appendixsec{\parsearg\appendixsecyyy} | 2582 \outer\def\appendixsec{\parsearg\appendixsecyyy} |
2968 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz | 2583 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz |
2969 \def\appendixsectionzzz #1{\seccheck{appendixsection}% | 2584 \def\appendixsectionzzz #1{\seccheck{appendixsection}% |
2970 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | 2585 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % |
2971 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% | 2586 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% |
2972 {\chapternofonts% | 2587 {\chapternofonts% |
2973 \toks0 = {#1}% | |
2974 \edef\temp{{\realbackslash secentry % | 2588 \edef\temp{{\realbackslash secentry % |
2975 {\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}% | 2589 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% |
2976 \escapechar=`\\% | 2590 \escapechar=`\\% |
2977 \write \contentsfile \temp % | 2591 \write \contentsfile \temp % |
2978 \appendixnoderef % | 2592 \appendixnoderef % |
2979 \penalty 10000 % | 2593 \penalty 10000 % |
2980 }} | 2594 }} |
2982 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} | 2596 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} |
2983 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz | 2597 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz |
2984 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}% | 2598 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}% |
2985 \plainsecheading {#1}\gdef\thissection{#1}% | 2599 \plainsecheading {#1}\gdef\thissection{#1}% |
2986 {\chapternofonts% | 2600 {\chapternofonts% |
2987 \toks0 = {#1}% | 2601 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% |
2988 \edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}% | |
2989 \escapechar=`\\% | 2602 \escapechar=`\\% |
2990 \write \contentsfile \temp % | 2603 \write \contentsfile \temp % |
2991 \unnumbnoderef % | 2604 \unnumbnoderef % |
2992 \penalty 10000 % | 2605 \penalty 10000 % |
2993 }} | 2606 }} |
2996 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz | 2609 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz |
2997 \def\numberedsubseczzz #1{\seccheck{subsection}% | 2610 \def\numberedsubseczzz #1{\seccheck{subsection}% |
2998 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | 2611 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % |
2999 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% | 2612 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% |
3000 {\chapternofonts% | 2613 {\chapternofonts% |
3001 \toks0 = {#1}% | |
3002 \edef\temp{{\realbackslash subsecentry % | 2614 \edef\temp{{\realbackslash subsecentry % |
3003 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% | 2615 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% |
3004 \escapechar=`\\% | 2616 \escapechar=`\\% |
3005 \write \contentsfile \temp % | 2617 \write \contentsfile \temp % |
3006 \donoderef % | 2618 \donoderef % |
3007 \penalty 10000 % | 2619 \penalty 10000 % |
3008 }} | 2620 }} |
3011 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz | 2623 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz |
3012 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}% | 2624 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}% |
3013 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | 2625 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % |
3014 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% | 2626 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% |
3015 {\chapternofonts% | 2627 {\chapternofonts% |
3016 \toks0 = {#1}% | |
3017 \edef\temp{{\realbackslash subsecentry % | 2628 \edef\temp{{\realbackslash subsecentry % |
3018 {\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% | 2629 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% |
3019 \escapechar=`\\% | 2630 \escapechar=`\\% |
3020 \write \contentsfile \temp % | 2631 \write \contentsfile \temp % |
3021 \appendixnoderef % | 2632 \appendixnoderef % |
3022 \penalty 10000 % | 2633 \penalty 10000 % |
3023 }} | 2634 }} |
3024 | 2635 |
3025 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} | 2636 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} |
3026 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | 2637 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz |
3027 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% | 2638 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% |
3028 \plainsubsecheading {#1}\gdef\thissection{#1}% | 2639 \plainsecheading {#1}\gdef\thissection{#1}% |
3029 {\chapternofonts% | 2640 {\chapternofonts% |
3030 \toks0 = {#1}% | 2641 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% |
3031 \edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}% | |
3032 \escapechar=`\\% | 2642 \escapechar=`\\% |
3033 \write \contentsfile \temp % | 2643 \write \contentsfile \temp % |
3034 \unnumbnoderef % | 2644 \unnumbnoderef % |
3035 \penalty 10000 % | 2645 \penalty 10000 % |
3036 }} | 2646 }} |
3040 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}% | 2650 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}% |
3041 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | 2651 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % |
3042 \subsubsecheading {#1} | 2652 \subsubsecheading {#1} |
3043 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | 2653 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% |
3044 {\chapternofonts% | 2654 {\chapternofonts% |
3045 \toks0 = {#1}% | 2655 \edef\temp{{\realbackslash subsubsecentry % |
3046 \edef\temp{{\realbackslash subsubsecentry{\the\toks0} | 2656 {#1} |
3047 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} | 2657 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} |
3048 {\noexpand\folio}}}% | 2658 {\noexpand\folio}}}% |
3049 \escapechar=`\\% | 2659 \escapechar=`\\% |
3050 \write \contentsfile \temp % | 2660 \write \contentsfile \temp % |
3051 \donoderef % | 2661 \donoderef % |
3057 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% | 2667 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% |
3058 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | 2668 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % |
3059 \subsubsecheading {#1} | 2669 \subsubsecheading {#1} |
3060 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | 2670 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% |
3061 {\chapternofonts% | 2671 {\chapternofonts% |
3062 \toks0 = {#1}% | 2672 \edef\temp{{\realbackslash subsubsecentry{#1}% |
3063 \edef\temp{{\realbackslash subsubsecentry{\the\toks0}% | |
3064 {\appendixletter} | 2673 {\appendixletter} |
3065 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% | 2674 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% |
3066 \escapechar=`\\% | 2675 \escapechar=`\\% |
3067 \write \contentsfile \temp % | 2676 \write \contentsfile \temp % |
3068 \appendixnoderef % | 2677 \appendixnoderef % |
3070 }} | 2679 }} |
3071 | 2680 |
3072 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} | 2681 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} |
3073 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | 2682 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz |
3074 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% | 2683 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% |
3075 \plainsubsubsecheading {#1}\gdef\thissection{#1}% | 2684 \plainsecheading {#1}\gdef\thissection{#1}% |
3076 {\chapternofonts% | 2685 {\chapternofonts% |
3077 \toks0 = {#1}% | 2686 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% |
3078 \edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}% | |
3079 \escapechar=`\\% | 2687 \escapechar=`\\% |
3080 \write \contentsfile \temp % | 2688 \write \contentsfile \temp % |
3081 \unnumbnoderef % | 2689 \unnumbnoderef % |
3082 \penalty 10000 % | 2690 \penalty 10000 % |
3083 }} | 2691 }} |
3109 | 2717 |
3110 % Define @majorheading, @heading and @subheading | 2718 % Define @majorheading, @heading and @subheading |
3111 | 2719 |
3112 % NOTE on use of \vbox for chapter headings, section headings, and | 2720 % NOTE on use of \vbox for chapter headings, section headings, and |
3113 % such: | 2721 % such: |
3114 % 1) We use \vbox rather than the earlier \line to permit | 2722 % 1) We use \vbox rather than the earlier \line to permit |
3115 % overlong headings to fold. | 2723 % overlong headings to fold. |
3116 % 2) \hyphenpenalty is set to 10000 because hyphenation in a | 2724 % 2) \hyphenpenalty is set to 10000 because hyphenation in a |
3117 % heading is obnoxious; this forbids it. | 2725 % heading is obnoxious; this forbids it. |
3118 % 3) Likewise, headings look best if no \parindent is used, and | 2726 % 3) Likewise, headings look best if no \parindent is used, and |
3119 % if justification is not attempted. Hence \raggedright. | 2727 % if justification is not attempted. Hence \raggedright. |
3120 | 2728 |
3121 | 2729 |
3122 \def\majorheading{\parsearg\majorheadingzzz} | 2730 \def\majorheading{\parsearg\majorheadingzzz} |
3130 \def\chapheadingzzz #1{\chapbreak % | 2738 \def\chapheadingzzz #1{\chapbreak % |
3131 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 2739 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3132 \parindent=0pt\raggedright | 2740 \parindent=0pt\raggedright |
3133 \rm #1\hfill}}\bigskip \par\penalty 200} | 2741 \rm #1\hfill}}\bigskip \par\penalty 200} |
3134 | 2742 |
3135 % @heading, @subheading, @subsubheading. | 2743 \def\heading{\parsearg\secheadingi} |
3136 \def\heading{\parsearg\plainsecheading} | 2744 |
3137 \def\subheading{\parsearg\plainsubsecheading} | 2745 \def\subheading{\parsearg\subsecheadingi} |
3138 \def\subsubheading{\parsearg\plainsubsubsecheading} | 2746 |
2747 \def\subsubheading{\parsearg\subsubsecheadingi} | |
3139 | 2748 |
3140 % These macros generate a chapter, section, etc. heading only | 2749 % These macros generate a chapter, section, etc. heading only |
3141 % (including whitespace, linebreaking, etc. around it), | 2750 % (including whitespace, linebreaking, etc. around it), |
3142 % given all the information in convenient, parsed form. | 2751 % given all the information in convenient, parsed form. |
3143 | 2752 |
3147 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} | 2756 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} |
3148 | 2757 |
3149 %%% Define plain chapter starts, and page on/off switching for it | 2758 %%% Define plain chapter starts, and page on/off switching for it |
3150 % Parameter controlling skip before chapter headings (if needed) | 2759 % Parameter controlling skip before chapter headings (if needed) |
3151 | 2760 |
3152 \newskip\chapheadingskip | 2761 \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt |
3153 | 2762 |
3154 \def\chapbreak{\dobreak \chapheadingskip {-4000}} | 2763 \def\chapbreak{\dobreak \chapheadingskip {-4000}} |
3155 \def\chappager{\par\vfill\supereject} | 2764 \def\chappager{\par\vfill\supereject} |
3156 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} | 2765 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} |
3157 | 2766 |
3158 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} | 2767 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} |
3159 | 2768 |
3160 \def\CHAPPAGoff{ | 2769 \def\CHAPPAGoff{ |
3161 \global\let\contentsalignmacro = \chappager | |
3162 \global\let\pchapsepmacro=\chapbreak | 2770 \global\let\pchapsepmacro=\chapbreak |
3163 \global\let\pagealignmacro=\chappager} | 2771 \global\let\pagealignmacro=\chappager} |
3164 | 2772 |
3165 \def\CHAPPAGon{ | 2773 \def\CHAPPAGon{ |
3166 \global\let\contentsalignmacro = \chappager | |
3167 \global\let\pchapsepmacro=\chappager | 2774 \global\let\pchapsepmacro=\chappager |
3168 \global\let\pagealignmacro=\chappager | 2775 \global\let\pagealignmacro=\chappager |
3169 \global\def\HEADINGSon{\HEADINGSsingle}} | 2776 \global\def\HEADINGSon{\HEADINGSsingle}} |
3170 | 2777 |
3171 \def\CHAPPAGodd{ | 2778 \def\CHAPPAGodd{ |
3172 \global\let\contentsalignmacro = \chapoddpage | |
3173 \global\let\pchapsepmacro=\chapoddpage | 2779 \global\let\pchapsepmacro=\chapoddpage |
3174 \global\let\pagealignmacro=\chapoddpage | 2780 \global\let\pagealignmacro=\chapoddpage |
3175 \global\def\HEADINGSon{\HEADINGSdouble}} | 2781 \global\def\HEADINGSon{\HEADINGSdouble}} |
3176 | 2782 |
3177 \CHAPPAGon | 2783 \CHAPPAGon |
3178 | 2784 |
3179 \def\CHAPFplain{ | 2785 \def\CHAPFplain{ |
3180 \global\let\chapmacro=\chfplain | 2786 \global\let\chapmacro=\chfplain |
3181 \global\let\unnumbchapmacro=\unnchfplain | 2787 \global\let\unnumbchapmacro=\unnchfplain} |
3182 \global\let\centerchapmacro=\centerchfplain} | 2788 |
3183 | 2789 \def\chfplain #1#2{% |
3184 % Plain chapter opening. | |
3185 % #1 is the text, #2 the chapter number or empty if unnumbered. | |
3186 \def\chfplain#1#2{% | |
3187 \pchapsepmacro | 2790 \pchapsepmacro |
3188 {% | 2791 {% |
3189 \chapfonts \rm | 2792 \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3190 \def\chapnum{#2}% | 2793 \parindent=0pt\raggedright |
3191 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% | 2794 \rm #2\enspace #1}% |
3192 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | |
3193 \hangindent = \wd0 \centerparametersmaybe | |
3194 \unhbox0 #1\par}% | |
3195 }% | 2795 }% |
3196 \nobreak\bigskip % no page break after a chapter title | 2796 \bigskip |
3197 \nobreak | 2797 \penalty5000 |
3198 } | 2798 } |
3199 | 2799 |
3200 % Plain opening for unnumbered. | 2800 \def\unnchfplain #1{% |
3201 \def\unnchfplain#1{\chfplain{#1}{}} | 2801 \pchapsepmacro % |
3202 | 2802 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3203 % @centerchap -- centered and unnumbered. | 2803 \parindent=0pt\raggedright |
3204 \let\centerparametersmaybe = \relax | 2804 \rm #1\hfill}}\bigskip \par\penalty 10000 % |
3205 \def\centerchfplain#1{{% | 2805 } |
3206 \def\centerparametersmaybe{% | |
3207 \advance\rightskip by 3\rightskip | |
3208 \leftskip = \rightskip | |
3209 \parfillskip = 0pt | |
3210 }% | |
3211 \chfplain{#1}{}% | |
3212 }} | |
3213 | |
3214 \CHAPFplain % The default | 2806 \CHAPFplain % The default |
3215 | 2807 |
3216 \def\unnchfopen #1{% | 2808 \def\unnchfopen #1{% |
3217 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 2809 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3218 \parindent=0pt\raggedright | 2810 \parindent=0pt\raggedright |
3222 \def\chfopen #1#2{\chapoddpage {\chapfonts | 2814 \def\chfopen #1#2{\chapoddpage {\chapfonts |
3223 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% | 2815 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% |
3224 \par\penalty 5000 % | 2816 \par\penalty 5000 % |
3225 } | 2817 } |
3226 | 2818 |
3227 \def\centerchfopen #1{% | |
3228 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | |
3229 \parindent=0pt | |
3230 \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % | |
3231 } | |
3232 | |
3233 \def\CHAPFopen{ | 2819 \def\CHAPFopen{ |
3234 \global\let\chapmacro=\chfopen | 2820 \global\let\chapmacro=\chfopen |
3235 \global\let\unnumbchapmacro=\unnchfopen | 2821 \global\let\unnumbchapmacro=\unnchfopen} |
3236 \global\let\centerchapmacro=\centerchfopen} | 2822 |
3237 | 2823 % Parameter controlling skip before section headings. |
3238 | 2824 |
3239 % Section titles. | 2825 \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt |
3240 \newskip\secheadingskip | 2826 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} |
2827 | |
2828 \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt | |
3241 \def\secheadingbreak{\dobreak \secheadingskip {-1000}} | 2829 \def\secheadingbreak{\dobreak \secheadingskip {-1000}} |
3242 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} | 2830 |
3243 \def\plainsecheading#1{\sectionheading{sec}{}{#1}} | 2831 % @paragraphindent is defined for the Info formatting commands only. |
3244 | 2832 \let\paragraphindent=\comment |
3245 % Subsection titles. | 2833 |
3246 \newskip \subsecheadingskip | 2834 % Section fonts are the base font at magstep2, which produces |
3247 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} | 2835 % a size a bit more than 14 points in the default situation. |
3248 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} | 2836 |
3249 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} | 2837 \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} |
3250 | 2838 \def\plainsecheading #1{\secheadingi {#1}} |
3251 % Subsubsection titles. | 2839 \def\secheadingi #1{{\advance \secheadingskip by \parskip % |
3252 \let\subsubsecheadingskip = \subsecheadingskip | 2840 \secheadingbreak}% |
3253 \let\subsubsecheadingbreak = \subsecheadingbreak | 2841 {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3254 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} | 2842 \parindent=0pt\raggedright |
3255 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} | 2843 \rm #1\hfill}}% |
3256 | 2844 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } |
3257 | 2845 |
3258 % Print any size section title. | 2846 |
3259 % | 2847 % Subsection fonts are the base font at magstep1, |
3260 % #1 is the section type (sec/subsec/subsubsec), #2 is the section | 2848 % which produces a size of 12 points. |
3261 % number (maybe empty), #3 the text. | 2849 |
3262 \def\sectionheading#1#2#3{% | 2850 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} |
3263 {% | 2851 \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % |
3264 \expandafter\advance\csname #1headingskip\endcsname by \parskip | 2852 \subsecheadingbreak}% |
3265 \csname #1headingbreak\endcsname | 2853 {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3266 }% | 2854 \parindent=0pt\raggedright |
3267 {% | 2855 \rm #1\hfill}}% |
3268 % Switch to the right set of fonts. | 2856 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } |
3269 \csname #1fonts\endcsname \rm | 2857 |
3270 % | 2858 \def\subsubsecfonts{\subsecfonts} % Maybe this should change: |
3271 % Only insert the separating space if we have a section number. | 2859 % Perhaps make sssec fonts scaled |
3272 \def\secnum{#2}% | 2860 % magstep half |
3273 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% | 2861 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} |
3274 % | 2862 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % |
3275 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | 2863 \subsecheadingbreak}% |
3276 \hangindent = \wd0 % zero if no section number | 2864 {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3277 \unhbox0 #3}% | 2865 \parindent=0pt\raggedright |
3278 }% | 2866 \rm #1\hfill}}% |
3279 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak | 2867 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} |
3280 } | |
3281 | 2868 |
3282 | 2869 |
3283 \message{toc printing,} | 2870 \message{toc printing,} |
2871 | |
3284 % Finish up the main text and prepare to read what we've written | 2872 % Finish up the main text and prepare to read what we've written |
3285 % to \contentsfile. | 2873 % to \contentsfile. |
3286 | 2874 |
3287 \newskip\contentsrightmargin \contentsrightmargin=1in | 2875 \newskip\contentsrightmargin \contentsrightmargin=1in |
3288 \def\startcontents#1{% | 2876 \def\startcontents#1{% |
3289 % If @setchapternewpage on, and @headings double, the contents should | 2877 \pagealignmacro |
3290 % start on an odd page, unlike chapters. Thus, we maintain | |
3291 % \contentsalignmacro in parallel with \pagealignmacro. | |
3292 % From: Torbjorn Granlund <tege@matematik.su.se> | |
3293 \contentsalignmacro | |
3294 \immediate\closeout \contentsfile | 2878 \immediate\closeout \contentsfile |
3295 \ifnum \pageno>0 | 2879 \ifnum \pageno>0 |
3296 \pageno = -1 % Request roman numbered pages. | 2880 \pageno = -1 % Request roman numbered pages. |
3297 \fi | 2881 \fi |
3298 % Don't need to put `Contents' or `Short Contents' in the headline. | 2882 % Don't need to put `Contents' or `Short Contents' in the headline. |
3299 % It is abundantly clear what they are. | 2883 % It is abundantly clear what they are. |
3300 \unnumbchapmacro{#1}\def\thischapter{}% | 2884 \unnumbchapmacro{#1}\def\thischapter{}% |
3301 \begingroup % Set up to handle contents files properly. | 2885 \begingroup % Set up to handle contents files properly. |
3302 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 | 2886 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 |
3303 % We can't do this, because then an actual ^ in a section | 2887 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi |
3304 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. | |
3305 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi | |
3306 \raggedbottom % Worry more about breakpoints than the bottom. | 2888 \raggedbottom % Worry more about breakpoints than the bottom. |
3307 \advance\hsize by -\contentsrightmargin % Don't use the full line length. | 2889 \advance\hsize by -\contentsrightmargin % Don't use the full line length. |
3308 } | 2890 } |
3309 | 2891 |
3310 | 2892 |
3324 \let\unnumbchapentry = \shortunnumberedentry | 2906 \let\unnumbchapentry = \shortunnumberedentry |
3325 % We want a true roman here for the page numbers. | 2907 % We want a true roman here for the page numbers. |
3326 \secfonts | 2908 \secfonts |
3327 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl | 2909 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl |
3328 \rm | 2910 \rm |
3329 \hyphenpenalty = 10000 | |
3330 \advance\baselineskip by 1pt % Open it up a little. | 2911 \advance\baselineskip by 1pt % Open it up a little. |
3331 \def\secentry ##1##2##3##4{} | 2912 \def\secentry ##1##2##3##4{} |
3332 \def\unnumbsecentry ##1##2{} | 2913 \def\unnumbsecentry ##1##2{} |
3333 \def\subsecentry ##1##2##3##4##5{} | 2914 \def\subsecentry ##1##2##3##4##5{} |
3334 \def\unnumbsubsecentry ##1##2{} | 2915 \def\unnumbsubsecentry ##1##2{} |
3368 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi | 2949 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi |
3369 % | 2950 % |
3370 % This space should be plenty, since a single number is .5em, and the | 2951 % This space should be plenty, since a single number is .5em, and the |
3371 % widest letter (M) is 1em, at least in the Computer Modern fonts. | 2952 % widest letter (M) is 1em, at least in the Computer Modern fonts. |
3372 % (This space doesn't include the extra space that gets added after | 2953 % (This space doesn't include the extra space that gets added after |
3373 % the label; that gets put in by \shortchapentry above.) | 2954 % the label; that gets put in in \shortchapentry above.) |
3374 \advance\dimen0 by 1.1em | 2955 \advance\dimen0 by 1.1em |
3375 \hbox to \dimen0{#1\hfil}% | 2956 \hbox to \dimen0{#1\hfil}% |
3376 } | 2957 } |
3377 | 2958 |
3378 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} | 2959 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} |
3389 % And subsubsections. | 2970 % And subsubsections. |
3390 \def\subsubsecentry#1#2#3#4#5#6{% | 2971 \def\subsubsecentry#1#2#3#4#5#6{% |
3391 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} | 2972 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} |
3392 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} | 2973 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} |
3393 | 2974 |
2975 | |
3394 % This parameter controls the indentation of the various levels. | 2976 % This parameter controls the indentation of the various levels. |
3395 \newdimen\tocindent \tocindent = 3pc | 2977 \newdimen\tocindent \tocindent = 3pc |
3396 | 2978 |
3397 % Now for the actual typesetting. In all these, #1 is the text and #2 is the | 2979 % Now for the actual typesetting. In all these, #1 is the text and #2 is the |
3398 % page number. | 2980 % page number. |
3399 % | 2981 % |
3400 % If the toc has to be broken over pages, we want it to be at chapters | 2982 % If the toc has to be broken over pages, we would want to be at chapters |
3401 % if at all possible; hence the \penalty. | 2983 % if at all possible; hence the \penalty. |
3402 \def\dochapentry#1#2{% | 2984 \def\dochapentry#1#2{% |
3403 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip | 2985 \penalty-300 \vskip\baselineskip |
3404 \begingroup | 2986 \begingroup |
3405 \chapentryfonts | 2987 \chapentryfonts |
3406 \tocentry{#1}{\dopageno{#2}}% | 2988 \tocentry{#1}{\dopageno{#2}}% |
3407 \endgroup | 2989 \endgroup |
3408 \nobreak\vskip .25\baselineskip plus.1\baselineskip | 2990 \nobreak\vskip .25\baselineskip |
3409 } | 2991 } |
3410 | 2992 |
3411 \def\dosecentry#1#2{\begingroup | 2993 \def\dosecentry#1#2{\begingroup |
3412 \secentryfonts \leftskip=\tocindent | 2994 \secentryfonts \leftskip=\tocindent |
3413 \tocentry{#1}{\dopageno{#2}}% | 2995 \tocentry{#1}{\dopageno{#2}}% |
3426 % Final typesetting of a toc entry; we use the same \entry macro as for | 3008 % Final typesetting of a toc entry; we use the same \entry macro as for |
3427 % the index entries, but we want to suppress hyphenation here. (We | 3009 % the index entries, but we want to suppress hyphenation here. (We |
3428 % can't do that in the \entry macro, since index entries might consist | 3010 % can't do that in the \entry macro, since index entries might consist |
3429 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) | 3011 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) |
3430 % | 3012 % |
3431 % \turnoffactive is for the sake of @" used for umlauts. | |
3432 \def\tocentry#1#2{\begingroup | 3013 \def\tocentry#1#2{\begingroup |
3433 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks | 3014 \hyphenpenalty = 10000 |
3434 \entry{\turnoffactive #1}{\turnoffactive #2}% | 3015 \entry{#1}{#2}% |
3435 \endgroup} | 3016 \endgroup} |
3436 | 3017 |
3437 % Space between chapter (or whatever) number and the title. | 3018 % Space between chapter (or whatever) number and the title. |
3438 \def\labelspace{\hskip1em \relax} | 3019 \def\labelspace{\hskip1em \relax} |
3439 | 3020 |
3452 % \tt widths. Each \tt character is 1en, so two makes it 1em. | 3033 % \tt widths. Each \tt character is 1en, so two makes it 1em. |
3453 % Furthermore, these definitions must come after we define our fonts. | 3034 % Furthermore, these definitions must come after we define our fonts. |
3454 \newbox\dblarrowbox \newbox\longdblarrowbox | 3035 \newbox\dblarrowbox \newbox\longdblarrowbox |
3455 \newbox\pushcharbox \newbox\bullbox | 3036 \newbox\pushcharbox \newbox\bullbox |
3456 \newbox\equivbox \newbox\errorbox | 3037 \newbox\equivbox \newbox\errorbox |
3038 | |
3039 \let\ptexequiv = \equiv | |
3457 | 3040 |
3458 %{\tentt | 3041 %{\tentt |
3459 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} | 3042 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} |
3460 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} | 3043 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} |
3461 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} | 3044 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} |
3463 % Adapted from the manmac format (p.420 of TeXbook) | 3046 % Adapted from the manmac format (p.420 of TeXbook) |
3464 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex | 3047 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex |
3465 % depth .1ex\hfil} | 3048 % depth .1ex\hfil} |
3466 %} | 3049 %} |
3467 | 3050 |
3468 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. | |
3469 \def\point{$\star$} | 3051 \def\point{$\star$} |
3052 | |
3470 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} | 3053 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} |
3471 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} | 3054 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} |
3472 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} | 3055 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} |
3056 | |
3473 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} | 3057 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} |
3474 | 3058 |
3475 % Adapted from the TeXbook's \boxit. | 3059 % Adapted from the TeXbook's \boxit. |
3476 {\tentt \global\dimen0 = 3em}% Width of the box. | 3060 {\tentt \global\dimen0 = 3em}% Width of the box. |
3477 \dimen2 = .55pt % Thickness of rules | 3061 \dimen2 = .55pt % Thickness of rules |
3499 \def\tex{\begingroup | 3083 \def\tex{\begingroup |
3500 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 | 3084 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 |
3501 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 | 3085 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 |
3502 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie | 3086 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie |
3503 \catcode `\%=14 | 3087 \catcode `\%=14 |
3504 \catcode 43=12 % plus | 3088 \catcode 43=12 |
3505 \catcode`\"=12 | 3089 \catcode`\"=12 |
3506 \catcode`\==12 | 3090 \catcode`\==12 |
3507 \catcode`\|=12 | 3091 \catcode`\|=12 |
3508 \catcode`\<=12 | 3092 \catcode`\<=12 |
3509 \catcode`\>=12 | 3093 \catcode`\>=12 |
3510 \escapechar=`\\ | 3094 \escapechar=`\\ |
3511 % | 3095 % |
3512 \let\,=\ptexcomma | 3096 \let\~=\ptextilde |
3513 \let\{=\ptexlbrace | 3097 \let\{=\ptexlbrace |
3514 \let\}=\ptexrbrace | 3098 \let\}=\ptexrbrace |
3515 \let\.=\ptexdot | 3099 \let\.=\ptexdot |
3516 \let\*=\ptexstar | 3100 \let\*=\ptexstar |
3517 \let\dots=\ptexdots | 3101 \let\dots=\ptexdots |
3518 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | |
3519 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% | |
3520 \def\@{@}% | 3102 \def\@{@}% |
3521 \let\bullet=\ptexbullet | 3103 \let\bullet=\ptexbullet |
3522 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext | 3104 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl |
3105 \let\L=\ptexL | |
3523 % | 3106 % |
3524 \let\Etex=\endgroup} | 3107 \let\Etex=\endgroup} |
3525 | 3108 |
3526 % Define @lisp ... @endlisp. | 3109 % Define @lisp ... @endlisp. |
3527 % @lisp does a \begingroup so it can rebind things, | 3110 % @lisp does a \begingroup so it can rebind things, |
3576 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth | 3159 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth |
3577 \def\ctr{{\hskip 6pt\circle\char'010}} | 3160 \def\ctr{{\hskip 6pt\circle\char'010}} |
3578 \def\cbl{{\circle\char'012\hskip -6pt}} | 3161 \def\cbl{{\circle\char'012\hskip -6pt}} |
3579 \def\cbr{{\hskip 6pt\circle\char'011}} | 3162 \def\cbr{{\hskip 6pt\circle\char'011}} |
3580 \def\carttop{\hbox to \cartouter{\hskip\lskip | 3163 \def\carttop{\hbox to \cartouter{\hskip\lskip |
3581 \ctl\leaders\hrule height\circthick\hfil\ctr | 3164 \ctl\leaders\hrule height\circthick\hfil\ctr |
3582 \hskip\rskip}} | 3165 \hskip\rskip}} |
3583 \def\cartbot{\hbox to \cartouter{\hskip\lskip | 3166 \def\cartbot{\hbox to \cartouter{\hskip\lskip |
3584 \cbl\leaders\hrule height\circthick\hfil\cbr | 3167 \cbl\leaders\hrule height\circthick\hfil\cbr |
3585 \hskip\rskip}} | 3168 \hskip\rskip}} |
3586 % | 3169 % |
3587 \newskip\lskip\newskip\rskip | 3170 \newskip\lskip\newskip\rskip |
3588 | 3171 |
3589 \long\def\cartouche{% | 3172 \long\def\cartouche{% |
3590 \begingroup | 3173 \begingroup |
3591 \lskip=\leftskip \rskip=\rightskip | 3174 \lskip=\leftskip \rskip=\rightskip |
3592 \leftskip=0pt\rightskip=0pt %we want these *outside*. | 3175 \leftskip=0pt\rightskip=0pt %we want these *outside*. |
3593 \cartinner=\hsize \advance\cartinner by-\lskip | 3176 \cartinner=\hsize \advance\cartinner by-\lskip |
3594 \advance\cartinner by-\rskip | 3177 \advance\cartinner by-\rskip |
3595 \cartouter=\hsize | 3178 \cartouter=\hsize |
3596 \advance\cartouter by 18pt % allow for 3pt kerns on either | 3179 \advance\cartouter by 18pt % allow for 3pt kerns on either |
3597 % side, and for 6pt waste from | 3180 % side, and for 6pt waste from |
3598 % each corner char | 3181 % each corner char |
3599 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip | 3182 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip |
3600 % Flag to tell @lisp, etc., not to narrow margin. | 3183 % Flag to tell @lisp, etc., not to narrow margin. |
3601 \let\nonarrowing=\comment | 3184 \let\nonarrowing=\comment |
3602 \vbox\bgroup | 3185 \vbox\bgroup |
3603 \baselineskip=0pt\parskip=0pt\lineskip=0pt | 3186 \baselineskip=0pt\parskip=0pt\lineskip=0pt |
3604 \carttop | 3187 \carttop |
3605 \hbox\bgroup | 3188 \hbox\bgroup |
3606 \hskip\lskip | 3189 \hskip\lskip |
3607 \vrule\kern3pt | 3190 \vrule\kern3pt |
3608 \vbox\bgroup | 3191 \vbox\bgroup |
3609 \hsize=\cartinner | 3192 \hsize=\cartinner |
3610 \kern3pt | 3193 \kern3pt |
3611 \begingroup | 3194 \begingroup |
3612 \baselineskip=\normbskip | 3195 \baselineskip=\normbskip |
3613 \lineskip=\normlskip | 3196 \lineskip=\normlskip |
3614 \parskip=\normpskip | 3197 \parskip=\normpskip |
3615 \vskip -\parskip | 3198 \vskip -\parskip |
3616 \def\Ecartouche{% | 3199 \def\Ecartouche{% |
3617 \endgroup | 3200 \endgroup |
3618 \kern3pt | 3201 \kern3pt |
3619 \egroup | 3202 \egroup |
3620 \kern3pt\vrule | 3203 \kern3pt\vrule |
3621 \hskip\rskip | 3204 \hskip\rskip |
3622 \egroup | 3205 \egroup |
3623 \cartbot | 3206 \cartbot |
3624 \egroup | 3207 \egroup |
3625 \endgroup | 3208 \endgroup |
3626 }} | 3209 }} |
3627 | 3210 |
3628 | 3211 |
3629 % This macro is called at the beginning of all the @example variants, | 3212 % This macro is called at the beginning of all the @example variants, |
3655 % will be inserted at the beginning of the next paragraph in the | 3238 % will be inserted at the beginning of the next paragraph in the |
3656 % document, after the environment. | 3239 % document, after the environment. |
3657 % | 3240 % |
3658 \def\nonfillfinish{\afterenvbreak\endgroup}% | 3241 \def\nonfillfinish{\afterenvbreak\endgroup}% |
3659 | 3242 |
3243 % This macro is | |
3660 \def\lisp{\begingroup | 3244 \def\lisp{\begingroup |
3661 \nonfillstart | 3245 \nonfillstart |
3662 \let\Elisp = \nonfillfinish | 3246 \let\Elisp = \nonfillfinish |
3663 \tt | 3247 \tt |
3664 % Make @kbd do something special, if requested. | |
3665 \let\kbdfont\kbdexamplefont | |
3666 \rawbackslash % have \ input char produce \ char from current font | 3248 \rawbackslash % have \ input char produce \ char from current font |
3667 \gobble | 3249 \gobble |
3668 } | 3250 } |
3669 | 3251 |
3670 % Define the \E... control sequence only if we are inside the | 3252 % Define the \E... control sequence only if we are inside the |
3683 \def\smalllispx{\begingroup | 3265 \def\smalllispx{\begingroup |
3684 \nonfillstart | 3266 \nonfillstart |
3685 \let\Esmalllisp = \nonfillfinish | 3267 \let\Esmalllisp = \nonfillfinish |
3686 \let\Esmallexample = \nonfillfinish | 3268 \let\Esmallexample = \nonfillfinish |
3687 % | 3269 % |
3688 % Smaller fonts for small examples. | 3270 % Smaller interline space and fonts for small examples. |
3271 \setleading{10pt}% | |
3689 \indexfonts \tt | 3272 \indexfonts \tt |
3690 \rawbackslash % make \ output the \ character from the current font (tt) | 3273 \rawbackslash % make \ output the \ character from the current font (tt) |
3691 \gobble | 3274 \gobble |
3692 } | 3275 } |
3693 | 3276 |
3778 % but make & act ordinary (given that it's active). | 3361 % but make & act ordinary (given that it's active). |
3779 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} | 3362 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} |
3780 | 3363 |
3781 % Definitions of (, ) and & used in args for functions. | 3364 % Definitions of (, ) and & used in args for functions. |
3782 % This is the definition of ( outside of all parentheses. | 3365 % This is the definition of ( outside of all parentheses. |
3783 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested | 3366 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % |
3784 \global\advance\parencount by 1 | 3367 \global\advance\parencount by 1 } |
3785 } | |
3786 % | 3368 % |
3787 % This is the definition of ( when already inside a level of parens. | 3369 % This is the definition of ( when already inside a level of parens. |
3788 \gdef\opnested{\char`\(\global\advance\parencount by 1 } | 3370 \gdef\opnested{\char`\(\global\advance\parencount by 1 } |
3789 % | 3371 % |
3790 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. | 3372 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. |
3791 % also in that case restore the outer-level definition of (. | 3373 % also in that case restore the outer-level definition of (. |
3792 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi | 3374 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi |
3793 \global\advance \parencount by -1 } | 3375 \global\advance \parencount by -1 } |
3794 % If we encounter &foo, then turn on ()-hacking afterwards | 3376 % If we encounter &foo, then turn on ()-hacking afterwards |
3795 \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } | 3377 \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } |
3796 % | 3378 % |
3797 \gdef\normalparens{\boldbrax\let&=\ampnr} | 3379 \gdef\normalparens{\boldbrax\let&=\ampnr} |
3798 } % End of definition inside \activeparens | 3380 } % End of definition inside \activeparens |
3799 %% These parens (in \boldbrax) actually are a little bolder than the | 3381 %% These parens (in \boldbrax) actually are a little bolder than the |
3800 %% contained text. This is especially needed for [ and ] | 3382 %% contained text. This is especially needed for [ and ] |
3801 \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } | 3383 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} |
3802 \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } | 3384 \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} |
3803 \def\ampnr{\&} | |
3804 \def\lbrb{{\bf\char`\[}} | |
3805 \def\rbrb{{\bf\char`\]}} | |
3806 | 3385 |
3807 % First, defname, which formats the header line itself. | 3386 % First, defname, which formats the header line itself. |
3808 % #1 should be the function name. | 3387 % #1 should be the function name. |
3809 % #2 should be the type of definition, such as "Function". | 3388 % #2 should be the type of definition, such as "Function". |
3810 | 3389 |
3893 \catcode 61=\active % | 3472 \catcode 61=\active % |
3894 \obeylines\spacesplit#3} | 3473 \obeylines\spacesplit#3} |
3895 | 3474 |
3896 % This is used for \def{tp,vr}parsebody. It could probably be used for | 3475 % This is used for \def{tp,vr}parsebody. It could probably be used for |
3897 % some of the others, too, with some judicious conditionals. | 3476 % some of the others, too, with some judicious conditionals. |
3898 % | 3477 % |
3899 \def\parsebodycommon#1#2#3{% | 3478 \def\parsebodycommon#1#2#3{% |
3900 \begingroup\inENV % | 3479 \begingroup\inENV % |
3901 \medbreak % | 3480 \medbreak % |
3902 % Define the end token that this defining construct specifies | 3481 % Define the end token that this defining construct specifies |
3903 % so that it will exit this group. | 3482 % so that it will exit this group. |
3927 \parsebodycommon{#1}{#2}{#3}% | 3506 \parsebodycommon{#1}{#2}{#3}% |
3928 \spacesplit{\parsetpheaderline{#3{#4}}}\empty | 3507 \spacesplit{\parsetpheaderline{#3{#4}}}\empty |
3929 } | 3508 } |
3930 | 3509 |
3931 % Fine, but then we have to eventually remove the \empty *and* the | 3510 % Fine, but then we have to eventually remove the \empty *and* the |
3932 % braces (if any). That's what this does. | 3511 % braces (if any). That's what this does, putting the result in \tptemp. |
3933 % | 3512 % |
3934 \def\removeemptybraces\empty#1\relax{#1} | 3513 \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% |
3935 | 3514 |
3936 % After \spacesplit has done its work, this is called -- #1 is the final | 3515 % After \spacesplit has done its work, this is called -- #1 is the final |
3937 % thing to call, #2 the type name (which starts with \empty), and #3 | 3516 % thing to call, #2 the type name (which starts with \empty), and #3 |
3938 % (which might be empty) the arguments. | 3517 % (which might be empty) the arguments. |
3939 % | 3518 % |
3940 \def\parsetpheaderline#1#2#3{% | 3519 \def\parsetpheaderline#1#2#3{% |
3941 #1{\removeemptybraces#2\relax}{#3}% | 3520 \removeemptybraces#2\relax |
3521 #1{\tptemp}{#3}% | |
3942 }% | 3522 }% |
3943 | 3523 |
3944 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % | 3524 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % |
3945 \medbreak % | 3525 \medbreak % |
3946 % Define the end token that this defining construct specifies | 3526 % Define the end token that this defining construct specifies |
3977 % Expand, preventing hyphenation at `-' chars. | 3557 % Expand, preventing hyphenation at `-' chars. |
3978 % Note that groups don't affect changes in \hyphenchar. | 3558 % Note that groups don't affect changes in \hyphenchar. |
3979 \hyphenchar\tensl=0 | 3559 \hyphenchar\tensl=0 |
3980 #1% | 3560 #1% |
3981 \hyphenchar\tensl=45 | 3561 \hyphenchar\tensl=45 |
3982 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% | 3562 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% |
3983 \interlinepenalty=10000 | 3563 \interlinepenalty=10000 |
3984 \advance\rightskip by 0pt plus 1fil | 3564 \advance\rightskip by 0pt plus 1fil |
3985 \endgraf\penalty 10000\vskip -\parskip\penalty 10000% | 3565 \endgraf\penalty 10000\vskip -\parskip\penalty 10000% |
3986 } | 3566 } |
3987 | 3567 |
4078 \def\deffnx #1 {\errmessage{@deffnx in invalid context}} | 3658 \def\deffnx #1 {\errmessage{@deffnx in invalid context}} |
4079 \def\defunx #1 {\errmessage{@defunx in invalid context}} | 3659 \def\defunx #1 {\errmessage{@defunx in invalid context}} |
4080 \def\defmacx #1 {\errmessage{@defmacx in invalid context}} | 3660 \def\defmacx #1 {\errmessage{@defmacx in invalid context}} |
4081 \def\defspecx #1 {\errmessage{@defspecx in invalid context}} | 3661 \def\defspecx #1 {\errmessage{@defspecx in invalid context}} |
4082 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} | 3662 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} |
4083 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} | |
4084 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} | 3663 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} |
4085 | 3664 |
4086 % @defmethod, and so on | 3665 % @defmethod, and so on |
4087 | 3666 |
4088 % @defop {Funny Method} foo-class frobnicate argument | 3667 % @defop {Funny Method} foo-class frobnicate argument |
4092 | 3671 |
4093 \def\defopheader #1#2#3{% | 3672 \def\defopheader #1#2#3{% |
4094 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index | 3673 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index |
4095 \begingroup\defname {#2}{\defoptype{} on #1}% | 3674 \begingroup\defname {#2}{\defoptype{} on #1}% |
4096 \defunargs {#3}\endgroup % | 3675 \defunargs {#3}\endgroup % |
4097 } | |
4098 | |
4099 % @deftypemethod foo-class return-type foo-method args | |
4100 % | |
4101 \def\deftypemethod{% | |
4102 \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} | |
4103 % | |
4104 % #1 is the class name, #2 the data type, #3 the method name, #4 the args. | |
4105 \def\deftypemethodheader#1#2#3#4{% | |
4106 \deftypefnheaderx{Method on #1}{#2}#3 #4\relax | |
4107 } | 3676 } |
4108 | 3677 |
4109 % @defmethod == @defop Method | 3678 % @defmethod == @defop Method |
4110 | 3679 |
4111 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} | 3680 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} |
4181 | 3750 |
4182 % @deftypevar int foobar | 3751 % @deftypevar int foobar |
4183 | 3752 |
4184 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} | 3753 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} |
4185 | 3754 |
4186 % #1 is the data type. #2 is the name, perhaps followed by text that | 3755 % #1 is the data type. #2 is the name. |
4187 % is actually part of the data type, which should not be put into the index. | |
4188 \def\deftypevarheader #1#2{% | 3756 \def\deftypevarheader #1#2{% |
4189 \dovarind#2 \relax% Make entry in variables index | 3757 \doind {vr}{\code{#2}}% Make entry in variables index |
4190 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% | 3758 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% |
4191 \interlinepenalty=10000 | 3759 \interlinepenalty=10000 |
4192 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 | 3760 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 |
4193 \endgroup} | 3761 \endgroup} |
4194 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} | |
4195 | 3762 |
4196 % @deftypevr {Global Flag} int enable | 3763 % @deftypevr {Global Flag} int enable |
4197 | 3764 |
4198 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} | 3765 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} |
4199 | 3766 |
4200 \def\deftypevrheader #1#2#3{\dovarind#3 \relax% | 3767 \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% |
4201 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} | 3768 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} |
4202 \interlinepenalty=10000 | 3769 \interlinepenalty=10000 |
4203 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 | 3770 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 |
4204 \endgroup} | 3771 \endgroup} |
4205 | 3772 |
4227 % This definition is run if you use @deftpx, etc | 3794 % This definition is run if you use @deftpx, etc |
4228 % anywhere other than immediately after a @deftp, etc. | 3795 % anywhere other than immediately after a @deftp, etc. |
4229 | 3796 |
4230 \def\deftpx #1 {\errmessage{@deftpx in invalid context}} | 3797 \def\deftpx #1 {\errmessage{@deftpx in invalid context}} |
4231 | 3798 |
4232 | |
4233 \message{cross reference,} | 3799 \message{cross reference,} |
4234 % Define cross-reference macros | 3800 % Define cross-reference macros |
4235 \newwrite \auxfile | 3801 \newwrite \auxfile |
4236 | 3802 |
4237 \newif\ifhavexrefs % True if xref values are known. | 3803 \newif\ifhavexrefs % True if xref values are known. |
4238 \newif\ifwarnedxrefs % True if we warned once that they aren't known. | 3804 \newif\ifwarnedxrefs % True if we warned once that they aren't known. |
4239 | |
4240 % @inforef is simple. | |
4241 \def\inforef #1{\inforefzzz #1,,,,**} | |
4242 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | |
4243 node \samp{\ignorespaces#1{}}} | |
4244 | 3805 |
4245 % \setref{foo} defines a cross-reference point named foo. | 3806 % \setref{foo} defines a cross-reference point named foo. |
4246 | 3807 |
4247 \def\setref#1{% | 3808 \def\setref#1{% |
4248 \dosetq{#1-title}{Ytitle}% | 3809 \dosetq{#1-title}{Ytitle}% |
4273 \def\printednodename{\ignorespaces #3}% | 3834 \def\printednodename{\ignorespaces #3}% |
4274 \setbox1=\hbox{\printedmanual}% | 3835 \setbox1=\hbox{\printedmanual}% |
4275 \setbox0=\hbox{\printednodename}% | 3836 \setbox0=\hbox{\printednodename}% |
4276 \ifdim \wd0 = 0pt | 3837 \ifdim \wd0 = 0pt |
4277 % No printed node name was explicitly given. | 3838 % No printed node name was explicitly given. |
4278 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax | 3839 \ifx\SETxref-automatic-section-title\relax % |
4279 % Use the node name inside the square brackets. | |
4280 \def\printednodename{\ignorespaces #1}% | |
4281 \else | |
4282 % Use the actual chapter/section title appear inside | 3840 % Use the actual chapter/section title appear inside |
4283 % the square brackets. Use the real section title if we have it. | 3841 % the square brackets. Use the real section title if we have it. |
4284 \ifdim \wd1>0pt% | 3842 \ifdim \wd1>0pt% |
4285 % It is in another manual, so we don't have it. | 3843 % It is in another manual, so we don't have it. |
4286 \def\printednodename{\ignorespaces #1}% | 3844 \def\printednodename{\ignorespaces #1}% |
4287 \else | 3845 \else |
4288 \ifhavexrefs | 3846 \ifhavexrefs |
4289 % We know the real title if we have the xref values. | 3847 % We know the real title if we have the xref values. |
4290 \def\printednodename{\refx{#1-title}{}}% | 3848 \def\printednodename{\refx{#1-title}}% |
4291 \else | 3849 \else |
4292 % Otherwise just copy the Info node name. | 3850 % Otherwise just copy the Info node name. |
4293 \def\printednodename{\ignorespaces #1}% | 3851 \def\printednodename{\ignorespaces #1}% |
4294 \fi% | 3852 \fi% |
4295 \fi | 3853 \fi |
3854 \def\printednodename{#1-title}% | |
3855 \else | |
3856 % Use the node name inside the square brackets. | |
3857 \def\printednodename{\ignorespaces #1}% | |
4296 \fi | 3858 \fi |
4297 \fi | 3859 \fi |
4298 % | 3860 % |
4299 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not | 3861 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not |
4300 % insert empty discretionaries after hyphens, which means that it will | 3862 % insert empty discretionaries after hyphens, which means that it will |
4318 | 3880 |
4319 % \dosetq is the interface for calls from other macros | 3881 % \dosetq is the interface for calls from other macros |
4320 | 3882 |
4321 % Use \turnoffactive so that punctuation chars such as underscore | 3883 % Use \turnoffactive so that punctuation chars such as underscore |
4322 % work in node names. | 3884 % work in node names. |
4323 \def\dosetq #1#2{{\let\folio=0 \turnoffactive | 3885 \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% |
4324 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% | 3886 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% |
4325 \next}} | 3887 \next}} |
4326 | 3888 |
4327 % \internalsetq {foo}{page} expands into | 3889 % \internalsetq {foo}{page} expands into |
4328 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} | 3890 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} |
4387 \csname X#1\endcsname | 3949 \csname X#1\endcsname |
4388 \fi | 3950 \fi |
4389 #2% Output the suffix in any case. | 3951 #2% Output the suffix in any case. |
4390 } | 3952 } |
4391 | 3953 |
3954 % Read the last existing aux file, if any. No error if none exists. | |
3955 | |
4392 % This is the macro invoked by entries in the aux file. | 3956 % This is the macro invoked by entries in the aux file. |
4393 \def\xrdef #1#2{{% | 3957 \def\xrdef #1#2{ |
4394 \catcode`\'=\other | 3958 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} |
4395 \expandafter\gdef\csname X#1\endcsname{#2}% | 3959 |
4396 }} | 3960 \def\readauxfile{% |
4397 | 3961 \begingroup |
4398 % Read the last existing aux file, if any. No error if none exists. | 3962 \catcode `\^^@=\other |
4399 \def\readauxfile{\begingroup | 3963 \catcode `\=\other |
4400 \catcode`\^^@=\other | 3964 \catcode `\=\other |
4401 \catcode`\^^A=\other | 3965 \catcode `\^^C=\other |
4402 \catcode`\^^B=\other | 3966 \catcode `\^^D=\other |
4403 \catcode`\^^C=\other | 3967 \catcode `\^^E=\other |
4404 \catcode`\^^D=\other | 3968 \catcode `\^^F=\other |
4405 \catcode`\^^E=\other | 3969 \catcode `\^^G=\other |
4406 \catcode`\^^F=\other | 3970 \catcode `\^^H=\other |
4407 \catcode`\^^G=\other | 3971 \catcode `\=\other |
4408 \catcode`\^^H=\other | 3972 \catcode `\^^L=\other |
4409 \catcode`\^^K=\other | 3973 \catcode `\=\other |
4410 \catcode`\^^L=\other | 3974 \catcode `\=\other |
4411 \catcode`\^^N=\other | 3975 \catcode `\=\other |
4412 \catcode`\^^P=\other | 3976 \catcode `\=\other |
4413 \catcode`\^^Q=\other | 3977 \catcode `\=\other |
4414 \catcode`\^^R=\other | 3978 \catcode `\=\other |
4415 \catcode`\^^S=\other | 3979 \catcode `\=\other |
4416 \catcode`\^^T=\other | 3980 \catcode `\=\other |
4417 \catcode`\^^U=\other | 3981 \catcode `\=\other |
4418 \catcode`\^^V=\other | 3982 \catcode `\=\other |
4419 \catcode`\^^W=\other | 3983 \catcode `\=\other |
4420 \catcode`\^^X=\other | 3984 \catcode `\=\other |
4421 \catcode`\^^Z=\other | 3985 \catcode 26=\other |
4422 \catcode`\^^[=\other | 3986 \catcode `\^^[=\other |
4423 \catcode`\^^\=\other | 3987 \catcode `\^^\=\other |
4424 \catcode`\^^]=\other | 3988 \catcode `\^^]=\other |
4425 \catcode`\^^^=\other | 3989 \catcode `\^^^=\other |
4426 \catcode`\^^_=\other | 3990 \catcode `\^^_=\other |
4427 \catcode`\@=\other | 3991 \catcode `\@=\other |
4428 \catcode`\^=\other | 3992 \catcode `\^=\other |
4429 % It was suggested to define this as 7, which would allow ^^e4 etc. | 3993 \catcode `\~=\other |
4430 % in xref tags, i.e., node names. But since ^^e4 notation isn't | 3994 \catcode `\[=\other |
4431 % supported in the main text, it doesn't seem desirable. Furthermore, | 3995 \catcode `\]=\other |
4432 % that is not enough: for node names that actually contain a ^ | 3996 \catcode`\"=\other |
4433 % character, we would end up writing a line like this: 'xrdef {'hat | 3997 \catcode`\_=\other |
4434 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first | 3998 \catcode`\|=\other |
4435 % argument, and \hat is not an expandable control sequence. It could | 3999 \catcode`\<=\other |
4436 % all be worked out, but why? Either we support ^^ or we don't. | 4000 \catcode`\>=\other |
4437 % | 4001 \catcode `\$=\other |
4438 % The other change necessary for this was to define \auxhat: | 4002 \catcode `\#=\other |
4439 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter | 4003 \catcode `\&=\other |
4440 % and then to call \auxhat in \setq. | 4004 % `\+ does not work, so use 43. |
4441 % | 4005 \catcode 43=\other |
4442 \catcode`\~=\other | 4006 % Make the characters 128-255 be printing characters |
4443 \catcode`\[=\other | 4007 {% |
4444 \catcode`\]=\other | 4008 \count 1=128 |
4445 \catcode`\"=\other | 4009 \def\loop{% |
4446 \catcode`\_=\other | 4010 \catcode\count 1=\other |
4447 \catcode`\|=\other | 4011 \advance\count 1 by 1 |
4448 \catcode`\<=\other | 4012 \ifnum \count 1<256 \loop \fi |
4449 \catcode`\>=\other | |
4450 \catcode`\$=\other | |
4451 \catcode`\#=\other | |
4452 \catcode`\&=\other | |
4453 % `\+ does not work, so use 43. | |
4454 \catcode43=\other | |
4455 % Make the characters 128-255 be printing characters | |
4456 {% | |
4457 \count 1=128 | |
4458 \def\loop{% | |
4459 \catcode\count 1=\other | |
4460 \advance\count 1 by 1 | |
4461 \ifnum \count 1<256 \loop \fi | |
4462 }% | |
4463 }% | 4013 }% |
4464 % The aux file uses ' as the escape (for now). | 4014 }% |
4465 % Turn off \ as an escape so we do not lose on | 4015 % the aux file uses ' as the escape. |
4466 % entries which were dumped with control sequences in their names. | 4016 % Turn off \ as an escape so we do not lose on |
4467 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ | 4017 % entries which were dumped with control sequences in their names. |
4468 % Reference to such entries still does not work the way one would wish, | 4018 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ |
4469 % but at least they do not bomb out when the aux file is read in. | 4019 % Reference to such entries still does not work the way one would wish, |
4470 \catcode`\{=1 | 4020 % but at least they do not bomb out when the aux file is read in. |
4471 \catcode`\}=2 | 4021 \catcode `\{=1 \catcode `\}=2 |
4472 \catcode`\%=\other | 4022 \catcode `\%=\other |
4473 \catcode`\'=0 | 4023 \catcode `\'=0 |
4474 \catcode`\\=\other | 4024 \catcode`\^=7 % to make ^^e4 etc usable in xref tags |
4475 % | 4025 \catcode `\\=\other |
4476 \openin 1 \jobname.aux | 4026 \openin 1 \jobname.aux |
4477 \ifeof 1 \else | 4027 \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue |
4478 \closein 1 | 4028 \global\warnedobstrue |
4479 \input \jobname.aux | 4029 \fi |
4480 \global\havexrefstrue | 4030 % Open the new aux file. Tex will close it automatically at exit. |
4481 \global\warnedobstrue | 4031 \openout \auxfile=\jobname.aux |
4482 \fi | |
4483 % Open the new aux file. TeX will close it automatically at exit. | |
4484 \openout\auxfile=\jobname.aux | |
4485 \endgroup} | 4032 \endgroup} |
4486 | 4033 |
4487 | 4034 |
4488 % Footnotes. | 4035 % Footnotes. |
4489 | 4036 |
4490 \newcount \footnoteno | 4037 \newcount \footnoteno |
4491 | 4038 |
4492 % The trailing space in the following definition for supereject is | 4039 % The trailing space in the following definition for supereject is |
4493 % vital for proper filling; pages come out unaligned when you do a | 4040 % vital for proper filling; pages come out unaligned when you do a |
4494 % pagealignmacro call if that space before the closing brace is | 4041 % pagealignmacro call if that space before the closing brace is |
4495 % removed. (Generally, numeric constants should always be followed by a | 4042 % removed. |
4496 % space to prevent strange expansion errors.) | |
4497 \def\supereject{\par\penalty -20000\footnoteno =0 } | 4043 \def\supereject{\par\penalty -20000\footnoteno =0 } |
4498 | 4044 |
4499 % @footnotestyle is meaningful for info output only. | 4045 % @footnotestyle is meaningful for info output only.. |
4500 \let\footnotestyle=\comment | 4046 \let\footnotestyle=\comment |
4501 | 4047 |
4502 \let\ptexfootnote=\footnote | 4048 \let\ptexfootnote=\footnote |
4503 | 4049 |
4504 {\catcode `\@=11 | 4050 {\catcode `\@=11 |
4520 }% | 4066 }% |
4521 | 4067 |
4522 % Don't bother with the trickery in plain.tex to not require the | 4068 % Don't bother with the trickery in plain.tex to not require the |
4523 % footnote text as a parameter. Our footnotes don't need to be so general. | 4069 % footnote text as a parameter. Our footnotes don't need to be so general. |
4524 % | 4070 % |
4525 % Oh yes, they do; otherwise, @ifset and anything else that uses | 4071 \long\gdef\footnotezzz#1{\insert\footins{% |
4526 % \parseargline fail inside footnotes because the tokens are fixed when | |
4527 % the footnote is read. --karl, 16nov96. | |
4528 % | |
4529 \long\gdef\footnotezzz{\insert\footins\bgroup | |
4530 % We want to typeset this text as a normal paragraph, even if the | 4072 % We want to typeset this text as a normal paragraph, even if the |
4531 % footnote reference occurs in (for example) a display environment. | 4073 % footnote reference occurs in (for example) a display environment. |
4532 % So reset some parameters. | 4074 % So reset some parameters. |
4533 \interlinepenalty\interfootnotelinepenalty | 4075 \interlinepenalty\interfootnotelinepenalty |
4534 \splittopskip\ht\strutbox % top baseline for broken footnotes | 4076 \splittopskip\ht\strutbox % top baseline for broken footnotes |
4546 % | 4088 % |
4547 % Don't crash into the line above the footnote text. Since this | 4089 % Don't crash into the line above the footnote text. Since this |
4548 % expands into a box, it must come within the paragraph, lest it | 4090 % expands into a box, it must come within the paragraph, lest it |
4549 % provide a place where TeX can split the footnote. | 4091 % provide a place where TeX can split the footnote. |
4550 \footstrut | 4092 \footstrut |
4551 \futurelet\next\fo@t | 4093 #1\strut}% |
4552 } | 4094 } |
4553 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t | |
4554 \else\let\next\f@t\fi \next} | |
4555 \def\f@@t{\bgroup\aftergroup\@foot\let\next} | |
4556 \def\f@t#1{#1\@foot} | |
4557 \def\@foot{\strut\egroup} | |
4558 | 4095 |
4559 }%end \catcode `\@=11 | 4096 }%end \catcode `\@=11 |
4560 | 4097 |
4561 % Set the baselineskip to #1, and the lineskip and strut size | 4098 % Set the baselineskip to #1, and the lineskip and strut size |
4562 % correspondingly. There is no deep meaning behind these magic numbers | 4099 % correspondingly. There is no deep meaning behind these magic numbers |
4609 % that mark overfull boxes (in case you have decided | 4146 % that mark overfull boxes (in case you have decided |
4610 % that the text looks ok even though it passes the margin). | 4147 % that the text looks ok even though it passes the margin). |
4611 % | 4148 % |
4612 \def\finalout{\overfullrule=0pt} | 4149 \def\finalout{\overfullrule=0pt} |
4613 | 4150 |
4614 % @image. We use the macros from epsf.tex to support this. | |
4615 % If epsf.tex is not installed and @image is used, we complain. | |
4616 % | |
4617 % Check for and read epsf.tex up front. If we read it only at @image | |
4618 % time, we might be inside a group, and then its definitions would get | |
4619 % undone and the next image would fail. | |
4620 \openin 1 = xepsf.tex | |
4621 \ifeof 1 \else | |
4622 \closein 1 | |
4623 \def\epsfannounce{\toks0 = }% do not bother showing banner | |
4624 \input epsf.tex | |
4625 \fi | |
4626 % | |
4627 \newif\ifwarnednoepsf | |
4628 \newhelp\noepsfhelp{epsf.tex must be installed for images to | |
4629 work. It is also included in the Texinfo distribution, or you can get | |
4630 it from ftp://ftp.tug.org/tex/epsf.tex.} | |
4631 % | |
4632 % Only complain once about lack of epsf.tex. | |
4633 \def\image#1{% | |
4634 \ifx\epsfbox\undefined | |
4635 \ifwarnednoepsf \else | |
4636 \errhelp = \noepsfhelp | |
4637 \errmessage{epsf.tex not found, images will be ignored}% | |
4638 \global\warnednoepsftrue | |
4639 \fi | |
4640 \else | |
4641 \imagexxx #1,,,\finish | |
4642 \fi | |
4643 } | |
4644 % | |
4645 % Arguments to @image: | |
4646 % #1 is (mandatory) image filename; we tack on .eps extension. | |
4647 % #2 is (optional) width, #3 is (optional) height. | |
4648 % #4 is just the usual extra ignored arg for parsing this stuff. | |
4649 \def\imagexxx#1,#2,#3,#4\finish{% | |
4650 % \epsfbox itself resets \epsf?size at each figure. | |
4651 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi | |
4652 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi | |
4653 \epsfbox{#1.eps}% | |
4654 } | |
4655 | 4151 |
4656 % End of control word definitions. | 4152 % End of control word definitions. |
4657 | |
4658 | 4153 |
4659 \message{and turning on texinfo input format.} | 4154 \message{and turning on texinfo input format.} |
4660 | 4155 |
4661 \def\openindices{% | 4156 \def\openindices{% |
4662 \newindex{cp}% | 4157 \newindex{cp}% |
4667 \newcodeindex{pg}% | 4162 \newcodeindex{pg}% |
4668 } | 4163 } |
4669 | 4164 |
4670 % Set some numeric style parameters, for 8.5 x 11 format. | 4165 % Set some numeric style parameters, for 8.5 x 11 format. |
4671 | 4166 |
4672 \hsize = 6in | 4167 %\hsize = 6.5in |
4673 \hoffset = .25in | |
4674 \newdimen\defaultparindent \defaultparindent = 15pt | 4168 \newdimen\defaultparindent \defaultparindent = 15pt |
4675 \parindent = \defaultparindent | 4169 \parindent = \defaultparindent |
4676 \parskip 3pt plus 2pt minus 1pt | 4170 \parskip 18pt plus 1pt |
4677 \setleading{13.2pt} | 4171 \setleading{15pt} |
4678 \advance\topskip by 1.2cm | 4172 \advance\topskip by 1.2cm |
4679 | |
4680 \chapheadingskip = 15pt plus 4pt minus 2pt | |
4681 \secheadingskip = 12pt plus 3pt minus 2pt | |
4682 \subsecheadingskip = 9pt plus 2pt minus 2pt | |
4683 | 4173 |
4684 % Prevent underfull vbox error messages. | 4174 % Prevent underfull vbox error messages. |
4685 \vbadness=10000 | 4175 \vbadness=10000 |
4686 | 4176 |
4687 % Following George Bush, just get rid of widows and orphans. | 4177 % Following George Bush, just get rid of widows and orphans. |
4701 \divide\emergencystretch by 45 | 4191 \divide\emergencystretch by 45 |
4702 \fi | 4192 \fi |
4703 | 4193 |
4704 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) | 4194 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) |
4705 \def\smallbook{ | 4195 \def\smallbook{ |
4706 \global\chapheadingskip = 15pt plus 4pt minus 2pt | 4196 |
4707 \global\secheadingskip = 12pt plus 3pt minus 2pt | 4197 % These values for secheadingskip and subsecheadingskip are |
4708 \global\subsecheadingskip = 9pt plus 2pt minus 2pt | 4198 % experiments. RJC 7 Aug 1992 |
4709 % | 4199 \global\secheadingskip = 17pt plus 6pt minus 3pt |
4710 \global\lispnarrowing = 0.3in | 4200 \global\subsecheadingskip = 14pt plus 6pt minus 3pt |
4711 \setleading{12pt} | 4201 |
4712 \advance\topskip by -1cm | 4202 \global\lispnarrowing = 0.3in |
4713 \global\parskip 2pt plus 1pt | 4203 \setleading{12pt} |
4714 \global\hsize = 5in | 4204 \advance\topskip by -1cm |
4715 \global\vsize=7.5in | 4205 \global\parskip 3pt plus 1pt |
4716 \global\tolerance=700 | 4206 \global\hsize = 5in |
4717 \global\hfuzz=1pt | 4207 \global\vsize=7.5in |
4718 \global\contentsrightmargin=0pt | 4208 \global\tolerance=700 |
4719 \global\deftypemargin=0pt | 4209 \global\hfuzz=1pt |
4720 \global\defbodyindent=.5cm | 4210 \global\contentsrightmargin=0pt |
4721 % | 4211 \global\deftypemargin=0pt |
4722 \global\pagewidth=\hsize | 4212 \global\defbodyindent=.5cm |
4723 \global\pageheight=\vsize | 4213 |
4724 % | 4214 \global\pagewidth=\hsize |
4725 \global\let\smalllisp=\smalllispx | 4215 \global\pageheight=\vsize |
4726 \global\let\smallexample=\smalllispx | 4216 |
4727 \global\def\Esmallexample{\Esmalllisp} | 4217 \global\let\smalllisp=\smalllispx |
4218 \global\let\smallexample=\smalllispx | |
4219 \global\def\Esmallexample{\Esmalllisp} | |
4728 } | 4220 } |
4729 | 4221 |
4730 % Use @afourpaper to print on European A4 paper. | 4222 % Use @afourpaper to print on European A4 paper. |
4731 \def\afourpaper{ | 4223 \def\afourpaper{ |
4732 \global\tolerance=700 | 4224 \global\tolerance=700 |
4745 | 4237 |
4746 \global\pagewidth=\hsize | 4238 \global\pagewidth=\hsize |
4747 \global\pageheight=\vsize | 4239 \global\pageheight=\vsize |
4748 } | 4240 } |
4749 | 4241 |
4750 \bindingoffset=0pt | |
4751 \normaloffset=\hoffset | |
4752 \pagewidth=\hsize | |
4753 \pageheight=\vsize | |
4754 | |
4755 % Allow control of the text dimensions. Parameters in order: textheight; | 4242 % Allow control of the text dimensions. Parameters in order: textheight; |
4756 % textwidth; voffset; hoffset; binding offset; topskip. | 4243 % textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; |
4757 % All require a dimension; | |
4758 % header is additional; added length extends the bottom of the page. | 4244 % header is additional; added length extends the bottom of the page. |
4759 | 4245 |
4760 \def\changepagesizes#1#2#3#4#5#6{ | 4246 \def\changepagesizes#1#2#3#4#5{ |
4761 \global\vsize= #1 | 4247 \global\vsize= #1 |
4762 \global\topskip= #6 | |
4763 \advance\vsize by \topskip | 4248 \advance\vsize by \topskip |
4764 \global\voffset= #3 | 4249 \global\voffset= #3 |
4765 \global\hsize= #2 | 4250 \global\hsize= #2 |
4766 \global\outerhsize=\hsize | 4251 \global\outerhsize=\hsize |
4767 \global\advance\outerhsize by 0.5in | 4252 \global\advance\outerhsize by 0.5in |
4770 \global\pagewidth=\hsize | 4255 \global\pagewidth=\hsize |
4771 \global\pageheight=\vsize | 4256 \global\pageheight=\vsize |
4772 \global\normaloffset= #4 | 4257 \global\normaloffset= #4 |
4773 \global\bindingoffset= #5} | 4258 \global\bindingoffset= #5} |
4774 | 4259 |
4775 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin | 4260 % This layout is compatible with Latex on A4 paper. |
4776 % 29mm, hence bottom margin 28mm, nominal side margin 3cm. | 4261 |
4777 \def\afourlatex | 4262 \def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} |
4778 {\global\tolerance=700 | |
4779 \global\hfuzz=1pt | |
4780 \setleading{12pt} | |
4781 \global\parskip 15pt plus 1pt | |
4782 \advance\baselineskip by 1.6pt | |
4783 \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} | |
4784 } | |
4785 | 4263 |
4786 % Use @afourwide to print on European A4 paper in wide format. | 4264 % Use @afourwide to print on European A4 paper in wide format. |
4787 \def\afourwide{\afourpaper | 4265 \def\afourwide{\afourpaper |
4788 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} | 4266 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} |
4789 | 4267 |
4790 % Define macros to output various characters with catcode for normal text. | 4268 % Define macros to output various characters with catcode for normal text. |
4791 \catcode`\"=\other | 4269 \catcode`\"=\other |
4792 \catcode`\~=\other | 4270 \catcode`\~=\other |
4793 \catcode`\^=\other | 4271 \catcode`\^=\other |
4826 \let"=\activedoublequote | 4304 \let"=\activedoublequote |
4827 \catcode`\~=\active | 4305 \catcode`\~=\active |
4828 \def~{{\tt \char '176}} | 4306 \def~{{\tt \char '176}} |
4829 \chardef\hat=`\^ | 4307 \chardef\hat=`\^ |
4830 \catcode`\^=\active | 4308 \catcode`\^=\active |
4309 \def\auxhat{\def^{'hat}} | |
4831 \def^{{\tt \hat}} | 4310 \def^{{\tt \hat}} |
4832 | 4311 |
4833 \catcode`\_=\active | 4312 \catcode`\_=\active |
4834 \def_{\ifusingtt\normalunderscore\_} | 4313 \def_{\ifusingtt\normalunderscore\_} |
4835 % Subroutine for the previous macro. | 4314 % Subroutine for the previous macro. |
4836 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} | 4315 \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}} |
4316 | |
4317 % \lvvmode is equivalent in function to \leavevmode. | |
4318 % Using \leavevmode runs into trouble when written out to | |
4319 % an index file due to the expansion of \leavevmode into ``\unhbox | |
4320 % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our | |
4321 % magic tricks with @. | |
4322 \def\lvvmode{\vbox to 0pt{}} | |
4837 | 4323 |
4838 \catcode`\|=\active | 4324 \catcode`\|=\active |
4839 \def|{{\tt \char '174}} | 4325 \def|{{\tt \char '174}} |
4840 \chardef \less=`\< | 4326 \chardef \less=`\< |
4841 \catcode`\<=\active | 4327 \catcode`\<=\active |