Mercurial > hg > xemacs-beta
comparison man/texinfo.tex @ 108:360340f9fd5f r20-1b6
Import from CVS: tag r20-1b6
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:18:39 +0200 |
parents | 131b0175ea99 |
children | 2d532a89d707 |
comparison
equal
deleted
inserted
replaced
107:523141596bda | 108:360340f9fd5f |
---|---|
1 %% TeX macros to handle texinfo files | 1 %% TeX macros to handle texinfo files |
2 | 2 |
3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc. | 3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, |
4 % 94, 95, 1996 Free Software Foundation, Inc. | |
4 | 5 |
5 %This texinfo.tex file is free software; you can redistribute it and/or | 6 %This texinfo.tex file is free software; you can redistribute it and/or |
6 %modify it under the terms of the GNU General Public License as | 7 %modify it under the terms of the GNU General Public License as |
7 %published by the Free Software Foundation; either version 2, or (at | 8 %published by the Free Software Foundation; either version 2, or (at |
8 %your option) any later version. | 9 %your option) any later version. |
12 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 %General Public License for more details. | 14 %General Public License for more details. |
14 | 15 |
15 %You should have received a copy of the GNU General Public License | 16 %You should have received a copy of the GNU General Public License |
16 %along with this texinfo.tex file; see the file COPYING. If not, write | 17 %along with this texinfo.tex file; see the file COPYING. If not, write |
17 %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, | 18 %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 %USA. | 19 %Boston, MA 02111-1307, USA. |
19 | 20 |
20 | 21 |
21 %In other words, you are welcome to use, share and improve this program. | 22 %In other words, you are welcome to use, share and improve this program. |
22 %You are forbidden to forbid anyone else to use, share and improve | 23 %You are forbidden to forbid anyone else to use, share and improve |
23 %what you give them. Help stamp out software-hoarding! | 24 %what you give them. Help stamp out software-hoarding! |
32 % Added by gildea November 1993. | 33 % Added by gildea November 1993. |
33 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 34 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
34 | 35 |
35 % This automatically updates the version number based on RCS. | 36 % This automatically updates the version number based on RCS. |
36 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} | 37 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} |
37 \deftexinfoversion$Revision: 1.1.1.1 $ | 38 \deftexinfoversion$Revision: 1.2 $ |
38 \message{Loading texinfo package [Version \texinfoversion]:} | 39 \message{Loading texinfo package [Version \texinfoversion]:} |
39 | 40 |
40 % If in a .fmt file, print the version number | 41 % If in a .fmt file, print the version number |
41 % and turn on active characters that we couldn't do earlier because | 42 % and turn on active characters that we couldn't do earlier because |
42 % they might have appeared in the input file name. | 43 % they might have appeared in the input file name. |
43 \everyjob{\message{[Texinfo version \texinfoversion]}\message{} | 44 \everyjob{\message{[Texinfo version \texinfoversion]}\message{} |
44 \catcode`+=\active \catcode`\_=\active} | 45 \catcode`+=\active \catcode`\_=\active} |
45 | 46 |
46 % Save some parts of plain tex whose names we will redefine. | 47 % Save some parts of plain tex whose names we will redefine. |
47 | 48 |
48 \let\ptextilde=\~ | 49 \let\ptexb=\b |
50 \let\ptexbullet=\bullet | |
51 \let\ptexc=\c | |
52 \let\ptexcomma=\, | |
53 \let\ptexdot=\. | |
54 \let\ptexdots=\dots | |
55 \let\ptexend=\end | |
56 \let\ptexequiv = \equiv | |
57 \let\ptexi=\i | |
49 \let\ptexlbrace=\{ | 58 \let\ptexlbrace=\{ |
50 \let\ptexrbrace=\} | 59 \let\ptexrbrace=\} |
51 \let\ptexdots=\dots | |
52 \let\ptexdot=\. | |
53 \let\ptexstar=\* | 60 \let\ptexstar=\* |
54 \let\ptexend=\end | |
55 \let\ptexbullet=\bullet | |
56 \let\ptexb=\b | |
57 \let\ptexc=\c | |
58 \let\ptexi=\i | |
59 \let\ptext=\t | 61 \let\ptext=\t |
60 \let\ptexl=\l | 62 \let\ptextilde=\~ |
61 \let\ptexL=\L | |
62 | 63 |
63 % Be sure we're in horizontal mode when doing a tie, since we make space | 64 % Be sure we're in horizontal mode when doing a tie, since we make space |
64 % equivalent to this in @example-like environments. Otherwise, a space | 65 % equivalent to this in @example-like environments. Otherwise, a space |
65 % at the beginning of a line will start with \penalty -- and | 66 % at the beginning of a line will start with \penalty -- and |
66 % since \penalty is valid in vertical mode, we'd end up putting the | 67 % since \penalty is valid in vertical mode, we'd end up putting the |
67 % penalty on the vertical list instead of in the new paragraph. | 68 % penalty on the vertical list instead of in the new paragraph. |
68 {\catcode`@ = 11 | 69 {\catcode`@ = 11 |
69 \gdef\tie{\leavevmode\penalty\@M\ } | 70 % Avoid using \@M directly, because that causes trouble |
71 % if the definition is written into an index file. | |
72 \global\let\tiepenalty = \@M | |
73 \gdef\tie{\leavevmode\penalty\tiepenalty\ } | |
70 } | 74 } |
71 \let\~ = \tie % And make it available as @~. | 75 \let\~ = \tie % And make it available as @~. |
76 | |
72 | 77 |
73 \message{Basics,} | 78 \message{Basics,} |
74 \chardef\other=12 | 79 \chardef\other=12 |
75 | 80 |
76 % If this character appears in an error message or help string, it | 81 % If this character appears in an error message or help string, it |
97 \hyphenation{ap-pen-dix} | 102 \hyphenation{ap-pen-dix} |
98 \hyphenation{mini-buf-fer mini-buf-fers} | 103 \hyphenation{mini-buf-fer mini-buf-fers} |
99 \hyphenation{eshell} | 104 \hyphenation{eshell} |
100 | 105 |
101 % Margin to add to right of even pages, to left of odd pages. | 106 % Margin to add to right of even pages, to left of odd pages. |
102 \newdimen \bindingoffset \bindingoffset=0pt | 107 \newdimen \bindingoffset |
103 \newdimen \normaloffset \normaloffset=\hoffset | 108 \newdimen \normaloffset |
104 \newdimen\pagewidth \newdimen\pageheight | 109 \newdimen\pagewidth \newdimen\pageheight |
105 \pagewidth=\hsize \pageheight=\vsize | |
106 | 110 |
107 % Sometimes it is convenient to have everything in the transcript file | 111 % Sometimes it is convenient to have everything in the transcript file |
108 % and nothing on the terminal. We don't just call \tracingall here, | 112 % and nothing on the terminal. We don't just call \tracingall here, |
109 % since that produces some useless output on the terminal. | 113 % since that produces some useless output on the terminal. |
110 % | 114 % |
121 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 | 125 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 |
122 % | 126 % |
123 \newdimen\cornerlong \newdimen\cornerthick | 127 \newdimen\cornerlong \newdimen\cornerthick |
124 \newdimen \topandbottommargin | 128 \newdimen \topandbottommargin |
125 \newdimen \outerhsize \newdimen \outervsize | 129 \newdimen \outerhsize \newdimen \outervsize |
126 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks | 130 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks |
127 \outerhsize=7in | 131 \outerhsize=7in |
128 %\outervsize=9.5in | 132 %\outervsize=9.5in |
129 % Alternative @smallbook page size is 9.25in | 133 % Alternative @smallbook page size is 9.25in |
130 \outervsize=9.25in | 134 \outervsize=9.25in |
131 \topandbottommargin=.75in | 135 \topandbottommargin=.75in |
132 % | 136 % |
133 %---------------------End change----------------------- | 137 %---------------------End change----------------------- |
134 | 138 |
135 % \onepageout takes a vbox as an argument. Note that \pagecontents | 139 % \onepageout takes a vbox as an argument. Note that \pagecontents |
136 % does insertions itself, but you have to call it yourself. | 140 % does insertions, but you have to call it yourself. |
137 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} | 141 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} |
138 \def\onepageout#1{\hoffset=\normaloffset | 142 \def\onepageout#1{% |
139 \ifodd\pageno \advance\hoffset by \bindingoffset | 143 \hoffset=\normaloffset |
140 \else \advance\hoffset by -\bindingoffset\fi | 144 \ifodd\pageno \advance\hoffset by \bindingoffset |
141 {\escapechar=`\\\relax % makes sure backslash is used in output files. | 145 \else \advance\hoffset by -\bindingoffset\fi |
142 \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% | 146 {% |
143 {\let\hsize=\pagewidth \makefootline}}}% | 147 \escapechar = `\\ % use backslash in output files. |
144 \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} | 148 \indexdummies |
149 \shipout\vbox{% | |
150 {\let\hsize=\pagewidth \makeheadline}% | |
151 \pagebody{#1}% | |
152 {\let\hsize=\pagewidth \makefootline}% | |
153 }% | |
154 }% | |
155 \advancepageno | |
156 \ifnum\outputpenalty>-20000 \else\dosupereject\fi | |
157 } | |
145 | 158 |
146 %%%% For @cropmarks command %%%% | 159 %%%% For @cropmarks command %%%% |
147 | 160 |
148 % Here is a modification of the main output routine for Near East Publications | 161 % Here is a modification of the main output routine for Near East Publications |
149 % This provides right-angle cropmarks at all four corners. | 162 % This provides right-angle cropmarks at all four corners. |
151 % and any desired binding offset is added as an \hskip on either | 164 % and any desired binding offset is added as an \hskip on either |
152 % site of the centerlined box. (P. A. MacKay, 12 November, 1986) | 165 % site of the centerlined box. (P. A. MacKay, 12 November, 1986) |
153 % | 166 % |
154 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up | 167 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up |
155 {\escapechar=`\\\relax % makes sure backslash is used in output files. | 168 {\escapechar=`\\\relax % makes sure backslash is used in output files. |
156 \shipout | 169 \shipout |
157 \vbox to \outervsize{\hsize=\outerhsize | 170 \vbox to \outervsize{\hsize=\outerhsize |
158 \vbox{\line{\ewtop\hfill\ewtop}} | 171 \vbox{\line{\ewtop\hfill\ewtop}} |
159 \nointerlineskip | 172 \nointerlineskip |
160 \line{\vbox{\moveleft\cornerthick\nstop} | 173 \line{\vbox{\moveleft\cornerthick\nstop} |
161 \hfill | 174 \hfill |
162 \vbox{\moveright\cornerthick\nstop}} | 175 \vbox{\moveright\cornerthick\nstop}} |
163 \vskip \topandbottommargin | 176 \vskip \topandbottommargin |
164 \centerline{\ifodd\pageno\hskip\bindingoffset\fi | 177 \centerline{\ifodd\pageno\hskip\bindingoffset\fi |
165 \vbox{ | 178 \vbox{ |
166 {\let\hsize=\pagewidth \makeheadline} | 179 {\let\hsize=\pagewidth \makeheadline} |
167 \pagebody{#1} | 180 \pagebody{#1} |
168 {\let\hsize=\pagewidth \makefootline}} | 181 {\let\hsize=\pagewidth \makefootline}} |
169 \ifodd\pageno\else\hskip\bindingoffset\fi} | 182 \ifodd\pageno\else\hskip\bindingoffset\fi} |
170 \vskip \topandbottommargin plus1fill minus1fill | 183 \vskip \topandbottommargin plus1fill minus1fill |
171 \boxmaxdepth\cornerthick | 184 \boxmaxdepth\cornerthick |
172 \line{\vbox{\moveleft\cornerthick\nsbot} | 185 \line{\vbox{\moveleft\cornerthick\nsbot} |
173 \hfill | 186 \hfill |
174 \vbox{\moveright\cornerthick\nsbot}} | 187 \vbox{\moveright\cornerthick\nsbot}} |
175 \nointerlineskip | 188 \nointerlineskip |
176 \vbox{\line{\ewbot\hfill\ewbot}} | 189 \vbox{\line{\ewbot\hfill\ewbot}} |
177 }} | 190 }} |
178 \advancepageno | 191 \advancepageno |
179 \ifnum\outputpenalty>-20000 \else\dosupereject\fi} | 192 \ifnum\outputpenalty>-20000 \else\dosupereject\fi} |
180 % | 193 % |
181 % Do @cropmarks to get crop marks | 194 % Do @cropmarks to get crop marks |
182 \def\cropmarks{\let\onepageout=\croppageout } | 195 \def\cropmarks{\let\onepageout=\croppageout } |
360 %% but suppressing ligatures. | 373 %% but suppressing ligatures. |
361 %\def\`{{`}} | 374 %\def\`{{`}} |
362 %\def\'{{'}} | 375 %\def\'{{'}} |
363 | 376 |
364 % Used to generate quoted braces. | 377 % Used to generate quoted braces. |
365 | |
366 \def\mylbrace {{\tt \char '173}} | 378 \def\mylbrace {{\tt \char '173}} |
367 \def\myrbrace {{\tt \char '175}} | 379 \def\myrbrace {{\tt \char '175}} |
368 \let\{=\mylbrace | 380 \let\{=\mylbrace |
369 \let\}=\myrbrace | 381 \let\}=\myrbrace |
382 \begingroup | |
383 % Definitions to produce actual \{ & \} command in an index. | |
384 \catcode`\{ = 12 \catcode`\} = 12 | |
385 \catcode`\[ = 1 \catcode`\] = 2 | |
386 \catcode`\@ = 0 \catcode`\\ = 12 | |
387 @gdef@lbracecmd[\{]% | |
388 @gdef@rbracecmd[\}]% | |
389 @endgroup | |
390 | |
391 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | |
392 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. | |
393 \let\, = \c | |
394 \let\dotaccent = \. | |
395 \def\ringaccent#1{{\accent23 #1}} | |
396 \let\tieaccent = \t | |
397 \let\ubaraccent = \b | |
398 \let\udotaccent = \d | |
399 | |
400 % Other special characters: @questiondown @exclamdown | |
401 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. | |
402 \def\questiondown{?`} | |
403 \def\exclamdown{!`} | |
404 | |
405 % Dotless i and dotless j, used for accents. | |
406 \def\imacro{i} | |
407 \def\jmacro{j} | |
408 \def\dotless#1{% | |
409 \def\temp{#1}% | |
410 \ifx\temp\imacro \ptexi | |
411 \else\ifx\temp\jmacro \j | |
412 \else \errmessage{@dotless can be used only with i or j}% | |
413 \fi\fi | |
414 } | |
370 | 415 |
371 % @: forces normal size whitespace following. | 416 % @: forces normal size whitespace following. |
372 \def\:{\spacefactor=1000 } | 417 \def\:{\spacefactor=1000 } |
373 | 418 |
374 % @* forces a line break. | 419 % @* forces a line break. |
531 % This defn is used inside nofill environments such as @example. | 576 % This defn is used inside nofill environments such as @example. |
532 \def\nofillexdent{\parsearg\nofillexdentyyy} | 577 \def\nofillexdent{\parsearg\nofillexdentyyy} |
533 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount | 578 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount |
534 \leftline{\hskip\leftskip{\rm#1}}}} | 579 \leftline{\hskip\leftskip{\rm#1}}}} |
535 | 580 |
581 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. | |
582 | |
583 \def\inmargin#1{% | |
584 \strut\vadjust{\nobreak\kern-\strutdepth | |
585 \vtop to \strutdepth{\baselineskip\strutdepth\vss | |
586 \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} | |
587 \newskip\inmarginspacing \inmarginspacing=1cm | |
588 \def\strutdepth{\dp\strutbox} | |
589 | |
536 %\hbox{{\rm#1}}\hfil\break}} | 590 %\hbox{{\rm#1}}\hfil\break}} |
537 | 591 |
538 % @include file insert text of that file as input. | 592 % @include file insert text of that file as input. |
539 | 593 % Allow normal characters that we make active in the argument (a file name). |
540 \def\include{\parsearg\includezzz} | 594 \def\include{\begingroup |
541 %Use \input\thisfile to avoid blank after \input, which may be an active | 595 \catcode`\\=12 |
542 %char (in which case the blank would become the \input argument). | 596 \catcode`~=12 |
543 %The grouping keeps the value of \thisfile correct even when @include | 597 \catcode`^=12 |
544 %is nested. | 598 \catcode`_=12 |
545 \def\includezzz #1{\begingroup | 599 \catcode`|=12 |
546 \def\thisfile{#1}\input\thisfile | 600 \catcode`<=12 |
601 \catcode`>=12 | |
602 \catcode`+=12 | |
603 \parsearg\includezzz} | |
604 % Restore active chars for included file. | |
605 \def\includezzz#1{\endgroup\begingroup | |
606 % Read the included file in a group so nested @include's work. | |
607 \def\thisfile{#1}% | |
608 \input\thisfile | |
547 \endgroup} | 609 \endgroup} |
548 | 610 |
549 \def\thisfile{} | 611 \def\thisfile{} |
550 | 612 |
551 % @center line outputs that line, centered | 613 % @center line outputs that line, centered |
556 \centerline{#1}}} | 618 \centerline{#1}}} |
557 | 619 |
558 % @sp n outputs n lines of vertical space | 620 % @sp n outputs n lines of vertical space |
559 | 621 |
560 \def\sp{\parsearg\spxxx} | 622 \def\sp{\parsearg\spxxx} |
561 \def\spxxx #1{\par \vskip #1\baselineskip} | 623 \def\spxxx #1{\vskip #1\baselineskip} |
562 | 624 |
563 % @comment ...line which is ignored... | 625 % @comment ...line which is ignored... |
564 % @c is the same as @comment | 626 % @c is the same as @comment |
565 % @ignore ... @end ignore is another way to write a comment | 627 % @ignore ... @end ignore is another way to write a comment |
566 | 628 |
568 \parsearg \commentxxx} | 630 \parsearg \commentxxx} |
569 | 631 |
570 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } | 632 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 } |
571 | 633 |
572 \let\c=\comment | 634 \let\c=\comment |
635 | |
636 % @paragraphindent is defined for the Info formatting commands only. | |
637 \let\paragraphindent=\comment | |
573 | 638 |
574 % Prevent errors for section commands. | 639 % Prevent errors for section commands. |
575 % Used in @ignore and in failing conditionals. | 640 % Used in @ignore and in failing conditionals. |
576 \def\ignoresections{% | 641 \def\ignoresections{% |
577 \let\chapter=\relax | 642 \let\chapter=\relax |
603 % Used in nested conditionals, where we have to parse the Texinfo source | 668 % Used in nested conditionals, where we have to parse the Texinfo source |
604 % and so want to turn off most commands, in case they are used | 669 % and so want to turn off most commands, in case they are used |
605 % incorrectly. | 670 % incorrectly. |
606 % | 671 % |
607 \def\ignoremorecommands{% | 672 \def\ignoremorecommands{% |
673 \let\defcodeindex = \relax | |
608 \let\defcv = \relax | 674 \let\defcv = \relax |
609 \let\deffn = \relax | 675 \let\deffn = \relax |
610 \let\deffnx = \relax | 676 \let\deffnx = \relax |
611 \let\defindex = \relax | 677 \let\defindex = \relax |
612 \let\defivar = \relax | 678 \let\defivar = \relax |
626 \let\ref = \relax | 692 \let\ref = \relax |
627 \let\xref = \relax | 693 \let\xref = \relax |
628 \let\printindex = \relax | 694 \let\printindex = \relax |
629 \let\pxref = \relax | 695 \let\pxref = \relax |
630 \let\settitle = \relax | 696 \let\settitle = \relax |
697 \let\setchapternewpage = \relax | |
698 \let\setchapterstyle = \relax | |
699 \let\everyheading = \relax | |
700 \let\evenheading = \relax | |
701 \let\oddheading = \relax | |
702 \let\everyfooting = \relax | |
703 \let\evenfooting = \relax | |
704 \let\oddfooting = \relax | |
705 \let\headings = \relax | |
631 \let\include = \relax | 706 \let\include = \relax |
632 \let\lowersections = \relax | 707 \let\lowersections = \relax |
633 \let\down = \relax | 708 \let\down = \relax |
634 \let\raisesections = \relax | 709 \let\raisesections = \relax |
635 \let\up = \relax | 710 \let\up = \relax |
636 \let\set = \relax | 711 \let\set = \relax |
637 \let\clear = \relax | 712 \let\clear = \relax |
638 \let\item = \relax | 713 \let\item = \relax |
639 \let\message = \relax | |
640 } | 714 } |
641 | 715 |
642 % Ignore @ignore ... @end ignore. | 716 % Ignore @ignore ... @end ignore. |
643 % | 717 % |
644 \def\ignore{\doignore{ignore}} | 718 \def\ignore{\doignore{ignore}} |
648 \def\ifinfo{\doignore{ifinfo}} | 722 \def\ifinfo{\doignore{ifinfo}} |
649 \def\ifhtml{\doignore{ifhtml}} | 723 \def\ifhtml{\doignore{ifhtml}} |
650 \def\html{\doignore{html}} | 724 \def\html{\doignore{html}} |
651 \def\menu{\doignore{menu}} | 725 \def\menu{\doignore{menu}} |
652 \def\direntry{\doignore{direntry}} | 726 \def\direntry{\doignore{direntry}} |
727 | |
728 % Also ignore @macro ... @end macro. The user must run texi2dvi, | |
729 % which runs makeinfo to do macro expansion. Ignore @unmacro, too. | |
730 \def\macro{\doignore{macro}} | |
731 \let\unmacro = \comment | |
732 | |
733 | |
734 % @dircategory CATEGORY -- specify a category of the dir file | |
735 % which this file should belong to. Ignore this in TeX. | |
736 \let\dircategory = \comment | |
653 | 737 |
654 % Ignore text until a line `@end #1'. | 738 % Ignore text until a line `@end #1'. |
655 % | 739 % |
656 \def\doignore#1{\begingroup | 740 \def\doignore#1{\begingroup |
657 % Don't complain about control sequences we have declared \outer. | 741 % Don't complain about control sequences we have declared \outer. |
680 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} | 764 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!} |
681 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} | 765 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} |
682 \immediate\write16{If you are running another version of TeX, relax.} | 766 \immediate\write16{If you are running another version of TeX, relax.} |
683 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} | 767 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} |
684 \immediate\write16{ Then upgrade your TeX installation if you can.} | 768 \immediate\write16{ Then upgrade your TeX installation if you can.} |
769 \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)} | |
685 \immediate\write16{If you are stuck with version 3.0, run the} | 770 \immediate\write16{If you are stuck with version 3.0, run the} |
686 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} | 771 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} |
687 \immediate\write16{ to use a workaround.} | 772 \immediate\write16{ to use a workaround.} |
688 \immediate\write16{} | 773 \immediate\write16{} |
689 \warnedobstrue | 774 \global\warnedobstrue |
690 \fi | 775 \fi |
691 } | 776 } |
692 | 777 |
693 % **In TeX 3.0, setting text in \nullfont hangs tex. For a | 778 % **In TeX 3.0, setting text in \nullfont hangs tex. For a |
694 % workaround (which requires the file ``dummy.tfm'' to be installed), | 779 % workaround (which requires the file ``dummy.tfm'' to be installed), |
760 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. | 845 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. |
761 % | 846 % |
762 % Since we want to separate VAR from REST-OF-LINE (which might be | 847 % Since we want to separate VAR from REST-OF-LINE (which might be |
763 % empty), we can't just use \parsearg; we have to insert a space of our | 848 % empty), we can't just use \parsearg; we have to insert a space of our |
764 % own to delimit the rest of the line, and then take it out again if we | 849 % own to delimit the rest of the line, and then take it out again if we |
765 % didn't need it. | 850 % didn't need it. Make sure the catcode of space is correct to avoid |
766 % | 851 % losing inside @example, for instance. |
767 \def\set{\parsearg\setxxx} | 852 % |
853 \def\set{\begingroup\catcode` =10 \parsearg\setxxx} | |
768 \def\setxxx#1{\setyyy#1 \endsetyyy} | 854 \def\setxxx#1{\setyyy#1 \endsetyyy} |
769 \def\setyyy#1 #2\endsetyyy{% | 855 \def\setyyy#1 #2\endsetyyy{% |
770 \def\temp{#2}% | 856 \def\temp{#2}% |
771 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty | 857 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty |
772 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. | 858 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. |
773 \fi | 859 \fi |
860 \endgroup | |
774 } | 861 } |
775 % Can't use \xdef to pre-expand #2 and save some time, since \temp or | 862 % Can't use \xdef to pre-expand #2 and save some time, since \temp or |
776 % \next or other control sequences that we've defined might get us into | 863 % \next or other control sequences that we've defined might get us into |
777 % an infinite loop. Consider `@set foo @cite{bar}'. | 864 % an infinite loop. Consider `@set foo @cite{bar}'. |
778 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} | 865 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} |
783 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} | 870 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} |
784 | 871 |
785 % @value{foo} gets the text saved in variable foo. | 872 % @value{foo} gets the text saved in variable foo. |
786 % | 873 % |
787 \def\value#1{\expandafter | 874 \def\value#1{\expandafter |
788 \ifx\csname SET#1\endcsname\relax | 875 \ifx\csname SET#1\endcsname\relax |
789 {\{No value for ``#1''\}} | 876 {\{No value for ``#1''\}} |
790 \else \csname SET#1\endcsname \fi} | 877 \else \csname SET#1\endcsname \fi} |
791 | 878 |
792 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined | 879 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined |
793 % with @set. | 880 % with @set. |
794 % | 881 % |
795 \def\ifset{\parsearg\ifsetxxx} | 882 \def\ifset{\parsearg\ifsetxxx} |
885 | 972 |
886 \def\appendixnoderef{\ifx\lastnode\relax\else | 973 \def\appendixnoderef{\ifx\lastnode\relax\else |
887 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi | 974 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi |
888 \global\let\lastnode=\relax} | 975 \global\let\lastnode=\relax} |
889 | 976 |
977 % @refill is a no-op. | |
890 \let\refill=\relax | 978 \let\refill=\relax |
891 | 979 |
892 % @setfilename is done at the beginning of every texinfo file. | 980 % @setfilename is done at the beginning of every texinfo file. |
893 % So open here the files we need to have open while reading the input. | 981 % So open here the files we need to have open while reading the input. |
894 % This makes it possible to make a .fmt file for texinfo. | 982 % This makes it possible to make a .fmt file for texinfo. |
899 \fixbackslash % Turn off hack to swallow `\input texinfo'. | 987 \fixbackslash % Turn off hack to swallow `\input texinfo'. |
900 \global\let\setfilename=\comment % Ignore extra @setfilename cmds. | 988 \global\let\setfilename=\comment % Ignore extra @setfilename cmds. |
901 \comment % Ignore the actual filename. | 989 \comment % Ignore the actual filename. |
902 } | 990 } |
903 | 991 |
992 % @bye. | |
904 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} | 993 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} |
905 | 994 |
906 \def\inforef #1{\inforefzzz #1,,,,**} | 995 % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx} |
907 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | 996 % \def\macroxxx#1#2 \end macro{% |
908 node \samp{\ignorespaces#1{}}} | 997 % \expandafter\gdef\macrotemp#1{#2}% |
998 % \endgroup} | |
999 | |
1000 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx} | |
1001 %\def\linemacroxxx#1#2 \end linemacro{% | |
1002 %\let\parsearg=\relax | |
1003 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}% | |
1004 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}% | |
1005 %\expandafter\gdef\macrotempx#1{#2}% | |
1006 %\endgroup} | |
1007 | |
1008 %\def\butfirst#1{} | |
1009 | |
909 | 1010 |
910 \message{fonts,} | 1011 \message{fonts,} |
911 | 1012 |
912 % Font-change commands. | 1013 % Font-change commands. |
913 | 1014 |
915 % So we set up a \sf analogous to plain's \rm, etc. | 1016 % So we set up a \sf analogous to plain's \rm, etc. |
916 \newfam\sffam | 1017 \newfam\sffam |
917 \def\sf{\fam=\sffam \tensf} | 1018 \def\sf{\fam=\sffam \tensf} |
918 \let\li = \sf % Sometimes we call it \li, not \sf. | 1019 \let\li = \sf % Sometimes we call it \li, not \sf. |
919 | 1020 |
1021 % We don't need math for this one. | |
1022 \def\ttsl{\tenttsl} | |
1023 | |
920 %% Try out Computer Modern fonts at \magstephalf | 1024 %% Try out Computer Modern fonts at \magstephalf |
921 \let\mainmagstep=\magstephalf | 1025 \let\mainmagstep=\magstephalf |
922 | 1026 |
923 % Set the font macro #1 to the font named #2, adding on the | 1027 % Set the font macro #1 to the font named #2, adding on the |
924 % specified font prefix (normally `cm'). | 1028 % specified font prefix (normally `cm'). |
925 \def\setfont#1#2{\font#1=\fontprefix#2} | 1029 % #3 is the font's design size, #4 is a scale factor |
1030 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} | |
926 | 1031 |
927 % Use cm as the default font prefix. | 1032 % Use cm as the default font prefix. |
928 % To specify the font prefix, you must define \fontprefix | 1033 % To specify the font prefix, you must define \fontprefix |
929 % before you read in texinfo.tex. | 1034 % before you read in texinfo.tex. |
930 \ifx\fontprefix\undefined | 1035 \ifx\fontprefix\undefined |
931 \def\fontprefix{cm} | 1036 \def\fontprefix{cm} |
932 \fi | 1037 \fi |
1038 % Support font families that don't use the same naming scheme as CM. | |
1039 \def\rmshape{r} | |
1040 \def\rmbshape{bx} %where the normal face is bold | |
1041 \def\bfshape{b} | |
1042 \def\bxshape{bx} | |
1043 \def\ttshape{tt} | |
1044 \def\ttbshape{tt} | |
1045 \def\ttslshape{sltt} | |
1046 \def\itshape{ti} | |
1047 \def\itbshape{bxti} | |
1048 \def\slshape{sl} | |
1049 \def\slbshape{bxsl} | |
1050 \def\sfshape{ss} | |
1051 \def\sfbshape{ss} | |
1052 \def\scshape{csc} | |
1053 \def\scbshape{csc} | |
933 | 1054 |
934 \ifx\bigger\relax | 1055 \ifx\bigger\relax |
935 \let\mainmagstep=\magstep1 | 1056 \let\mainmagstep=\magstep1 |
936 \setfont\textrm{r12} | 1057 \setfont\textrm\rmshape{12}{1000} |
937 \setfont\texttt{tt12} | 1058 \setfont\texttt\ttshape{12}{1000} |
938 \else | 1059 \else |
939 \setfont\textrm{r10 scaled \mainmagstep} | 1060 \setfont\textrm\rmshape{10}{\mainmagstep} |
940 \setfont\texttt{tt10 scaled \mainmagstep} | 1061 \setfont\texttt\ttshape{10}{\mainmagstep} |
941 \fi | 1062 \fi |
942 % Instead of cmb10, you many want to use cmbx10. | 1063 % Instead of cmb10, you many want to use cmbx10. |
943 % cmbx10 is a prettier font on its own, but cmb10 | 1064 % cmbx10 is a prettier font on its own, but cmb10 |
944 % looks better when embedded in a line with cmr10. | 1065 % looks better when embedded in a line with cmr10. |
945 \setfont\textbf{b10 scaled \mainmagstep} | 1066 \setfont\textbf\bfshape{10}{\mainmagstep} |
946 \setfont\textit{ti10 scaled \mainmagstep} | 1067 \setfont\textit\itshape{10}{\mainmagstep} |
947 \setfont\textsl{sl10 scaled \mainmagstep} | 1068 \setfont\textsl\slshape{10}{\mainmagstep} |
948 \setfont\textsf{ss10 scaled \mainmagstep} | 1069 \setfont\textsf\sfshape{10}{\mainmagstep} |
949 \setfont\textsc{csc10 scaled \mainmagstep} | 1070 \setfont\textsc\scshape{10}{\mainmagstep} |
1071 \setfont\textttsl\ttslshape{10}{\mainmagstep} | |
950 \font\texti=cmmi10 scaled \mainmagstep | 1072 \font\texti=cmmi10 scaled \mainmagstep |
951 \font\textsy=cmsy10 scaled \mainmagstep | 1073 \font\textsy=cmsy10 scaled \mainmagstep |
952 | 1074 |
953 % A few fonts for @defun, etc. | 1075 % A few fonts for @defun, etc. |
954 \setfont\defbf{bx10 scaled \magstep1} %was 1314 | 1076 \setfont\defbf\bxshape{10}{\magstep1} %was 1314 |
955 \setfont\deftt{tt10 scaled \magstep1} | 1077 \setfont\deftt\ttshape{10}{\magstep1} |
956 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} | 1078 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} |
957 | 1079 |
958 % Fonts for indices and small examples. | 1080 % Fonts for indices and small examples (9pt). |
959 % We actually use the slanted font rather than the italic, | 1081 % We actually use the slanted font rather than the italic, |
960 % because texinfo normally uses the slanted fonts for that. | 1082 % because texinfo normally uses the slanted fonts for that. |
961 % Do not make many font distinctions in general in the index, since they | 1083 % Do not make many font distinctions in general in the index, since they |
962 % aren't very useful. | 1084 % aren't very useful. |
963 \setfont\ninett{tt9} | 1085 \setfont\ninett\ttshape{9}{1000} |
964 \setfont\indrm{r9} | 1086 \setfont\indrm\rmshape{9}{1000} |
965 \setfont\indit{sl9} | 1087 \setfont\indit\slshape{9}{1000} |
966 \let\indsl=\indit | 1088 \let\indsl=\indit |
967 \let\indtt=\ninett | 1089 \let\indtt=\ninett |
1090 \let\indttsl=\ninett | |
968 \let\indsf=\indrm | 1091 \let\indsf=\indrm |
969 \let\indbf=\indrm | 1092 \let\indbf=\indrm |
970 \setfont\indsc{csc10 at 9pt} | 1093 \setfont\indsc\scshape{10}{900} |
971 \font\indi=cmmi9 | 1094 \font\indi=cmmi9 |
972 \font\indsy=cmsy9 | 1095 \font\indsy=cmsy9 |
973 | 1096 |
974 % Fonts for headings | 1097 % Chapter (and unnumbered) fonts (17.28pt). |
975 \setfont\chaprm{bx12 scaled \magstep2} | 1098 \setfont\chaprm\rmbshape{12}{\magstep2} |
976 \setfont\chapit{ti12 scaled \magstep2} | 1099 \setfont\chapit\itbshape{10}{\magstep3} |
977 \setfont\chapsl{sl12 scaled \magstep2} | 1100 \setfont\chapsl\slbshape{10}{\magstep3} |
978 \setfont\chaptt{tt12 scaled \magstep2} | 1101 \setfont\chaptt\ttbshape{12}{\magstep2} |
979 \setfont\chapsf{ss12 scaled \magstep2} | 1102 \setfont\chapttsl\ttslshape{10}{\magstep3} |
1103 \setfont\chapsf\sfbshape{12}{\magstep2} | |
980 \let\chapbf=\chaprm | 1104 \let\chapbf=\chaprm |
981 \setfont\chapsc{csc10 scaled\magstep3} | 1105 \setfont\chapsc\scbshape{10}{\magstep3} |
982 \font\chapi=cmmi12 scaled \magstep2 | 1106 \font\chapi=cmmi12 scaled \magstep2 |
983 \font\chapsy=cmsy10 scaled \magstep3 | 1107 \font\chapsy=cmsy10 scaled \magstep3 |
984 | 1108 |
985 \setfont\secrm{bx12 scaled \magstep1} | 1109 % Section fonts (14.4pt). |
986 \setfont\secit{ti12 scaled \magstep1} | 1110 \setfont\secrm\rmbshape{12}{\magstep1} |
987 \setfont\secsl{sl12 scaled \magstep1} | 1111 \setfont\secit\itbshape{10}{\magstep2} |
988 \setfont\sectt{tt12 scaled \magstep1} | 1112 \setfont\secsl\slbshape{10}{\magstep2} |
989 \setfont\secsf{ss12 scaled \magstep1} | 1113 \setfont\sectt\ttbshape{12}{\magstep1} |
990 \setfont\secbf{bx12 scaled \magstep1} | 1114 \setfont\secttsl\ttslshape{10}{\magstep2} |
991 \setfont\secsc{csc10 scaled\magstep2} | 1115 \setfont\secsf\sfbshape{12}{\magstep1} |
1116 \let\secbf\secrm | |
1117 \setfont\secsc\scbshape{10}{\magstep2} | |
992 \font\seci=cmmi12 scaled \magstep1 | 1118 \font\seci=cmmi12 scaled \magstep1 |
993 \font\secsy=cmsy10 scaled \magstep2 | 1119 \font\secsy=cmsy10 scaled \magstep2 |
994 | 1120 |
995 % \setfont\ssecrm{bx10 scaled \magstep1} % This size an font looked bad. | 1121 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. |
996 % \setfont\ssecit{cmti10 scaled \magstep1} % The letters were too crowded. | 1122 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. |
997 % \setfont\ssecsl{sl10 scaled \magstep1} | 1123 % \setfont\ssecsl\slshape{10}{\magstep1} |
998 % \setfont\ssectt{tt10 scaled \magstep1} | 1124 % \setfont\ssectt\ttshape{10}{\magstep1} |
999 % \setfont\ssecsf{ss10 scaled \magstep1} | 1125 % \setfont\ssecsf\sfshape{10}{\magstep1} |
1000 | 1126 |
1001 %\setfont\ssecrm{b10 scaled 1315} % Note the use of cmb rather than cmbx. | 1127 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. |
1002 %\setfont\ssecit{ti10 scaled 1315} % Also, the size is a little larger than | 1128 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than |
1003 %\setfont\ssecsl{sl10 scaled 1315} % being scaled magstep1. | 1129 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. |
1004 %\setfont\ssectt{tt10 scaled 1315} | 1130 %\setfont\ssectt\ttshape{10}{1315} |
1005 %\setfont\ssecsf{ss10 scaled 1315} | 1131 %\setfont\ssecsf\sfshape{10}{1315} |
1006 | 1132 |
1007 %\let\ssecbf=\ssecrm | 1133 %\let\ssecbf=\ssecrm |
1008 | 1134 |
1009 \setfont\ssecrm{bx12 scaled \magstephalf} | 1135 % Subsection fonts (13.15pt). |
1010 \setfont\ssecit{ti12 scaled \magstephalf} | 1136 \setfont\ssecrm\rmbshape{12}{\magstephalf} |
1011 \setfont\ssecsl{sl12 scaled \magstephalf} | 1137 \setfont\ssecit\itbshape{10}{1315} |
1012 \setfont\ssectt{tt12 scaled \magstephalf} | 1138 \setfont\ssecsl\slbshape{10}{1315} |
1013 \setfont\ssecsf{ss12 scaled \magstephalf} | 1139 \setfont\ssectt\ttbshape{12}{\magstephalf} |
1014 \setfont\ssecbf{bx12 scaled \magstephalf} | 1140 \setfont\ssecttsl\ttslshape{10}{\magstep1} |
1015 \setfont\ssecsc{csc10 scaled \magstep1} | 1141 \setfont\ssecsf\sfbshape{12}{\magstephalf} |
1142 \let\ssecbf\ssecrm | |
1143 \setfont\ssecsc\scbshape{10}{\magstep1} | |
1016 \font\sseci=cmmi12 scaled \magstephalf | 1144 \font\sseci=cmmi12 scaled \magstephalf |
1017 \font\ssecsy=cmsy10 scaled \magstep1 | 1145 \font\ssecsy=cmsy10 scaled \magstep1 |
1018 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, | 1146 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, |
1019 % but that is not a standard magnification. | 1147 % but that is not a standard magnification. |
1020 | 1148 |
1021 % Fonts for title page: | 1149 % Fonts for title page: |
1022 \setfont\titlerm{bx12 scaled \magstep3} | 1150 \setfont\titlerm\rmbshape{12}{\magstep3} |
1023 \let\authorrm = \secrm | 1151 \let\authorrm = \secrm |
1024 | 1152 |
1025 % In order for the font changes to affect most math symbols and letters, | 1153 % In order for the font changes to affect most math symbols and letters, |
1026 % we have to define the \textfont of the standard families. Since | 1154 % we have to define the \textfont of the standard families. Since |
1027 % texinfo doesn't allow for producing subscripts and superscripts, we | 1155 % texinfo doesn't allow for producing subscripts and superscripts, we |
1036 | 1164 |
1037 | 1165 |
1038 % The font-changing commands redefine the meanings of \tenSTYLE, instead | 1166 % The font-changing commands redefine the meanings of \tenSTYLE, instead |
1039 % of just \STYLE. We do this so that font changes will continue to work | 1167 % of just \STYLE. We do this so that font changes will continue to work |
1040 % in math mode, where it is the current \fam that is relevant in most | 1168 % in math mode, where it is the current \fam that is relevant in most |
1041 % cases, not the current. Plain TeX does, for example, | 1169 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam |
1042 % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need | 1170 % \tenbf}, for example. By redefining \tenbf, we obviate the need to |
1043 % to redefine \bf itself. | 1171 % redefine \bf itself. |
1044 \def\textfonts{% | 1172 \def\textfonts{% |
1045 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | 1173 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl |
1046 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc | 1174 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc |
1047 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy | 1175 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl |
1048 \resetmathfonts} | 1176 \resetmathfonts} |
1049 \def\chapfonts{% | 1177 \def\chapfonts{% |
1050 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl | 1178 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl |
1051 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc | 1179 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc |
1052 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy | 1180 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl |
1053 \resetmathfonts} | 1181 \resetmathfonts \setleading{19pt}} |
1054 \def\secfonts{% | 1182 \def\secfonts{% |
1055 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl | 1183 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl |
1056 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc | 1184 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc |
1057 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy | 1185 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl |
1058 \resetmathfonts} | 1186 \resetmathfonts \setleading{16pt}} |
1059 \def\subsecfonts{% | 1187 \def\subsecfonts{% |
1060 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl | 1188 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl |
1061 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc | 1189 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc |
1062 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy | 1190 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl |
1063 \resetmathfonts} | 1191 \resetmathfonts \setleading{15pt}} |
1192 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? | |
1064 \def\indexfonts{% | 1193 \def\indexfonts{% |
1065 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl | 1194 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl |
1066 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc | 1195 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc |
1067 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy | 1196 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl |
1068 \resetmathfonts} | 1197 \resetmathfonts \setleading{12pt}} |
1069 | 1198 |
1070 % Set up the default fonts, so we can use them for creating boxes. | 1199 % Set up the default fonts, so we can use them for creating boxes. |
1071 % | 1200 % |
1072 \textfonts | 1201 \textfonts |
1073 | 1202 |
1074 % Count depth in font-changes, for error checks | 1203 % Count depth in font-changes, for error checks |
1075 \newcount\fontdepth \fontdepth=0 | 1204 \newcount\fontdepth \fontdepth=0 |
1076 | 1205 |
1077 % Fonts for short table of contents. | 1206 % Fonts for short table of contents. |
1078 \setfont\shortcontrm{r12} | 1207 \setfont\shortcontrm\rmshape{12}{1000} |
1079 \setfont\shortcontbf{bx12} | 1208 \setfont\shortcontbf\bxshape{12}{1000} |
1080 \setfont\shortcontsl{sl12} | 1209 \setfont\shortcontsl\slshape{12}{1000} |
1081 | 1210 |
1082 %% Add scribe-like font environments, plus @l for inline lisp (usually sans | 1211 %% Add scribe-like font environments, plus @l for inline lisp (usually sans |
1083 %% serif) and @ii for TeX italic | 1212 %% serif) and @ii for TeX italic |
1084 | 1213 |
1085 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction | 1214 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction |
1102 % | 1231 % |
1103 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} | 1232 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} |
1104 \def\restorehyphenation{\hyphenchar\font = `- } | 1233 \def\restorehyphenation{\hyphenchar\font = `- } |
1105 | 1234 |
1106 \def\t#1{% | 1235 \def\t#1{% |
1107 {\tt \nohyphenation \rawbackslash \frenchspacing #1}% | 1236 {\tt \rawbackslash \frenchspacing #1}% |
1108 \null | 1237 \null |
1109 } | 1238 } |
1110 \let\ttfont = \t | 1239 \let\ttfont=\t |
1111 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null} | |
1112 \def\samp #1{`\tclose{#1}'\null} | 1240 \def\samp #1{`\tclose{#1}'\null} |
1113 \def\key #1{{\tt \nohyphenation \uppercase{#1}}\null} | 1241 \setfont\smallrm\rmshape{8}{1000} |
1242 \font\smallsy=cmsy9 | |
1243 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% | |
1244 \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{% | |
1245 \vbox{\hrule\kern-0.4pt | |
1246 \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}% | |
1247 \kern-0.4pt\hrule}% | |
1248 \kern-.06em\raise0.4pt\hbox{$\rangle$}}}} | |
1249 % The old definition, with no lozenge: | |
1250 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} | |
1114 \def\ctrl #1{{\tt \rawbackslash \hat}#1} | 1251 \def\ctrl #1{{\tt \rawbackslash \hat}#1} |
1115 | 1252 |
1116 \let\file=\samp | 1253 \let\file=\samp |
1254 \let\url=\samp % perhaps include a hypertex \special eventually | |
1255 \def\email#1{$\langle${\tt #1}$\rangle$} | |
1117 | 1256 |
1118 % @code is a modification of @t, | 1257 % @code is a modification of @t, |
1119 % which makes spaces the same size as normal in the surrounding text. | 1258 % which makes spaces the same size as normal in the surrounding text. |
1120 \def\tclose#1{% | 1259 \def\tclose#1{% |
1121 {% | 1260 {% |
1137 }% | 1276 }% |
1138 \null | 1277 \null |
1139 } | 1278 } |
1140 | 1279 |
1141 % We *must* turn on hyphenation at `-' and `_' in \code. | 1280 % We *must* turn on hyphenation at `-' and `_' in \code. |
1142 % Otherwise, it is too hard to avoid overful hboxes | 1281 % Otherwise, it is too hard to avoid overfull hboxes |
1143 % in the Emacs manual, the Library manual, etc. | 1282 % in the Emacs manual, the Library manual, etc. |
1144 | 1283 |
1145 % Unfortunately, TeX uses one parameter (\hyphenchar) to control | 1284 % Unfortunately, TeX uses one parameter (\hyphenchar) to control |
1146 % both hyphenation at - and hyphenation within words. | 1285 % both hyphenation at - and hyphenation within words. |
1147 % We must therefore turn them both off (\tclose does that) | 1286 % We must therefore turn them both off (\tclose does that) |
1148 % and arrange explicitly to hyphenate an a dash. | 1287 % and arrange explicitly to hyphenate at a dash. |
1149 % -- rms. | 1288 % -- rms. |
1150 { | 1289 { |
1151 \catcode`\-=\active | 1290 \catcode`\-=\active |
1152 \catcode`\_=\active | 1291 \catcode`\_=\active |
1153 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} | 1292 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} |
1155 % wrap around. It is necessary for - and _ to be active before the index is | 1294 % wrap around. It is necessary for - and _ to be active before the index is |
1156 % read from the file, as \entry parses the arguments long before \code is | 1295 % read from the file, as \entry parses the arguments long before \code is |
1157 % ever called. -- mycroft | 1296 % ever called. -- mycroft |
1158 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} | 1297 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} |
1159 } | 1298 } |
1299 | |
1160 \def\realdash{-} | 1300 \def\realdash{-} |
1161 \def\realunder{_} | 1301 \def\realunder{_} |
1162 \def\codedash{-\discretionary{}{}{}} | 1302 \def\codedash{-\discretionary{}{}{}} |
1163 \def\codeunder{\normalunderscore\discretionary{}{}{}} | 1303 \def\codeunder{\normalunderscore\discretionary{}{}{}} |
1164 \def\codex #1{\tclose{#1}\endgroup} | 1304 \def\codex #1{\tclose{#1}\endgroup} |
1165 | 1305 |
1166 %\let\exp=\tclose %Was temporary | 1306 %\let\exp=\tclose %Was temporary |
1167 | 1307 |
1168 % @kbd is like @code, except that if the argument is just one @key command, | 1308 % @kbd is like @code, except that if the argument is just one @key command, |
1169 % then @kbd has no effect. | 1309 % then @kbd has no effect. |
1170 | 1310 % |
1171 \def\xkey{\key} | 1311 \def\xkey{\key} |
1172 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | 1312 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% |
1173 \ifx\one\xkey\ifx\threex\three \key{#2}% | 1313 \ifx\one\xkey\ifx\threex\three \key{#2}% |
1174 \else\tclose{\look}\fi | 1314 \else{\tclose{\ttsl\look}}\fi |
1175 \else\tclose{\look}\fi} | 1315 \else{\tclose{\ttsl\look}}\fi} |
1316 | |
1317 % Check if we are currently using a typewriter font. Since all the | |
1318 % Computer Modern typewriter fonts have zero interword stretch (and | |
1319 % shrink), and it is reasonable to expect all typewriter fonts to have | |
1320 % this property, we can check that font parameter. | |
1321 % | |
1322 \def\ifmonospace{\ifdim\fontdimen3\font=0pt } | |
1176 | 1323 |
1177 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the | 1324 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the |
1178 % argument is to make the input look right: @dmn{pt} instead of | 1325 % argument is to make the input look right: @dmn{pt} instead of |
1179 % @dmn{}pt. | 1326 % @dmn{}pt. |
1180 % | 1327 % |
1181 \def\dmn#1{\thinspace #1} | 1328 \def\dmn#1{\thinspace #1} |
1182 | 1329 |
1183 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} | 1330 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} |
1184 | 1331 |
1185 \def\l#1{{\li #1}\null} % | 1332 % @l was never documented to mean ``switch to the Lisp font'', |
1186 | 1333 % and it is not used as such in any manual I can find. We need it for |
1187 \def\r#1{{\rm #1}} % roman font | 1334 % Polish suppressed-l. --karl, 22sep96. |
1335 %\def\l#1{{\li #1}\null} | |
1336 | |
1337 \def\r#1{{\rm #1}} % roman font | |
1188 % Use of \lowercase was suggested. | 1338 % Use of \lowercase was suggested. |
1189 \def\sc#1{{\smallcaps#1}} % smallcaps font | 1339 \def\sc#1{{\smallcaps#1}} % smallcaps font |
1190 \def\ii#1{{\it #1}} % italic font | 1340 \def\ii#1{{\it #1}} % italic font |
1341 | |
1342 % @pounds{} is a sterling sign. | |
1343 \def\pounds{{\it\$}} | |
1344 | |
1191 | 1345 |
1192 \message{page headings,} | 1346 \message{page headings,} |
1193 | 1347 |
1194 \newskip\titlepagetopglue \titlepagetopglue = 1.5in | 1348 \newskip\titlepagetopglue \titlepagetopglue = 1.5in |
1195 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc | 1349 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc |
1200 \newif\ifseenauthor | 1354 \newif\ifseenauthor |
1201 \newif\iffinishedtitlepage | 1355 \newif\iffinishedtitlepage |
1202 | 1356 |
1203 \def\shorttitlepage{\parsearg\shorttitlepagezzz} | 1357 \def\shorttitlepage{\parsearg\shorttitlepagezzz} |
1204 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% | 1358 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% |
1205 \endgroup\page\hbox{}\page} | 1359 \endgroup\page\hbox{}\page} |
1206 | 1360 |
1207 \def\titlepage{\begingroup \parindent=0pt \textfonts | 1361 \def\titlepage{\begingroup \parindent=0pt \textfonts |
1208 \let\subtitlerm=\tenrm | 1362 \let\subtitlerm=\tenrm |
1209 % I deinstalled the following change because \cmr12 is undefined. | 1363 % I deinstalled the following change because \cmr12 is undefined. |
1210 % This change was not in the ChangeLog anyway. --rms. | 1364 % This change was not in the ChangeLog anyway. --rms. |
1217 \vglue\titlepagetopglue | 1371 \vglue\titlepagetopglue |
1218 % | 1372 % |
1219 % Now you can print the title using @title. | 1373 % Now you can print the title using @title. |
1220 \def\title{\parsearg\titlezzz}% | 1374 \def\title{\parsearg\titlezzz}% |
1221 \def\titlezzz##1{\leftline{\titlefont{##1}} | 1375 \def\titlezzz##1{\leftline{\titlefont{##1}} |
1222 % print a rule at the page bottom also. | 1376 % print a rule at the page bottom also. |
1223 \finishedtitlepagefalse | 1377 \finishedtitlepagefalse |
1224 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% | 1378 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% |
1225 % No rule at page bottom unless we print one at the top with @title. | 1379 % No rule at page bottom unless we print one at the top with @title. |
1226 \finishedtitlepagetrue | 1380 \finishedtitlepagetrue |
1227 % | 1381 % |
1228 % Now you can put text using @subtitle. | 1382 % Now you can put text using @subtitle. |
1229 \def\subtitle{\parsearg\subtitlezzz}% | 1383 \def\subtitle{\parsearg\subtitlezzz}% |
1237 % Most title ``pages'' are actually two pages long, with space | 1391 % Most title ``pages'' are actually two pages long, with space |
1238 % at the top of the second. We don't want the ragged left on the second. | 1392 % at the top of the second. We don't want the ragged left on the second. |
1239 \let\oldpage = \page | 1393 \let\oldpage = \page |
1240 \def\page{% | 1394 \def\page{% |
1241 \iffinishedtitlepage\else | 1395 \iffinishedtitlepage\else |
1242 \finishtitlepage | 1396 \finishtitlepage |
1243 \fi | 1397 \fi |
1244 \oldpage | 1398 \oldpage |
1245 \let\page = \oldpage | 1399 \let\page = \oldpage |
1246 \hbox{}}% | 1400 \hbox{}}% |
1247 % \def\page{\oldpage \hbox{}} | 1401 % \def\page{\oldpage \hbox{}} |
1325 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} | 1479 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} |
1326 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | 1480 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} |
1327 % | 1481 % |
1328 }% unbind the catcode of @. | 1482 }% unbind the catcode of @. |
1329 | 1483 |
1330 % @headings double turns headings on for double-sided printing. | 1484 % @headings double turns headings on for double-sided printing. |
1331 % @headings single turns headings on for single-sided printing. | 1485 % @headings single turns headings on for single-sided printing. |
1332 % @headings off turns them off. | 1486 % @headings off turns them off. |
1333 % @headings on same as @headings double, retained for compatibility. | 1487 % @headings on same as @headings double, retained for compatibility. |
1334 % @headings after turns on double-sided headings after this page. | 1488 % @headings after turns on double-sided headings after this page. |
1335 % @headings doubleafter turns on double-sided headings after this page. | 1489 % @headings doubleafter turns on double-sided headings after this page. |
1336 % @headings singleafter turns on single-sided headings after this page. | 1490 % @headings singleafter turns on single-sided headings after this page. |
1337 % By default, they are off. | 1491 % By default, they are off at the start of a document, |
1492 % and turned `on' after @end titlepage. | |
1338 | 1493 |
1339 \def\headings #1 {\csname HEADINGS#1\endcsname} | 1494 \def\headings #1 {\csname HEADINGS#1\endcsname} |
1340 | 1495 |
1341 \def\HEADINGSoff{ | 1496 \def\HEADINGSoff{ |
1342 \global\evenheadline={\hfil} \global\evenfootline={\hfil} | 1497 \global\evenheadline={\hfil} \global\evenfootline={\hfil} |
1346 % For double-sided printing, put current file name in lower left corner, | 1501 % For double-sided printing, put current file name in lower left corner, |
1347 % chapter name on inside top of right hand pages, document | 1502 % chapter name on inside top of right hand pages, document |
1348 % title on inside top of left hand pages, and page numbers on outside top | 1503 % title on inside top of left hand pages, and page numbers on outside top |
1349 % edge of all pages. | 1504 % edge of all pages. |
1350 \def\HEADINGSdouble{ | 1505 \def\HEADINGSdouble{ |
1351 %\pagealignmacro | |
1352 \global\pageno=1 | 1506 \global\pageno=1 |
1353 \global\evenfootline={\hfil} | 1507 \global\evenfootline={\hfil} |
1354 \global\oddfootline={\hfil} | 1508 \global\oddfootline={\hfil} |
1355 \global\evenheadline={\line{\folio\hfil\thistitle}} | 1509 \global\evenheadline={\line{\folio\hfil\thistitle}} |
1356 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1510 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1357 } | 1511 \global\let\contentsalignmacro = \chapoddpage |
1512 } | |
1513 \let\contentsalignmacro = \chappager | |
1514 | |
1358 % For single-sided printing, chapter title goes across top left of page, | 1515 % For single-sided printing, chapter title goes across top left of page, |
1359 % page number on top right. | 1516 % page number on top right. |
1360 \def\HEADINGSsingle{ | 1517 \def\HEADINGSsingle{ |
1361 %\pagealignmacro | |
1362 \global\pageno=1 | 1518 \global\pageno=1 |
1363 \global\evenfootline={\hfil} | 1519 \global\evenfootline={\hfil} |
1364 \global\oddfootline={\hfil} | 1520 \global\oddfootline={\hfil} |
1365 \global\evenheadline={\line{\thischapter\hfil\folio}} | 1521 \global\evenheadline={\line{\thischapter\hfil\folio}} |
1366 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1522 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1523 \global\let\contentsalignmacro = \chappager | |
1367 } | 1524 } |
1368 \def\HEADINGSon{\HEADINGSdouble} | 1525 \def\HEADINGSon{\HEADINGSdouble} |
1369 | 1526 |
1370 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} | 1527 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} |
1371 \let\HEADINGSdoubleafter=\HEADINGSafter | 1528 \let\HEADINGSdoubleafter=\HEADINGSafter |
1372 \def\HEADINGSdoublex{% | 1529 \def\HEADINGSdoublex{% |
1373 \global\evenfootline={\hfil} | 1530 \global\evenfootline={\hfil} |
1374 \global\oddfootline={\hfil} | 1531 \global\oddfootline={\hfil} |
1375 \global\evenheadline={\line{\folio\hfil\thistitle}} | 1532 \global\evenheadline={\line{\folio\hfil\thistitle}} |
1376 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1533 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1534 \global\let\contentsalignmacro = \chapoddpage | |
1377 } | 1535 } |
1378 | 1536 |
1379 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} | 1537 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} |
1380 \def\HEADINGSsinglex{% | 1538 \def\HEADINGSsinglex{% |
1381 \global\evenfootline={\hfil} | 1539 \global\evenfootline={\hfil} |
1382 \global\oddfootline={\hfil} | 1540 \global\oddfootline={\hfil} |
1383 \global\evenheadline={\line{\thischapter\hfil\folio}} | 1541 \global\evenheadline={\line{\thischapter\hfil\folio}} |
1384 \global\oddheadline={\line{\thischapter\hfil\folio}} | 1542 \global\oddheadline={\line{\thischapter\hfil\folio}} |
1543 \global\let\contentsalignmacro = \chappager | |
1385 } | 1544 } |
1386 | 1545 |
1387 % Subroutines used in generating headings | 1546 % Subroutines used in generating headings |
1388 % Produces Day Month Year style of output. | 1547 % Produces Day Month Year style of output. |
1389 \def\today{\number\day\space | 1548 \def\today{\number\day\space |
1403 | 1562 |
1404 \def\thistitle{No Title} | 1563 \def\thistitle{No Title} |
1405 \def\settitle{\parsearg\settitlezzz} | 1564 \def\settitle{\parsearg\settitlezzz} |
1406 \def\settitlezzz #1{\gdef\thistitle{#1}} | 1565 \def\settitlezzz #1{\gdef\thistitle{#1}} |
1407 | 1566 |
1567 | |
1408 \message{tables,} | 1568 \message{tables,} |
1409 | 1569 |
1410 % @tabs -- simple alignment | 1570 % @tabs -- simple alignment |
1411 | 1571 |
1412 % These don't work. For one thing, \+ is defined as outer. | 1572 % These don't work. For one thing, \+ is defined as outer. |
1435 % They also define \itemindex | 1595 % They also define \itemindex |
1436 % to index the item name in whatever manner is desired (perhaps none). | 1596 % to index the item name in whatever manner is desired (perhaps none). |
1437 | 1597 |
1438 \newif\ifitemxneedsnegativevskip | 1598 \newif\ifitemxneedsnegativevskip |
1439 | 1599 |
1440 \def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi} | 1600 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} |
1441 | 1601 |
1442 \def\internalBitem{\smallbreak \parsearg\itemzzz} | 1602 \def\internalBitem{\smallbreak \parsearg\itemzzz} |
1443 \def\internalBitemx{\itemxpar \parsearg\itemzzz} | 1603 \def\internalBitemx{\itemxpar \parsearg\itemzzz} |
1444 | 1604 |
1445 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} | 1605 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} |
1542 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} | 1702 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} |
1543 | 1703 |
1544 \def\tablez #1#2#3#4#5#6{% | 1704 \def\tablez #1#2#3#4#5#6{% |
1545 \aboveenvbreak % | 1705 \aboveenvbreak % |
1546 \begingroup % | 1706 \begingroup % |
1547 \def\Edescription{\Etable}% Neccessary kludge. | 1707 \def\Edescription{\Etable}% Necessary kludge. |
1548 \let\itemindex=#1% | 1708 \let\itemindex=#1% |
1549 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % | 1709 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % |
1550 \ifnum 0#4>0 \tableindent=#4\mil \fi % | 1710 \ifnum 0#4>0 \tableindent=#4\mil \fi % |
1551 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % | 1711 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % |
1552 \def\itemfont{#2}% | 1712 \def\itemfont{#2}% |
1706 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% | 1866 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% |
1707 \vadjust{\penalty 1200}}% | 1867 \vadjust{\penalty 1200}}% |
1708 \flushcr} | 1868 \flushcr} |
1709 | 1869 |
1710 % @multitable macros | 1870 % @multitable macros |
1711 % Amy Hendrickson, 8/18/94 | 1871 % Amy Hendrickson, 8/18/94, 3/6/96 |
1712 % | 1872 % |
1713 % @multitable ... @endmultitable will make as many columns as desired. | 1873 % @multitable ... @end multitable will make as many columns as desired. |
1714 % Contents of each column will wrap at width given in preamble. Width | 1874 % Contents of each column will wrap at width given in preamble. Width |
1715 % can be specified either with sample text given in a template line, | 1875 % can be specified either with sample text given in a template line, |
1716 % or in percent of \hsize, the current width of text on page. | 1876 % or in percent of \hsize, the current width of text on page. |
1717 | 1877 |
1718 % Table can continue over pages but will only break between lines. | 1878 % Table can continue over pages but will only break between lines. |
1719 | 1879 |
1720 % To make preamble: | 1880 % To make preamble: |
1721 % | 1881 % |
1722 % Either define widths of columns in terms of percent of \hsize: | 1882 % Either define widths of columns in terms of percent of \hsize: |
1723 % @multitable @percentofhsize .2 .3 .5 | 1883 % @multitable @columnfractions .25 .3 .45 |
1724 % @item ... | 1884 % @item ... |
1725 % | 1885 % |
1726 % Numbers following @percentofhsize are the percent of the total | 1886 % Numbers following @columnfractions are the percent of the total |
1727 % current hsize to be used for each column. You may use as many | 1887 % current hsize to be used for each column. You may use as many |
1728 % columns as desired. | 1888 % columns as desired. |
1889 | |
1729 | 1890 |
1730 % Or use a template: | 1891 % Or use a template: |
1731 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | 1892 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} |
1732 % @item ... | 1893 % @item ... |
1733 % using the widest term desired in each column. | 1894 % using the widest term desired in each column. |
1734 | 1895 % |
1896 % For those who want to use more than one line's worth of words in | |
1897 % the preamble, break the line within one argument and it | |
1898 % will parse correctly, i.e., | |
1899 % | |
1900 % @multitable {Column 1 template} {Column 2 template} {Column 3 | |
1901 % template} | |
1902 % Not: | |
1903 % @multitable {Column 1 template} {Column 2 template} | |
1904 % {Column 3 template} | |
1735 | 1905 |
1736 % Each new table line starts with @item, each subsequent new column | 1906 % Each new table line starts with @item, each subsequent new column |
1737 % starts with @tab. Empty columns may be produced by supplying @tab's | 1907 % starts with @tab. Empty columns may be produced by supplying @tab's |
1738 % with nothing between them for as many times as empty columns are needed, | 1908 % with nothing between them for as many times as empty columns are needed, |
1739 % ie, @tab@tab@tab will produce two empty columns. | 1909 % ie, @tab@tab@tab will produce two empty columns. |
1740 | 1910 |
1741 % @item, @tab, @multicolumn or @endmulticolumn do not need to be on their | 1911 % @item, @tab, @multitable or @end multitable do not need to be on their |
1742 % own lines, but it will not hurt if they are. | 1912 % own lines, but it will not hurt if they are. |
1743 | 1913 |
1744 % Sample multitable: | 1914 % Sample multitable: |
1745 | 1915 |
1746 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | 1916 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} |
1754 % @item first col stuff @tab second col stuff | 1924 % @item first col stuff @tab second col stuff |
1755 % @tab Many paragraphs of text may be used in any column. | 1925 % @tab Many paragraphs of text may be used in any column. |
1756 % | 1926 % |
1757 % They will wrap at the width determined by the template. | 1927 % They will wrap at the width determined by the template. |
1758 % @item@tab@tab This will be in third column. | 1928 % @item@tab@tab This will be in third column. |
1759 % @endmultitable | 1929 % @end multitable |
1760 | 1930 |
1761 % Default dimensions may be reset by user. | 1931 % Default dimensions may be reset by user. |
1762 % @intableparskip will set vertical space between paragraphs in table. | 1932 % @multitableparskip is vertical space between paragraphs in table. |
1763 % @intableparindent will set paragraph indent in table. | 1933 % @multitableparindent is paragraph indent in table. |
1764 % @spacebetweencols will set horizontal space to be left between columns. | 1934 % @multitablecolmargin is horizontal space to be left between columns. |
1765 % @spacebetweenlines will set vertical space to be left between lines. | 1935 % @multitablelinespace is space to leave between table items, baseline |
1936 % to baseline. | |
1937 % 0pt means it depends on current normal line spacing. | |
1766 | 1938 |
1767 %%%% | 1939 %%%% |
1768 % Dimensions | 1940 % Dimensions |
1769 | 1941 |
1770 \newdimen\intableparskip | 1942 \newskip\multitableparskip |
1771 \newdimen\intableparindent | 1943 \newskip\multitableparindent |
1772 \newdimen\spacebetweencols | 1944 \newdimen\multitablecolspace |
1773 \newdimen\spacebetweenlines | 1945 \newskip\multitablelinespace |
1774 \intableparskip=0pt | 1946 \multitableparskip=0pt |
1775 \intableparindent=6pt | 1947 \multitableparindent=6pt |
1776 \spacebetweencols=12pt | 1948 \multitablecolspace=12pt |
1777 \spacebetweenlines=12pt | 1949 \multitablelinespace=0pt |
1778 | 1950 |
1779 %%%% | 1951 %%%% |
1780 % Macros used to set up halign preamble: | 1952 % Macros used to set up halign preamble: |
1781 \let\endsetuptable\relax | 1953 \let\endsetuptable\relax |
1782 \def\xendsetuptable{\endsetuptable} | 1954 \def\xendsetuptable{\endsetuptable} |
1783 \let\percentofhsize\relax | 1955 \let\columnfractions\relax |
1784 \def\xpercentofhsize{\percentofhsize} | 1956 \def\xcolumnfractions{\columnfractions} |
1785 \newif\ifsetpercent | 1957 \newif\ifsetpercent |
1958 | |
1959 %% 2/1/96, to allow fractions to be given with more than one digit. | |
1960 \def\pickupwholefraction#1 {\global\advance\colcount by1 % | |
1961 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% | |
1962 \setuptable} | |
1786 | 1963 |
1787 \newcount\colcount | 1964 \newcount\colcount |
1788 \def\setuptable#1{\def\firstarg{#1}% | 1965 \def\setuptable#1{\def\firstarg{#1}% |
1789 \ifx\firstarg\xendsetuptable\let\go\relax% | 1966 \ifx\firstarg\xendsetuptable\let\go\relax% |
1790 \else | 1967 \else |
1791 \ifx\firstarg\xpercentofhsize\global\setpercenttrue% | 1968 \ifx\firstarg\xcolumnfractions\global\setpercenttrue% |
1792 \else | 1969 \else |
1793 \ifsetpercent | 1970 \ifsetpercent |
1794 \if#1.\else% | 1971 \let\go\pickupwholefraction % In this case arg of setuptable |
1795 \global\advance\colcount by1 % | 1972 % is the decimal point before the |
1796 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}% | 1973 % number given in percent of hsize. |
1797 \fi | 1974 % We don't need this so we don't use it. |
1798 \else | 1975 \else |
1799 \global\advance\colcount by1 | 1976 \global\advance\colcount by1 |
1800 \setbox0=\hbox{#1}% | 1977 \setbox0=\hbox{#1 }% Add a normal word space as a separator; |
1978 % typically that is always in the input, anyway. | |
1801 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% | 1979 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% |
1802 \fi% | 1980 \fi% |
1803 \fi% | 1981 \fi% |
1804 \let\go\setuptable% | 1982 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi% |
1805 \fi\go} | 1983 \fi\go} |
1984 | |
1806 %%%% | 1985 %%%% |
1807 % multitable syntax | 1986 % multitable syntax |
1808 \def\tab{&} | 1987 \def\tab{&\hskip1sp\relax} % 2/2/96 |
1988 % tiny skip here makes sure this column space is | |
1989 % maintained, even if it is never used. | |
1990 | |
1809 | 1991 |
1810 %%%% | 1992 %%%% |
1811 % @multitable ... @endmultitable definitions: | 1993 % @multitable ... @end multitable definitions: |
1812 | 1994 |
1813 \def\multitable#1\item{\bgroup | 1995 \def\multitable{\parsearg\dotable} |
1996 | |
1997 \def\dotable#1{\bgroup | |
1814 \let\item\cr | 1998 \let\item\cr |
1815 \tolerance=9500 | 1999 \tolerance=9500 |
1816 \hbadness=9500 | 2000 \hbadness=9500 |
1817 \parskip=\intableparskip | 2001 \setmultitablespacing |
1818 \parindent=\intableparindent | 2002 \parskip=\multitableparskip |
2003 \parindent=\multitableparindent | |
1819 \overfullrule=0pt | 2004 \overfullrule=0pt |
1820 \global\colcount=0\relax% | 2005 \global\colcount=0\relax% |
1821 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% | 2006 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% |
1822 % To parse everything between @multitable and @item : | 2007 % To parse everything between @multitable and @item : |
1823 \def\one{#1}\expandafter\setuptable\one\endsetuptable | 2008 \setuptable#1 \endsetuptable |
1824 % Need to reset this to 0 after \setuptable. | 2009 % Need to reset this to 0 after \setuptable. |
1825 \global\colcount=0\relax% | 2010 \global\colcount=0\relax% |
1826 % | 2011 % |
1827 % This preamble sets up a generic column definition, which will | 2012 % This preamble sets up a generic column definition, which will |
1828 % be used as many times as user calls for columns. | 2013 % be used as many times as user calls for columns. |
1829 % \vtop will set a single line and will also let text wrap and | 2014 % \vtop will set a single line and will also let text wrap and |
1830 % continue for many paragraphs if desired. | 2015 % continue for many paragraphs if desired. |
1831 \halign\bgroup&\global\advance\colcount by 1\relax% | 2016 \halign\bgroup&\global\advance\colcount by 1\relax% |
1832 \vtop{\hsize=\expandafter\csname col\the\colcount\endcsname | 2017 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname |
1833 % In order to keep entries from bumping into each other | 2018 % In order to keep entries from bumping into each other |
1834 % we will add a \leftskip of \spacebetweencols to all columns after | 2019 % we will add a \leftskip of \multitablecolspace to all columns after |
1835 % the first one. | 2020 % the first one. |
1836 % If a template has been used, we will add \spacebetweencols | 2021 % If a template has been used, we will add \multitablecolspace |
1837 % to the width of each template entry. | 2022 % to the width of each template entry. |
1838 % If user has set preamble in terms of percent of \hsize | 2023 % If user has set preamble in terms of percent of \hsize |
1839 % we will use that dimension as the width of the column, and | 2024 % we will use that dimension as the width of the column, and |
1840 % the \leftskip will keep entries from bumping into each other. | 2025 % the \leftskip will keep entries from bumping into each other. |
1841 % Table will start at left margin and final column will justify at | 2026 % Table will start at left margin and final column will justify at |
1843 \ifnum\colcount=1 | 2028 \ifnum\colcount=1 |
1844 \else | 2029 \else |
1845 \ifsetpercent | 2030 \ifsetpercent |
1846 \else | 2031 \else |
1847 % If user has <not> set preamble in terms of percent of \hsize | 2032 % If user has <not> set preamble in terms of percent of \hsize |
1848 % we will advance \hsize by \spacebetweencols | 2033 % we will advance \hsize by \multitablecolspace |
1849 \advance\hsize by \spacebetweencols | 2034 \advance\hsize by \multitablecolspace |
1850 \fi | 2035 \fi |
1851 % In either case we will make \leftskip=\spacebetweencols: | 2036 % In either case we will make \leftskip=\multitablecolspace: |
1852 \leftskip=\spacebetweencols | 2037 \leftskip=\multitablecolspace |
1853 \fi | 2038 \fi |
1854 \noindent##}\cr% | 2039 \noindent##\multistrut}\cr% |
1855 % \everycr will reset column counter, \colcount, at the end of | 2040 % \everycr will reset column counter, \colcount, at the end of |
1856 % each line. Every column entry will cause \colcount to advance by one. | 2041 % each line. Every column entry will cause \colcount to advance by one. |
1857 % The table preamble | 2042 % The table preamble |
1858 % looks at the current \colcount to find the correct column width. | 2043 % looks at the current \colcount to find the correct column width. |
1859 \global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines | 2044 \global\everycr{\noalign{% |
1860 \filbreak%% keeps underfull box messages off when table breaks over pages. | 2045 \filbreak%% keeps underfull box messages off when table breaks over pages. |
1861 \global\colcount=0\relax}}} | 2046 \global\colcount=0\relax}} |
2047 } | |
2048 | |
2049 \def\setmultitablespacing{% test to see if user has set \multitablelinespace. | |
2050 % If so, do nothing. If not, give it an appropriate dimension based on | |
2051 % current baselineskip. | |
2052 \ifdim\multitablelinespace=0pt | |
2053 %% strut to put in table in case some entry doesn't have descenders, | |
2054 %% to keep lines equally spaced | |
2055 \let\multistrut = \strut | |
2056 %% Test to see if parskip is larger than space between lines of | |
2057 %% table. If not, do nothing. | |
2058 %% If so, set to same dimension as multitablelinespace. | |
2059 \else | |
2060 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 | |
2061 width0pt\relax} \fi | |
2062 \ifdim\multitableparskip>\multitablelinespace | |
2063 \global\multitableparskip=\multitablelinespace | |
2064 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | |
2065 %% than skip between lines in the table. | |
2066 \fi% | |
2067 \ifdim\multitableparskip=0pt | |
2068 \global\multitableparskip=\multitablelinespace | |
2069 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | |
2070 %% than skip between lines in the table. | |
2071 \fi} | |
2072 | |
1862 | 2073 |
1863 \message{indexing,} | 2074 \message{indexing,} |
1864 % Index generation facilities | 2075 % Index generation facilities |
1865 | 2076 |
1866 % Define \newwrite to be identical to plain tex's \newwrite | 2077 % Define \newwrite to be identical to plain tex's \newwrite |
1870 | 2081 |
1871 % \newindex {foo} defines an index named foo. | 2082 % \newindex {foo} defines an index named foo. |
1872 % It automatically defines \fooindex such that | 2083 % It automatically defines \fooindex such that |
1873 % \fooindex ...rest of line... puts an entry in the index foo. | 2084 % \fooindex ...rest of line... puts an entry in the index foo. |
1874 % It also defines \fooindfile to be the number of the output channel for | 2085 % It also defines \fooindfile to be the number of the output channel for |
1875 % the file that accumulates this index. The file's extension is foo. | 2086 % the file that accumulates this index. The file's extension is foo. |
1876 % The name of an index should be no more than 2 characters long | 2087 % The name of an index should be no more than 2 characters long |
1877 % for the sake of vms. | 2088 % for the sake of vms. |
1878 | 2089 |
1879 \def\newindex #1{ | 2090 \def\newindex #1{ |
1880 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file | 2091 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file |
1881 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file | 2092 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file |
1882 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 2093 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
1883 \noexpand\doindex {#1}} | 2094 \noexpand\doindex {#1}} |
1884 } | 2095 } |
1885 | 2096 |
1886 % @defindex foo == \newindex{foo} | 2097 % @defindex foo == \newindex{foo} |
1887 | 2098 |
1889 | 2100 |
1890 % Define @defcodeindex, like @defindex except put all entries in @code. | 2101 % Define @defcodeindex, like @defindex except put all entries in @code. |
1891 | 2102 |
1892 \def\newcodeindex #1{ | 2103 \def\newcodeindex #1{ |
1893 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file | 2104 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file |
1894 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file | 2105 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file |
1895 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 2106 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
1896 \noexpand\docodeindex {#1}} | 2107 \noexpand\docodeindex {#1}} |
1897 } | 2108 } |
1898 | 2109 |
1899 \def\defcodeindex{\parsearg\newcodeindex} | 2110 \def\defcodeindex{\parsearg\newcodeindex} |
1900 | 2111 |
1901 % @synindex foo bar makes index foo feed into index bar. | 2112 % @synindex foo bar makes index foo feed into index bar. |
1902 % Do this instead of @defindex foo if you don't want it as a separate index. | 2113 % Do this instead of @defindex foo if you don't want it as a separate index. |
1903 \def\synindex #1 #2 {% | 2114 \def\synindex #1 #2 {% |
1904 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname | 2115 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname |
1905 \expandafter\let\csname#1indfile\endcsname=\synindexfoo | 2116 \expandafter\let\csname#1indfile\endcsname=\synindexfoo |
1906 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 2117 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
1907 \noexpand\doindex {#2}}% | 2118 \noexpand\doindex {#2}}% |
1908 } | 2119 } |
1909 | 2120 |
1910 % @syncodeindex foo bar similar, but put all entries made for index foo | 2121 % @syncodeindex foo bar similar, but put all entries made for index foo |
1911 % inside @code. | 2122 % inside @code. |
1912 \def\syncodeindex #1 #2 {% | 2123 \def\syncodeindex #1 #2 {% |
1913 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname | 2124 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname |
1914 \expandafter\let\csname#1indfile\endcsname=\synindexfoo | 2125 \expandafter\let\csname#1indfile\endcsname=\synindexfoo |
1915 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex | 2126 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex |
1916 \noexpand\docodeindex {#2}}% | 2127 \noexpand\docodeindex {#2}}% |
1917 } | 2128 } |
1918 | 2129 |
1919 % Define \doindex, the driver for all \fooindex macros. | 2130 % Define \doindex, the driver for all \fooindex macros. |
1920 % Argument #1 is generated by the calling \fooindex macro, | 2131 % Argument #1 is generated by the calling \fooindex macro, |
1958 \def\O{\realbackslash O}% | 2169 \def\O{\realbackslash O}% |
1959 \def\l{\realbackslash l}% | 2170 \def\l{\realbackslash l}% |
1960 \def\L{\realbackslash L}% | 2171 \def\L{\realbackslash L}% |
1961 \def\ss{\realbackslash ss}% | 2172 \def\ss{\realbackslash ss}% |
1962 % Take care of texinfo commands likely to appear in an index entry. | 2173 % Take care of texinfo commands likely to appear in an index entry. |
2174 % (Must be a way to avoid doing expansion at all, and thus not have to | |
2175 % laboriously list every single command here.) | |
2176 \def\@{@}% will be @@ when we switch to @ as escape char. | |
2177 %\let\{ = \lbracecmd | |
2178 %\let\} = \rbracecmd | |
1963 \def\_{{\realbackslash _}}% | 2179 \def\_{{\realbackslash _}}% |
1964 \def\w{\realbackslash w }% | 2180 \def\w{\realbackslash w }% |
1965 \def\bf{\realbackslash bf }% | 2181 \def\bf{\realbackslash bf }% |
1966 \def\rm{\realbackslash rm }% | 2182 %\def\rm{\realbackslash rm }% |
1967 \def\sl{\realbackslash sl }% | 2183 \def\sl{\realbackslash sl }% |
1968 \def\sf{\realbackslash sf}% | 2184 \def\sf{\realbackslash sf}% |
1969 \def\tt{\realbackslash tt}% | 2185 \def\tt{\realbackslash tt}% |
1970 \def\gtr{\realbackslash gtr}% | 2186 \def\gtr{\realbackslash gtr}% |
1971 \def\less{\realbackslash less}% | 2187 \def\less{\realbackslash less}% |
1972 \def\hat{\realbackslash hat}% | 2188 \def\hat{\realbackslash hat}% |
1973 \def\char{\realbackslash char}% | 2189 %\def\char{\realbackslash char}% |
1974 \def\TeX{\realbackslash TeX}% | 2190 \def\TeX{\realbackslash TeX}% |
1975 \def\dots{\realbackslash dots }% | 2191 \def\dots{\realbackslash dots }% |
1976 \def\copyright{\realbackslash copyright }% | 2192 \def\copyright{\realbackslash copyright }% |
1977 \def\tclose##1{\realbackslash tclose {##1}}% | 2193 \def\tclose##1{\realbackslash tclose {##1}}% |
1978 \def\code##1{\realbackslash code {##1}}% | 2194 \def\code##1{\realbackslash code {##1}}% |
2195 \def\dotless##1{\realbackslash dotless {##1}}% | |
1979 \def\samp##1{\realbackslash samp {##1}}% | 2196 \def\samp##1{\realbackslash samp {##1}}% |
1980 \def\t##1{\realbackslash r {##1}}% | 2197 \def\,##1{\realbackslash ,{##1}}% |
2198 \def\t##1{\realbackslash t {##1}}% | |
1981 \def\r##1{\realbackslash r {##1}}% | 2199 \def\r##1{\realbackslash r {##1}}% |
1982 \def\i##1{\realbackslash i {##1}}% | 2200 \def\i##1{\realbackslash i {##1}}% |
1983 \def\b##1{\realbackslash b {##1}}% | 2201 \def\b##1{\realbackslash b {##1}}% |
1984 \def\cite##1{\realbackslash cite {##1}}% | 2202 \def\cite##1{\realbackslash cite {##1}}% |
1985 \def\key##1{\realbackslash key {##1}}% | 2203 \def\key##1{\realbackslash key {##1}}% |
1986 \def\file##1{\realbackslash file {##1}}% | 2204 \def\file##1{\realbackslash file {##1}}% |
1987 \def\var##1{\realbackslash var {##1}}% | 2205 \def\var##1{\realbackslash var {##1}}% |
1988 \def\kbd##1{\realbackslash kbd {##1}}% | 2206 \def\kbd##1{\realbackslash kbd {##1}}% |
1989 \def\dfn##1{\realbackslash dfn {##1}}% | 2207 \def\dfn##1{\realbackslash dfn {##1}}% |
1990 \def\emph##1{\realbackslash emph {##1}}% | 2208 \def\emph##1{\realbackslash emph {##1}}% |
1991 } | 2209 \unsepspaces |
2210 } | |
2211 | |
2212 % If an index command is used in an @example environment, any spaces | |
2213 % therein should become regular spaces in the raw index file, not the | |
2214 % expansion of \tie (\\leavevmode \penalty \@M \ ). | |
2215 {\obeyspaces | |
2216 \gdef\unsepspaces{\obeyspaces\let =\space}} | |
1992 | 2217 |
1993 % \indexnofonts no-ops all font-change commands. | 2218 % \indexnofonts no-ops all font-change commands. |
1994 % This is used when outputting the strings to sort the index by. | 2219 % This is used when outputting the strings to sort the index by. |
1995 \def\indexdummyfont#1{#1} | 2220 \def\indexdummyfont#1{#1} |
1996 \def\indexdummytex{TeX} | 2221 \def\indexdummytex{TeX} |
1997 \def\indexdummydots{...} | 2222 \def\indexdummydots{...} |
1998 | 2223 |
1999 \def\indexnofonts{% | 2224 \def\indexnofonts{% |
2000 % Just ignore accents. | 2225 % Just ignore accents. |
2226 \let\,=\indexdummyfont | |
2001 \let\"=\indexdummyfont | 2227 \let\"=\indexdummyfont |
2002 \let\`=\indexdummyfont | 2228 \let\`=\indexdummyfont |
2003 \let\'=\indexdummyfont | 2229 \let\'=\indexdummyfont |
2004 \let\^=\indexdummyfont | 2230 \let\^=\indexdummyfont |
2005 \let\~=\indexdummyfont | 2231 \let\~=\indexdummyfont |
2008 \let\c=\indexdummyfont | 2234 \let\c=\indexdummyfont |
2009 \let\d=\indexdummyfont | 2235 \let\d=\indexdummyfont |
2010 \let\u=\indexdummyfont | 2236 \let\u=\indexdummyfont |
2011 \let\v=\indexdummyfont | 2237 \let\v=\indexdummyfont |
2012 \let\H=\indexdummyfont | 2238 \let\H=\indexdummyfont |
2239 \let\dotless=\indexdummyfont | |
2013 % Take care of the plain tex special European modified letters. | 2240 % Take care of the plain tex special European modified letters. |
2014 \def\oe{oe}% | 2241 \def\oe{oe}% |
2015 \def\ae{ae}% | 2242 \def\ae{ae}% |
2016 \def\aa{aa}% | 2243 \def\aa{aa}% |
2017 \def\OE{OE}% | 2244 \def\OE{OE}% |
2041 \let\kbd=\indexdummyfont | 2268 \let\kbd=\indexdummyfont |
2042 \let\key=\indexdummyfont | 2269 \let\key=\indexdummyfont |
2043 \let\var=\indexdummyfont | 2270 \let\var=\indexdummyfont |
2044 \let\TeX=\indexdummytex | 2271 \let\TeX=\indexdummytex |
2045 \let\dots=\indexdummydots | 2272 \let\dots=\indexdummydots |
2273 \def\@{@}% | |
2046 } | 2274 } |
2047 | 2275 |
2048 % To define \realbackslash, we must make \ not be an escape. | 2276 % To define \realbackslash, we must make \ not be an escape. |
2049 % We must first make another character (@) an escape | 2277 % We must first make another character (@) an escape |
2050 % so we do not become unable to do a definition. | 2278 % so we do not become unable to do a definition. |
2056 | 2284 |
2057 \let\SETmarginindex=\relax %initialize! | 2285 \let\SETmarginindex=\relax %initialize! |
2058 % workhorse for all \fooindexes | 2286 % workhorse for all \fooindexes |
2059 % #1 is name of index, #2 is stuff to put there | 2287 % #1 is name of index, #2 is stuff to put there |
2060 \def\doind #1#2{% | 2288 \def\doind #1#2{% |
2061 % Put the index entry in the margin if desired. | 2289 % Put the index entry in the margin if desired. |
2062 \ifx\SETmarginindex\relax\else% | 2290 \ifx\SETmarginindex\relax\else |
2063 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% | 2291 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% |
2064 \fi% | 2292 \fi |
2065 {\count10=\lastpenalty % | 2293 {% |
2066 {\indexdummies % Must do this here, since \bf, etc expand at this stage | 2294 \count255=\lastpenalty |
2067 \escapechar=`\\% | 2295 {% |
2068 {\let\folio=0% Expand all macros now EXCEPT \folio | 2296 \indexdummies % Must do this here, since \bf, etc expand at this stage |
2069 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now | 2297 \escapechar=`\\ |
2070 % so it will be output as is; and it will print as backslash in the indx. | 2298 {% |
2071 % | 2299 \let\folio=0 % We will expand all macros now EXCEPT \folio. |
2072 % Now process the index-string once, with all font commands turned off, | 2300 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now |
2073 % to get the string to sort the index by. | 2301 % so it will be output as is; and it will print as backslash. |
2074 {\indexnofonts | 2302 % |
2075 \xdef\temp1{#2}% | 2303 % First process the index-string with all font commands turned off |
2076 }% | 2304 % to get the string to sort by. |
2077 % Now produce the complete index entry. We process the index-string again, | 2305 {\indexnofonts \xdef\indexsorttmp{#2}}% |
2078 % this time with font commands expanded, to get what to print in the index. | 2306 % |
2079 \edef\temp{% | 2307 % Now produce the complete index entry, with both the sort key and the |
2080 \write \csname#1indfile\endcsname{% | 2308 % original text, including any font commands. |
2081 \realbackslash entry {\temp1}{\folio}{#2}}}% | 2309 \toks0 = {#2}% |
2082 \temp }% | 2310 \edef\temp{% |
2083 }\penalty\count10}} | 2311 \write\csname#1indfile\endcsname{% |
2312 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% | |
2313 }% | |
2314 \temp | |
2315 }% | |
2316 }% | |
2317 \penalty\count255 | |
2318 }% | |
2319 } | |
2084 | 2320 |
2085 \def\dosubind #1#2#3{% | 2321 \def\dosubind #1#2#3{% |
2086 {\count10=\lastpenalty % | 2322 {\count10=\lastpenalty % |
2087 {\indexdummies % Must do this here, since \bf, etc expand at this stage | 2323 {\indexdummies % Must do this here, since \bf, etc expand at this stage |
2088 \escapechar=`\\% | 2324 \escapechar=`\\% |
2139 % @unnumbered Function Index | 2375 % @unnumbered Function Index |
2140 % @printindex fn | 2376 % @printindex fn |
2141 | 2377 |
2142 \def\printindex{\parsearg\doprintindex} | 2378 \def\printindex{\parsearg\doprintindex} |
2143 | 2379 |
2144 \def\doprintindex#1{% | 2380 \def\doprintindex#1{\begingroup |
2145 \tex | 2381 \dobreak \chapheadingskip{10000}% |
2146 \dobreak \chapheadingskip {10000} | 2382 % |
2147 \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other | 2383 \indexfonts \rm |
2148 \catcode`\$=\other | 2384 \tolerance = 9500 |
2149 \catcode`\~=\other | |
2150 \indexbreaks | 2385 \indexbreaks |
2151 % | 2386 \def\indexbackslash{\rawbackslashxx}% |
2152 % The following don't help, since the chars were translated | 2387 % Index files are almost Texinfo source, but we use \ as the escape |
2153 % when the raw index was written, and their fonts were discarded | 2388 % character. It would be better to use @, but that's too big a change |
2154 % due to \indexnofonts. | 2389 % to make right now. |
2155 %\catcode`\"=\active | 2390 \catcode`\\ = 0 |
2156 %\catcode`\^=\active | 2391 \catcode`\@ = 11 |
2157 %\catcode`\_=\active | 2392 \escapechar = `\\ |
2158 %\catcode`\|=\active | |
2159 %\catcode`\<=\active | |
2160 %\catcode`\>=\active | |
2161 % % | |
2162 \def\indexbackslash{\rawbackslashxx} | |
2163 \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt | |
2164 \begindoublecolumns | 2393 \begindoublecolumns |
2165 % | 2394 % |
2166 % See if the index file exists and is nonempty. | 2395 % See if the index file exists and is nonempty. |
2167 \openin 1 \jobname.#1s | 2396 \openin 1 \jobname.#1s |
2168 \ifeof 1 | 2397 \ifeof 1 |
2169 % \enddoublecolumns gets confused if there is no text in the index, | 2398 % \enddoublecolumns gets confused if there is no text in the index, |
2170 % and it loses the chapter title and the aux file entries for the | 2399 % and it loses the chapter title and the aux file entries for the |
2171 % index. The easiest way to prevent this problem is to make sure | 2400 % index. The easiest way to prevent this problem is to make sure |
2172 % there is some text. | 2401 % there is some text. |
2173 (Index is nonexistent) | 2402 (Index is nonexistent) |
2174 \else | 2403 \else |
2175 % | 2404 % |
2176 % If the index file exists but is empty, then \openin leaves \ifeof | 2405 % If the index file exists but is empty, then \openin leaves \ifeof |
2177 % false. We have to make TeX try to read something from the file, so | 2406 % false. We have to make TeX try to read something from the file, so |
2178 % it can discover if there is anything in it. | 2407 % it can discover if there is anything in it. |
2179 \read 1 to \temp | 2408 \read 1 to \temp |
2183 \input \jobname.#1s | 2412 \input \jobname.#1s |
2184 \fi | 2413 \fi |
2185 \fi | 2414 \fi |
2186 \closein 1 | 2415 \closein 1 |
2187 \enddoublecolumns | 2416 \enddoublecolumns |
2188 \Etex | 2417 \endgroup} |
2189 } | |
2190 | 2418 |
2191 % These macros are used by the sorted index file itself. | 2419 % These macros are used by the sorted index file itself. |
2192 % Change them to control the appearance of the index. | 2420 % Change them to control the appearance of the index. |
2193 | 2421 |
2194 % Same as \bigskipamount except no shrink. | 2422 % Same as \bigskipamount except no shrink. |
2238 % parameters we've set above will have an effect. | 2466 % parameters we've set above will have an effect. |
2239 \noindent | 2467 \noindent |
2240 % | 2468 % |
2241 % Insert the text of the index entry. TeX will do line-breaking on it. | 2469 % Insert the text of the index entry. TeX will do line-breaking on it. |
2242 #1% | 2470 #1% |
2243 % The following is kluged to not output a line of dots in the index if | 2471 % The following is kludged to not output a line of dots in the index if |
2244 % there are no page numbers. The next person who breaks this will be | 2472 % there are no page numbers. The next person who breaks this will be |
2245 % cursed by a Unix daemon. | 2473 % cursed by a Unix daemon. |
2246 \def\tempa{{\rm }}% | 2474 \def\tempa{{\rm }}% |
2247 \def\tempb{#2}% | 2475 \def\tempb{#2}% |
2248 \edef\tempc{\tempa}% | 2476 \edef\tempc{\tempa}% |
2275 {\parfillskip=0in \parskip=0in | 2503 {\parfillskip=0in \parskip=0in |
2276 \hangindent =1in \hangafter=1 | 2504 \hangindent =1in \hangafter=1 |
2277 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par | 2505 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par |
2278 }} | 2506 }} |
2279 | 2507 |
2280 %% Define two-column mode, which is used in indexes. | 2508 % Define two-column mode, which we use to typeset indexes. |
2281 %% Adapted from the TeXbook, page 416. | 2509 % Adapted from the TeXbook, page 416, which is to say, |
2282 \catcode `\@=11 | 2510 % the manmac.tex format used to print the TeXbook itself. |
2511 \catcode`\@=11 | |
2283 | 2512 |
2284 \newbox\partialpage | 2513 \newbox\partialpage |
2285 | |
2286 \newdimen\doublecolumnhsize | 2514 \newdimen\doublecolumnhsize |
2287 | 2515 |
2288 \def\begindoublecolumns{\begingroup | 2516 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns |
2289 % Grab any single-column material above us. | 2517 % Grab any single-column material above us. |
2290 \output = {\global\setbox\partialpage | 2518 \output = {\global\setbox\partialpage |
2291 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% | 2519 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% |
2292 \eject | 2520 \eject |
2293 % | 2521 % |
2316 \hsize = \doublecolumnhsize | 2544 \hsize = \doublecolumnhsize |
2317 % | 2545 % |
2318 % Double the \vsize as well. (We don't need a separate register here, | 2546 % Double the \vsize as well. (We don't need a separate register here, |
2319 % since nobody clobbers \vsize.) | 2547 % since nobody clobbers \vsize.) |
2320 \vsize = 2\vsize | 2548 \vsize = 2\vsize |
2321 \doublecolumnpagegoal | 2549 } |
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}} | |
2339 \def\doublecolumnout{% | 2550 \def\doublecolumnout{% |
2340 \setbox5=\copy255 | 2551 \splittopskip=\topskip \splitmaxdepth=\maxdepth |
2341 {\vbadness=10000 \doublecolumnsplit} | 2552 % Get the available space for the double columns -- the normal |
2342 \ifvbox255 | 2553 % (undoubled) page height minus any material left over from the |
2343 \setbox0=\vtop to\dimen@{\unvbox0} | 2554 % previous page. |
2344 \setbox2=\vtop to\dimen@{\unvbox2} | 2555 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage |
2345 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty | 2556 % box0 will be the left-hand column, box1 the right. |
2346 \else | 2557 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ |
2347 \setbox0=\vbox{\unvbox5} | 2558 \onepageout\pagesofar |
2348 \ifvbox0 | 2559 \unvbox255 \penalty\outputpenalty |
2349 \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip | 2560 } |
2350 \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth | 2561 \def\pagesofar{% |
2351 {\vbadness=10000 | 2562 % The contents of the output page -- any previous material, |
2352 \loop \global\setbox5=\copy0 | 2563 % followed by the two boxes we just split. |
2353 \setbox1=\vsplit5 to\dimen@ | 2564 \unvbox\partialpage |
2354 \setbox3=\vsplit5 to\dimen@ | 2565 \hsize = \doublecolumnhsize |
2355 \ifvbox5 \global\advance\dimen@ by1pt \repeat | 2566 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% |
2356 \setbox0=\vbox to\dimen@{\unvbox1} | 2567 } |
2357 \setbox2=\vbox to\dimen@{\unvbox3} | 2568 \def\enddoublecolumns{% |
2358 \global\setbox\partialpage=\vbox{\pagesofar} | 2569 \output={\balancecolumns}\eject % split what we have |
2359 \doublecolumnpagegoal | 2570 \endgroup |
2360 } | 2571 % Back to normal single-column typesetting, but take account of the |
2361 \fi | 2572 % fact that we just accumulated some stuff on the output page. |
2362 \fi | 2573 \pagegoal=\vsize |
2363 } | 2574 } |
2364 | 2575 \def\balancecolumns{% |
2576 % Called on the last page of the double column material. | |
2577 \setbox0=\vbox{\unvbox255}% | |
2578 \dimen@ = \ht0 | |
2579 \advance\dimen@ by \topskip | |
2580 \advance\dimen@ by-\baselineskip | |
2581 \divide\dimen@ by 2 | |
2582 \splittopskip = \topskip | |
2583 % Loop until we get a decent breakpoint. | |
2584 {\vbadness=10000 \loop \global\setbox3=\copy0 | |
2585 \global\setbox1=\vsplit3 to\dimen@ | |
2586 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}% | |
2587 \setbox0=\vbox to\dimen@{\unvbox1}% | |
2588 \setbox2=\vbox to\dimen@{\unvbox3}% | |
2589 \pagesofar | |
2590 } | |
2365 \catcode `\@=\other | 2591 \catcode `\@=\other |
2592 | |
2593 | |
2366 \message{sectioning,} | 2594 \message{sectioning,} |
2367 % Define chapters, sections, etc. | 2595 % Define chapters, sections, etc. |
2368 | 2596 |
2369 \newcount \chapno | 2597 \newcount \chapno |
2370 \newcount \secno \secno=0 | 2598 \newcount \secno \secno=0 |
2532 \global\let\section = \appendixsec | 2760 \global\let\section = \appendixsec |
2533 \global\let\subsection = \appendixsubsec | 2761 \global\let\subsection = \appendixsubsec |
2534 \global\let\subsubsection = \appendixsubsubsec | 2762 \global\let\subsubsection = \appendixsubsubsec |
2535 }} | 2763 }} |
2536 | 2764 |
2765 % @centerchap is like @unnumbered, but the heading is centered. | |
2766 \outer\def\centerchap{\parsearg\centerchapyyy} | |
2767 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} | |
2768 | |
2537 \outer\def\top{\parsearg\unnumberedyyy} | 2769 \outer\def\top{\parsearg\unnumberedyyy} |
2538 \outer\def\unnumbered{\parsearg\unnumberedyyy} | 2770 \outer\def\unnumbered{\parsearg\unnumberedyyy} |
2539 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz | 2771 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz |
2540 \def\unnumberedzzz #1{\seccheck{unnumbered}% | 2772 \def\unnumberedzzz #1{\seccheck{unnumbered}% |
2541 \secno=0 \subsecno=0 \subsubsecno=0 | 2773 \secno=0 \subsecno=0 \subsubsecno=0 |
2576 \write \contentsfile \temp % | 2808 \write \contentsfile \temp % |
2577 \donoderef % | 2809 \donoderef % |
2578 \penalty 10000 % | 2810 \penalty 10000 % |
2579 }} | 2811 }} |
2580 | 2812 |
2581 \outer\def\appenixsection{\parsearg\appendixsecyyy} | 2813 \outer\def\appendixsection{\parsearg\appendixsecyyy} |
2582 \outer\def\appendixsec{\parsearg\appendixsecyyy} | 2814 \outer\def\appendixsec{\parsearg\appendixsecyyy} |
2583 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz | 2815 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz |
2584 \def\appendixsectionzzz #1{\seccheck{appendixsection}% | 2816 \def\appendixsectionzzz #1{\seccheck{appendixsection}% |
2585 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | 2817 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % |
2586 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% | 2818 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% |
2634 }} | 2866 }} |
2635 | 2867 |
2636 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} | 2868 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} |
2637 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | 2869 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz |
2638 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% | 2870 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% |
2639 \plainsecheading {#1}\gdef\thissection{#1}% | 2871 \plainsubsecheading {#1}\gdef\thissection{#1}% |
2640 {\chapternofonts% | 2872 {\chapternofonts% |
2641 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% | 2873 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% |
2642 \escapechar=`\\% | 2874 \escapechar=`\\% |
2643 \write \contentsfile \temp % | 2875 \write \contentsfile \temp % |
2644 \unnumbnoderef % | 2876 \unnumbnoderef % |
2679 }} | 2911 }} |
2680 | 2912 |
2681 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} | 2913 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} |
2682 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | 2914 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz |
2683 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% | 2915 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% |
2684 \plainsecheading {#1}\gdef\thissection{#1}% | 2916 \plainsubsubsecheading {#1}\gdef\thissection{#1}% |
2685 {\chapternofonts% | 2917 {\chapternofonts% |
2686 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% | 2918 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% |
2687 \escapechar=`\\% | 2919 \escapechar=`\\% |
2688 \write \contentsfile \temp % | 2920 \write \contentsfile \temp % |
2689 \unnumbnoderef % | 2921 \unnumbnoderef % |
2717 | 2949 |
2718 % Define @majorheading, @heading and @subheading | 2950 % Define @majorheading, @heading and @subheading |
2719 | 2951 |
2720 % NOTE on use of \vbox for chapter headings, section headings, and | 2952 % NOTE on use of \vbox for chapter headings, section headings, and |
2721 % such: | 2953 % such: |
2722 % 1) We use \vbox rather than the earlier \line to permit | 2954 % 1) We use \vbox rather than the earlier \line to permit |
2723 % overlong headings to fold. | 2955 % overlong headings to fold. |
2724 % 2) \hyphenpenalty is set to 10000 because hyphenation in a | 2956 % 2) \hyphenpenalty is set to 10000 because hyphenation in a |
2725 % heading is obnoxious; this forbids it. | 2957 % heading is obnoxious; this forbids it. |
2726 % 3) Likewise, headings look best if no \parindent is used, and | 2958 % 3) Likewise, headings look best if no \parindent is used, and |
2727 % if justification is not attempted. Hence \raggedright. | 2959 % if justification is not attempted. Hence \raggedright. |
2728 | 2960 |
2729 | 2961 |
2730 \def\majorheading{\parsearg\majorheadingzzz} | 2962 \def\majorheading{\parsearg\majorheadingzzz} |
2738 \def\chapheadingzzz #1{\chapbreak % | 2970 \def\chapheadingzzz #1{\chapbreak % |
2739 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 2971 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
2740 \parindent=0pt\raggedright | 2972 \parindent=0pt\raggedright |
2741 \rm #1\hfill}}\bigskip \par\penalty 200} | 2973 \rm #1\hfill}}\bigskip \par\penalty 200} |
2742 | 2974 |
2743 \def\heading{\parsearg\secheadingi} | 2975 % @heading, @subheading, @subsubheading. |
2744 | 2976 \def\heading{\parsearg\plainsecheading} |
2745 \def\subheading{\parsearg\subsecheadingi} | 2977 \def\subheading{\parsearg\plainsubsecheading} |
2746 | 2978 \def\subsubheading{\parsearg\plainsubsubsecheading} |
2747 \def\subsubheading{\parsearg\subsubsecheadingi} | |
2748 | 2979 |
2749 % These macros generate a chapter, section, etc. heading only | 2980 % These macros generate a chapter, section, etc. heading only |
2750 % (including whitespace, linebreaking, etc. around it), | 2981 % (including whitespace, linebreaking, etc. around it), |
2751 % given all the information in convenient, parsed form. | 2982 % given all the information in convenient, parsed form. |
2752 | 2983 |
2756 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} | 2987 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} |
2757 | 2988 |
2758 %%% Define plain chapter starts, and page on/off switching for it | 2989 %%% Define plain chapter starts, and page on/off switching for it |
2759 % Parameter controlling skip before chapter headings (if needed) | 2990 % Parameter controlling skip before chapter headings (if needed) |
2760 | 2991 |
2761 \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt | 2992 \newskip\chapheadingskip |
2762 | 2993 |
2763 \def\chapbreak{\dobreak \chapheadingskip {-4000}} | 2994 \def\chapbreak{\dobreak \chapheadingskip {-4000}} |
2764 \def\chappager{\par\vfill\supereject} | 2995 \def\chappager{\par\vfill\supereject} |
2765 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} | 2996 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} |
2766 | 2997 |
2767 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} | 2998 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} |
2768 | 2999 |
2769 \def\CHAPPAGoff{ | 3000 \def\CHAPPAGoff{ |
3001 \global\let\contentsalignmacro = \chappager | |
2770 \global\let\pchapsepmacro=\chapbreak | 3002 \global\let\pchapsepmacro=\chapbreak |
2771 \global\let\pagealignmacro=\chappager} | 3003 \global\let\pagealignmacro=\chappager} |
2772 | 3004 |
2773 \def\CHAPPAGon{ | 3005 \def\CHAPPAGon{ |
3006 \global\let\contentsalignmacro = \chappager | |
2774 \global\let\pchapsepmacro=\chappager | 3007 \global\let\pchapsepmacro=\chappager |
2775 \global\let\pagealignmacro=\chappager | 3008 \global\let\pagealignmacro=\chappager |
2776 \global\def\HEADINGSon{\HEADINGSsingle}} | 3009 \global\def\HEADINGSon{\HEADINGSsingle}} |
2777 | 3010 |
2778 \def\CHAPPAGodd{ | 3011 \def\CHAPPAGodd{ |
3012 \global\let\contentsalignmacro = \chapoddpage | |
2779 \global\let\pchapsepmacro=\chapoddpage | 3013 \global\let\pchapsepmacro=\chapoddpage |
2780 \global\let\pagealignmacro=\chapoddpage | 3014 \global\let\pagealignmacro=\chapoddpage |
2781 \global\def\HEADINGSon{\HEADINGSdouble}} | 3015 \global\def\HEADINGSon{\HEADINGSdouble}} |
2782 | 3016 |
2783 \CHAPPAGon | 3017 \CHAPPAGon |
2784 | 3018 |
2785 \def\CHAPFplain{ | 3019 \def\CHAPFplain{ |
2786 \global\let\chapmacro=\chfplain | 3020 \global\let\chapmacro=\chfplain |
2787 \global\let\unnumbchapmacro=\unnchfplain} | 3021 \global\let\unnumbchapmacro=\unnchfplain |
2788 | 3022 \global\let\centerchapmacro=\centerchfplain} |
2789 \def\chfplain #1#2{% | 3023 |
3024 % Plain chapter opening. | |
3025 % #1 is the text, #2 the chapter number or empty if unnumbered. | |
3026 \def\chfplain#1#2{% | |
2790 \pchapsepmacro | 3027 \pchapsepmacro |
2791 {% | 3028 {% |
2792 \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 3029 \chapfonts \rm |
2793 \parindent=0pt\raggedright | 3030 \def\chapnum{#2}% |
2794 \rm #2\enspace #1}% | 3031 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% |
3032 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | |
3033 \hangindent = \wd0 \centerparametersmaybe | |
3034 \unhbox0 #1\par}% | |
2795 }% | 3035 }% |
2796 \bigskip | 3036 \nobreak\bigskip % no page break after a chapter title |
2797 \penalty5000 | 3037 \nobreak |
2798 } | 3038 } |
2799 | 3039 |
2800 \def\unnchfplain #1{% | 3040 % Plain opening for unnumbered. |
2801 \pchapsepmacro % | 3041 \def\unnchfplain#1{\chfplain{#1}{}} |
2802 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 3042 |
2803 \parindent=0pt\raggedright | 3043 % @centerchap -- centered and unnumbered. |
2804 \rm #1\hfill}}\bigskip \par\penalty 10000 % | 3044 \let\centerparametersmaybe = \relax |
2805 } | 3045 \def\centerchfplain#1{{% |
3046 \def\centerparametersmaybe{% | |
3047 \advance\rightskip by 3\rightskip | |
3048 \leftskip = \rightskip | |
3049 \parfillskip = 0pt | |
3050 }% | |
3051 \chfplain{#1}{}% | |
3052 }} | |
3053 | |
2806 \CHAPFplain % The default | 3054 \CHAPFplain % The default |
2807 | 3055 |
2808 \def\unnchfopen #1{% | 3056 \def\unnchfopen #1{% |
2809 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 3057 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
2810 \parindent=0pt\raggedright | 3058 \parindent=0pt\raggedright |
2814 \def\chfopen #1#2{\chapoddpage {\chapfonts | 3062 \def\chfopen #1#2{\chapoddpage {\chapfonts |
2815 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% | 3063 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% |
2816 \par\penalty 5000 % | 3064 \par\penalty 5000 % |
2817 } | 3065 } |
2818 | 3066 |
3067 \def\centerchfopen #1{% | |
3068 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | |
3069 \parindent=0pt | |
3070 \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 % | |
3071 } | |
3072 | |
2819 \def\CHAPFopen{ | 3073 \def\CHAPFopen{ |
2820 \global\let\chapmacro=\chfopen | 3074 \global\let\chapmacro=\chfopen |
2821 \global\let\unnumbchapmacro=\unnchfopen} | 3075 \global\let\unnumbchapmacro=\unnchfopen |
2822 | 3076 \global\let\centerchapmacro=\centerchfopen} |
2823 % Parameter controlling skip before section headings. | 3077 |
2824 | 3078 |
2825 \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt | 3079 % Section titles. |
3080 \newskip\secheadingskip | |
3081 \def\secheadingbreak{\dobreak \secheadingskip {-1000}} | |
3082 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} | |
3083 \def\plainsecheading#1{\sectionheading{sec}{}{#1}} | |
3084 | |
3085 % Subsection titles. | |
3086 \newskip \subsecheadingskip | |
2826 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} | 3087 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} |
2827 | 3088 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} |
2828 \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt | 3089 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} |
2829 \def\secheadingbreak{\dobreak \secheadingskip {-1000}} | 3090 |
2830 | 3091 % Subsubsection titles. |
2831 % @paragraphindent is defined for the Info formatting commands only. | 3092 \let\subsubsecheadingskip = \subsecheadingskip |
2832 \let\paragraphindent=\comment | 3093 \let\subsubsecheadingbreak = \subsecheadingbreak |
2833 | 3094 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} |
2834 % Section fonts are the base font at magstep2, which produces | 3095 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} |
2835 % a size a bit more than 14 points in the default situation. | 3096 |
2836 | 3097 |
2837 \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} | 3098 % Print any size section title. |
2838 \def\plainsecheading #1{\secheadingi {#1}} | 3099 % |
2839 \def\secheadingi #1{{\advance \secheadingskip by \parskip % | 3100 % #1 is the section type (sec/subsec/subsubsec), #2 is the section |
2840 \secheadingbreak}% | 3101 % number (maybe empty), #3 the text. |
2841 {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 3102 \def\sectionheading#1#2#3{% |
2842 \parindent=0pt\raggedright | 3103 {% |
2843 \rm #1\hfill}}% | 3104 \expandafter\advance\csname #1headingskip\endcsname by \parskip |
2844 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } | 3105 \csname #1headingbreak\endcsname |
2845 | 3106 }% |
2846 | 3107 {% |
2847 % Subsection fonts are the base font at magstep1, | 3108 % Switch to the right set of fonts. |
2848 % which produces a size of 12 points. | 3109 \csname #1fonts\endcsname \rm |
2849 | 3110 % |
2850 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}} | 3111 % Only insert the separating space if we have a section number. |
2851 \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip % | 3112 \def\secnum{#2}% |
2852 \subsecheadingbreak}% | 3113 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% |
2853 {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 3114 % |
2854 \parindent=0pt\raggedright | 3115 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright |
2855 \rm #1\hfill}}% | 3116 \hangindent = \wd0 % zero if no section number |
2856 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } | 3117 \unhbox0 #3}% |
2857 | 3118 }% |
2858 \def\subsubsecfonts{\subsecfonts} % Maybe this should change: | 3119 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak |
2859 % Perhaps make sssec fonts scaled | 3120 } |
2860 % magstep half | |
2861 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}} | |
2862 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip % | |
2863 \subsecheadingbreak}% | |
2864 {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | |
2865 \parindent=0pt\raggedright | |
2866 \rm #1\hfill}}% | |
2867 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} | |
2868 | 3121 |
2869 | 3122 |
2870 \message{toc printing,} | 3123 \message{toc printing,} |
2871 | |
2872 % Finish up the main text and prepare to read what we've written | 3124 % Finish up the main text and prepare to read what we've written |
2873 % to \contentsfile. | 3125 % to \contentsfile. |
2874 | 3126 |
2875 \newskip\contentsrightmargin \contentsrightmargin=1in | 3127 \newskip\contentsrightmargin \contentsrightmargin=1in |
2876 \def\startcontents#1{% | 3128 \def\startcontents#1{% |
2877 \pagealignmacro | 3129 % If @setchapternewpage on, and @headings double, the contents should |
3130 % start on an odd page, unlike chapters. Thus, we maintain | |
3131 % \contentsalignmacro in parallel with \pagealignmacro. | |
3132 % From: Torbjorn Granlund <tege@matematik.su.se> | |
3133 \contentsalignmacro | |
2878 \immediate\closeout \contentsfile | 3134 \immediate\closeout \contentsfile |
2879 \ifnum \pageno>0 | 3135 \ifnum \pageno>0 |
2880 \pageno = -1 % Request roman numbered pages. | 3136 \pageno = -1 % Request roman numbered pages. |
2881 \fi | 3137 \fi |
2882 % Don't need to put `Contents' or `Short Contents' in the headline. | 3138 % Don't need to put `Contents' or `Short Contents' in the headline. |
2883 % It is abundantly clear what they are. | 3139 % It is abundantly clear what they are. |
2884 \unnumbchapmacro{#1}\def\thischapter{}% | 3140 \unnumbchapmacro{#1}\def\thischapter{}% |
2885 \begingroup % Set up to handle contents files properly. | 3141 \begingroup % Set up to handle contents files properly. |
2886 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 | 3142 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 |
2887 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi | 3143 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi |
2888 \raggedbottom % Worry more about breakpoints than the bottom. | 3144 \raggedbottom % Worry more about breakpoints than the bottom. |
2889 \advance\hsize by -\contentsrightmargin % Don't use the full line length. | 3145 \advance\hsize by -\contentsrightmargin % Don't use the full line length. |
2890 } | 3146 } |
2906 \let\unnumbchapentry = \shortunnumberedentry | 3162 \let\unnumbchapentry = \shortunnumberedentry |
2907 % We want a true roman here for the page numbers. | 3163 % We want a true roman here for the page numbers. |
2908 \secfonts | 3164 \secfonts |
2909 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl | 3165 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl |
2910 \rm | 3166 \rm |
3167 \hyphenpenalty = 10000 | |
2911 \advance\baselineskip by 1pt % Open it up a little. | 3168 \advance\baselineskip by 1pt % Open it up a little. |
2912 \def\secentry ##1##2##3##4{} | 3169 \def\secentry ##1##2##3##4{} |
2913 \def\unnumbsecentry ##1##2{} | 3170 \def\unnumbsecentry ##1##2{} |
2914 \def\subsecentry ##1##2##3##4##5{} | 3171 \def\subsecentry ##1##2##3##4##5{} |
2915 \def\unnumbsubsecentry ##1##2{} | 3172 \def\unnumbsubsecentry ##1##2{} |
2949 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi | 3206 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi |
2950 % | 3207 % |
2951 % This space should be plenty, since a single number is .5em, and the | 3208 % This space should be plenty, since a single number is .5em, and the |
2952 % widest letter (M) is 1em, at least in the Computer Modern fonts. | 3209 % widest letter (M) is 1em, at least in the Computer Modern fonts. |
2953 % (This space doesn't include the extra space that gets added after | 3210 % (This space doesn't include the extra space that gets added after |
2954 % the label; that gets put in in \shortchapentry above.) | 3211 % the label; that gets put in by \shortchapentry above.) |
2955 \advance\dimen0 by 1.1em | 3212 \advance\dimen0 by 1.1em |
2956 \hbox to \dimen0{#1\hfil}% | 3213 \hbox to \dimen0{#1\hfil}% |
2957 } | 3214 } |
2958 | 3215 |
2959 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} | 3216 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} |
2970 % And subsubsections. | 3227 % And subsubsections. |
2971 \def\subsubsecentry#1#2#3#4#5#6{% | 3228 \def\subsubsecentry#1#2#3#4#5#6{% |
2972 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} | 3229 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} |
2973 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} | 3230 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} |
2974 | 3231 |
2975 | |
2976 % This parameter controls the indentation of the various levels. | 3232 % This parameter controls the indentation of the various levels. |
2977 \newdimen\tocindent \tocindent = 3pc | 3233 \newdimen\tocindent \tocindent = 3pc |
2978 | 3234 |
2979 % Now for the actual typesetting. In all these, #1 is the text and #2 is the | 3235 % Now for the actual typesetting. In all these, #1 is the text and #2 is the |
2980 % page number. | 3236 % page number. |
2981 % | 3237 % |
2982 % If the toc has to be broken over pages, we would want to be at chapters | 3238 % If the toc has to be broken over pages, we want it to be at chapters |
2983 % if at all possible; hence the \penalty. | 3239 % if at all possible; hence the \penalty. |
2984 \def\dochapentry#1#2{% | 3240 \def\dochapentry#1#2{% |
2985 \penalty-300 \vskip\baselineskip | 3241 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip |
2986 \begingroup | 3242 \begingroup |
2987 \chapentryfonts | 3243 \chapentryfonts |
2988 \tocentry{#1}{\dopageno{#2}}% | 3244 \tocentry{#1}{\dopageno{#2}}% |
2989 \endgroup | 3245 \endgroup |
2990 \nobreak\vskip .25\baselineskip | 3246 \nobreak\vskip .25\baselineskip plus.1\baselineskip |
2991 } | 3247 } |
2992 | 3248 |
2993 \def\dosecentry#1#2{\begingroup | 3249 \def\dosecentry#1#2{\begingroup |
2994 \secentryfonts \leftskip=\tocindent | 3250 \secentryfonts \leftskip=\tocindent |
2995 \tocentry{#1}{\dopageno{#2}}% | 3251 \tocentry{#1}{\dopageno{#2}}% |
3008 % Final typesetting of a toc entry; we use the same \entry macro as for | 3264 % Final typesetting of a toc entry; we use the same \entry macro as for |
3009 % the index entries, but we want to suppress hyphenation here. (We | 3265 % the index entries, but we want to suppress hyphenation here. (We |
3010 % can't do that in the \entry macro, since index entries might consist | 3266 % can't do that in the \entry macro, since index entries might consist |
3011 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) | 3267 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) |
3012 % | 3268 % |
3269 % \turnoffactive is for the sake of @" used for umlauts. | |
3013 \def\tocentry#1#2{\begingroup | 3270 \def\tocentry#1#2{\begingroup |
3014 \hyphenpenalty = 10000 | 3271 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks |
3015 \entry{#1}{#2}% | 3272 \entry{\turnoffactive #1}{\turnoffactive #2}% |
3016 \endgroup} | 3273 \endgroup} |
3017 | 3274 |
3018 % Space between chapter (or whatever) number and the title. | 3275 % Space between chapter (or whatever) number and the title. |
3019 \def\labelspace{\hskip1em \relax} | 3276 \def\labelspace{\hskip1em \relax} |
3020 | 3277 |
3033 % \tt widths. Each \tt character is 1en, so two makes it 1em. | 3290 % \tt widths. Each \tt character is 1en, so two makes it 1em. |
3034 % Furthermore, these definitions must come after we define our fonts. | 3291 % Furthermore, these definitions must come after we define our fonts. |
3035 \newbox\dblarrowbox \newbox\longdblarrowbox | 3292 \newbox\dblarrowbox \newbox\longdblarrowbox |
3036 \newbox\pushcharbox \newbox\bullbox | 3293 \newbox\pushcharbox \newbox\bullbox |
3037 \newbox\equivbox \newbox\errorbox | 3294 \newbox\equivbox \newbox\errorbox |
3038 | |
3039 \let\ptexequiv = \equiv | |
3040 | 3295 |
3041 %{\tentt | 3296 %{\tentt |
3042 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} | 3297 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} |
3043 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} | 3298 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} |
3044 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} | 3299 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} |
3046 % Adapted from the manmac format (p.420 of TeXbook) | 3301 % Adapted from the manmac format (p.420 of TeXbook) |
3047 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex | 3302 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex |
3048 % depth .1ex\hfil} | 3303 % depth .1ex\hfil} |
3049 %} | 3304 %} |
3050 | 3305 |
3306 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. | |
3051 \def\point{$\star$} | 3307 \def\point{$\star$} |
3052 | |
3053 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} | 3308 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} |
3054 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} | 3309 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} |
3055 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} | 3310 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} |
3056 | |
3057 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} | 3311 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} |
3058 | 3312 |
3059 % Adapted from the TeXbook's \boxit. | 3313 % Adapted from the TeXbook's \boxit. |
3060 {\tentt \global\dimen0 = 3em}% Width of the box. | 3314 {\tentt \global\dimen0 = 3em}% Width of the box. |
3061 \dimen2 = .55pt % Thickness of rules | 3315 \dimen2 = .55pt % Thickness of rules |
3083 \def\tex{\begingroup | 3337 \def\tex{\begingroup |
3084 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 | 3338 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 |
3085 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 | 3339 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 |
3086 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie | 3340 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie |
3087 \catcode `\%=14 | 3341 \catcode `\%=14 |
3088 \catcode 43=12 | 3342 \catcode 43=12 % plus |
3089 \catcode`\"=12 | 3343 \catcode`\"=12 |
3090 \catcode`\==12 | 3344 \catcode`\==12 |
3091 \catcode`\|=12 | 3345 \catcode`\|=12 |
3092 \catcode`\<=12 | 3346 \catcode`\<=12 |
3093 \catcode`\>=12 | 3347 \catcode`\>=12 |
3094 \escapechar=`\\ | 3348 \escapechar=`\\ |
3095 % | 3349 % |
3350 \let\,=\ptexcomma | |
3096 \let\~=\ptextilde | 3351 \let\~=\ptextilde |
3097 \let\{=\ptexlbrace | 3352 \let\{=\ptexlbrace |
3098 \let\}=\ptexrbrace | 3353 \let\}=\ptexrbrace |
3099 \let\.=\ptexdot | 3354 \let\.=\ptexdot |
3100 \let\*=\ptexstar | 3355 \let\*=\ptexstar |
3101 \let\dots=\ptexdots | 3356 \let\dots=\ptexdots |
3357 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} | |
3358 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} | |
3102 \def\@{@}% | 3359 \def\@{@}% |
3103 \let\bullet=\ptexbullet | 3360 \let\bullet=\ptexbullet |
3104 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl | 3361 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext |
3105 \let\L=\ptexL | |
3106 % | 3362 % |
3107 \let\Etex=\endgroup} | 3363 \let\Etex=\endgroup} |
3108 | 3364 |
3109 % Define @lisp ... @endlisp. | 3365 % Define @lisp ... @endlisp. |
3110 % @lisp does a \begingroup so it can rebind things, | 3366 % @lisp does a \begingroup so it can rebind things, |
3159 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth | 3415 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth |
3160 \def\ctr{{\hskip 6pt\circle\char'010}} | 3416 \def\ctr{{\hskip 6pt\circle\char'010}} |
3161 \def\cbl{{\circle\char'012\hskip -6pt}} | 3417 \def\cbl{{\circle\char'012\hskip -6pt}} |
3162 \def\cbr{{\hskip 6pt\circle\char'011}} | 3418 \def\cbr{{\hskip 6pt\circle\char'011}} |
3163 \def\carttop{\hbox to \cartouter{\hskip\lskip | 3419 \def\carttop{\hbox to \cartouter{\hskip\lskip |
3164 \ctl\leaders\hrule height\circthick\hfil\ctr | 3420 \ctl\leaders\hrule height\circthick\hfil\ctr |
3165 \hskip\rskip}} | 3421 \hskip\rskip}} |
3166 \def\cartbot{\hbox to \cartouter{\hskip\lskip | 3422 \def\cartbot{\hbox to \cartouter{\hskip\lskip |
3167 \cbl\leaders\hrule height\circthick\hfil\cbr | 3423 \cbl\leaders\hrule height\circthick\hfil\cbr |
3168 \hskip\rskip}} | 3424 \hskip\rskip}} |
3169 % | 3425 % |
3170 \newskip\lskip\newskip\rskip | 3426 \newskip\lskip\newskip\rskip |
3171 | 3427 |
3172 \long\def\cartouche{% | 3428 \long\def\cartouche{% |
3173 \begingroup | 3429 \begingroup |
3174 \lskip=\leftskip \rskip=\rightskip | 3430 \lskip=\leftskip \rskip=\rightskip |
3175 \leftskip=0pt\rightskip=0pt %we want these *outside*. | 3431 \leftskip=0pt\rightskip=0pt %we want these *outside*. |
3176 \cartinner=\hsize \advance\cartinner by-\lskip | 3432 \cartinner=\hsize \advance\cartinner by-\lskip |
3177 \advance\cartinner by-\rskip | 3433 \advance\cartinner by-\rskip |
3178 \cartouter=\hsize | 3434 \cartouter=\hsize |
3179 \advance\cartouter by 18pt % allow for 3pt kerns on either | 3435 \advance\cartouter by 18pt % allow for 3pt kerns on either |
3180 % side, and for 6pt waste from | 3436 % side, and for 6pt waste from |
3181 % each corner char | 3437 % each corner char |
3182 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip | 3438 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip |
3183 % Flag to tell @lisp, etc., not to narrow margin. | 3439 % Flag to tell @lisp, etc., not to narrow margin. |
3184 \let\nonarrowing=\comment | 3440 \let\nonarrowing=\comment |
3185 \vbox\bgroup | 3441 \vbox\bgroup |
3186 \baselineskip=0pt\parskip=0pt\lineskip=0pt | 3442 \baselineskip=0pt\parskip=0pt\lineskip=0pt |
3187 \carttop | 3443 \carttop |
3188 \hbox\bgroup | 3444 \hbox\bgroup |
3189 \hskip\lskip | 3445 \hskip\lskip |
3190 \vrule\kern3pt | 3446 \vrule\kern3pt |
3191 \vbox\bgroup | 3447 \vbox\bgroup |
3192 \hsize=\cartinner | 3448 \hsize=\cartinner |
3193 \kern3pt | 3449 \kern3pt |
3194 \begingroup | 3450 \begingroup |
3195 \baselineskip=\normbskip | 3451 \baselineskip=\normbskip |
3196 \lineskip=\normlskip | 3452 \lineskip=\normlskip |
3197 \parskip=\normpskip | 3453 \parskip=\normpskip |
3198 \vskip -\parskip | 3454 \vskip -\parskip |
3199 \def\Ecartouche{% | 3455 \def\Ecartouche{% |
3200 \endgroup | 3456 \endgroup |
3201 \kern3pt | 3457 \kern3pt |
3202 \egroup | 3458 \egroup |
3203 \kern3pt\vrule | 3459 \kern3pt\vrule |
3204 \hskip\rskip | 3460 \hskip\rskip |
3205 \egroup | 3461 \egroup |
3206 \cartbot | 3462 \cartbot |
3207 \egroup | 3463 \egroup |
3208 \endgroup | 3464 \endgroup |
3209 }} | 3465 }} |
3210 | 3466 |
3211 | 3467 |
3212 % This macro is called at the beginning of all the @example variants, | 3468 % This macro is called at the beginning of all the @example variants, |
3265 \def\smalllispx{\begingroup | 3521 \def\smalllispx{\begingroup |
3266 \nonfillstart | 3522 \nonfillstart |
3267 \let\Esmalllisp = \nonfillfinish | 3523 \let\Esmalllisp = \nonfillfinish |
3268 \let\Esmallexample = \nonfillfinish | 3524 \let\Esmallexample = \nonfillfinish |
3269 % | 3525 % |
3270 % Smaller interline space and fonts for small examples. | 3526 % Smaller fonts for small examples. |
3271 \setleading{10pt}% | |
3272 \indexfonts \tt | 3527 \indexfonts \tt |
3273 \rawbackslash % make \ output the \ character from the current font (tt) | 3528 \rawbackslash % make \ output the \ character from the current font (tt) |
3274 \gobble | 3529 \gobble |
3275 } | 3530 } |
3276 | 3531 |
3794 % This definition is run if you use @deftpx, etc | 4049 % This definition is run if you use @deftpx, etc |
3795 % anywhere other than immediately after a @deftp, etc. | 4050 % anywhere other than immediately after a @deftp, etc. |
3796 | 4051 |
3797 \def\deftpx #1 {\errmessage{@deftpx in invalid context}} | 4052 \def\deftpx #1 {\errmessage{@deftpx in invalid context}} |
3798 | 4053 |
4054 | |
3799 \message{cross reference,} | 4055 \message{cross reference,} |
3800 % Define cross-reference macros | 4056 % Define cross-reference macros |
3801 \newwrite \auxfile | 4057 \newwrite \auxfile |
3802 | 4058 |
3803 \newif\ifhavexrefs % True if xref values are known. | 4059 \newif\ifhavexrefs % True if xref values are known. |
3804 \newif\ifwarnedxrefs % True if we warned once that they aren't known. | 4060 \newif\ifwarnedxrefs % True if we warned once that they aren't known. |
4061 | |
4062 % @inforef is simple. | |
4063 \def\inforef #1{\inforefzzz #1,,,,**} | |
4064 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | |
4065 node \samp{\ignorespaces#1{}}} | |
3805 | 4066 |
3806 % \setref{foo} defines a cross-reference point named foo. | 4067 % \setref{foo} defines a cross-reference point named foo. |
3807 | 4068 |
3808 \def\setref#1{% | 4069 \def\setref#1{% |
3809 \dosetq{#1-title}{Ytitle}% | 4070 \dosetq{#1-title}{Ytitle}% |
3834 \def\printednodename{\ignorespaces #3}% | 4095 \def\printednodename{\ignorespaces #3}% |
3835 \setbox1=\hbox{\printedmanual}% | 4096 \setbox1=\hbox{\printedmanual}% |
3836 \setbox0=\hbox{\printednodename}% | 4097 \setbox0=\hbox{\printednodename}% |
3837 \ifdim \wd0 = 0pt | 4098 \ifdim \wd0 = 0pt |
3838 % No printed node name was explicitly given. | 4099 % No printed node name was explicitly given. |
3839 \ifx\SETxref-automatic-section-title\relax % | 4100 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax |
4101 % Use the node name inside the square brackets. | |
4102 \def\printednodename{\ignorespaces #1}% | |
4103 \else | |
3840 % Use the actual chapter/section title appear inside | 4104 % Use the actual chapter/section title appear inside |
3841 % the square brackets. Use the real section title if we have it. | 4105 % the square brackets. Use the real section title if we have it. |
3842 \ifdim \wd1>0pt% | 4106 \ifdim \wd1>0pt% |
3843 % It is in another manual, so we don't have it. | 4107 % It is in another manual, so we don't have it. |
3844 \def\printednodename{\ignorespaces #1}% | 4108 \def\printednodename{\ignorespaces #1}% |
3845 \else | 4109 \else |
3846 \ifhavexrefs | 4110 \ifhavexrefs |
3847 % We know the real title if we have the xref values. | 4111 % We know the real title if we have the xref values. |
3848 \def\printednodename{\refx{#1-title}}% | 4112 \def\printednodename{\refx{#1-title}{}}% |
3849 \else | 4113 \else |
3850 % Otherwise just copy the Info node name. | 4114 % Otherwise just copy the Info node name. |
3851 \def\printednodename{\ignorespaces #1}% | 4115 \def\printednodename{\ignorespaces #1}% |
3852 \fi% | 4116 \fi% |
3853 \fi | 4117 \fi |
3854 \def\printednodename{#1-title}% | |
3855 \else | |
3856 % Use the node name inside the square brackets. | |
3857 \def\printednodename{\ignorespaces #1}% | |
3858 \fi | 4118 \fi |
3859 \fi | 4119 \fi |
3860 % | 4120 % |
3861 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not | 4121 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not |
3862 % insert empty discretionaries after hyphens, which means that it will | 4122 % insert empty discretionaries after hyphens, which means that it will |
4037 \newcount \footnoteno | 4297 \newcount \footnoteno |
4038 | 4298 |
4039 % The trailing space in the following definition for supereject is | 4299 % The trailing space in the following definition for supereject is |
4040 % vital for proper filling; pages come out unaligned when you do a | 4300 % vital for proper filling; pages come out unaligned when you do a |
4041 % pagealignmacro call if that space before the closing brace is | 4301 % pagealignmacro call if that space before the closing brace is |
4042 % removed. | 4302 % removed. (Generally, numeric constants should always be followed by a |
4303 % space to prevent strange expansion errors.) | |
4043 \def\supereject{\par\penalty -20000\footnoteno =0 } | 4304 \def\supereject{\par\penalty -20000\footnoteno =0 } |
4044 | 4305 |
4045 % @footnotestyle is meaningful for info output only.. | 4306 % @footnotestyle is meaningful for info output only.. |
4046 \let\footnotestyle=\comment | 4307 \let\footnotestyle=\comment |
4047 | 4308 |
4162 \newcodeindex{pg}% | 4423 \newcodeindex{pg}% |
4163 } | 4424 } |
4164 | 4425 |
4165 % Set some numeric style parameters, for 8.5 x 11 format. | 4426 % Set some numeric style parameters, for 8.5 x 11 format. |
4166 | 4427 |
4167 %\hsize = 6.5in | 4428 \hsize = 6in |
4429 \hoffset = .25in | |
4168 \newdimen\defaultparindent \defaultparindent = 15pt | 4430 \newdimen\defaultparindent \defaultparindent = 15pt |
4169 \parindent = \defaultparindent | 4431 \parindent = \defaultparindent |
4170 \parskip 18pt plus 1pt | 4432 \parskip 3pt plus 2pt minus 1pt |
4171 \setleading{15pt} | 4433 \setleading{13.2pt} |
4172 \advance\topskip by 1.2cm | 4434 \advance\topskip by 1.2cm |
4435 | |
4436 \chapheadingskip = 15pt plus 4pt minus 2pt | |
4437 \secheadingskip = 12pt plus 3pt minus 2pt | |
4438 \subsecheadingskip = 9pt plus 2pt minus 2pt | |
4173 | 4439 |
4174 % Prevent underfull vbox error messages. | 4440 % Prevent underfull vbox error messages. |
4175 \vbadness=10000 | 4441 \vbadness=10000 |
4176 | 4442 |
4177 % Following George Bush, just get rid of widows and orphans. | 4443 % Following George Bush, just get rid of widows and orphans. |
4191 \divide\emergencystretch by 45 | 4457 \divide\emergencystretch by 45 |
4192 \fi | 4458 \fi |
4193 | 4459 |
4194 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) | 4460 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25) |
4195 \def\smallbook{ | 4461 \def\smallbook{ |
4196 | 4462 \global\chapheadingskip = 15pt plus 4pt minus 2pt |
4197 % These values for secheadingskip and subsecheadingskip are | 4463 \global\secheadingskip = 12pt plus 3pt minus 2pt |
4198 % experiments. RJC 7 Aug 1992 | 4464 \global\subsecheadingskip = 9pt plus 2pt minus 2pt |
4199 \global\secheadingskip = 17pt plus 6pt minus 3pt | 4465 % |
4200 \global\subsecheadingskip = 14pt plus 6pt minus 3pt | 4466 \global\lispnarrowing = 0.3in |
4201 | 4467 \setleading{12pt} |
4202 \global\lispnarrowing = 0.3in | 4468 \advance\topskip by -1cm |
4203 \setleading{12pt} | 4469 \global\parskip 2pt plus 1pt |
4204 \advance\topskip by -1cm | 4470 \global\hsize = 5in |
4205 \global\parskip 3pt plus 1pt | 4471 \global\vsize=7.5in |
4206 \global\hsize = 5in | 4472 \global\tolerance=700 |
4207 \global\vsize=7.5in | 4473 \global\hfuzz=1pt |
4208 \global\tolerance=700 | 4474 \global\contentsrightmargin=0pt |
4209 \global\hfuzz=1pt | 4475 \global\deftypemargin=0pt |
4210 \global\contentsrightmargin=0pt | 4476 \global\defbodyindent=.5cm |
4211 \global\deftypemargin=0pt | 4477 % |
4212 \global\defbodyindent=.5cm | 4478 \global\pagewidth=\hsize |
4213 | 4479 \global\pageheight=\vsize |
4214 \global\pagewidth=\hsize | 4480 % |
4215 \global\pageheight=\vsize | 4481 \global\let\smalllisp=\smalllispx |
4216 | 4482 \global\let\smallexample=\smalllispx |
4217 \global\let\smalllisp=\smalllispx | 4483 \global\def\Esmallexample{\Esmalllisp} |
4218 \global\let\smallexample=\smalllispx | |
4219 \global\def\Esmallexample{\Esmalllisp} | |
4220 } | 4484 } |
4221 | 4485 |
4222 % Use @afourpaper to print on European A4 paper. | 4486 % Use @afourpaper to print on European A4 paper. |
4223 \def\afourpaper{ | 4487 \def\afourpaper{ |
4224 \global\tolerance=700 | 4488 \global\tolerance=700 |
4237 | 4501 |
4238 \global\pagewidth=\hsize | 4502 \global\pagewidth=\hsize |
4239 \global\pageheight=\vsize | 4503 \global\pageheight=\vsize |
4240 } | 4504 } |
4241 | 4505 |
4506 \bindingoffset=0pt | |
4507 \normaloffset=\hoffset | |
4508 \pagewidth=\hsize | |
4509 \pageheight=\vsize | |
4510 | |
4242 % Allow control of the text dimensions. Parameters in order: textheight; | 4511 % Allow control of the text dimensions. Parameters in order: textheight; |
4243 % textwidth; \voffset; \hoffset (!); binding offset. All require a dimension; | 4512 % textwidth; voffset; hoffset; binding offset; topskip. |
4513 % All require a dimension; | |
4244 % header is additional; added length extends the bottom of the page. | 4514 % header is additional; added length extends the bottom of the page. |
4245 | 4515 |
4246 \def\changepagesizes#1#2#3#4#5{ | 4516 \def\changepagesizes#1#2#3#4#5#6{ |
4247 \global\vsize= #1 | 4517 \global\vsize= #1 |
4518 \global\topskip= #6 | |
4248 \advance\vsize by \topskip | 4519 \advance\vsize by \topskip |
4249 \global\voffset= #3 | 4520 \global\voffset= #3 |
4250 \global\hsize= #2 | 4521 \global\hsize= #2 |
4251 \global\outerhsize=\hsize | 4522 \global\outerhsize=\hsize |
4252 \global\advance\outerhsize by 0.5in | 4523 \global\advance\outerhsize by 0.5in |
4255 \global\pagewidth=\hsize | 4526 \global\pagewidth=\hsize |
4256 \global\pageheight=\vsize | 4527 \global\pageheight=\vsize |
4257 \global\normaloffset= #4 | 4528 \global\normaloffset= #4 |
4258 \global\bindingoffset= #5} | 4529 \global\bindingoffset= #5} |
4259 | 4530 |
4260 % This layout is compatible with Latex on A4 paper. | 4531 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin |
4261 | 4532 % 29mm, hence bottom margin 28mm, nominal side margin 3cm. |
4262 \def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}} | 4533 \def\afourlatex |
4534 {\global\tolerance=700 | |
4535 \global\hfuzz=1pt | |
4536 \setleading{12pt} | |
4537 \global\parskip 15pt plus 1pt | |
4538 \advance\baselineskip by 1.6pt | |
4539 \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm} | |
4540 } | |
4263 | 4541 |
4264 % Use @afourwide to print on European A4 paper in wide format. | 4542 % Use @afourwide to print on European A4 paper in wide format. |
4265 \def\afourwide{\afourpaper | 4543 \def\afourwide{\afourpaper |
4266 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}} | 4544 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}} |
4267 | 4545 |
4268 % Define macros to output various characters with catcode for normal text. | 4546 % Define macros to output various characters with catcode for normal text. |
4269 \catcode`\"=\other | 4547 \catcode`\"=\other |
4270 \catcode`\~=\other | 4548 \catcode`\~=\other |
4271 \catcode`\^=\other | 4549 \catcode`\^=\other |
4310 \def^{{\tt \hat}} | 4588 \def^{{\tt \hat}} |
4311 | 4589 |
4312 \catcode`\_=\active | 4590 \catcode`\_=\active |
4313 \def_{\ifusingtt\normalunderscore\_} | 4591 \def_{\ifusingtt\normalunderscore\_} |
4314 % Subroutine for the previous macro. | 4592 % Subroutine for the previous macro. |
4315 \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}} | 4593 \def\_{\leavevmode \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{}} | |
4323 | 4594 |
4324 \catcode`\|=\active | 4595 \catcode`\|=\active |
4325 \def|{{\tt \char '174}} | 4596 \def|{{\tt \char '174}} |
4326 \chardef \less=`\< | 4597 \chardef \less=`\< |
4327 \catcode`\<=\active | 4598 \catcode`\<=\active |