Mercurial > emacs
comparison lispintro/texinfo.tex @ 51944:4bfad02b45db
Apply Karl Berry's bug fix so @copying works with @ifnottex
author | Robert J. Chassell <bob@rattlesnake.com> |
---|---|
date | Wed, 16 Jul 2003 19:00:28 +0000 |
parents | 23a1cea22d13 |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
51943:4ab63324776e | 51944:4bfad02b45db |
---|---|
1 % texinfo.tex -- TeX macros to handle Texinfo files. | 1 % texinfo.tex -- TeX macros to handle Texinfo files. |
2 % | 2 % |
3 % Load plain if necessary, i.e., if running under initex. | 3 % Load plain if necessary, i.e., if running under initex. |
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
5 % | 5 % |
6 \def\texinfoversion{2002-06-07.15} | 6 \def\texinfoversion{2003-07-16.18} |
7 % | 7 % |
8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, | 8 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
9 % 2000, 01, 02 Free Software Foundation, Inc. | 9 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
10 % | 10 % |
11 % This texinfo.tex file is free software; you can redistribute it and/or | 11 % This texinfo.tex file is free software; you can redistribute it and/or |
12 % modify it under the terms of the GNU General Public License as | 12 % modify it under the terms of the GNU General Public License as |
13 % published by the Free Software Foundation; either version 2, or (at | 13 % published by the Free Software Foundation; either version 2, or (at |
14 % your option) any later version. | 14 % your option) any later version. |
27 % You are forbidden to forbid anyone else to use, share and improve | 27 % You are forbidden to forbid anyone else to use, share and improve |
28 % what you give them. Help stamp out software-hoarding! | 28 % what you give them. Help stamp out software-hoarding! |
29 % | 29 % |
30 % Please try the latest version of texinfo.tex before submitting bug | 30 % Please try the latest version of texinfo.tex before submitting bug |
31 % reports; you can get the latest version from: | 31 % reports; you can get the latest version from: |
32 % ftp://ftp.gnu.org/gnu/texinfo.tex | 32 % ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex |
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) | 33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) |
34 % ftp://texinfo.org/texinfo/texinfo.tex | |
35 % ftp://tug.org/tex/texinfo.tex | 34 % ftp://tug.org/tex/texinfo.tex |
36 % (and all CTAN mirrors, see http://www.ctan.org), | 35 % (and all CTAN mirrors, see http://www.ctan.org), |
37 % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. | 36 % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. |
38 % | 37 % |
38 % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. | |
39 % | |
39 % The texinfo.tex in any given Texinfo distribution could well be out | 40 % The texinfo.tex in any given Texinfo distribution could well be out |
40 % of date, so if that's what you're using, please check. | 41 % of date, so if that's what you're using, please check. |
41 % | |
42 % Texinfo has a small home page at http://texinfo.org/ and also | |
43 % http://www.gnu.org/software/texinfo. | |
44 % | 42 % |
45 % Send bug reports to bug-texinfo@gnu.org. Please include including a | 43 % Send bug reports to bug-texinfo@gnu.org. Please include including a |
46 % complete document in each bug report with which we can reproduce the | 44 % complete document in each bug report with which we can reproduce the |
47 % problem. Patches are, of course, greatly appreciated. | 45 % problem. Patches are, of course, greatly appreciated. |
48 % | 46 % |
56 % dvips foo.dvi -o # or whatever; this makes foo.ps. | 54 % dvips foo.dvi -o # or whatever; this makes foo.ps. |
57 % The extra TeX runs get the cross-reference information correct. | 55 % The extra TeX runs get the cross-reference information correct. |
58 % Sometimes one run after texindex suffices, and sometimes you need more | 56 % Sometimes one run after texindex suffices, and sometimes you need more |
59 % than two; texi2dvi does it as many times as necessary. | 57 % than two; texi2dvi does it as many times as necessary. |
60 % | 58 % |
61 % It is possible to adapt texinfo.tex for other languages. You can get | 59 % It is possible to adapt texinfo.tex for other languages, to some |
62 % the existing language-specific files from the full Texinfo distribution. | 60 % extent. You can get the existing language-specific files from the |
61 % full Texinfo distribution. | |
63 | 62 |
64 \message{Loading texinfo [version \texinfoversion]:} | 63 \message{Loading texinfo [version \texinfoversion]:} |
65 | 64 |
66 % If in a .fmt file, print the version number | 65 % If in a .fmt file, print the version number |
67 % and turn on active characters that we couldn't do earlier because | 66 % and turn on active characters that we couldn't do earlier because |
68 % they might have appeared in the input file name. | 67 % they might have appeared in the input file name. |
69 \everyjob{\message{[Texinfo version \texinfoversion]}% | 68 \everyjob{\message{[Texinfo version \texinfoversion]}% |
70 \catcode`+=\active \catcode`\_=\active} | 69 \catcode`+=\active \catcode`\_=\active} |
71 | 70 |
72 % Save some parts of plain tex whose names we will redefine. | 71 \message{Basics,} |
72 \chardef\other=12 | |
73 | |
74 % We never want plain's \outer definition of \+ in Texinfo. | |
75 % For @tex, we can use \tabalign. | |
76 \let\+ = \relax | |
77 | |
78 % Save some plain tex macros whose names we will redefine. | |
73 \let\ptexb=\b | 79 \let\ptexb=\b |
74 \let\ptexbullet=\bullet | 80 \let\ptexbullet=\bullet |
75 \let\ptexc=\c | 81 \let\ptexc=\c |
76 \let\ptexcomma=\, | 82 \let\ptexcomma=\, |
77 \let\ptexdot=\. | 83 \let\ptexdot=\. |
78 \let\ptexdots=\dots | 84 \let\ptexdots=\dots |
79 \let\ptexend=\end | 85 \let\ptexend=\end |
80 \let\ptexequiv=\equiv | 86 \let\ptexequiv=\equiv |
81 \let\ptexexclam=\! | 87 \let\ptexexclam=\! |
88 \let\ptexgtr=> | |
89 \let\ptexhat=^ | |
82 \let\ptexi=\i | 90 \let\ptexi=\i |
91 \let\ptexindent=\indent | |
83 \let\ptexlbrace=\{ | 92 \let\ptexlbrace=\{ |
93 \let\ptexless=< | |
94 \let\ptexplus=+ | |
84 \let\ptexrbrace=\} | 95 \let\ptexrbrace=\} |
96 \let\ptexslash=\/ | |
85 \let\ptexstar=\* | 97 \let\ptexstar=\* |
86 \let\ptext=\t | 98 \let\ptext=\t |
87 | |
88 % We never want plain's outer \+ definition in Texinfo. | |
89 % For @tex, we can use \tabalign. | |
90 \let\+ = \relax | |
91 | |
92 \message{Basics,} | |
93 \chardef\other=12 | |
94 | 99 |
95 % If this character appears in an error message or help string, it | 100 % If this character appears in an error message or help string, it |
96 % starts a new line in the output. | 101 % starts a new line in the output. |
97 \newlinechar = `^^J | 102 \newlinechar = `^^J |
98 | 103 |
136 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi | 141 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi |
137 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi | 142 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi |
138 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi | 143 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi |
139 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi | 144 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi |
140 | 145 |
146 % In some macros, we cannot use the `\? notation---the left quote is | |
147 % in some cases the escape char. | |
148 \chardef\colonChar = `\: | |
149 \chardef\commaChar = `\, | |
150 \chardef\dotChar = `\. | |
151 \chardef\equalChar = `\= | |
152 \chardef\exclamChar= `\! | |
153 \chardef\questChar = `\? | |
154 \chardef\semiChar = `\; | |
155 \chardef\spaceChar = `\ % | |
156 \chardef\underChar = `\_ | |
157 | |
141 % Ignore a token. | 158 % Ignore a token. |
142 % | 159 % |
143 \def\gobble#1{} | 160 \def\gobble#1{} |
144 | 161 |
162 % True if #1 is the empty string, i.e., called like `\ifempty{}'. | |
163 % | |
164 \def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}% | |
165 \def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}% | |
166 | |
167 % Hyphenation fixes. | |
145 \hyphenation{ap-pen-dix} | 168 \hyphenation{ap-pen-dix} |
169 \hyphenation{eshell} | |
146 \hyphenation{mini-buf-fer mini-buf-fers} | 170 \hyphenation{mini-buf-fer mini-buf-fers} |
147 \hyphenation{eshell} | 171 \hyphenation{time-stamp} |
148 \hyphenation{white-space} | 172 \hyphenation{white-space} |
149 | 173 |
150 % Margin to add to right of even pages, to left of odd pages. | 174 % Margin to add to right of even pages, to left of odd pages. |
151 \newdimen \bindingoffset | 175 \newdimen\bindingoffset |
152 \newdimen \normaloffset | 176 \newdimen\normaloffset |
153 \newdimen\pagewidth \newdimen\pageheight | 177 \newdimen\pagewidth \newdimen\pageheight |
154 | 178 |
155 % Sometimes it is convenient to have everything in the transcript file | 179 % Sometimes it is convenient to have everything in the transcript file |
156 % and nothing on the terminal. We don't just call \tracingall here, | 180 % and nothing on the terminal. We don't just call \tracingall here, |
157 % since that produces some useless output on the terminal. | 181 % since that produces some useless output on the terminal. We also make |
182 % some effort to order the tracing commands to reduce output in the log | |
183 % file; cf. trace.sty in LaTeX. | |
158 % | 184 % |
159 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% | 185 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% |
160 \ifx\eTeXversion\undefined | 186 \def\loggingall{% |
161 \def\loggingall{\tracingcommands2 \tracingstats2 | 187 \tracingstats2 |
162 \tracingpages1 \tracingoutput1 \tracinglostchars1 | 188 \tracingpages1 |
163 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 | 189 \tracinglostchars2 % 2 gives us more in etex |
164 \showboxbreadth\maxdimen\showboxdepth\maxdimen | 190 \tracingparagraphs1 |
191 \tracingoutput1 | |
192 \tracingmacros2 | |
193 \tracingrestores1 | |
194 \showboxbreadth\maxdimen \showboxdepth\maxdimen | |
195 \ifx\eTeXversion\undefined\else % etex gives us more logging | |
196 \tracingscantokens1 | |
197 \tracingifs1 | |
198 \tracinggroups1 | |
199 \tracingnesting2 | |
200 \tracingassigns1 | |
201 \fi | |
202 \tracingcommands3 % 3 gives us more in etex | |
203 \errorcontextlines\maxdimen | |
165 }% | 204 }% |
166 \else | |
167 \def\loggingall{\tracingcommands3 \tracingstats2 | |
168 \tracingpages1 \tracingoutput1 \tracinglostchars1 | |
169 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 | |
170 \tracingscantokens1 \tracingassigns1 \tracingifs1 | |
171 \tracinggroups1 \tracingnesting2 | |
172 \showboxbreadth\maxdimen\showboxdepth\maxdimen | |
173 }% | |
174 \fi | |
175 | 205 |
176 % add check for \lastpenalty to plain's definitions. If the last thing | 206 % add check for \lastpenalty to plain's definitions. If the last thing |
177 % we did was a \nobreak, we don't want to insert more space. | 207 % we did was a \nobreak, we don't want to insert more space. |
178 % | 208 % |
179 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount | 209 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount |
274 \line{\ewbot\hfil\ewbot}% | 304 \line{\ewbot\hfil\ewbot}% |
275 }% | 305 }% |
276 \egroup % \vbox from first cropmarks clause | 306 \egroup % \vbox from first cropmarks clause |
277 \fi | 307 \fi |
278 }% end of \shipout\vbox | 308 }% end of \shipout\vbox |
279 }% end of group with \turnoffactive | 309 }% end of group with \normalturnoffactive |
280 \advancepageno | 310 \advancepageno |
281 \ifnum\outputpenalty>-20000 \else\dosupereject\fi | 311 \ifnum\outputpenalty>-20000 \else\dosupereject\fi |
282 } | 312 } |
283 | 313 |
284 \newinsert\margin \dimen\margin=\maxdimen | 314 \newinsert\margin \dimen\margin=\maxdimen |
434 \def\defineunmatchedend#1{% | 464 \def\defineunmatchedend#1{% |
435 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% | 465 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% |
436 } | 466 } |
437 | 467 |
438 | 468 |
439 % Single-spacing is done by various environments (specifically, in | |
440 % \nonfillstart and \quotations). | |
441 \newskip\singlespaceskip \singlespaceskip = 12.5pt | |
442 \def\singlespace{% | |
443 % Why was this kern here? It messes up equalizing space above and below | |
444 % environments. --karl, 6may93 | |
445 %{\advance \baselineskip by -\singlespaceskip | |
446 %\kern \baselineskip}% | |
447 \setleading\singlespaceskip | |
448 } | |
449 | |
450 %% Simple single-character @ commands | 469 %% Simple single-character @ commands |
451 | 470 |
452 % @@ prints an @ | 471 % @@ prints an @ |
453 % Kludge this until the fonts are right (grr). | 472 % Kludge this until the fonts are right (grr). |
454 \def\@{{\tt\char64}} | 473 \def\@{{\tt\char64}} |
464 \def\mylbrace {{\tt\char123}} | 483 \def\mylbrace {{\tt\char123}} |
465 \def\myrbrace {{\tt\char125}} | 484 \def\myrbrace {{\tt\char125}} |
466 \let\{=\mylbrace | 485 \let\{=\mylbrace |
467 \let\}=\myrbrace | 486 \let\}=\myrbrace |
468 \begingroup | 487 \begingroup |
469 % Definitions to produce actual \{ & \} command in an index. | 488 % Definitions to produce \{ and \} commands for indices, |
470 \catcode`\{ = 12 \catcode`\} = 12 | 489 % and @{ and @} for the aux file. |
490 \catcode`\{ = \other \catcode`\} = \other | |
471 \catcode`\[ = 1 \catcode`\] = 2 | 491 \catcode`\[ = 1 \catcode`\] = 2 |
472 \catcode`\@ = 0 \catcode`\\ = 12 | 492 \catcode`\! = 0 \catcode`\\ = \other |
473 @gdef@lbracecmd[\{]% | 493 !gdef!lbracecmd[\{]% |
474 @gdef@rbracecmd[\}]% | 494 !gdef!rbracecmd[\}]% |
475 @endgroup | 495 !gdef!lbraceatcmd[@{]% |
496 !gdef!rbraceatcmd[@}]% | |
497 !endgroup | |
476 | 498 |
477 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | 499 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent |
478 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. | 500 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. |
479 \let\, = \c | 501 \let\, = \c |
480 \let\dotaccent = \. | 502 \let\dotaccent = \. |
481 \def\ringaccent#1{{\accent23 #1}} | 503 \def\ringaccent#1{{\accent23 #1}} |
482 \let\tieaccent = \t | 504 \let\tieaccent = \t |
483 \let\ubaraccent = \b | 505 \let\ubaraccent = \b |
484 \let\udotaccent = \d | 506 \let\udotaccent = \d |
485 | 507 |
486 % Other special characters: @questiondown @exclamdown | 508 % Other special characters: @questiondown @exclamdown |
487 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. | 509 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. |
488 \def\questiondown{?`} | 510 \def\questiondown{?`} |
489 \def\exclamdown{!`} | 511 \def\exclamdown{!`} |
490 | 512 |
491 % Dotless i and dotless j, used for accents. | 513 % Dotless i and dotless j, used for accents. |
492 \def\imacro{i} | 514 \def\imacro{i} |
515 \def\:{\spacefactor=1000 } | 537 \def\:{\spacefactor=1000 } |
516 | 538 |
517 % @* forces a line break. | 539 % @* forces a line break. |
518 \def\*{\hfil\break\hbox{}\ignorespaces} | 540 \def\*{\hfil\break\hbox{}\ignorespaces} |
519 | 541 |
542 % @/ allows a line break. | |
543 \let\/=\allowbreak | |
544 | |
520 % @. is an end-of-sentence period. | 545 % @. is an end-of-sentence period. |
521 \def\.{.\spacefactor=3000 } | 546 \def\.{.\spacefactor=3000 } |
522 | 547 |
523 % @! is an end-of-sentence bang. | 548 % @! is an end-of-sentence bang. |
524 \def\!{!\spacefactor=3000 } | 549 \def\!{!\spacefactor=3000 } |
537 % \topskip (p.114 of the TeXbook), the glue inserted is | 562 % \topskip (p.114 of the TeXbook), the glue inserted is |
538 % max (\topskip - \ht (first item), 0). If that height is large, | 563 % max (\topskip - \ht (first item), 0). If that height is large, |
539 % therefore, no glue is inserted, and the space between the headline and | 564 % therefore, no glue is inserted, and the space between the headline and |
540 % the text is small, which looks bad. | 565 % the text is small, which looks bad. |
541 % | 566 % |
567 % Another complication is that the group might be very large. This can | |
568 % cause the glue on the previous page to be unduly stretched, because it | |
569 % does not have much material. In this case, it's better to add an | |
570 % explicit \vfill so that the extra space is at the bottom. The | |
571 % threshold for doing this is if the group is more than \vfilllimit | |
572 % percent of a page (\vfilllimit can be changed inside of @tex). | |
573 % | |
574 \newbox\groupbox | |
575 \def\vfilllimit{0.7} | |
576 % | |
542 \def\group{\begingroup | 577 \def\group{\begingroup |
543 \ifnum\catcode13=\active \else | 578 \ifnum\catcode13=\active \else |
544 \errhelp = \groupinvalidhelp | 579 \errhelp = \groupinvalidhelp |
545 \errmessage{@group invalid in context where filling is enabled}% | 580 \errmessage{@group invalid in context where filling is enabled}% |
546 \fi | 581 \fi |
550 % next line of text is done) \lineskip glue after it. (See p.82 of | 585 % next line of text is done) \lineskip glue after it. (See p.82 of |
551 % the TeXbook.) Thus, space below is not quite equal to space | 586 % the TeXbook.) Thus, space below is not quite equal to space |
552 % above. But it's pretty close. | 587 % above. But it's pretty close. |
553 \def\Egroup{% | 588 \def\Egroup{% |
554 \egroup % End the \vtop. | 589 \egroup % End the \vtop. |
590 % \dimen0 is the vertical size of the group's box. | |
591 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox | |
592 % \dimen2 is how much space is left on the page (more or less). | |
593 \dimen2 = \pageheight \advance\dimen2 by -\pagetotal | |
594 % if the group doesn't fit on the current page, and it's a big big | |
595 % group, force a page break. | |
596 \ifdim \dimen0 > \dimen2 | |
597 \ifdim \pagetotal < \vfilllimit\pageheight | |
598 \page | |
599 \fi | |
600 \fi | |
601 \copy\groupbox | |
555 \endgroup % End the \group. | 602 \endgroup % End the \group. |
556 }% | 603 }% |
557 % | 604 % |
558 \vtop\bgroup | 605 \setbox\groupbox = \vtop\bgroup |
559 % We have to put a strut on the last line in case the @group is in | 606 % We have to put a strut on the last line in case the @group is in |
560 % the midst of an example, rather than completely enclosing it. | 607 % the midst of an example, rather than completely enclosing it. |
561 % Otherwise, the interline space between the last line of the group | 608 % Otherwise, the interline space between the last line of the group |
562 % and the first line afterwards is too small. But we can't put the | 609 % and the first line afterwards is too small. But we can't put the |
563 % strut in \Egroup, since there it would be on a line by itself. | 610 % strut in \Egroup, since there it would be on a line by itself. |
678 \hskip 0pt plus 0.5fil minus 0.5fil | 725 \hskip 0pt plus 0.5fil minus 0.5fil |
679 }% | 726 }% |
680 \spacefactor=3000 | 727 \spacefactor=3000 |
681 } | 728 } |
682 | 729 |
683 | 730 % @page forces the start of a new page. |
684 % @page forces the start of a new page | |
685 % | 731 % |
686 \def\page{\par\vfill\supereject} | 732 \def\page{\par\vfill\supereject} |
687 | 733 |
688 % @exdent text.... | 734 % @exdent text.... |
689 % outputs text on separate line in roman font, starting at standard page margin | 735 % outputs text on separate line in roman font, starting at standard page margin |
751 } | 797 } |
752 | 798 |
753 % @include file insert text of that file as input. | 799 % @include file insert text of that file as input. |
754 % Allow normal characters that we make active in the argument (a file name). | 800 % Allow normal characters that we make active in the argument (a file name). |
755 \def\include{\begingroup | 801 \def\include{\begingroup |
756 \catcode`\\=12 | 802 \catcode`\\=\other |
757 \catcode`~=12 | 803 \catcode`~=\other |
758 \catcode`^=12 | 804 \catcode`^=\other |
759 \catcode`_=12 | 805 \catcode`_=\other |
760 \catcode`|=12 | 806 \catcode`|=\other |
761 \catcode`<=12 | 807 \catcode`<=\other |
762 \catcode`>=12 | 808 \catcode`>=\other |
763 \catcode`+=12 | 809 \catcode`+=\other |
764 \parsearg\includezzz} | 810 \parsearg\includezzz} |
765 % Restore active chars for included file. | 811 % Restore active chars for included file. |
766 \def\includezzz#1{\endgroup\begingroup | 812 \def\includezzz#1{\endgroup\begingroup |
767 % Read the included file in a group so nested @include's work. | 813 % Read the included file in a group so nested @include's work. |
768 \def\thisfile{#1}% | 814 \def\thisfile{#1}% |
815 \let\value=\expandablevalue | |
769 \input\thisfile | 816 \input\thisfile |
770 \endgroup} | 817 \endgroup} |
771 | 818 |
772 \def\thisfile{} | 819 \def\thisfile{} |
773 | 820 |
774 % @center line outputs that line, centered | 821 % @center line |
775 | 822 % outputs that line, centered. |
776 \def\center{\parsearg\centerzzz} | 823 % |
777 \def\centerzzz #1{{\advance\hsize by -\leftskip | 824 \def\center{\parsearg\docenter} |
778 \advance\hsize by -\rightskip | 825 \def\docenter#1{{% |
779 \centerline{#1}}} | 826 \ifhmode \hfil\break \fi |
827 \advance\hsize by -\leftskip | |
828 \advance\hsize by -\rightskip | |
829 \line{\hfil \ignorespaces#1\unskip \hfil}% | |
830 \ifhmode \break \fi | |
831 }} | |
780 | 832 |
781 % @sp n outputs n lines of vertical space | 833 % @sp n outputs n lines of vertical space |
782 | 834 |
783 \def\sp{\parsearg\spxxx} | 835 \def\sp{\parsearg\spxxx} |
784 \def\spxxx #1{\vskip #1\baselineskip} | 836 \def\spxxx #1{\vskip #1\baselineskip} |
794 | 846 |
795 \let\c=\comment | 847 \let\c=\comment |
796 | 848 |
797 % @paragraphindent NCHARS | 849 % @paragraphindent NCHARS |
798 % We'll use ems for NCHARS, close enough. | 850 % We'll use ems for NCHARS, close enough. |
799 % We cannot implement @paragraphindent asis, though. | 851 % NCHARS can also be the word `asis' or `none'. |
852 % We cannot feasibly implement @paragraphindent asis, though. | |
800 % | 853 % |
801 \def\asisword{asis} % no translation, these are keywords | 854 \def\asisword{asis} % no translation, these are keywords |
802 \def\noneword{none} | 855 \def\noneword{none} |
803 % | 856 % |
804 \def\paragraphindent{\parsearg\doparagraphindent} | 857 \def\paragraphindent{\parsearg\doparagraphindent} |
830 \lispnarrowing = #1em | 883 \lispnarrowing = #1em |
831 \fi | 884 \fi |
832 \fi | 885 \fi |
833 } | 886 } |
834 | 887 |
888 % @firstparagraphindent WORD | |
889 % If WORD is `none', then suppress indentation of the first paragraph | |
890 % after a section heading. If WORD is `insert', then do indentat such | |
891 % paragraphs. | |
892 % | |
893 % The paragraph indentation is suppressed or not by calling | |
894 % \suppressfirstparagraphindent, which the sectioning commands do. We | |
895 % switch the definition of this back and forth according to WORD. By | |
896 % default, we suppress indentation. | |
897 % | |
898 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} | |
899 \newdimen\currentparindent | |
900 % | |
901 \def\insertword{insert} | |
902 % | |
903 \def\firstparagraphindent{\parsearg\dofirstparagraphindent} | |
904 \def\dofirstparagraphindent#1{% | |
905 \def\temp{#1}% | |
906 \ifx\temp\noneword | |
907 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent | |
908 \else\ifx\temp\insertword | |
909 \let\suppressfirstparagraphindent = \relax | |
910 \else | |
911 \errhelp = \EMsimple | |
912 \errmessage{Unknown @firstparagraphindent option `\temp'}% | |
913 \fi\fi | |
914 } | |
915 | |
916 % Here is how we actually suppress indentation. Redefine \everypar to | |
917 % \kern backwards by \parindent, and then reset itself to empty. | |
918 % | |
919 % We also make \indent itself not actually do anything until the next | |
920 % paragraph. | |
921 % | |
922 \gdef\dosuppressfirstparagraphindent{% | |
923 \gdef\indent{% | |
924 \global\let\indent=\ptexindent | |
925 \global\everypar = {}% | |
926 }% | |
927 \global\everypar = {% | |
928 \kern-\parindent | |
929 \global\let\indent=\ptexindent | |
930 \global\everypar = {}% | |
931 }% | |
932 }% | |
933 | |
934 | |
835 % @asis just yields its argument. Used with @table, for example. | 935 % @asis just yields its argument. Used with @table, for example. |
836 % | 936 % |
837 \def\asis#1{#1} | 937 \def\asis#1{#1} |
838 | 938 |
839 % @math outputs its argument in math mode. | 939 % @math outputs its argument in math mode. |
840 % We don't use $'s directly in the definition of \math because we need | 940 % We don't use $'s directly in the definition of \math because we need |
841 % to set catcodes according to plain TeX first, to allow for subscripts, | 941 % to set catcodes according to plain TeX first, to allow for subscripts, |
842 % superscripts, special math chars, etc. | 942 % superscripts, special math chars, etc. |
843 % | 943 % |
844 % @math does not do math typesetting in section titles, index | |
845 % entries, and other such contexts where the catcodes are set before | |
846 % @math gets a chance to work. This could perhaps be fixed, but for now | |
847 % at least we can have real math in the main text, where it's needed most. | |
848 % | |
849 \let\implicitmath = $%$ font-lock fix | 944 \let\implicitmath = $%$ font-lock fix |
850 % | 945 % |
851 % One complication: _ usually means subscripts, but it could also mean | 946 % One complication: _ usually means subscripts, but it could also mean |
852 % an actual _ character, as in @math{@var{some_variable} + 1}. So make | 947 % an actual _ character, as in @math{@var{some_variable} + 1}. So make |
853 % _ within @math be active (mathcode "8000), and distinguish by seeing | 948 % _ within @math be active (mathcode "8000), and distinguish by seeing |
854 % if the current family is \slfam, which is what @var uses. | 949 % if the current family is \slfam, which is what @var uses. |
855 % | 950 % |
856 {\catcode95 = \active % 95 = _ | 951 {\catcode\underChar = \active |
857 \gdef\mathunderscore{% | 952 \gdef\mathunderscore{% |
858 \catcode95=\active | 953 \catcode\underChar=\active |
859 \def_{\ifnum\fam=\slfam \_\else\sb\fi}% | 954 \def_{\ifnum\fam=\slfam \_\else\sb\fi}% |
860 }} | 955 }} |
861 % | 956 % |
862 % Another complication: we want \\ (and @\) to output a \ character. | 957 % Another complication: we want \\ (and @\) to output a \ character. |
863 % FYI, plain.tex uses \\ as a temporary control sequence (why?), but | 958 % FYI, plain.tex uses \\ as a temporary control sequence (why?), but |
869 % | 964 % |
870 \def\math{% | 965 \def\math{% |
871 \tex | 966 \tex |
872 \mathcode`\_="8000 \mathunderscore | 967 \mathcode`\_="8000 \mathunderscore |
873 \let\\ = \mathbackslash | 968 \let\\ = \mathbackslash |
969 \mathactive | |
874 \implicitmath\finishmath} | 970 \implicitmath\finishmath} |
875 \def\finishmath#1{#1\implicitmath\Etex} | 971 \def\finishmath#1{#1\implicitmath\Etex} |
972 | |
973 % Some active characters (such as <) are spaced differently in math. | |
974 % We have to reset their definitions in case the @math was an | |
975 % argument to a command which set the catcodes (such as @item or @section). | |
976 % | |
977 { | |
978 \catcode`^ = \active | |
979 \catcode`< = \active | |
980 \catcode`> = \active | |
981 \catcode`+ = \active | |
982 \gdef\mathactive{% | |
983 \let^ = \ptexhat | |
984 \let< = \ptexless | |
985 \let> = \ptexgtr | |
986 \let+ = \ptexplus | |
987 } | |
988 } | |
876 | 989 |
877 % @bullet and @minus need the same treatment as @math, just above. | 990 % @bullet and @minus need the same treatment as @math, just above. |
878 \def\bullet{\implicitmath\ptexbullet\implicitmath} | 991 \def\bullet{\implicitmath\ptexbullet\implicitmath} |
879 \def\minus{\implicitmath-\implicitmath} | 992 \def\minus{\implicitmath-\implicitmath} |
880 | 993 |
963 \immediate\pdfximage | 1076 \immediate\pdfximage |
964 \fi | 1077 \fi |
965 \ifx\empty\imagewidth\else width \imagewidth \fi | 1078 \ifx\empty\imagewidth\else width \imagewidth \fi |
966 \ifx\empty\imageheight\else height \imageheight \fi | 1079 \ifx\empty\imageheight\else height \imageheight \fi |
967 \ifnum\pdftexversion<13 | 1080 \ifnum\pdftexversion<13 |
968 #1.pdf% | 1081 #1.pdf% |
969 \else | 1082 \else |
970 {#1.pdf}% | 1083 {#1.pdf}% |
971 \fi | 1084 \fi |
972 \ifnum\pdftexversion < 14 \else | 1085 \ifnum\pdftexversion < 14 \else |
973 \pdfrefximage \pdflastximage | 1086 \pdfrefximage \pdflastximage |
985 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} | 1098 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} |
986 \def\pdfmakeoutlines{{% | 1099 \def\pdfmakeoutlines{{% |
987 \openin 1 \jobname.toc | 1100 \openin 1 \jobname.toc |
988 \ifeof 1\else\begingroup | 1101 \ifeof 1\else\begingroup |
989 \closein 1 | 1102 \closein 1 |
990 \indexnofonts | |
991 \def\tt{} | |
992 \let\_ = \normalunderscore | |
993 % Thanh's hack / proper braces in bookmarks | 1103 % Thanh's hack / proper braces in bookmarks |
994 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace | 1104 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace |
995 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace | 1105 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace |
996 % | 1106 % |
997 \def\chapentry ##1##2##3{} | 1107 \def\chapentry ##1##2##3{} |
1108 \def\secentry ##1##2##3##4{\advancenumber{chap##2}} | |
1109 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} | |
1110 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} | |
998 \let\appendixentry = \chapentry | 1111 \let\appendixentry = \chapentry |
999 \def\unnumbchapentry ##1##2{} | 1112 \let\unnumbchapentry = \chapentry |
1000 \def\secentry ##1##2##3##4{\advancenumber{chap##2}} | 1113 \let\unnumbsecentry = \secentry |
1001 \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} | 1114 \let\unnumbsubsecentry = \subsecentry |
1002 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} | 1115 \let\unnumbsubsubsecentry = \subsubsecentry |
1003 \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} | |
1004 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} | |
1005 \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} | |
1006 \input \jobname.toc | 1116 \input \jobname.toc |
1007 \def\chapentry ##1##2##3{% | 1117 \def\chapentry ##1##2##3{% |
1008 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} | 1118 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} |
1009 \let\appendixentry = \chapentry | |
1010 \def\unnumbchapentry ##1##2{% | |
1011 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} | |
1012 \def\secentry ##1##2##3##4{% | 1119 \def\secentry ##1##2##3##4{% |
1013 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} | 1120 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} |
1014 \def\unnumbsecentry ##1##2##3{% | |
1015 \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} | |
1016 \def\subsecentry ##1##2##3##4##5{% | 1121 \def\subsecentry ##1##2##3##4##5{% |
1017 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} | 1122 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} |
1018 \def\unnumbsubsecentry ##1##2##3##4{% | |
1019 \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} | |
1020 \def\subsubsecentry ##1##2##3##4##5##6{% | 1123 \def\subsubsecentry ##1##2##3##4##5##6{% |
1021 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} | 1124 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} |
1022 \def\unnumbsubsubsecentry ##1##2##3##4##5{% | 1125 \let\appendixentry = \chapentry |
1023 \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} | 1126 \let\unnumbchapentry = \chapentry |
1127 \let\unnumbsecentry = \secentry | |
1128 \let\unnumbsubsecentry = \subsecentry | |
1129 \let\unnumbsubsubsecentry = \subsubsecentry | |
1130 % | |
1131 % Make special characters normal for writing to the pdf file. | |
1132 % | |
1133 \indexnofonts | |
1134 \let\tt=\relax | |
1135 \turnoffactive | |
1024 \input \jobname.toc | 1136 \input \jobname.toc |
1025 \endgroup\fi | 1137 \endgroup\fi |
1026 }} | 1138 }} |
1027 \def\makelinks #1,{% | 1139 \def\makelinks #1,{% |
1028 \def\params{#1}\def\E{END}% | 1140 \def\params{#1}\def\E{END}% |
1168 \def\scbshape{csc} | 1280 \def\scbshape{csc} |
1169 | 1281 |
1170 \newcount\mainmagstep | 1282 \newcount\mainmagstep |
1171 \ifx\bigger\relax | 1283 \ifx\bigger\relax |
1172 % not really supported. | 1284 % not really supported. |
1173 \let\mainmagstep=\magstep1 | 1285 \mainmagstep=\magstep1 |
1174 \setfont\textrm\rmshape{12}{1000} | 1286 \setfont\textrm\rmshape{12}{1000} |
1175 \setfont\texttt\ttshape{12}{1000} | 1287 \setfont\texttt\ttshape{12}{1000} |
1176 \else | 1288 \else |
1177 % \mainmagstep=\magstephalf | 1289 \mainmagstep=\magstephalf |
1178 \mainmagstep=\magstep1 | |
1179 \setfont\textrm\rmshape{10}{\mainmagstep} | 1290 \setfont\textrm\rmshape{10}{\mainmagstep} |
1180 \setfont\texttt\ttshape{10}{\mainmagstep} | 1291 \setfont\texttt\ttshape{10}{\mainmagstep} |
1181 \fi | 1292 \fi |
1182 % Instead of cmb10, you many want to use cmbx10. | 1293 % Instead of cmb10, you may want to use cmbx10. |
1183 % cmbx10 is a prettier font on its own, but cmb10 | 1294 % cmbx10 is a prettier font on its own, but cmb10 |
1184 % looks better when embedded in a line with cmr10. | 1295 % looks better when embedded in a line with cmr10 |
1296 % (in Bob's opinion). | |
1185 \setfont\textbf\bfshape{10}{\mainmagstep} | 1297 \setfont\textbf\bfshape{10}{\mainmagstep} |
1186 \setfont\textit\itshape{10}{\mainmagstep} | 1298 \setfont\textit\itshape{10}{\mainmagstep} |
1187 \setfont\textsl\slshape{10}{\mainmagstep} | 1299 \setfont\textsl\slshape{10}{\mainmagstep} |
1188 \setfont\textsf\sfshape{10}{\mainmagstep} | 1300 \setfont\textsf\sfshape{10}{\mainmagstep} |
1189 \setfont\textsc\scshape{10}{\mainmagstep} | 1301 \setfont\textsc\scshape{10}{\mainmagstep} |
1230 \let\titlebf=\titlerm | 1342 \let\titlebf=\titlerm |
1231 \setfont\titlesc\scbshape{10}{\magstep4} | 1343 \setfont\titlesc\scbshape{10}{\magstep4} |
1232 \font\titlei=cmmi12 scaled \magstep3 | 1344 \font\titlei=cmmi12 scaled \magstep3 |
1233 \font\titlesy=cmsy10 scaled \magstep4 | 1345 \font\titlesy=cmsy10 scaled \magstep4 |
1234 \def\authorrm{\secrm} | 1346 \def\authorrm{\secrm} |
1347 \def\authortt{\sectt} | |
1235 | 1348 |
1236 % Chapter (and unnumbered) fonts (17.28pt). | 1349 % Chapter (and unnumbered) fonts (17.28pt). |
1237 \setfont\chaprm\rmbshape{12}{\magstep2} | 1350 \setfont\chaprm\rmbshape{12}{\magstep2} |
1238 \setfont\chapit\itbshape{10}{\magstep3} | 1351 \setfont\chapit\itbshape{10}{\magstep3} |
1239 \setfont\chapsl\slbshape{10}{\magstep3} | 1352 \setfont\chapsl\slbshape{10}{\magstep3} |
1327 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl | 1440 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl |
1328 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc | 1441 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc |
1329 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy | 1442 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy |
1330 \let\tenttsl=\smallerttsl | 1443 \let\tenttsl=\smallerttsl |
1331 \resetmathfonts \setleading{9.5pt}} | 1444 \resetmathfonts \setleading{9.5pt}} |
1332 \let\smallexamplefonts = \smallerfonts | 1445 |
1446 % Set the fonts to use with the @small... environments. | |
1447 \let\smallexamplefonts = \smallfonts | |
1448 | |
1449 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample | |
1450 % can fit this many characters: | |
1451 % 8.5x11=86 smallbook=72 a4=90 a5=69 | |
1452 % If we use \smallerfonts (8pt), then we can fit this many characters: | |
1453 % 8.5x11=90+ smallbook=80 a4=90+ a5=77 | |
1454 % For me, subjectively, the few extra characters that fit aren't worth | |
1455 % the additional smallness of 8pt. So I'm making the default 9pt. | |
1456 % | |
1457 % By the way, for comparison, here's what fits with @example (10pt): | |
1458 % 8.5x11=71 smallbook=60 a4=75 a5=58 | |
1459 % | |
1460 % I wish we used A4 paper on this side of the Atlantic. | |
1461 % | |
1462 % --karl, 24jan03. | |
1463 | |
1333 | 1464 |
1334 % Set up the default fonts, so we can use them for creating boxes. | 1465 % Set up the default fonts, so we can use them for creating boxes. |
1335 % | 1466 % |
1336 \textfonts | 1467 \textfonts |
1337 | 1468 |
1344 | 1475 |
1345 % Fonts for short table of contents. | 1476 % Fonts for short table of contents. |
1346 \setfont\shortcontrm\rmshape{12}{1000} | 1477 \setfont\shortcontrm\rmshape{12}{1000} |
1347 \setfont\shortcontbf\bxshape{12}{1000} | 1478 \setfont\shortcontbf\bxshape{12}{1000} |
1348 \setfont\shortcontsl\slshape{12}{1000} | 1479 \setfont\shortcontsl\slshape{12}{1000} |
1480 \setfont\shortconttt\ttshape{12}{1000} | |
1349 | 1481 |
1350 %% Add scribe-like font environments, plus @l for inline lisp (usually sans | 1482 %% Add scribe-like font environments, plus @l for inline lisp (usually sans |
1351 %% serif) and @ii for TeX italic | 1483 %% serif) and @ii for TeX italic |
1352 | 1484 |
1353 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction | 1485 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction |
1354 % unless the following character is such as not to need one. | 1486 % unless the following character is such as not to need one. |
1355 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} | 1487 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else |
1356 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} | 1488 \ptexslash\fi\fi\fi} |
1357 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} | 1489 \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} |
1490 \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} | |
1358 | 1491 |
1359 \let\i=\smartitalic | 1492 \let\i=\smartitalic |
1360 \let\var=\smartslanted | 1493 \let\var=\smartslanted |
1361 \let\dfn=\smartslanted | 1494 \let\dfn=\smartslanted |
1362 \let\emph=\smartitalic | 1495 \let\emph=\smartitalic |
1369 % the end of a paragraph. Restore normal hyphenation at the end of the | 1502 % the end of a paragraph. Restore normal hyphenation at the end of the |
1370 % group within which \nohyphenation is presumably called. | 1503 % group within which \nohyphenation is presumably called. |
1371 % | 1504 % |
1372 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} | 1505 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} |
1373 \def\restorehyphenation{\hyphenchar\font = `- } | 1506 \def\restorehyphenation{\hyphenchar\font = `- } |
1507 | |
1508 % Set sfcode to normal for the chars that usually have another value. | |
1509 % Can't use plain's \frenchspacing because it uses the `\x notation, and | |
1510 % sometimes \x has an active definition that messes things up. | |
1511 % | |
1512 \catcode`@=11 | |
1513 \def\frenchspacing{% | |
1514 \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m | |
1515 \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m | |
1516 } | |
1517 \catcode`@=\other | |
1374 | 1518 |
1375 \def\t#1{% | 1519 \def\t#1{% |
1376 {\tt \rawbackslash \frenchspacing #1}% | 1520 {\tt \rawbackslash \frenchspacing #1}% |
1377 \null | 1521 \null |
1378 } | 1522 } |
1469 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% | 1613 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% |
1470 \else\ifx\arg\wordexample | 1614 \else\ifx\arg\wordexample |
1471 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% | 1615 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% |
1472 \else\ifx\arg\wordcode | 1616 \else\ifx\arg\wordcode |
1473 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% | 1617 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% |
1618 \else | |
1619 \errhelp = \EMsimple | |
1620 \errmessage{Unknown @kbdinputstyle option `\arg'}% | |
1474 \fi\fi\fi | 1621 \fi\fi\fi |
1475 } | 1622 } |
1476 \def\worddistinct{distinct} | 1623 \def\worddistinct{distinct} |
1477 \def\wordexample{example} | 1624 \def\wordexample{example} |
1478 \def\wordcode{code} | 1625 \def\wordcode{code} |
1479 | 1626 |
1480 % Default is kbdinputdistinct. (Too much of a hassle to call the macro, | 1627 % Default is `distinct.' |
1481 % the catcodes are wrong for parsearg to work.) | 1628 \kbdinputstyle distinct |
1482 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} | |
1483 | 1629 |
1484 \def\xkey{\key} | 1630 \def\xkey{\key} |
1485 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | 1631 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% |
1486 \ifx\one\xkey\ifx\threex\three \key{#2}% | 1632 \ifx\one\xkey\ifx\threex\three \key{#2}% |
1487 \else{\tclose{\kbdfont\look}}\fi | 1633 \else{\tclose{\kbdfont\look}}\fi |
1565 \def\acronym#1{{\smallcaps \lowercase{#1}}} | 1711 \def\acronym#1{{\smallcaps \lowercase{#1}}} |
1566 | 1712 |
1567 % @pounds{} is a sterling sign. | 1713 % @pounds{} is a sterling sign. |
1568 \def\pounds{{\it\$}} | 1714 \def\pounds{{\it\$}} |
1569 | 1715 |
1716 % @registeredsymbol - R in a circle. For now, only works in text size; | |
1717 % we'd have to redo the font mechanism to change the \scriptstyle and | |
1718 % \scriptscriptstyle font sizes to make it look right in headings. | |
1719 % Adapted from the plain.tex definition of \copyright. | |
1720 % | |
1721 \def\registeredsymbol{% | |
1722 $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}% | |
1723 }$% | |
1724 } | |
1725 | |
1570 | 1726 |
1571 \message{page headings,} | 1727 \message{page headings,} |
1572 | 1728 |
1573 \newskip\titlepagetopglue \titlepagetopglue = 1.5in | 1729 \newskip\titlepagetopglue \titlepagetopglue = 1.5in |
1574 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc | 1730 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc |
1591 | 1747 |
1592 \def\titlepage{\begingroup \parindent=0pt \textfonts | 1748 \def\titlepage{\begingroup \parindent=0pt \textfonts |
1593 \let\subtitlerm=\tenrm | 1749 \let\subtitlerm=\tenrm |
1594 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% | 1750 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% |
1595 % | 1751 % |
1596 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% | 1752 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines |
1753 \let\tt=\authortt}% | |
1597 % | 1754 % |
1598 % Leave some space at the very top of the page. | 1755 % Leave some space at the very top of the page. |
1599 \vglue\titlepagetopglue | 1756 \vglue\titlepagetopglue |
1600 % | 1757 % |
1601 % Now you can print the title using @title. | 1758 % Now you can print the title using @title. |
1872 % | 2029 % |
1873 % We're going to be starting a paragraph, but we don't want the | 2030 % We're going to be starting a paragraph, but we don't want the |
1874 % \parskip glue -- logically it's part of the @item we just started. | 2031 % \parskip glue -- logically it's part of the @item we just started. |
1875 \nobreak \vskip-\parskip | 2032 \nobreak \vskip-\parskip |
1876 % | 2033 % |
1877 % Stop a page break at the \parskip glue coming up. Unfortunately | 2034 % Stop a page break at the \parskip glue coming up. (Unfortunately |
1878 % we can't prevent a possible page break at the following | 2035 % we can't prevent a possible page break at the following |
1879 % \baselineskip glue. | 2036 % \baselineskip glue.) However, if what follows is an environment |
1880 \nobreak | 2037 % such as @example, there will be no \parskip glue; then |
2038 % the negative vskip we just would cause the example and the item to | |
2039 % crash together. So we use this bizarre value of 10001 as a signal | |
2040 % to \aboveenvbreak to insert \parskip glue after all. | |
2041 % (Possibly there are other commands that could be followed by | |
2042 % @example which need the same treatment, but not section titles; or | |
2043 % maybe section titles are the only special case and they should be | |
2044 % penalty 10001...) | |
2045 \penalty 10001 | |
1881 \endgroup | 2046 \endgroup |
1882 \itemxneedsnegativevskipfalse | 2047 \itemxneedsnegativevskipfalse |
1883 \else | 2048 \else |
1884 % The item text fits into the space. Start a paragraph, so that the | 2049 % The item text fits into the space. Start a paragraph, so that the |
1885 % following text (if any) will end up on the same line. | 2050 % following text (if any) will end up on the same line. |
1968 \def\itemizezzz #1{% | 2133 \def\itemizezzz #1{% |
1969 \begingroup % ended by the @end itemize | 2134 \begingroup % ended by the @end itemize |
1970 \itemizey {#1}{\Eitemize} | 2135 \itemizey {#1}{\Eitemize} |
1971 } | 2136 } |
1972 | 2137 |
1973 \def\itemizey #1#2{% | 2138 \def\itemizey#1#2{% |
1974 \aboveenvbreak % | 2139 \aboveenvbreak |
1975 \itemmax=\itemindent % | 2140 \itemmax=\itemindent |
1976 \advance \itemmax by -\itemmargin % | 2141 \advance\itemmax by -\itemmargin |
1977 \advance \leftskip by \itemindent % | 2142 \advance\leftskip by \itemindent |
1978 \exdentamount=\itemindent | 2143 \exdentamount=\itemindent |
1979 \parindent = 0pt % | 2144 \parindent=0pt |
1980 \parskip = \smallskipamount % | 2145 \parskip=\smallskipamount |
1981 \ifdim \parskip=0pt \parskip=2pt \fi% | 2146 \ifdim\parskip=0pt \parskip=2pt \fi |
1982 \def#2{\endgraf\afterenvbreak\endgroup}% | 2147 \def#2{\endgraf\afterenvbreak\endgroup}% |
1983 \def\itemcontents{#1}% | 2148 \def\itemcontents{#1}% |
1984 \let\item=\itemizeitem} | 2149 % @itemize with no arg is equivalent to @itemize @bullet. |
1985 | 2150 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi |
1986 % Set sfcode to normal for the chars that usually have another value. | 2151 \let\item=\itemizeitem |
1987 % These are `.?!:;,' | 2152 } |
1988 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 | |
1989 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } | |
1990 | 2153 |
1991 % \splitoff TOKENS\endmark defines \first to be the first token in | 2154 % \splitoff TOKENS\endmark defines \first to be the first token in |
1992 % TOKENS, and \rest to be the remainder. | 2155 % TOKENS, and \rest to be the remainder. |
1993 % | 2156 % |
1994 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% | 2157 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% |
2207 \else | 2370 \else |
2208 \ifsetpercent | 2371 \ifsetpercent |
2209 \let\go\pickupwholefraction | 2372 \let\go\pickupwholefraction |
2210 \else | 2373 \else |
2211 \global\advance\colcount by 1 | 2374 \global\advance\colcount by 1 |
2212 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; | 2375 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a |
2213 % typically that is always in the input, anyway. | 2376 % separator; typically that is always in the input, anyway. |
2214 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% | 2377 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% |
2215 \fi | 2378 \fi |
2216 \fi | 2379 \fi |
2217 \ifx\go\pickupwholefraction | 2380 \ifx\go\pickupwholefraction |
2218 % Put the argument back for the \pickupwholefraction call, so | 2381 % Put the argument back for the \pickupwholefraction call, so |
2223 \fi% | 2386 \fi% |
2224 \fi | 2387 \fi |
2225 \go | 2388 \go |
2226 } | 2389 } |
2227 | 2390 |
2228 % This used to have \hskip1sp. But then the space in a template line is | |
2229 % not enough. That is bad. So let's go back to just & until we | |
2230 % encounter the problem it was intended to solve again. | |
2231 % --karl, nathan@acm.org, 20apr99. | |
2232 \def\tab{&} | |
2233 | |
2234 % @multitable ... @end multitable definitions: | 2391 % @multitable ... @end multitable definitions: |
2235 % | 2392 % |
2236 \def\multitable{\parsearg\dotable} | 2393 \def\multitable{\parsearg\dotable} |
2237 \def\dotable#1{\bgroup | 2394 \def\dotable#1{\bgroup |
2238 \vskip\parskip | 2395 \vskip\parskip |
2239 \let\item\crcr | 2396 \let\item=\crcrwithfootnotes |
2397 % A \tab used to include \hskip1sp. But then the space in a template | |
2398 % line is not enough. That is bad. So let's go back to just & until | |
2399 % we encounter the problem it was intended to solve again. --karl, | |
2400 % nathan@acm.org, 20apr99. | |
2401 \let\tab=&% | |
2402 \let\startfootins=\startsavedfootnote | |
2240 \tolerance=9500 | 2403 \tolerance=9500 |
2241 \hbadness=9500 | 2404 \hbadness=9500 |
2242 \setmultitablespacing | 2405 \setmultitablespacing |
2243 \parskip=\multitableparskip | 2406 \parskip=\multitableparskip |
2244 \parindent=\multitableparindent | 2407 \parindent=\multitableparindent |
2245 \overfullrule=0pt | 2408 \overfullrule=0pt |
2246 \global\colcount=0 | 2409 \global\colcount=0 |
2247 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% | 2410 \def\Emultitable{% |
2411 \global\setpercentfalse | |
2412 \crcrwithfootnotes\crcr | |
2413 \egroup\egroup | |
2414 }% | |
2248 % | 2415 % |
2249 % To parse everything between @multitable and @item: | 2416 % To parse everything between @multitable and @item: |
2250 \setuptable#1 \endsetuptable | 2417 \setuptable#1 \endsetuptable |
2251 % | 2418 % |
2252 % \everycr will reset column counter, \colcount, at the end of | 2419 % \everycr will reset column counter, \colcount, at the end of |
2331 \global\multitableparskip=\multitablelinespace | 2498 \global\multitableparskip=\multitablelinespace |
2332 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | 2499 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller |
2333 %% than skip between lines in the table. | 2500 %% than skip between lines in the table. |
2334 \fi} | 2501 \fi} |
2335 | 2502 |
2503 % In case a @footnote appears inside an alignment, save the footnote | |
2504 % text to a box and make the \insert when a row of the table is | |
2505 % finished. Otherwise, the insertion is lost, it never migrates to the | |
2506 % main vertical list. --kasal, 22jan03. | |
2507 % | |
2508 \newbox\savedfootnotes | |
2509 % | |
2510 % \dotable \let's \startfootins to this, so that \dofootnote will call | |
2511 % it instead of starting the insertion right away. | |
2512 \def\startsavedfootnote{% | |
2513 \global\setbox\savedfootnotes = \vbox\bgroup | |
2514 \unvbox\savedfootnotes | |
2515 } | |
2516 \def\crcrwithfootnotes{% | |
2517 \crcr | |
2518 \ifvoid\savedfootnotes \else | |
2519 \noalign{\insert\footins{\box\savedfootnotes}}% | |
2520 \fi | |
2521 } | |
2336 | 2522 |
2337 \message{conditionals,} | 2523 \message{conditionals,} |
2338 % Prevent errors for section commands. | 2524 % Prevent errors for section commands. |
2339 % Used in @ignore and in failing conditionals. | 2525 % Used in @ignore and in failing conditionals. |
2340 \def\ignoresections{% | 2526 \def\ignoresections{% |
2366 | 2552 |
2367 % Used in nested conditionals, where we have to parse the Texinfo source | 2553 % Used in nested conditionals, where we have to parse the Texinfo source |
2368 % and so want to turn off most commands, in case they are used | 2554 % and so want to turn off most commands, in case they are used |
2369 % incorrectly. | 2555 % incorrectly. |
2370 % | 2556 % |
2557 % We use \empty instead of \relax for the @def... commands, so that \end | |
2558 % doesn't throw an error. For instance: | |
2559 % @ignore | |
2560 % @deffn ... | |
2561 % @end deffn | |
2562 % @end ignore | |
2563 % | |
2564 % The @end deffn is going to get expanded, because we're trying to allow | |
2565 % nested conditionals. But we don't want to expand the actual @deffn, | |
2566 % since it might be syntactically correct and intended to be ignored. | |
2567 % Since \end checks for \relax, using \empty does not cause an error. | |
2568 % | |
2371 \def\ignoremorecommands{% | 2569 \def\ignoremorecommands{% |
2372 \let\defcodeindex = \relax | 2570 \let\defcodeindex = \relax |
2373 \let\defcv = \relax | 2571 \let\defcv = \empty |
2374 \let\deffn = \relax | 2572 \let\defcvx = \empty |
2375 \let\deffnx = \relax | 2573 \let\Edefcv = \empty |
2574 \let\deffn = \empty | |
2575 \let\deffnx = \empty | |
2576 \let\Edeffn = \empty | |
2376 \let\defindex = \relax | 2577 \let\defindex = \relax |
2377 \let\defivar = \relax | 2578 \let\defivar = \empty |
2378 \let\defmac = \relax | 2579 \let\defivarx = \empty |
2379 \let\defmethod = \relax | 2580 \let\Edefivar = \empty |
2380 \let\defop = \relax | 2581 \let\defmac = \empty |
2381 \let\defopt = \relax | 2582 \let\defmacx = \empty |
2382 \let\defspec = \relax | 2583 \let\Edefmac = \empty |
2383 \let\deftp = \relax | 2584 \let\defmethod = \empty |
2384 \let\deftypefn = \relax | 2585 \let\defmethodx = \empty |
2385 \let\deftypefun = \relax | 2586 \let\Edefmethod = \empty |
2386 \let\deftypeivar = \relax | 2587 \let\defop = \empty |
2387 \let\deftypeop = \relax | 2588 \let\defopx = \empty |
2388 \let\deftypevar = \relax | 2589 \let\Edefop = \empty |
2389 \let\deftypevr = \relax | 2590 \let\defopt = \empty |
2390 \let\defun = \relax | 2591 \let\defoptx = \empty |
2391 \let\defvar = \relax | 2592 \let\Edefopt = \empty |
2392 \let\defvr = \relax | 2593 \let\defspec = \empty |
2393 \let\ref = \relax | 2594 \let\defspecx = \empty |
2394 \let\xref = \relax | 2595 \let\Edefspec = \empty |
2596 \let\deftp = \empty | |
2597 \let\deftpx = \empty | |
2598 \let\Edeftp = \empty | |
2599 \let\deftypefn = \empty | |
2600 \let\deftypefnx = \empty | |
2601 \let\Edeftypefn = \empty | |
2602 \let\deftypefun = \empty | |
2603 \let\deftypefunx = \empty | |
2604 \let\Edeftypefun = \empty | |
2605 \let\deftypeivar = \empty | |
2606 \let\deftypeivarx = \empty | |
2607 \let\Edeftypeivar = \empty | |
2608 \let\deftypemethod = \empty | |
2609 \let\deftypemethodx = \empty | |
2610 \let\Edeftypemethod = \empty | |
2611 \let\deftypeop = \empty | |
2612 \let\deftypeopx = \empty | |
2613 \let\Edeftypeop = \empty | |
2614 \let\deftypevar = \empty | |
2615 \let\deftypevarx = \empty | |
2616 \let\Edeftypevar = \empty | |
2617 \let\deftypevr = \empty | |
2618 \let\deftypevrx = \empty | |
2619 \let\Edeftypevr = \empty | |
2620 \let\defun = \empty | |
2621 \let\defunx = \empty | |
2622 \let\Edefun = \empty | |
2623 \let\defvar = \empty | |
2624 \let\defvarx = \empty | |
2625 \let\Edefvar = \empty | |
2626 \let\defvr = \empty | |
2627 \let\defvrx = \empty | |
2628 \let\Edefvr = \empty | |
2629 \let\clear = \relax | |
2630 \let\down = \relax | |
2631 \let\evenfooting = \relax | |
2632 \let\evenheading = \relax | |
2633 \let\everyfooting = \relax | |
2634 \let\everyheading = \relax | |
2635 \let\headings = \relax | |
2636 \let\include = \relax | |
2637 \let\item = \relax | |
2638 \let\lowersections = \relax | |
2639 \let\oddfooting = \relax | |
2640 \let\oddheading = \relax | |
2395 \let\printindex = \relax | 2641 \let\printindex = \relax |
2396 \let\pxref = \relax | 2642 \let\pxref = \relax |
2397 \let\settitle = \relax | 2643 \let\raisesections = \relax |
2644 \let\ref = \relax | |
2645 \let\set = \relax | |
2398 \let\setchapternewpage = \relax | 2646 \let\setchapternewpage = \relax |
2399 \let\setchapterstyle = \relax | 2647 \let\setchapterstyle = \relax |
2400 \let\everyheading = \relax | 2648 \let\settitle = \relax |
2401 \let\evenheading = \relax | |
2402 \let\oddheading = \relax | |
2403 \let\everyfooting = \relax | |
2404 \let\evenfooting = \relax | |
2405 \let\oddfooting = \relax | |
2406 \let\headings = \relax | |
2407 \let\include = \relax | |
2408 \let\lowersections = \relax | |
2409 \let\down = \relax | |
2410 \let\raisesections = \relax | |
2411 \let\up = \relax | 2649 \let\up = \relax |
2412 \let\set = \relax | 2650 \let\verbatiminclude = \relax |
2413 \let\clear = \relax | 2651 \let\xref = \relax |
2414 \let\item = \relax | 2652 } |
2415 } | 2653 |
2416 | 2654 % Ignore @ignore, @ifhtml, @ifinfo, and the like. |
2417 % Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, | 2655 % |
2418 % @direntry, and @documentdescription. | 2656 \def\direntry{\doignore{direntry}} |
2419 % | 2657 \def\documentdescriptionword{documentdescription} |
2420 \def\ignore{\doignore{ignore}} | 2658 \def\documentdescription{\doignore{documentdescription}} |
2659 \def\html{\doignore{html}} | |
2421 \def\ifhtml{\doignore{ifhtml}} | 2660 \def\ifhtml{\doignore{ifhtml}} |
2422 \def\ifinfo{\doignore{ifinfo}} | 2661 \def\ifinfo{\doignore{ifinfo}} |
2662 \def\ifnottex{\nestedignore{ifnottex}} | |
2423 \def\ifplaintext{\doignore{ifplaintext}} | 2663 \def\ifplaintext{\doignore{ifplaintext}} |
2424 \def\ifnottex{\doignore{ifnottex}} | 2664 \def\ifxml{\doignore{ifxml}} |
2425 \def\html{\doignore{html}} | 2665 \def\ignore{\doignore{ignore}} |
2426 \def\menu{\doignore{menu}} | 2666 \def\menu{\doignore{menu}} |
2427 \def\direntry{\doignore{direntry}} | 2667 \def\xml{\doignore{xml}} |
2428 \def\documentdescription{\doignore{documentdescription}} | |
2429 \def\documentdescriptionword{documentdescription} | |
2430 | 2668 |
2431 % @dircategory CATEGORY -- specify a category of the dir file | 2669 % @dircategory CATEGORY -- specify a category of the dir file |
2432 % which this file should belong to. Ignore this in TeX. | 2670 % which this file should belong to. Ignore this in TeX. |
2433 \let\dircategory = \comment | 2671 \let\dircategory = \comment |
2434 | 2672 |
2442 % This @ is a catcode 12 token (that is the normal catcode of @ in | 2680 % This @ is a catcode 12 token (that is the normal catcode of @ in |
2443 % this texinfo.tex file). We change the catcode of @ below to match. | 2681 % this texinfo.tex file). We change the catcode of @ below to match. |
2444 \long\def\doignoretext##1@end #1{\enddoignore}% | 2682 \long\def\doignoretext##1@end #1{\enddoignore}% |
2445 % | 2683 % |
2446 % Make sure that spaces turn into tokens that match what \doignoretext wants. | 2684 % Make sure that spaces turn into tokens that match what \doignoretext wants. |
2447 \catcode32 = 10 | 2685 \catcode\spaceChar = 10 |
2448 % | 2686 % |
2449 % Ignore braces, too, so mismatched braces don't cause trouble. | 2687 % Ignore braces, too, so mismatched braces don't cause trouble. |
2450 \catcode`\{ = 9 | 2688 \catcode`\{ = 9 |
2451 \catcode`\} = 9 | 2689 \catcode`\} = 9 |
2452 % | 2690 % |
2484 \immediate\write16{WARNING: for users of Unix TeX 3.0!} | 2722 \immediate\write16{WARNING: for users of Unix TeX 3.0!} |
2485 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} | 2723 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} |
2486 \immediate\write16{If you are running another version of TeX, relax.} | 2724 \immediate\write16{If you are running another version of TeX, relax.} |
2487 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} | 2725 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} |
2488 \immediate\write16{ Then upgrade your TeX installation if you can.} | 2726 \immediate\write16{ Then upgrade your TeX installation if you can.} |
2489 \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} | 2727 \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)} |
2490 \immediate\write16{If you are stuck with version 3.0, run the} | 2728 \immediate\write16{If you are stuck with version 3.0, run the} |
2491 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} | 2729 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} |
2492 \immediate\write16{ to use a workaround.} | 2730 \immediate\write16{ to use a workaround.} |
2493 \immediate\write16{} | 2731 \immediate\write16{} |
2494 \global\warnedobstrue | 2732 \global\warnedobstrue |
2506 \def\nestedignore#1{% | 2744 \def\nestedignore#1{% |
2507 \obstexwarn | 2745 \obstexwarn |
2508 % We must actually expand the ignored text to look for the @end | 2746 % We must actually expand the ignored text to look for the @end |
2509 % command, so that nested ignore constructs work. Thus, we put the | 2747 % command, so that nested ignore constructs work. Thus, we put the |
2510 % text into a \vbox and then do nothing with the result. To minimize | 2748 % text into a \vbox and then do nothing with the result. To minimize |
2511 % the change of memory overflow, we follow the approach outlined on | 2749 % the chance of memory overflow, we follow the approach outlined on |
2512 % page 401 of the TeXbook: make the current font be a dummy font. | 2750 % page 401 of the TeXbook. |
2513 % | 2751 % |
2514 \setbox0 = \vbox\bgroup | 2752 \setbox0 = \vbox\bgroup |
2515 % Don't complain about control sequences we have declared \outer. | 2753 % Don't complain about control sequences we have declared \outer. |
2516 \ignoresections | 2754 \ignoresections |
2517 % | 2755 % |
2528 % they'll produce `undefined control sequence' errors. | 2766 % they'll produce `undefined control sequence' errors. |
2529 \ignoremorecommands | 2767 \ignoremorecommands |
2530 % | 2768 % |
2531 % Set the current font to be \nullfont, a TeX primitive, and define | 2769 % Set the current font to be \nullfont, a TeX primitive, and define |
2532 % all the font commands to also use \nullfont. We don't use | 2770 % all the font commands to also use \nullfont. We don't use |
2533 % dummy.tfm, as suggested in the TeXbook, because not all sites | 2771 % dummy.tfm, as suggested in the TeXbook, because some sites |
2534 % might have that installed. Therefore, math mode will still | 2772 % might not have that installed. Therefore, math mode will still |
2535 % produce output, but that should be an extremely small amount of | 2773 % produce output, but that should be an extremely small amount of |
2536 % stuff compared to the main input. | 2774 % stuff compared to the main input. |
2537 % | 2775 % |
2538 \nullfont | 2776 \nullfont |
2539 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont | 2777 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont |
2558 \hbadness = 10000 | 2796 \hbadness = 10000 |
2559 % | 2797 % |
2560 % Do minimal line-breaking. | 2798 % Do minimal line-breaking. |
2561 \pretolerance = 10000 | 2799 \pretolerance = 10000 |
2562 % | 2800 % |
2563 % Do not execute instructions in @tex | 2801 % Do not execute instructions in @tex. |
2564 \def\tex{\doignore{tex}}% | 2802 \def\tex{\doignore{tex}}% |
2565 % Do not execute macro definitions. | 2803 % Do not execute macro definitions. |
2566 % `c' is a comment character, so the word `macro' will get cut off. | 2804 % `c' is a comment character, so the word `macro' will get cut off. |
2567 \def\macro{\doignore{ma}}% | 2805 \def\macro{\doignore{ma}}% |
2568 } | 2806 } |
2603 % | 2841 % |
2604 % We might end up with active _ or - characters in the argument if | 2842 % We might end up with active _ or - characters in the argument if |
2605 % we're called from @code, as @code{@value{foo-bar_}}. So \let any | 2843 % we're called from @code, as @code{@value{foo-bar_}}. So \let any |
2606 % such active characters to their normal equivalents. | 2844 % such active characters to their normal equivalents. |
2607 \gdef\value{\begingroup | 2845 \gdef\value{\begingroup |
2608 \catcode`\-=12 \catcode`\_=12 | 2846 \catcode`\-=\other \catcode`\_=\other |
2609 \indexbreaks \let_\normalunderscore | 2847 \indexbreaks \let_\normalunderscore |
2610 \valuexxx} | 2848 \valuexxx} |
2611 } | 2849 } |
2612 \def\valuexxx#1{\expandablevalue{#1}\endgroup} | 2850 \def\valuexxx#1{\expandablevalue{#1}\endgroup} |
2613 | 2851 |
2614 % We have this subroutine so that we can handle at least some @value's | 2852 % We have this subroutine so that we can handle at least some @value's |
2615 % properly in indexes (we \let\value to this in \indexdummies). Ones | 2853 % properly in indexes (we \let\value to this in \indexdummies). Ones |
2616 % whose names contain - or _ still won't work, but we can't do anything | 2854 % whose names contain - or _ still won't work, but we can't do anything |
2617 % about that. The command has to be fully expandable, since the result | 2855 % about that. The command has to be fully expandable (if the variable |
2618 % winds up in the index file. This means that if the variable's value | 2856 % is set), since the result winds up in the index file. This means that |
2619 % contains other Texinfo commands, it's almost certain it will fail | 2857 % if the variable's value contains other Texinfo commands, it's almost |
2620 % (although perhaps we could fix that with sufficient work to do a | 2858 % certain it will fail (although perhaps we could fix that with |
2621 % one-level expansion on the result, instead of complete). | 2859 % sufficient work to do a one-level expansion on the result, instead of |
2860 % complete). | |
2622 % | 2861 % |
2623 \def\expandablevalue#1{% | 2862 \def\expandablevalue#1{% |
2624 \expandafter\ifx\csname SET#1\endcsname\relax | 2863 \expandafter\ifx\csname SET#1\endcsname\relax |
2625 {[No value for ``#1'']}% | 2864 {[No value for ``#1'']}% |
2865 \message{Variable `#1', used in @value, is not set.}% | |
2626 \else | 2866 \else |
2627 \csname SET#1\endcsname | 2867 \csname SET#1\endcsname |
2628 \fi | 2868 \fi |
2629 } | 2869 } |
2630 | 2870 |
2631 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined | 2871 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined |
2632 % with @set. | 2872 % with @set. |
2633 % | 2873 % |
2634 \def\ifset{\parsearg\ifsetxxx} | 2874 \def\ifset{\parsearg\doifset} |
2635 \def\ifsetxxx #1{% | 2875 \def\doifset#1{% |
2636 \expandafter\ifx\csname SET#1\endcsname\relax | 2876 \expandafter\ifx\csname SET#1\endcsname\relax |
2637 \expandafter\ifsetfail | 2877 \let\next=\ifsetfail |
2638 \else | 2878 \else |
2639 \expandafter\ifsetsucceed | 2879 \let\next=\ifsetsucceed |
2640 \fi | 2880 \fi |
2881 \next | |
2641 } | 2882 } |
2642 \def\ifsetsucceed{\conditionalsucceed{ifset}} | 2883 \def\ifsetsucceed{\conditionalsucceed{ifset}} |
2643 \def\ifsetfail{\nestedignore{ifset}} | 2884 \def\ifsetfail{\nestedignore{ifset}} |
2644 \defineunmatchedend{ifset} | 2885 \defineunmatchedend{ifset} |
2645 | 2886 |
2646 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been | 2887 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been |
2647 % defined with @set, or has been undefined with @clear. | 2888 % defined with @set, or has been undefined with @clear. |
2648 % | 2889 % |
2649 \def\ifclear{\parsearg\ifclearxxx} | 2890 \def\ifclear{\parsearg\doifclear} |
2650 \def\ifclearxxx #1{% | 2891 \def\doifclear#1{% |
2651 \expandafter\ifx\csname SET#1\endcsname\relax | 2892 \expandafter\ifx\csname SET#1\endcsname\relax |
2652 \expandafter\ifclearsucceed | 2893 \let\next=\ifclearsucceed |
2653 \else | 2894 \else |
2654 \expandafter\ifclearfail | 2895 \let\next=\ifclearfail |
2655 \fi | 2896 \fi |
2897 \next | |
2656 } | 2898 } |
2657 \def\ifclearsucceed{\conditionalsucceed{ifclear}} | 2899 \def\ifclearsucceed{\conditionalsucceed{ifclear}} |
2658 \def\ifclearfail{\nestedignore{ifclear}} | 2900 \def\ifclearfail{\nestedignore{ifclear}} |
2659 \defineunmatchedend{ifclear} | 2901 \defineunmatchedend{ifclear} |
2660 | 2902 |
2669 \defineunmatchedend{iftex} | 2911 \defineunmatchedend{iftex} |
2670 \defineunmatchedend{ifnothtml} | 2912 \defineunmatchedend{ifnothtml} |
2671 \defineunmatchedend{ifnotinfo} | 2913 \defineunmatchedend{ifnotinfo} |
2672 \defineunmatchedend{ifnotplaintext} | 2914 \defineunmatchedend{ifnotplaintext} |
2673 | 2915 |
2674 % We can't just want to start a group at @iftex (etc.) and end it at | 2916 % True conditional. Since \set globally defines its variables, we can |
2675 % @end iftex, since then @set commands inside the conditional have no | 2917 % just start and end a group (to keep the @end definition undefined at |
2676 % effect (they'd get reverted at the end of the group). So we must | 2918 % the outer level). |
2677 % define \Eiftex to redefine itself to be its previous value. (We can't | 2919 % |
2678 % just define it to fail again with an ``unmatched end'' error, since | 2920 \def\conditionalsucceed#1{\begingroup |
2679 % the @ifset might be nested.) | 2921 \expandafter\def\csname E#1\endcsname{\endgroup}% |
2680 % | 2922 } |
2681 \def\conditionalsucceed#1{% | |
2682 \edef\temp{% | |
2683 % Remember the current value of \E#1. | |
2684 \let\nece{prevE#1} = \nece{E#1}% | |
2685 % | |
2686 % At the `@end #1', redefine \E#1 to be its previous value. | |
2687 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% | |
2688 }% | |
2689 \temp | |
2690 } | |
2691 | |
2692 % We need to expand lots of \csname's, but we don't want to expand the | |
2693 % control sequences after we've constructed them. | |
2694 % | |
2695 \def\nece#1{\expandafter\noexpand\csname#1\endcsname} | |
2696 | 2923 |
2697 % @defininfoenclose. | 2924 % @defininfoenclose. |
2698 \let\definfoenclose=\comment | 2925 \let\definfoenclose=\comment |
2699 | 2926 |
2700 | 2927 |
2783 | 3010 |
2784 % like the previous two, but they put @code around the argument. | 3011 % like the previous two, but they put @code around the argument. |
2785 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} | 3012 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} |
2786 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} | 3013 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} |
2787 | 3014 |
2788 % Take care of texinfo commands likely to appear in an index entry. | 3015 % Take care of Texinfo commands that can appear in an index entry. |
2789 % (Must be a way to avoid doing expansion at all, and thus not have to | 3016 % Since there are some commands we want to expand, and others we don't, |
2790 % laboriously list every single command here.) | 3017 % we have to laboriously prevent expansion for those that we don't. |
2791 % | 3018 % |
2792 \def\indexdummies{% | 3019 \def\indexdummies{% |
2793 \def\ { }% | 3020 \def\@{@}% change to @@ when we switch to @ as escape char in index files. |
2794 \def\@{@}% change to @@ when we switch to @ as escape char in aux files. | 3021 \def\ {\realbackslash\space }% |
2795 % Need these in case \tex is in effect and \{ is a \delimiter again. | 3022 % Need these in case \tex is in effect and \{ is a \delimiter again. |
2796 % But can't use \lbracecmd and \rbracecmd because texindex assumes | 3023 % But can't use \lbracecmd and \rbracecmd because texindex assumes |
2797 % braces and backslashes are used only as delimiters. | 3024 % braces and backslashes are used only as delimiters. |
2798 \let\{ = \mylbrace | 3025 \let\{ = \mylbrace |
2799 \let\} = \myrbrace | 3026 \let\} = \myrbrace |
2800 \def\_{{\realbackslash _}}% | 3027 % |
2801 \normalturnoffactive | 3028 % \definedummyword defines \#1 as \realbackslash #1\space, thus |
2802 % | 3029 % effectively preventing its expansion. This is used only for control |
2803 % Take care of the plain tex accent commands. | 3030 % words, not control letters, because the \space would be incorrect |
2804 \def\,##1{\realbackslash ,{##1}}% | 3031 % for control characters, but is needed to separate the control word |
2805 \def\"{\realbackslash "}% | 3032 % from whatever follows. |
2806 \def\`{\realbackslash `}% | 3033 % |
2807 \def\'{\realbackslash '}% | 3034 % For control letters, we have \definedummyletter, which omits the |
2808 \def\^{\realbackslash ^}% | 3035 % space. |
2809 \def\~{\realbackslash ~}% | 3036 % |
2810 \def\={\realbackslash =}% | 3037 % These can be used both for control words that take an argument and |
2811 \def\b{\realbackslash b}% | 3038 % those that do not. If it is followed by {arg} in the input, then |
2812 \def\c{\realbackslash c}% | 3039 % that will dutifully get written to the index (or wherever). |
2813 \def\d{\realbackslash d}% | 3040 % |
2814 \def\u{\realbackslash u}% | 3041 \def\definedummyword##1{% |
2815 \def\v{\realbackslash v}% | 3042 \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% |
2816 \def\H{\realbackslash H}% | 3043 }% |
2817 \def\dotless##1{\realbackslash dotless {##1}}% | 3044 \def\definedummyletter##1{% |
2818 % Take care of the plain tex special European modified letters. | 3045 \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% |
2819 \def\AA{\realbackslash AA}% | 3046 }% |
2820 \def\AE{\realbackslash AE}% | 3047 % |
2821 \def\L{\realbackslash L}% | 3048 % Do the redefinitions. |
2822 \def\OE{\realbackslash OE}% | 3049 \commondummies |
2823 \def\O{\realbackslash O}% | 3050 } |
2824 \def\aa{\realbackslash aa}% | 3051 |
2825 \def\ae{\realbackslash ae}% | 3052 % For the aux file, @ is the escape character. So we want to redefine |
2826 \def\l{\realbackslash l}% | 3053 % everything using @ instead of \realbackslash. When everything uses |
2827 \def\oe{\realbackslash oe}% | 3054 % @, this will be simpler. |
2828 \def\o{\realbackslash o}% | 3055 % |
2829 \def\ss{\realbackslash ss}% | 3056 \def\atdummies{% |
2830 % | 3057 \def\@{@@}% |
2831 % Although these internals commands shouldn't show up, sometimes they do. | 3058 \def\ {@ }% |
2832 \def\bf{\realbackslash bf }% | 3059 \let\{ = \lbraceatcmd |
2833 \def\gtr{\realbackslash gtr}% | 3060 \let\} = \rbraceatcmd |
2834 \def\hat{\realbackslash hat}% | 3061 % |
2835 \def\less{\realbackslash less}% | 3062 % (See comments in \indexdummies.) |
2836 %\def\rm{\realbackslash rm }% | 3063 \def\definedummyword##1{% |
2837 \def\sf{\realbackslash sf}% | 3064 \expandafter\def\csname ##1\endcsname{@##1\space}% |
2838 \def\sl{\realbackslash sl }% | 3065 }% |
2839 \def\tclose##1{\realbackslash tclose {##1}}% | 3066 \def\definedummyletter##1{% |
2840 \def\tt{\realbackslash tt}% | 3067 \expandafter\def\csname ##1\endcsname{@##1}% |
2841 % | 3068 }% |
2842 \def\b##1{\realbackslash b {##1}}% | 3069 % |
2843 \def\i##1{\realbackslash i {##1}}% | 3070 % Do the redefinitions. |
2844 \def\sc##1{\realbackslash sc {##1}}% | 3071 \commondummies |
2845 \def\t##1{\realbackslash t {##1}}% | 3072 } |
2846 \def\r##1{\realbackslash r {##1}}% | 3073 |
2847 % | 3074 % Called from \indexdummies and \atdummies. \definedummyword and |
2848 \def\TeX{\realbackslash TeX}% | 3075 % \definedummyletter must be defined first. |
2849 \def\acronym##1{\realbackslash acronym {##1}}% | 3076 % |
2850 \def\cite##1{\realbackslash cite {##1}}% | 3077 \def\commondummies{% |
2851 \def\code##1{\realbackslash code {##1}}% | 3078 % |
2852 \def\command##1{\realbackslash command {##1}}% | 3079 \normalturnoffactive |
2853 \def\dfn##1{\realbackslash dfn {##1}}% | 3080 % |
2854 \def\dots{\realbackslash dots }% | 3081 % Control letters and accents. |
2855 \def\emph##1{\realbackslash emph {##1}}% | 3082 \definedummyletter{_}% |
2856 \def\env##1{\realbackslash env {##1}}% | 3083 \definedummyletter{,}% |
2857 \def\file##1{\realbackslash file {##1}}% | 3084 \definedummyletter{"}% |
2858 \def\kbd##1{\realbackslash kbd {##1}}% | 3085 \definedummyletter{`}% |
2859 \def\key##1{\realbackslash key {##1}}% | 3086 \definedummyletter{'}% |
2860 \def\math##1{\realbackslash math {##1}}% | 3087 \definedummyletter{^}% |
2861 \def\option##1{\realbackslash option {##1}}% | 3088 \definedummyletter{~}% |
2862 \def\samp##1{\realbackslash samp {##1}}% | 3089 \definedummyletter{=}% |
2863 \def\strong##1{\realbackslash strong {##1}}% | 3090 \definedummyword{u}% |
2864 \def\uref##1{\realbackslash uref {##1}}% | 3091 \definedummyword{v}% |
2865 \def\url##1{\realbackslash url {##1}}% | 3092 \definedummyword{H}% |
2866 \def\var##1{\realbackslash var {##1}}% | 3093 \definedummyword{dotaccent}% |
2867 \def\w{\realbackslash w }% | 3094 \definedummyword{ringaccent}% |
2868 % | 3095 \definedummyword{tieaccent}% |
2869 % These math commands don't seem likely to be used in index entries. | 3096 \definedummyword{ubaraccent}% |
2870 \def\copyright{\realbackslash copyright}% | 3097 \definedummyword{udotaccent}% |
2871 \def\equiv{\realbackslash equiv}% | 3098 \definedummyword{dotless}% |
2872 \def\error{\realbackslash error}% | 3099 % |
2873 \def\expansion{\realbackslash expansion}% | 3100 % Other non-English letters. |
2874 \def\point{\realbackslash point}% | 3101 \definedummyword{AA}% |
2875 \def\print{\realbackslash print}% | 3102 \definedummyword{AE}% |
2876 \def\result{\realbackslash result}% | 3103 \definedummyword{L}% |
2877 % | 3104 \definedummyword{OE}% |
2878 % Handle some cases of @value -- where the variable name does not | 3105 \definedummyword{O}% |
2879 % contain - or _, and the value does not contain any | 3106 \definedummyword{aa}% |
2880 % (non-fully-expandable) commands. | 3107 \definedummyword{ae}% |
2881 \let\value = \expandablevalue | 3108 \definedummyword{l}% |
2882 % | 3109 \definedummyword{oe}% |
2883 \unsepspaces | 3110 \definedummyword{o}% |
2884 % Turn off macro expansion | 3111 \definedummyword{ss}% |
2885 \turnoffmacros | 3112 % |
3113 % Although these internal commands shouldn't show up, sometimes they do. | |
3114 \definedummyword{bf}% | |
3115 \definedummyword{gtr}% | |
3116 \definedummyword{hat}% | |
3117 \definedummyword{less}% | |
3118 \definedummyword{sf}% | |
3119 \definedummyword{sl}% | |
3120 \definedummyword{tclose}% | |
3121 \definedummyword{tt}% | |
3122 % | |
3123 % Texinfo font commands. | |
3124 \definedummyword{b}% | |
3125 \definedummyword{i}% | |
3126 \definedummyword{r}% | |
3127 \definedummyword{sc}% | |
3128 \definedummyword{t}% | |
3129 % | |
3130 \definedummyword{TeX}% | |
3131 \definedummyword{acronym}% | |
3132 \definedummyword{cite}% | |
3133 \definedummyword{code}% | |
3134 \definedummyword{command}% | |
3135 \definedummyword{dfn}% | |
3136 \definedummyword{dots}% | |
3137 \definedummyword{emph}% | |
3138 \definedummyword{env}% | |
3139 \definedummyword{file}% | |
3140 \definedummyword{kbd}% | |
3141 \definedummyword{key}% | |
3142 \definedummyword{math}% | |
3143 \definedummyword{option}% | |
3144 \definedummyword{samp}% | |
3145 \definedummyword{strong}% | |
3146 \definedummyword{uref}% | |
3147 \definedummyword{url}% | |
3148 \definedummyword{var}% | |
3149 \definedummyword{w}% | |
3150 % | |
3151 % Assorted special characters. | |
3152 \definedummyword{bullet}% | |
3153 \definedummyword{copyright}% | |
3154 \definedummyword{dots}% | |
3155 \definedummyword{enddots}% | |
3156 \definedummyword{equiv}% | |
3157 \definedummyword{error}% | |
3158 \definedummyword{expansion}% | |
3159 \definedummyword{minus}% | |
3160 \definedummyword{pounds}% | |
3161 \definedummyword{point}% | |
3162 \definedummyword{print}% | |
3163 \definedummyword{result}% | |
3164 % | |
3165 % Handle some cases of @value -- where the variable name does not | |
3166 % contain - or _, and the value does not contain any | |
3167 % (non-fully-expandable) commands. | |
3168 \let\value = \expandablevalue | |
3169 % | |
3170 % Normal spaces, not active ones. | |
3171 \unsepspaces | |
3172 % | |
3173 % No macro expansion. | |
3174 \turnoffmacros | |
2886 } | 3175 } |
2887 | 3176 |
2888 % If an index command is used in an @example environment, any spaces | 3177 % If an index command is used in an @example environment, any spaces |
2889 % therein should become regular spaces in the raw index file, not the | 3178 % therein should become regular spaces in the raw index file, not the |
2890 % expansion of \tie (\leavevmode \penalty \@M \ ). | 3179 % expansion of \tie (\leavevmode \penalty \@M \ ). |
2891 {\obeyspaces | 3180 {\obeyspaces |
2892 \gdef\unsepspaces{\obeyspaces\let =\space}} | 3181 \gdef\unsepspaces{\obeyspaces\let =\space}} |
2893 | 3182 |
2894 % \indexnofonts no-ops all font-change commands. | 3183 |
2895 % This is used when outputting the strings to sort the index by. | 3184 % \indexnofonts is used when outputting the strings to sort the index |
2896 \def\indexdummyfont#1{#1} | 3185 % by, and when constructing control sequence names. It eliminates all |
3186 % control sequences and just writes whatever the best ASCII sort string | |
3187 % would be for a given command (usually its argument). | |
3188 % | |
2897 \def\indexdummytex{TeX} | 3189 \def\indexdummytex{TeX} |
2898 \def\indexdummydots{...} | 3190 \def\indexdummydots{...} |
2899 | 3191 % |
2900 \def\indexnofonts{% | 3192 \def\indexnofonts{% |
2901 \def\@{@}% | 3193 \def\ { }% |
2902 % how to handle braces? | 3194 \def\@{@}% |
2903 \def\_{\normalunderscore}% | 3195 % how to handle braces? |
2904 % | 3196 \def\_{\normalunderscore}% |
2905 \let\,=\indexdummyfont | 3197 % |
2906 \let\"=\indexdummyfont | 3198 \let\,=\asis |
2907 \let\`=\indexdummyfont | 3199 \let\"=\asis |
2908 \let\'=\indexdummyfont | 3200 \let\`=\asis |
2909 \let\^=\indexdummyfont | 3201 \let\'=\asis |
2910 \let\~=\indexdummyfont | 3202 \let\^=\asis |
2911 \let\==\indexdummyfont | 3203 \let\~=\asis |
2912 \let\b=\indexdummyfont | 3204 \let\==\asis |
2913 \let\c=\indexdummyfont | 3205 \let\u=\asis |
2914 \let\d=\indexdummyfont | 3206 \let\v=\asis |
2915 \let\u=\indexdummyfont | 3207 \let\H=\asis |
2916 \let\v=\indexdummyfont | 3208 \let\dotaccent=\asis |
2917 \let\H=\indexdummyfont | 3209 \let\ringaccent=\asis |
2918 \let\dotless=\indexdummyfont | 3210 \let\tieaccent=\asis |
2919 % Take care of the plain tex special European modified letters. | 3211 \let\ubaraccent=\asis |
2920 \def\AA{AA}% | 3212 \let\udotaccent=\asis |
2921 \def\AE{AE}% | 3213 \let\dotless=\asis |
2922 \def\L{L}% | 3214 % |
2923 \def\OE{OE}% | 3215 % Other non-English letters. |
2924 \def\O{O}% | 3216 \def\AA{AA}% |
2925 \def\aa{aa}% | 3217 \def\AE{AE}% |
2926 \def\ae{ae}% | 3218 \def\L{L}% |
2927 \def\l{l}% | 3219 \def\OE{OE}% |
2928 \def\oe{oe}% | 3220 \def\O{O}% |
2929 \def\o{o}% | 3221 \def\aa{aa}% |
2930 \def\ss{ss}% | 3222 \def\ae{ae}% |
2931 % | 3223 \def\l{l}% |
2932 % Don't no-op \tt, since it isn't a user-level command | 3224 \def\oe{oe}% |
2933 % and is used in the definitions of the active chars like <, >, |, etc. | 3225 \def\o{o}% |
2934 % Likewise with the other plain tex font commands. | 3226 \def\ss{ss}% |
2935 %\let\tt=\indexdummyfont | 3227 \def\exclamdown{!}% |
2936 % | 3228 \def\questiondown{?}% |
2937 \let\b=\indexdummyfont | 3229 % |
2938 \let\i=\indexdummyfont | 3230 % Don't no-op \tt, since it isn't a user-level command |
2939 \let\r=\indexdummyfont | 3231 % and is used in the definitions of the active chars like <, >, |, etc. |
2940 \let\sc=\indexdummyfont | 3232 % Likewise with the other plain tex font commands. |
2941 \let\t=\indexdummyfont | 3233 %\let\tt=\asis |
2942 % | 3234 % |
2943 \let\TeX=\indexdummytex | 3235 % Texinfo font commands. |
2944 \let\acronym=\indexdummyfont | 3236 \let\b=\asis |
2945 \let\cite=\indexdummyfont | 3237 \let\i=\asis |
2946 \let\code=\indexdummyfont | 3238 \let\r=\asis |
2947 \let\command=\indexdummyfont | 3239 \let\sc=\asis |
2948 \let\dfn=\indexdummyfont | 3240 \let\t=\asis |
2949 \let\dots=\indexdummydots | 3241 % |
2950 \let\emph=\indexdummyfont | 3242 \let\TeX=\indexdummytex |
2951 \let\env=\indexdummyfont | 3243 \let\acronym=\asis |
2952 \let\file=\indexdummyfont | 3244 \let\cite=\asis |
2953 \let\kbd=\indexdummyfont | 3245 \let\code=\asis |
2954 \let\key=\indexdummyfont | 3246 \let\command=\asis |
2955 \let\math=\indexdummyfont | 3247 \let\dfn=\asis |
2956 \let\option=\indexdummyfont | 3248 \let\dots=\indexdummydots |
2957 \let\samp=\indexdummyfont | 3249 \let\emph=\asis |
2958 \let\strong=\indexdummyfont | 3250 \let\env=\asis |
2959 \let\uref=\indexdummyfont | 3251 \let\file=\asis |
2960 \let\url=\indexdummyfont | 3252 \let\kbd=\asis |
2961 \let\var=\indexdummyfont | 3253 \let\key=\asis |
2962 \let\w=\indexdummyfont | 3254 \let\math=\asis |
2963 } | 3255 \let\option=\asis |
2964 | 3256 \let\samp=\asis |
2965 % To define \realbackslash, we must make \ not be an escape. | 3257 \let\strong=\asis |
2966 % We must first make another character (@) an escape | 3258 \let\uref=\asis |
2967 % so we do not become unable to do a definition. | 3259 \let\url=\asis |
2968 | 3260 \let\var=\asis |
2969 {\catcode`\@=0 \catcode`\\=\other | 3261 \let\w=\asis |
2970 @gdef@realbackslash{\}} | 3262 } |
2971 | 3263 |
2972 \let\indexbackslash=0 %overridden during \printindex. | 3264 \let\indexbackslash=0 %overridden during \printindex. |
2973 \let\SETmarginindex=\relax % put index entries in margin (undocumented)? | 3265 \let\SETmarginindex=\relax % put index entries in margin (undocumented)? |
2974 | 3266 |
2975 % For \ifx comparisons. | 3267 % For \ifx comparisons. |
2997 {% | 3289 {% |
2998 \let\folio = 0% We will expand all macros now EXCEPT \folio. | 3290 \let\folio = 0% We will expand all macros now EXCEPT \folio. |
2999 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now | 3291 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now |
3000 % so it will be output as is; and it will print as backslash. | 3292 % so it will be output as is; and it will print as backslash. |
3001 % | 3293 % |
3002 \def\thirdarg{#3}% | 3294 % The main index entry text. |
3295 \toks0 = {#2}% | |
3003 % | 3296 % |
3004 % If third arg is present, precede it with space in sort key. | 3297 % If third arg is present, precede it with space in sort key. |
3005 \ifx\thirdarg\emptymacro | 3298 \def\thirdarg{#3}% |
3006 \let\subentry = \empty | 3299 \ifx\thirdarg\emptymacro \else |
3007 \else | 3300 % If the third (subentry) arg is present, add it to the index |
3008 \def\subentry{ #3}% | 3301 % line to write. |
3302 \toks0 = \expandafter{\the\toks0 \space #3}% | |
3009 \fi | 3303 \fi |
3010 % | 3304 % |
3011 % First process the index entry with all font commands turned | 3305 % Process the index entry with all font commands turned off, to |
3012 % off to get the string to sort by. | 3306 % get the string to sort by. |
3013 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% | 3307 {\indexnofonts |
3014 % | 3308 \edef\temp{\the\toks0}% need full expansion |
3015 % Now the real index entry with the fonts. | 3309 \xdef\indexsorttmp{\temp}% |
3016 \toks0 = {#2}% | 3310 }% |
3017 % | |
3018 % If the third (subentry) arg is present, add it to the index | |
3019 % line to write. | |
3020 \ifx\thirdarg\emptymacro \else | |
3021 \toks0 = \expandafter{\the\toks0{#3}}% | |
3022 \fi | |
3023 % | 3311 % |
3024 % Set up the complete index entry, with both the sort key and | 3312 % Set up the complete index entry, with both the sort key and |
3025 % the original text, including any font commands. We write | 3313 % the original text, including any font commands. We write |
3026 % three arguments to \entry to the .?? file (four in the | 3314 % three arguments to \entry to the .?? file (four in the |
3027 % subentry case), texindex reduces to two when writing the .??s | 3315 % subentry case), texindex reduces to two when writing the .??s |
3049 % Avoid page breaks due to these extra skips, too. | 3337 % Avoid page breaks due to these extra skips, too. |
3050 % | 3338 % |
3051 \iflinks | 3339 \iflinks |
3052 \ifvmode | 3340 \ifvmode |
3053 \skip0 = \lastskip | 3341 \skip0 = \lastskip |
3054 \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi | 3342 \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi |
3055 \fi | 3343 \fi |
3056 % | 3344 % |
3057 \temp % do the write | 3345 \temp % do the write |
3058 % | |
3059 % | 3346 % |
3060 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi | 3347 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi |
3061 \fi | 3348 \fi |
3062 }% | 3349 }% |
3063 }% | 3350 }% |
3104 \def\doprintindex#1{\begingroup | 3391 \def\doprintindex#1{\begingroup |
3105 \dobreak \chapheadingskip{10000}% | 3392 \dobreak \chapheadingskip{10000}% |
3106 % | 3393 % |
3107 \smallfonts \rm | 3394 \smallfonts \rm |
3108 \tolerance = 9500 | 3395 \tolerance = 9500 |
3396 \everypar = {}% don't want the \kern\-parindent from indentation suppression. | |
3109 \indexbreaks | 3397 \indexbreaks |
3110 % | 3398 % |
3111 % See if the index file exists and is nonempty. | 3399 % See if the index file exists and is nonempty. |
3112 % Change catcode of @ here so that if the index file contains | 3400 % Change catcode of @ here so that if the index file contains |
3113 % \initial {@} | 3401 % \initial {@} |
3485 \chapterzzz{#2} | 3773 \chapterzzz{#2} |
3486 \else | 3774 \else |
3487 \numberedsubsubseczzz{#2} | 3775 \numberedsubsubseczzz{#2} |
3488 \fi | 3776 \fi |
3489 \fi | 3777 \fi |
3778 \suppressfirstparagraphindent | |
3490 } | 3779 } |
3491 | 3780 |
3492 % like \numhead, but chooses appendix heading levels | 3781 % like \numhead, but chooses appendix heading levels |
3493 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 | 3782 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 |
3494 \ifcase\absseclevel | 3783 \ifcase\absseclevel |
3504 \appendixzzz{#2} | 3793 \appendixzzz{#2} |
3505 \else | 3794 \else |
3506 \appendixsubsubseczzz{#2} | 3795 \appendixsubsubseczzz{#2} |
3507 \fi | 3796 \fi |
3508 \fi | 3797 \fi |
3798 \suppressfirstparagraphindent | |
3509 } | 3799 } |
3510 | 3800 |
3511 % like \numhead, but chooses numberless heading levels | 3801 % like \numhead, but chooses numberless heading levels |
3512 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 | 3802 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 |
3513 \ifcase\absseclevel | 3803 \ifcase\absseclevel |
3523 \unnumberedzzz{#2} | 3813 \unnumberedzzz{#2} |
3524 \else | 3814 \else |
3525 \unnumberedsubsubseczzz{#2} | 3815 \unnumberedsubsubseczzz{#2} |
3526 \fi | 3816 \fi |
3527 \fi | 3817 \fi |
3818 \suppressfirstparagraphindent | |
3528 } | 3819 } |
3529 | 3820 |
3530 % @chapter, @appendix, @unnumbered. | 3821 % @chapter, @appendix, @unnumbered. |
3531 \def\thischaptername{No Chapter Title} | 3822 \def\thischaptername{No Chapter Title} |
3532 \outer\def\chapter{\parsearg\chapteryyy} | 3823 \outer\def\chapter{\parsearg\chapteryyy} |
3533 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz | 3824 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz |
3534 \def\chapterzzz #1{% | 3825 \def\chapterzzz #1{% |
3535 \secno=0 \subsecno=0 \subsubsecno=0 | 3826 \secno=0 \subsecno=0 \subsubsecno=0 |
3536 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% | 3827 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% |
3537 \chapmacro {#1}{\the\chapno}% | 3828 \chapmacro {#1}{\the\chapno}% |
3538 \gdef\thissection{#1}% | 3829 \gdef\thissection{#1}% |
3539 \gdef\thischaptername{#1}% | 3830 \gdef\thischaptername{#1}% |
3540 % We don't substitute the actual chapter name into \thischapter | 3831 % We don't substitute the actual chapter name into \thischapter |
3541 % because we don't want its macros evaluated now. | 3832 % because we don't want its macros evaluated now. |
3542 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% | 3833 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% |
3543 \toks0 = {#1}% | 3834 \writetocentry{chap}{#1}{{\the\chapno}} |
3544 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% | 3835 \donoderef |
3545 {\the\chapno}}}% | 3836 \global\let\section = \numberedsec |
3546 \temp | 3837 \global\let\subsection = \numberedsubsec |
3547 \donoderef | 3838 \global\let\subsubsection = \numberedsubsubsec |
3548 \global\let\section = \numberedsec | 3839 } |
3549 \global\let\subsection = \numberedsubsec | 3840 |
3550 \global\let\subsubsection = \numberedsubsubsec | 3841 % we use \chapno to avoid indenting back |
3551 } | 3842 \def\appendixbox#1{% |
3843 \setbox0 = \hbox{\putwordAppendix{} \the\chapno}% | |
3844 \hbox to \wd0{#1\hss}} | |
3552 | 3845 |
3553 \outer\def\appendix{\parsearg\appendixyyy} | 3846 \outer\def\appendix{\parsearg\appendixyyy} |
3554 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz | 3847 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz |
3555 \def\appendixzzz #1{% | 3848 \def\appendixzzz #1{% |
3556 \secno=0 \subsecno=0 \subsubsecno=0 | 3849 \secno=0 \subsecno=0 \subsubsecno=0 |
3557 \global\advance \appendixno by 1 | 3850 \global\advance \appendixno by 1 |
3558 \message{\putwordAppendix\space \appendixletter}% | 3851 \message{\putwordAppendix\space \appendixletter}% |
3559 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% | 3852 \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}% |
3560 \gdef\thissection{#1}% | 3853 \gdef\thissection{#1}% |
3561 \gdef\thischaptername{#1}% | 3854 \gdef\thischaptername{#1}% |
3562 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% | 3855 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% |
3563 \toks0 = {#1}% | 3856 \writetocentry{appendix}{#1}{{\appendixletter}} |
3564 \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% | 3857 \appendixnoderef |
3565 {\appendixletter}}}% | 3858 \global\let\section = \appendixsec |
3566 \temp | 3859 \global\let\subsection = \appendixsubsec |
3567 \appendixnoderef | 3860 \global\let\subsubsection = \appendixsubsubsec |
3568 \global\let\section = \appendixsec | |
3569 \global\let\subsection = \appendixsubsec | |
3570 \global\let\subsubsection = \appendixsubsubsec | |
3571 } | 3861 } |
3572 | 3862 |
3573 % @centerchap is like @unnumbered, but the heading is centered. | 3863 % @centerchap is like @unnumbered, but the heading is centered. |
3574 \outer\def\centerchap{\parsearg\centerchapyyy} | 3864 \outer\def\centerchap{\parsearg\centerchapyyy} |
3575 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} | 3865 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} |
3578 \outer\def\top{\parsearg\unnumberedyyy} | 3868 \outer\def\top{\parsearg\unnumberedyyy} |
3579 | 3869 |
3580 \outer\def\unnumbered{\parsearg\unnumberedyyy} | 3870 \outer\def\unnumbered{\parsearg\unnumberedyyy} |
3581 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz | 3871 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz |
3582 \def\unnumberedzzz #1{% | 3872 \def\unnumberedzzz #1{% |
3583 \secno=0 \subsecno=0 \subsubsecno=0 | 3873 \secno=0 \subsecno=0 \subsubsecno=0 |
3584 % | 3874 % |
3585 % This used to be simply \message{#1}, but TeX fully expands the | 3875 % This used to be simply \message{#1}, but TeX fully expands the |
3586 % argument to \message. Therefore, if #1 contained @-commands, TeX | 3876 % argument to \message. Therefore, if #1 contained @-commands, TeX |
3587 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX | 3877 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX |
3588 % expanded @cite (which turns out to cause errors because \cite is meant | 3878 % expanded @cite (which turns out to cause errors because \cite is meant |
3589 % to be executed, not expanded). | 3879 % to be executed, not expanded). |
3590 % | 3880 % |
3591 % Anyway, we don't want the fully-expanded definition of @cite to appear | 3881 % Anyway, we don't want the fully-expanded definition of @cite to appear |
3592 % as a result of the \message, we just want `@cite' itself. We use | 3882 % as a result of the \message, we just want `@cite' itself. We use |
3593 % \the<toks register> to achieve this: TeX expands \the<toks> only once, | 3883 % \the<toks register> to achieve this: TeX expands \the<toks> only once, |
3594 % simply yielding the contents of <toks register>. (We also do this for | 3884 % simply yielding the contents of <toks register>. (We also do this for |
3595 % the toc entries.) | 3885 % the toc entries.) |
3596 \toks0 = {#1}\message{(\the\toks0)}% | 3886 \toks0 = {#1}\message{(\the\toks0)}% |
3597 % | 3887 % |
3598 \unnumbchapmacro {#1}% | 3888 \unnumbchapmacro {#1}% |
3599 \gdef\thischapter{#1}\gdef\thissection{#1}% | 3889 \gdef\thischapter{#1}\gdef\thissection{#1}% |
3600 \toks0 = {#1}% | 3890 \writetocentry{unnumbchap}{#1}{{\the\chapno}} |
3601 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% | 3891 \unnumbnoderef |
3602 \temp | 3892 \global\let\section = \unnumberedsec |
3603 \unnumbnoderef | 3893 \global\let\subsection = \unnumberedsubsec |
3604 \global\let\section = \unnumberedsec | 3894 \global\let\subsubsection = \unnumberedsubsubsec |
3605 \global\let\subsection = \unnumberedsubsec | |
3606 \global\let\subsubsection = \unnumberedsubsubsec | |
3607 } | 3895 } |
3608 | 3896 |
3609 % Sections. | 3897 % Sections. |
3610 \outer\def\numberedsec{\parsearg\secyyy} | 3898 \outer\def\numberedsec{\parsearg\secyyy} |
3611 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz | 3899 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz |
3612 \def\seczzz #1{% | 3900 \def\seczzz #1{% |
3613 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | 3901 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % |
3614 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% | 3902 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% |
3615 \toks0 = {#1}% | 3903 \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}} |
3616 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% | 3904 \donoderef |
3617 {\the\chapno}{\the\secno}}}% | 3905 \nobreak |
3618 \temp | |
3619 \donoderef | |
3620 \nobreak | |
3621 } | 3906 } |
3622 | 3907 |
3623 \outer\def\appendixsection{\parsearg\appendixsecyyy} | 3908 \outer\def\appendixsection{\parsearg\appendixsecyyy} |
3624 \outer\def\appendixsec{\parsearg\appendixsecyyy} | 3909 \outer\def\appendixsec{\parsearg\appendixsecyyy} |
3625 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz | 3910 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz |
3626 \def\appendixsectionzzz #1{% | 3911 \def\appendixsectionzzz #1{% |
3627 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | 3912 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % |
3628 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% | 3913 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% |
3629 \toks0 = {#1}% | 3914 \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}} |
3630 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% | 3915 \appendixnoderef |
3631 {\appendixletter}{\the\secno}}}% | 3916 \nobreak |
3632 \temp | |
3633 \appendixnoderef | |
3634 \nobreak | |
3635 } | 3917 } |
3636 | 3918 |
3637 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} | 3919 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} |
3638 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz | 3920 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz |
3639 \def\unnumberedseczzz #1{% | 3921 \def\unnumberedseczzz #1{% |
3640 \plainsecheading {#1}\gdef\thissection{#1}% | 3922 \plainsecheading {#1}\gdef\thissection{#1}% |
3641 \toks0 = {#1}% | 3923 \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}} |
3642 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% | 3924 \unnumbnoderef |
3643 {\the\toks0}{\the\chapno}}}% | 3925 \nobreak |
3644 \temp | |
3645 \unnumbnoderef | |
3646 \nobreak | |
3647 } | 3926 } |
3648 | 3927 |
3649 % Subsections. | 3928 % Subsections. |
3650 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} | 3929 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} |
3651 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz | 3930 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz |
3652 \def\numberedsubseczzz #1{% | 3931 \def\numberedsubseczzz #1{% |
3653 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | 3932 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % |
3654 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% | 3933 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% |
3655 \toks0 = {#1}% | 3934 \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} |
3656 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% | 3935 \donoderef |
3657 {\the\chapno}{\the\secno}{\the\subsecno}}}% | 3936 \nobreak |
3658 \temp | |
3659 \donoderef | |
3660 \nobreak | |
3661 } | 3937 } |
3662 | 3938 |
3663 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} | 3939 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} |
3664 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz | 3940 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz |
3665 \def\appendixsubseczzz #1{% | 3941 \def\appendixsubseczzz #1{% |
3666 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | 3942 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % |
3667 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% | 3943 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% |
3668 \toks0 = {#1}% | 3944 \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}} |
3669 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% | 3945 \appendixnoderef |
3670 {\appendixletter}{\the\secno}{\the\subsecno}}}% | 3946 \nobreak |
3671 \temp | |
3672 \appendixnoderef | |
3673 \nobreak | |
3674 } | 3947 } |
3675 | 3948 |
3676 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} | 3949 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} |
3677 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | 3950 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz |
3678 \def\unnumberedsubseczzz #1{% | 3951 \def\unnumberedsubseczzz #1{% |
3679 \plainsubsecheading {#1}\gdef\thissection{#1}% | 3952 \plainsubsecheading {#1}\gdef\thissection{#1}% |
3680 \toks0 = {#1}% | 3953 \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} |
3681 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% | 3954 \unnumbnoderef |
3682 {\the\toks0}{\the\chapno}{\the\secno}}}% | 3955 \nobreak |
3683 \temp | |
3684 \unnumbnoderef | |
3685 \nobreak | |
3686 } | 3956 } |
3687 | 3957 |
3688 % Subsubsections. | 3958 % Subsubsections. |
3689 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} | 3959 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} |
3690 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz | 3960 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz |
3691 \def\numberedsubsubseczzz #1{% | 3961 \def\numberedsubsubseczzz #1{% |
3692 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | 3962 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % |
3693 \subsubsecheading {#1} | 3963 \subsubsecheading {#1} |
3694 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | 3964 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% |
3695 \toks0 = {#1}% | 3965 \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} |
3696 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% | 3966 \donoderef |
3697 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% | 3967 \nobreak |
3698 \temp | |
3699 \donoderef | |
3700 \nobreak | |
3701 } | 3968 } |
3702 | 3969 |
3703 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} | 3970 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} |
3704 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz | 3971 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz |
3705 \def\appendixsubsubseczzz #1{% | 3972 \def\appendixsubsubseczzz #1{% |
3706 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | 3973 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % |
3707 \subsubsecheading {#1} | 3974 \subsubsecheading {#1} |
3708 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | 3975 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% |
3709 \toks0 = {#1}% | 3976 \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}} |
3710 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% | 3977 \appendixnoderef |
3711 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% | 3978 \nobreak |
3712 \temp | |
3713 \appendixnoderef | |
3714 \nobreak | |
3715 } | 3979 } |
3716 | 3980 |
3717 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} | 3981 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} |
3718 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | 3982 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz |
3719 \def\unnumberedsubsubseczzz #1{% | 3983 \def\unnumberedsubsubseczzz #1{% |
3720 \plainsubsubsecheading {#1}\gdef\thissection{#1}% | 3984 \plainsubsubsecheading {#1}\gdef\thissection{#1}% |
3721 \toks0 = {#1}% | 3985 \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} |
3722 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% | 3986 \unnumbnoderef |
3723 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% | 3987 \nobreak |
3724 \temp | |
3725 \unnumbnoderef | |
3726 \nobreak | |
3727 } | 3988 } |
3728 | 3989 |
3729 % These are variants which are not "outer", so they can appear in @ifinfo. | 3990 % These are variants which are not "outer", so they can appear in @ifinfo. |
3730 % Actually, they should now be obsolete; ordinary section commands should work. | 3991 % Actually, they should now be obsolete; ordinary section commands should work. |
3731 \def\infotop{\parsearg\unnumberedzzz} | 3992 \def\infotop{\parsearg\unnumberedzzz} |
3762 % if justification is not attempted. Hence \raggedright. | 4023 % if justification is not attempted. Hence \raggedright. |
3763 | 4024 |
3764 | 4025 |
3765 \def\majorheading{\parsearg\majorheadingzzz} | 4026 \def\majorheading{\parsearg\majorheadingzzz} |
3766 \def\majorheadingzzz #1{% | 4027 \def\majorheadingzzz #1{% |
3767 {\advance\chapheadingskip by 10pt \chapbreak }% | 4028 {\advance\chapheadingskip by 10pt \chapbreak }% |
3768 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 4029 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3769 \parindent=0pt\raggedright | 4030 \parindent=0pt\raggedright |
3770 \rm #1\hfill}}\bigskip \par\penalty 200} | 4031 \rm #1\hfill}}\bigskip \par\penalty 200} |
3771 | 4032 |
3772 \def\chapheading{\parsearg\chapheadingzzz} | 4033 \def\chapheading{\parsearg\chapheadingzzz} |
3773 \def\chapheadingzzz #1{\chapbreak % | 4034 \def\chapheadingzzz #1{\chapbreak % |
3774 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | 4035 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 |
3775 \parindent=0pt\raggedright | 4036 \parindent=0pt\raggedright |
3776 \rm #1\hfill}}\bigskip \par\penalty 200} | 4037 \rm #1\hfill}}\bigskip \par\penalty 200} |
3777 | 4038 |
3778 % @heading, @subheading, @subsubheading. | 4039 % @heading, @subheading, @subsubheading. |
3779 \def\heading{\parsearg\plainsecheading} | 4040 \def\heading{\parsearg\plainsecheading} |
3780 \def\subheading{\parsearg\plainsubsecheading} | 4041 \def\subheading{\parsearg\plainsubsecheading} |
3781 \def\subsubheading{\parsearg\plainsubsubsecheading} | 4042 \def\subsubheading{\parsearg\plainsubsubsecheading} |
3917 % | 4178 % |
3918 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | 4179 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright |
3919 \hangindent = \wd0 % zero if no section number | 4180 \hangindent = \wd0 % zero if no section number |
3920 \unhbox0 #3}% | 4181 \unhbox0 #3}% |
3921 }% | 4182 }% |
3922 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak | 4183 % Add extra space after the heading -- either a line space or a |
4184 % paragraph space, whichever is more. (Some people like to set | |
4185 % \parskip to large values for some reason.) Don't allow stretch, though. | |
4186 \nobreak | |
4187 \ifdim\parskip>\normalbaselineskip | |
4188 \kern\parskip | |
4189 \else | |
4190 \kern\normalbaselineskip | |
4191 \fi | |
4192 \nobreak | |
3923 } | 4193 } |
3924 | 4194 |
3925 | 4195 |
3926 \message{toc,} | 4196 \message{toc,} |
3927 % Table of contents. | 4197 % Table of contents. |
3929 | 4199 |
3930 % Write an entry to the toc file, opening it if necessary. | 4200 % Write an entry to the toc file, opening it if necessary. |
3931 % Called from @chapter, etc. We supply {\folio} at the end of the | 4201 % Called from @chapter, etc. We supply {\folio} at the end of the |
3932 % argument, which will end up as the last argument to the \...entry macro. | 4202 % argument, which will end up as the last argument to the \...entry macro. |
3933 % | 4203 % |
3934 % We open the .toc file here instead of at @setfilename or any other | 4204 % Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}} |
3935 % fixed time so that @contents can be put in the document anywhere. | 4205 % We open the .toc file for writing here instead of at @setfilename (or |
4206 % any other fixed time) so that @contents can be anywhere in the document. | |
3936 % | 4207 % |
3937 \newif\iftocfileopened | 4208 \newif\iftocfileopened |
3938 \def\writetocentry#1{% | 4209 \def\writetocentry#1#2#3{% |
3939 \iftocfileopened\else | 4210 \iftocfileopened\else |
3940 \immediate\openout\tocfile = \jobname.toc | 4211 \immediate\openout\tocfile = \jobname.toc |
3941 \global\tocfileopenedtrue | 4212 \global\tocfileopenedtrue |
3942 \fi | 4213 \fi |
3943 \iflinks \write\tocfile{#1{\folio}}\fi | 4214 % |
4215 \iflinks | |
4216 \toks0 = {#2}% | |
4217 \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}% | |
4218 \temp | |
4219 \fi | |
3944 % | 4220 % |
3945 % Tell \shipout to create a page destination if we're doing pdf, which | 4221 % Tell \shipout to create a page destination if we're doing pdf, which |
3946 % will be the target of the links in the table of contents. We can't | 4222 % will be the target of the links in the table of contents. We can't |
3947 % just do it on every page because the title pages are numbered 1 and | 4223 % just do it on every page because the title pages are numbered 1 and |
3948 % 2 (the page numbers aren't printed), and so are the first two pages | 4224 % 2 (the page numbers aren't printed), and so are the first two pages |
3977 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi | 4253 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi |
3978 \raggedbottom % Worry more about breakpoints than the bottom. | 4254 \raggedbottom % Worry more about breakpoints than the bottom. |
3979 \advance\hsize by -\contentsrightmargin % Don't use the full line length. | 4255 \advance\hsize by -\contentsrightmargin % Don't use the full line length. |
3980 % | 4256 % |
3981 % Roman numerals for page numbers. | 4257 % Roman numerals for page numbers. |
3982 \ifnum \pageno>0 \pageno = \lastnegativepageno \fi | 4258 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi |
3983 } | 4259 } |
3984 | 4260 |
3985 | 4261 |
3986 % Normal (long) toc. | 4262 % Normal (long) toc. |
3987 \def\contents{% | 4263 \def\contents{% |
3994 \vfill \eject | 4270 \vfill \eject |
3995 \contentsalignmacro % in case @setchapternewpage odd is in effect | 4271 \contentsalignmacro % in case @setchapternewpage odd is in effect |
3996 \pdfmakeoutlines | 4272 \pdfmakeoutlines |
3997 \endgroup | 4273 \endgroup |
3998 \lastnegativepageno = \pageno | 4274 \lastnegativepageno = \pageno |
3999 \pageno = \savepageno | 4275 \global\pageno = \savepageno |
4000 } | 4276 } |
4001 | 4277 |
4002 % And just the chapters. | 4278 % And just the chapters. |
4003 \def\summarycontents{% | 4279 \def\summarycontents{% |
4004 \startcontents{\putwordShortTOC}% | 4280 \startcontents{\putwordShortTOC}% |
4006 \let\chapentry = \shortchapentry | 4282 \let\chapentry = \shortchapentry |
4007 \let\appendixentry = \shortappendixentry | 4283 \let\appendixentry = \shortappendixentry |
4008 \let\unnumbchapentry = \shortunnumberedentry | 4284 \let\unnumbchapentry = \shortunnumberedentry |
4009 % We want a true roman here for the page numbers. | 4285 % We want a true roman here for the page numbers. |
4010 \secfonts | 4286 \secfonts |
4011 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl | 4287 \let\rm=\shortcontrm \let\bf=\shortcontbf |
4288 \let\sl=\shortcontsl \let\tt=\shortconttt | |
4012 \rm | 4289 \rm |
4013 \hyphenpenalty = 10000 | 4290 \hyphenpenalty = 10000 |
4014 \advance\baselineskip by 1pt % Open it up a little. | 4291 \advance\baselineskip by 1pt % Open it up a little. |
4015 \def\secentry ##1##2##3##4{} | 4292 \def\secentry ##1##2##3##4{} |
4016 \def\unnumbsecentry ##1##2##3{} | |
4017 \def\subsecentry ##1##2##3##4##5{} | 4293 \def\subsecentry ##1##2##3##4##5{} |
4018 \def\unnumbsubsecentry ##1##2##3##4{} | |
4019 \def\subsubsecentry ##1##2##3##4##5##6{} | 4294 \def\subsubsecentry ##1##2##3##4##5##6{} |
4020 \def\unnumbsubsubsecentry ##1##2##3##4##5{} | 4295 \let\unnumbsecentry = \secentry |
4296 \let\unnumbsubsecentry = \subsecentry | |
4297 \let\unnumbsubsubsecentry = \subsubsecentry | |
4021 \openin 1 \jobname.toc | 4298 \openin 1 \jobname.toc |
4022 \ifeof 1 \else | 4299 \ifeof 1 \else |
4023 \closein 1 | 4300 \closein 1 |
4024 \input \jobname.toc | 4301 \input \jobname.toc |
4025 \fi | 4302 \fi |
4026 \vfill \eject | 4303 \vfill \eject |
4027 \contentsalignmacro % in case @setchapternewpage odd is in effect | 4304 \contentsalignmacro % in case @setchapternewpage odd is in effect |
4028 \endgroup | 4305 \endgroup |
4029 \lastnegativepageno = \pageno | 4306 \lastnegativepageno = \pageno |
4030 \pageno = \savepageno | 4307 \global\pageno = \savepageno |
4031 } | 4308 } |
4032 \let\shortcontents = \summarycontents | 4309 \let\shortcontents = \summarycontents |
4033 | 4310 |
4034 \ifpdf | 4311 \ifpdf |
4035 \pdfcatalog{/PageMode /UseOutlines}% | 4312 \pdfcatalog{/PageMode /UseOutlines}% |
4048 \def\shortchapentry#1#2#3{% | 4325 \def\shortchapentry#1#2#3{% |
4049 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% | 4326 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% |
4050 } | 4327 } |
4051 | 4328 |
4052 % Appendices, in the main contents. | 4329 % Appendices, in the main contents. |
4053 \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} | 4330 \def\appendixentry#1#2#3{% |
4331 \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}} | |
4054 % | 4332 % |
4055 % Appendices, in the short toc. | 4333 % Appendices, in the short toc. |
4056 \let\shortappendixentry = \shortchapentry | 4334 \let\shortappendixentry = \shortchapentry |
4057 | 4335 |
4058 % Typeset the label for a chapter or appendix for the short contents. | 4336 % Typeset the label for a chapter or appendix for the short contents. |
4072 \dimen0 = 1em | 4350 \dimen0 = 1em |
4073 \hbox to \dimen0{#1\hss}% | 4351 \hbox to \dimen0{#1\hss}% |
4074 } | 4352 } |
4075 | 4353 |
4076 % Unnumbered chapters. | 4354 % Unnumbered chapters. |
4077 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} | 4355 \def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}} |
4078 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} | 4356 \def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}} |
4079 | 4357 |
4080 % Sections. | 4358 % Sections. |
4081 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} | 4359 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} |
4082 \def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} | 4360 \def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}} |
4083 | 4361 |
4084 % Subsections. | 4362 % Subsections. |
4085 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} | 4363 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} |
4086 \def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} | 4364 \def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}} |
4087 | 4365 |
4088 % And subsubsections. | 4366 % And subsubsections. |
4089 \def\subsubsecentry#1#2#3#4#5#6{% | 4367 \def\subsubsecentry#1#2#3#4#5#6{% |
4090 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} | 4368 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} |
4091 \def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} | 4369 \def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}} |
4092 | 4370 |
4093 % This parameter controls the indentation of the various levels. | 4371 % This parameter controls the indentation of the various levels. |
4094 \newdimen\tocindent \tocindent = 3pc | 4372 \newdimen\tocindent \tocindent = 3pc |
4095 | 4373 |
4096 % Now for the actual typesetting. In all these, #1 is the text and #2 is the | 4374 % Now for the actual typesetting. In all these, #1 is the text and #2 is the |
4188 % But \@ or @@ will get a plain tex @ character. | 4466 % But \@ or @@ will get a plain tex @ character. |
4189 | 4467 |
4190 \def\tex{\begingroup | 4468 \def\tex{\begingroup |
4191 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 | 4469 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 |
4192 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 | 4470 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 |
4193 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie | 4471 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie |
4194 \catcode `\%=14 | 4472 \catcode `\%=14 |
4195 \catcode 43=12 % plus | 4473 \catcode `\+=\other |
4196 \catcode`\"=12 | 4474 \catcode `\"=\other |
4197 \catcode`\==12 | 4475 \catcode `\==\other |
4198 \catcode`\|=12 | 4476 \catcode `\|=\other |
4199 \catcode`\<=12 | 4477 \catcode `\<=\other |
4200 \catcode`\>=12 | 4478 \catcode `\>=\other |
4201 \escapechar=`\\ | 4479 \escapechar=`\\ |
4202 % | 4480 % |
4203 \let\b=\ptexb | 4481 \let\b=\ptexb |
4204 \let\bullet=\ptexbullet | 4482 \let\bullet=\ptexbullet |
4205 \let\c=\ptexc | 4483 \let\c=\ptexc |
4207 \let\.=\ptexdot | 4485 \let\.=\ptexdot |
4208 \let\dots=\ptexdots | 4486 \let\dots=\ptexdots |
4209 \let\equiv=\ptexequiv | 4487 \let\equiv=\ptexequiv |
4210 \let\!=\ptexexclam | 4488 \let\!=\ptexexclam |
4211 \let\i=\ptexi | 4489 \let\i=\ptexi |
4490 \let\indent=\ptexindent | |
4212 \let\{=\ptexlbrace | 4491 \let\{=\ptexlbrace |
4213 \let\+=\tabalign | 4492 \let\+=\tabalign |
4214 \let\}=\ptexrbrace | 4493 \let\}=\ptexrbrace |
4494 \let\/=\ptexslash | |
4215 \let\*=\ptexstar | 4495 \let\*=\ptexstar |
4216 \let\t=\ptext | 4496 \let\t=\ptext |
4217 % | 4497 % |
4218 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | 4498 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% |
4219 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% | 4499 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% |
4249 \newskip\envskipamount \envskipamount = 0pt | 4529 \newskip\envskipamount \envskipamount = 0pt |
4250 | 4530 |
4251 % Make spacing and below environment symmetrical. We use \parskip here | 4531 % Make spacing and below environment symmetrical. We use \parskip here |
4252 % to help in doing that, since in @example-like environments \parskip | 4532 % to help in doing that, since in @example-like environments \parskip |
4253 % is reset to zero; thus the \afterenvbreak inserts no space -- but the | 4533 % is reset to zero; thus the \afterenvbreak inserts no space -- but the |
4254 % start of the next paragraph will insert \parskip | 4534 % start of the next paragraph will insert \parskip. |
4255 % | 4535 % |
4256 \def\aboveenvbreak{{% | 4536 \def\aboveenvbreak{{% |
4257 \ifnum\lastpenalty < 10000 | 4537 % =10000 instead of <10000 because of a special case in \itemzzz, q.v. |
4538 \ifnum \lastpenalty=10000 \else | |
4258 \advance\envskipamount by \parskip | 4539 \advance\envskipamount by \parskip |
4259 \endgraf | 4540 \endgraf |
4260 \ifdim\lastskip<\envskipamount | 4541 \ifdim\lastskip<\envskipamount |
4261 \removelastskip | 4542 \removelastskip |
4262 \penalty-50 | 4543 % it's not a good place to break if the last penalty was \nobreak |
4544 % or better ... | |
4545 \ifnum\lastpenalty>10000 \else \penalty-50 \fi | |
4263 \vskip\envskipamount | 4546 \vskip\envskipamount |
4264 \fi | 4547 \fi |
4265 \fi | 4548 \fi |
4266 }} | 4549 }} |
4267 | 4550 |
4289 \cbl\leaders\hrule height\circthick\hfil\cbr | 4572 \cbl\leaders\hrule height\circthick\hfil\cbr |
4290 \hskip\rskip}} | 4573 \hskip\rskip}} |
4291 % | 4574 % |
4292 \newskip\lskip\newskip\rskip | 4575 \newskip\lskip\newskip\rskip |
4293 | 4576 |
4294 \long\def\cartouche{% | 4577 \def\cartouche{% |
4578 \par % can't be in the midst of a paragraph. | |
4295 \begingroup | 4579 \begingroup |
4296 \lskip=\leftskip \rskip=\rightskip | 4580 \lskip=\leftskip \rskip=\rightskip |
4297 \leftskip=0pt\rightskip=0pt %we want these *outside*. | 4581 \leftskip=0pt\rightskip=0pt %we want these *outside*. |
4298 \cartinner=\hsize \advance\cartinner by-\lskip | 4582 \cartinner=\hsize \advance\cartinner by-\lskip |
4299 \advance\cartinner by-\rskip | 4583 \advance\cartinner by-\rskip |
4336 \def\nonfillstart{% | 4620 \def\nonfillstart{% |
4337 \aboveenvbreak | 4621 \aboveenvbreak |
4338 \inENV % This group ends at the end of the body | 4622 \inENV % This group ends at the end of the body |
4339 \hfuzz = 12pt % Don't be fussy | 4623 \hfuzz = 12pt % Don't be fussy |
4340 \sepspaces % Make spaces be word-separators rather than space tokens. | 4624 \sepspaces % Make spaces be word-separators rather than space tokens. |
4341 \singlespace | |
4342 \let\par = \lisppar % don't ignore blank lines | 4625 \let\par = \lisppar % don't ignore blank lines |
4343 \obeylines % each line of input is a line of output | 4626 \obeylines % each line of input is a line of output |
4344 \parskip = 0pt | 4627 \parskip = 0pt |
4345 \parindent = 0pt | 4628 \parindent = 0pt |
4346 \emergencystretch = 0pt % don't try to avoid overfull boxes | 4629 \emergencystretch = 0pt % don't try to avoid overfull boxes |
4375 } | 4658 } |
4376 | 4659 |
4377 % @example: Same as @lisp. | 4660 % @example: Same as @lisp. |
4378 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} | 4661 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} |
4379 | 4662 |
4380 % @small... is usually equivalent to the non-small (@smallbook | 4663 % @smallexample and @smalllisp: use smaller fonts. |
4381 % redefines). We must call \example (or whatever) last in the | |
4382 % definition, since it reads the return following the @example (or | |
4383 % whatever) command. | |
4384 % | |
4385 % This actually allows (for example) @end display inside an | |
4386 % @smalldisplay. Too bad, but makeinfo will catch the error anyway. | |
4387 % | |
4388 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} | |
4389 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} | |
4390 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} | |
4391 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} | |
4392 | |
4393 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. | |
4394 % Originally contributed by Pavel@xerox. | 4664 % Originally contributed by Pavel@xerox. |
4395 \def\smalllispx{\begingroup | 4665 \def\smalllisp{\begingroup |
4396 \def\Esmalllisp{\nonfillfinish\endgroup}% | 4666 \def\Esmalllisp{\nonfillfinish\endgroup}% |
4397 \def\Esmallexample{\nonfillfinish\endgroup}% | 4667 \def\Esmallexample{\nonfillfinish\endgroup}% |
4398 \smallexamplefonts | 4668 \smallexamplefonts |
4399 \lisp | 4669 \lisp |
4400 } | 4670 } |
4671 \let\smallexample = \smalllisp | |
4672 | |
4401 | 4673 |
4402 % @display: same as @lisp except keep current font. | 4674 % @display: same as @lisp except keep current font. |
4403 % | 4675 % |
4404 \def\display{\begingroup | 4676 \def\display{\begingroup |
4405 \nonfillstart | 4677 \nonfillstart |
4406 \let\Edisplay = \nonfillfinish | 4678 \let\Edisplay = \nonfillfinish |
4407 \gobble | 4679 \gobble |
4408 } | 4680 } |
4409 % | 4681 % |
4410 % @smalldisplay (when @smallbook): @display plus smaller fonts. | 4682 % @smalldisplay: @display plus smaller fonts. |
4411 % | 4683 % |
4412 \def\smalldisplayx{\begingroup | 4684 \def\smalldisplay{\begingroup |
4413 \def\Esmalldisplay{\nonfillfinish\endgroup}% | 4685 \def\Esmalldisplay{\nonfillfinish\endgroup}% |
4414 \smallexamplefonts \rm | 4686 \smallexamplefonts \rm |
4415 \display | 4687 \display |
4416 } | 4688 } |
4417 | 4689 |
4422 \nonfillstart | 4694 \nonfillstart |
4423 \let\Eformat = \nonfillfinish | 4695 \let\Eformat = \nonfillfinish |
4424 \gobble | 4696 \gobble |
4425 } | 4697 } |
4426 % | 4698 % |
4427 % @smallformat (when @smallbook): @format plus smaller fonts. | 4699 % @smallformat: @format plus smaller fonts. |
4428 % | 4700 % |
4429 \def\smallformatx{\begingroup | 4701 \def\smallformat{\begingroup |
4430 \def\Esmallformat{\nonfillfinish\endgroup}% | 4702 \def\Esmallformat{\nonfillfinish\endgroup}% |
4431 \smallexamplefonts \rm | 4703 \smallexamplefonts \rm |
4432 \format | 4704 \format |
4433 } | 4705 } |
4434 | 4706 |
4451 % and narrows the margins. | 4723 % and narrows the margins. |
4452 % | 4724 % |
4453 \def\quotation{% | 4725 \def\quotation{% |
4454 \begingroup\inENV %This group ends at the end of the @quotation body | 4726 \begingroup\inENV %This group ends at the end of the @quotation body |
4455 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip | 4727 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip |
4456 \singlespace | |
4457 \parindent=0pt | 4728 \parindent=0pt |
4458 % We have retained a nonzero parskip for the environment, since we're | 4729 % We have retained a nonzero parskip for the environment, since we're |
4459 % doing normal filling. So to avoid extra space below the environment... | 4730 % doing normal filling. So to avoid extra space below the environment... |
4460 \def\Equotation{\parskip = 0pt \nonfillfinish}% | 4731 \def\Equotation{\parskip = 0pt \nonfillfinish}% |
4461 % | 4732 % |
4474 % we need the curly braces so that makeinfo sees the @verb command, eg: | 4745 % we need the curly braces so that makeinfo sees the @verb command, eg: |
4475 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org | 4746 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org |
4476 % | 4747 % |
4477 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. | 4748 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. |
4478 % | 4749 % |
4479 % [Knuth] p. 344; only we need to do '@' too | 4750 % [Knuth] p.344; only we need to do the other characters Texinfo sets |
4751 % active too. Otherwise, they get lost as the first character on a | |
4752 % verbatim line. | |
4480 \def\dospecials{% | 4753 \def\dospecials{% |
4481 \do\ \do\\\do\@\do\{\do\}\do\$\do\&% | 4754 \do\ \do\\\do\{\do\}\do\$\do\&% |
4482 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} | 4755 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% |
4756 \do\<\do\>\do\|\do\@\do+\do\"% | |
4757 } | |
4483 % | 4758 % |
4484 % [Knuth] p. 380 | 4759 % [Knuth] p. 380 |
4485 \def\uncatcodespecials{% | 4760 \def\uncatcodespecials{% |
4486 \def\do##1{\catcode`##1=12}\dospecials} | 4761 \def\do##1{\catcode`##1=12}\dospecials} |
4487 % | 4762 % |
4564 % | 4839 % |
4565 % \def\doverbatim#1@end verbatim{#1} | 4840 % \def\doverbatim#1@end verbatim{#1} |
4566 % | 4841 % |
4567 % For Texinfo it's a lot easier than for LaTeX, | 4842 % For Texinfo it's a lot easier than for LaTeX, |
4568 % because texinfo's \verbatim doesn't stop at '\end{verbatim}': | 4843 % because texinfo's \verbatim doesn't stop at '\end{verbatim}': |
4569 % we need not redefine '\', '{' and '}' | 4844 % we need not redefine '\', '{' and '}'. |
4570 % | 4845 % |
4571 % Inspired by LaTeX's verbatim command set [latex.ltx] | 4846 % Inspired by LaTeX's verbatim command set [latex.ltx] |
4572 %% Include LaTeX hack for completeness -- never know | 4847 %% Include LaTeX hack for completeness -- never know |
4573 %% \begingroup | 4848 %% \begingroup |
4574 %% \catcode`|=0 \catcode`[=1 | 4849 %% \catcode`|=0 \catcode`[=1 |
4575 %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active | 4850 %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active |
4576 %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ | 4851 %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ |
4577 %% #1|endgroup|def|Everbatim[]|end[verbatim]] | 4852 %% #1|endgroup|def|Everbatim[]|end[verbatim]] |
4578 %% |endgroup | 4853 %% |endgroup |
4854 % | |
4579 \begingroup | 4855 \begingroup |
4580 \catcode`\ =\active | 4856 \catcode`\ =\active |
4581 \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} | 4857 \obeylines % |
4858 % ignore everything up to the first ^^M, that's the newline at the end | |
4859 % of the @verbatim input line itself. Otherwise we get an extra blank | |
4860 % line in the output. | |
4861 \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}% | |
4582 \endgroup | 4862 \endgroup |
4583 % | 4863 % |
4584 \def\verbatim{% | 4864 \def\verbatim{% |
4585 \def\Everbatim{\nonfillfinish\endgroup}% | 4865 \def\Everbatim{\nonfillfinish\endgroup}% |
4586 \begingroup | 4866 \begingroup |
4592 % @verbatiminclude FILE - insert text of file in verbatim environment. | 4872 % @verbatiminclude FILE - insert text of file in verbatim environment. |
4593 % | 4873 % |
4594 % Allow normal characters that we make active in the argument (a file name). | 4874 % Allow normal characters that we make active in the argument (a file name). |
4595 \def\verbatiminclude{% | 4875 \def\verbatiminclude{% |
4596 \begingroup | 4876 \begingroup |
4597 \catcode`\\=12 | 4877 \catcode`\\=\other |
4598 \catcode`~=12 | 4878 \catcode`~=\other |
4599 \catcode`^=12 | 4879 \catcode`^=\other |
4600 \catcode`_=12 | 4880 \catcode`_=\other |
4601 \catcode`|=12 | 4881 \catcode`|=\other |
4602 \catcode`<=12 | 4882 \catcode`<=\other |
4603 \catcode`>=12 | 4883 \catcode`>=\other |
4604 \catcode`+=12 | 4884 \catcode`+=\other |
4605 \parsearg\doverbatiminclude | 4885 \parsearg\doverbatiminclude |
4606 } | 4886 } |
4607 \def\setupverbatiminclude{% | 4887 \def\setupverbatiminclude{% |
4608 \begingroup | 4888 \begingroup |
4609 \nonfillstart | 4889 \nonfillstart |
4613 % | 4893 % |
4614 \def\doverbatiminclude#1{% | 4894 \def\doverbatiminclude#1{% |
4615 % Restore active chars for included file. | 4895 % Restore active chars for included file. |
4616 \endgroup | 4896 \endgroup |
4617 \begingroup | 4897 \begingroup |
4618 \def\thisfile{#1}% | 4898 \let\value=\expandablevalue |
4619 \expandafter\expandafter\setupverbatiminclude\input\thisfile | 4899 \def\thisfile{#1}% |
4620 \endgroup\nonfillfinish\endgroup | 4900 \expandafter\expandafter\setupverbatiminclude\input\thisfile |
4901 \endgroup | |
4902 \nonfillfinish | |
4903 \endgroup | |
4621 } | 4904 } |
4622 | 4905 |
4623 % @copying ... @end copying. | 4906 % @copying ... @end copying. |
4624 % Save the text away for @insertcopying later. | 4907 % Save the text away for @insertcopying later. Many commands won't be |
4625 % | 4908 % allowed in this context, but that's ok. |
4626 \newbox\copyingbox | 4909 % |
4910 % We save the uninterpreted tokens, rather than creating a box. | |
4911 % Saving the text in a box would be much easier, but then all the | |
4912 % typesetting commands (@smallbook, font changes, etc.) have to be done | |
4913 % beforehand -- and a) we want @copying to be done first in the source | |
4914 % file; b) letting users define the frontmatter in as flexible order as | |
4915 % possible is very desirable. | |
4627 % | 4916 % |
4628 \def\copying{\begingroup | 4917 \def\copying{\begingroup |
4918 % Define a command to swallow text until we reach `@end copying'. | |
4919 % \ is the escape char in this texinfo.tex file, so it is the | |
4920 % delimiter for the command; @ will be the escape char when we read | |
4921 % it, but that doesn't matter. | |
4922 \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}% | |
4923 % | |
4924 % We must preserve ^^M's in the input file; see \insertcopying below. | |
4925 \catcode`\^^M = \active | |
4926 \docopying | |
4927 } | |
4928 | |
4929 % What we do to finish off the copying text. | |
4930 % | |
4931 \def\enddocopying{\endgroup\ignorespaces} | |
4932 | |
4933 % @insertcopying. Here we must play games with ^^M's. On the one hand, | |
4934 % we need them to delimit commands such as `@end quotation', so they | |
4935 % must be active. On the other hand, we certainly don't want every | |
4936 % end-of-line to be a \par, as would happen with the normal active | |
4937 % definition of ^^M. On the third hand, two ^^M's in a row should still | |
4938 % generate a \par. | |
4939 % | |
4940 % Our approach is to make ^^M insert a space and a penalty1 normally; | |
4941 % then it can also check if \lastpenalty=1. If it does, then manually | |
4942 % do \par. | |
4943 % | |
4944 % This messes up the normal definitions of @c[omment], so we redefine | |
4945 % it. Similarly for @ignore. (These commands are used in the gcc | |
4946 % manual for man page generation.) | |
4947 % | |
4948 % Seems pretty fragile, most line-oriented commands will presumably | |
4949 % fail, but for the limited use of getting the copying text (which | |
4950 % should be quite simple) inserted, we can hope it's ok. | |
4951 % | |
4952 {\catcode`\^^M=\active % | |
4953 \gdef\insertcopying{\begingroup % | |
4629 \parindent = 0pt % looks wrong on title page | 4954 \parindent = 0pt % looks wrong on title page |
4630 \def\Ecopying{\egroup\endgroup}% | 4955 \def^^M{% |
4631 \global\setbox\copyingbox = \vbox\bgroup | 4956 \ifnum \lastpenalty=1 % |
4632 } | 4957 \par % |
4633 | 4958 \else % |
4634 % @insertcopying. | 4959 \space \penalty 1 % |
4635 % | 4960 \fi % |
4636 \def\insertcopying{\unvcopy\copyingbox} | 4961 }% |
4637 | 4962 % |
4963 % Fix @c[omment] for catcode 13 ^^M's. | |
4964 \def\c##1^^M{\ignorespaces}% | |
4965 \let\comment = \c % | |
4966 % | |
4967 % Don't bother jumping through all the hoops that \doignore does, it | |
4968 % would be very hard since the catcodes are already set. | |
4969 \long\def\ignore##1\end ignore{\ignorespaces}% | |
4970 % | |
4971 \copyingtext % | |
4972 \endgroup}% | |
4973 } | |
4638 | 4974 |
4639 \message{defuns,} | 4975 \message{defuns,} |
4640 % @defun etc. | 4976 % @defun etc. |
4641 | 4977 |
4642 % Allow user to change definition object font (\df) internally | 4978 % Allow user to change definition object font (\df) internally |
4643 \def\setdeffont #1 {\csname DEF#1\endcsname} | 4979 \def\setdeffont#1 {\csname DEF#1\endcsname} |
4644 | 4980 |
4645 \newskip\defbodyindent \defbodyindent=.4in | 4981 \newskip\defbodyindent \defbodyindent=.4in |
4646 \newskip\defargsindent \defargsindent=50pt | 4982 \newskip\defargsindent \defargsindent=50pt |
4647 \newskip\deftypemargin \deftypemargin=12pt | |
4648 \newskip\deflastargmargin \deflastargmargin=18pt | 4983 \newskip\deflastargmargin \deflastargmargin=18pt |
4649 | 4984 |
4650 \newcount\parencount | 4985 \newcount\parencount |
4651 % define \functionparens, which makes ( and ) and & do special things. | 4986 |
4652 % \functionparens affects the group it is contained in. | 4987 % We want ()&[] to print specially on the defun line. |
4988 % | |
4653 \def\activeparens{% | 4989 \def\activeparens{% |
4654 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active | 4990 \catcode`\(=\active \catcode`\)=\active |
4655 \catcode`\[=\active \catcode`\]=\active} | 4991 \catcode`\&=\active |
4992 \catcode`\[=\active \catcode`\]=\active | |
4993 } | |
4656 | 4994 |
4657 % Make control sequences which act like normal parenthesis chars. | 4995 % Make control sequences which act like normal parenthesis chars. |
4658 \let\lparen = ( \let\rparen = ) | 4996 \let\lparen = ( \let\rparen = ) |
4659 | 4997 |
4660 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) | 4998 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) |
4697 \def\lbrb{{\bf\char`\[}} | 5035 \def\lbrb{{\bf\char`\[}} |
4698 \def\rbrb{{\bf\char`\]}} | 5036 \def\rbrb{{\bf\char`\]}} |
4699 | 5037 |
4700 % Active &'s sneak into the index arguments, so make sure it's defined. | 5038 % Active &'s sneak into the index arguments, so make sure it's defined. |
4701 { | 5039 { |
4702 \catcode`& = 13 | 5040 \catcode`& = \active |
4703 \global\let& = \ampnr | 5041 \global\let& = \ampnr |
4704 } | 5042 } |
4705 | 5043 |
4706 % First, defname, which formats the header line itself. | 5044 % \defname, which formats the name of the @def (not the args). |
4707 % #1 should be the function name. | 5045 % #1 is the function name. |
4708 % #2 should be the type of definition, such as "Function". | 5046 % #2 is the type of definition, such as "Function". |
4709 | 5047 % |
4710 \def\defname #1#2{% | 5048 \def\defname#1#2{% |
4711 % Get the values of \leftskip and \rightskip as they were | 5049 % How we'll output the type name. Putting it in brackets helps |
4712 % outside the @def... | 5050 % distinguish it from the body text that may end up on the next line |
4713 \dimen2=\leftskip | 5051 % just below it. |
4714 \advance\dimen2 by -\defbodyindent | 5052 \ifempty{#2}% |
4715 \noindent | 5053 \def\defnametype{}% |
4716 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% | 5054 \else |
4717 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line | 5055 \def\defnametype{[\rm #2]}% |
4718 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations | 5056 \fi |
4719 \parshape 2 0in \dimen0 \defargsindent \dimen1 | 5057 % |
4720 % Now output arg 2 ("Function" or some such) | 5058 % Get the values of \leftskip and \rightskip as they were outside the @def... |
4721 % ending at \deftypemargin from the right margin, | 5059 \dimen2=\leftskip |
4722 % but stuck inside a box of width 0 so it does not interfere with linebreaking | 5060 \advance\dimen2 by -\defbodyindent |
4723 {% Adjust \hsize to exclude the ambient margins, | 5061 % |
4724 % so that \rightline will obey them. | 5062 % Figure out values for the paragraph shape. |
4725 \advance \hsize by -\dimen2 | 5063 \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}% |
4726 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% | 5064 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line |
4727 % Make all lines underfull and no complaints: | 5065 \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations |
4728 \tolerance=10000 \hbadness=10000 | 5066 \parshape 2 0in \dimen0 \defargsindent \dimen1 |
4729 \advance\leftskip by -\defbodyindent | 5067 % |
4730 \exdentamount=\defbodyindent | 5068 % Output arg 2 ("Function" or some such) but stuck inside a box of |
4731 {\df #1}\enskip % Generate function name | 5069 % width 0 so it does not interfere with linebreaking. |
4732 } | 5070 \noindent |
4733 | 5071 % |
4734 % Actually process the body of a definition | 5072 {% Adjust \hsize to exclude the ambient margins, |
4735 % #1 should be the terminating control sequence, such as \Edefun. | 5073 % so that \rightline will obey them. |
4736 % #2 should be the "another name" control sequence, such as \defunx. | 5074 \advance \hsize by -\dimen2 |
4737 % #3 should be the control sequence that actually processes the header, | 5075 \dimen3 = 0pt % was -1.25pc |
4738 % such as \defunheader. | 5076 \rlap{\rightline{\defnametype\kern\dimen3}}% |
4739 | 5077 }% |
4740 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody | 5078 % |
4741 \medbreak % | 5079 % Allow all lines to be underfull without complaint: |
4742 % Define the end token that this defining construct specifies | 5080 \tolerance=10000 \hbadness=10000 |
4743 % so that it will exit this group. | 5081 \advance\leftskip by -\defbodyindent |
4744 \def#1{\endgraf\endgroup\medbreak}% | 5082 \exdentamount=\defbodyindent |
4745 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% | 5083 {\df #1}\enskip % output function name |
4746 \parindent=0in | 5084 % \defunargs will be called next to output the arguments, if any. |
4747 \advance\leftskip by \defbodyindent | 5085 } |
4748 \exdentamount=\defbodyindent | 5086 |
4749 \begingroup % | 5087 % Common pieces to start any @def... |
4750 \catcode 61=\active % 61 is `=' | |
4751 \obeylines\activeparens\spacesplit#3} | |
4752 | |
4753 % #1 is the \E... control sequence to end the definition (which we define). | 5088 % #1 is the \E... control sequence to end the definition (which we define). |
4754 % #2 is the \...x control sequence for consecutive fns (which we define). | 5089 % #2 is the \...x control sequence (which our caller defines). |
4755 % #3 is the control sequence to call to resume processing. | 5090 % #3 is the control sequence to process the header, such as \defunheader. |
4756 % #4, delimited by the space, is the class name. | 5091 % |
4757 % | 5092 \def\parsebodycommon#1#2#3{% |
4758 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV % | 5093 \begingroup\inENV |
4759 \medbreak % | 5094 % If there are two @def commands in a row, we'll have a \nobreak, |
4760 % Define the end token that this defining construct specifies | 5095 % which is there to keep the function description together with its |
4761 % so that it will exit this group. | 5096 % header. But if there's nothing but headers, we want to allow a |
4762 \def#1{\endgraf\endgroup\medbreak}% | 5097 % break after all. Check for penalty 10002 (inserted by |
4763 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% | 5098 % \defargscommonending) instead of 10000, since the sectioning |
4764 \parindent=0in | 5099 % commands insert a \penalty10000, and we don't want to allow a break |
4765 \advance\leftskip by \defbodyindent | 5100 % between a section heading and a defun. |
4766 \exdentamount=\defbodyindent | 5101 \ifnum\lastpenalty=10002 \penalty0 \fi |
4767 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} | |
4768 | |
4769 % Used for @deftypemethod and @deftypeivar. | |
4770 % #1 is the \E... control sequence to end the definition (which we define). | |
4771 % #2 is the \...x control sequence for consecutive fns (which we define). | |
4772 % #3 is the control sequence to call to resume processing. | |
4773 % #4, delimited by a space, is the class name. | |
4774 % #5 is the method's return type. | |
4775 % | |
4776 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV | |
4777 \medbreak | 5102 \medbreak |
5103 % | |
5104 % Define the \E... end token that this defining construct specifies | |
5105 % so that it will exit this group. | |
4778 \def#1{\endgraf\endgroup\medbreak}% | 5106 \def#1{\endgraf\endgroup\medbreak}% |
4779 \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% | 5107 % |
4780 \parindent=0in | 5108 \parindent=0in |
4781 \advance\leftskip by \defbodyindent | 5109 \advance\leftskip by \defbodyindent |
4782 \exdentamount=\defbodyindent | 5110 \exdentamount=\defbodyindent |
4783 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} | 5111 } |
5112 | |
5113 % Common part of the \...x definitions. | |
5114 % | |
5115 \def\defxbodycommon{% | |
5116 % As with \parsebodycommon above, allow line break if we have multiple | |
5117 % x headers in a row. It's not a great place, though. | |
5118 \ifnum\lastpenalty=10000 \penalty1000 \fi | |
5119 % | |
5120 \begingroup\obeylines | |
5121 } | |
5122 | |
5123 % Process body of @defun, @deffn, @defmac, etc. | |
5124 % | |
5125 \def\defparsebody#1#2#3{% | |
5126 \parsebodycommon{#1}{#2}{#3}% | |
5127 \def#2{\defxbodycommon \activeparens \spacesplit#3}% | |
5128 \catcode\equalChar=\active | |
5129 \begingroup\obeylines\activeparens | |
5130 \spacesplit#3% | |
5131 } | |
5132 | |
5133 % #1, #2, #3 are the common arguments (see \parsebodycommon above). | |
5134 % #4, delimited by the space, is the class name. | |
5135 % | |
5136 \def\defmethparsebody#1#2#3#4 {% | |
5137 \parsebodycommon{#1}{#2}{#3}% | |
5138 \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}% | |
5139 \begingroup\obeylines\activeparens | |
5140 % The \empty here prevents misinterpretation of a construct such as | |
5141 % @deffn {whatever} {Enharmonic comma} | |
5142 % See comments at \deftpparsebody, although in our case we don't have | |
5143 % to remove the \empty afterwards, since it is empty. | |
5144 \spacesplit{#3{#4}}\empty | |
5145 } | |
5146 | |
5147 % Used for @deftypemethod and @deftypeivar. | |
5148 % #1, #2, #3 are the common arguments (see \defparsebody). | |
5149 % #4, delimited by a space, is the class name. | |
5150 % #5 is the method's return type. | |
5151 % | |
5152 \def\deftypemethparsebody#1#2#3#4 #5 {% | |
5153 \parsebodycommon{#1}{#2}{#3}% | |
5154 \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}% | |
5155 \begingroup\obeylines\activeparens | |
5156 \spacesplit{#3{#4}{#5}}% | |
5157 } | |
4784 | 5158 |
4785 % Used for @deftypeop. The change from \deftypemethparsebody is an | 5159 % Used for @deftypeop. The change from \deftypemethparsebody is an |
4786 % extra argument at the beginning which is the `category', instead of it | 5160 % extra argument at the beginning which is the `category', instead of it |
4787 % being the hardwired string `Method' or `Instance Variable'. We have | 5161 % being the hardwired string `Method' or `Instance Variable'. We have |
4788 % to account for this both in the \...x definition and in parsing the | 5162 % to account for this both in the \...x definition and in parsing the |
4789 % input at hand. Thus also need a control sequence (passed as #5) for | 5163 % input at hand. Thus also need a control sequence (passed as #5) for |
4790 % the \E... definition to assign the category name to. | 5164 % the \E... definition to assign the category name to. |
4791 % | 5165 % |
4792 \def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV | 5166 \def\deftypeopparsebody#1#2#3#4#5 #6 {% |
4793 \medbreak | 5167 \parsebodycommon{#1}{#2}{#3}% |
4794 \def#1{\endgraf\endgroup\medbreak}% | 5168 \def#2##1 ##2 ##3 {\def#4{##1}% |
4795 \def#2##1 ##2 ##3 {% | 5169 \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}% |
4796 \def#4{##1}% | 5170 \begingroup\obeylines\activeparens |
4797 \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% | 5171 \spacesplit{#3{#5}{#6}}% |
4798 \parindent=0in | 5172 } |
4799 \advance\leftskip by \defbodyindent | 5173 |
4800 \exdentamount=\defbodyindent | 5174 % For @defop. |
4801 \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} | 5175 \def\defopparsebody #1#2#3#4#5 {% |
4802 | 5176 \parsebodycommon{#1}{#2}{#3}% |
4803 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % | 5177 \def#2##1 ##2 {\def#4{##1}% |
4804 \medbreak % | 5178 \defxbodycommon \activeparens \spacesplit{#3{##2}}}% |
4805 % Define the end token that this defining construct specifies | 5179 \begingroup\obeylines\activeparens |
4806 % so that it will exit this group. | 5180 \spacesplit{#3{#5}}% |
4807 \def#1{\endgraf\endgroup\medbreak}% | 5181 } |
4808 \def#2##1 ##2 {\def#4{##1}% | |
4809 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% | |
4810 \parindent=0in | |
4811 \advance\leftskip by \defbodyindent | |
4812 \exdentamount=\defbodyindent | |
4813 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} | |
4814 | 5182 |
4815 % These parsing functions are similar to the preceding ones | 5183 % These parsing functions are similar to the preceding ones |
4816 % except that they do not make parens into active characters. | 5184 % except that they do not make parens into active characters. |
4817 % These are used for "variables" since they have no arguments. | 5185 % These are used for "variables" since they have no arguments. |
4818 | 5186 % |
4819 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody | 5187 \def\defvarparsebody #1#2#3{% |
4820 \medbreak % | 5188 \parsebodycommon{#1}{#2}{#3}% |
4821 % Define the end token that this defining construct specifies | 5189 \def#2{\defxbodycommon \spacesplit#3}% |
4822 % so that it will exit this group. | 5190 \catcode\equalChar=\active |
4823 \def#1{\endgraf\endgroup\medbreak}% | |
4824 \def#2{\begingroup\obeylines\spacesplit#3}% | |
4825 \parindent=0in | |
4826 \advance\leftskip by \defbodyindent | |
4827 \exdentamount=\defbodyindent | |
4828 \begingroup % | |
4829 \catcode 61=\active % | |
4830 \obeylines\spacesplit#3} | |
4831 | |
4832 % This is used for \def{tp,vr}parsebody. It could probably be used for | |
4833 % some of the others, too, with some judicious conditionals. | |
4834 % | |
4835 \def\parsebodycommon#1#2#3{% | |
4836 \begingroup\inENV % | |
4837 \medbreak % | |
4838 % Define the end token that this defining construct specifies | |
4839 % so that it will exit this group. | |
4840 \def#1{\endgraf\endgroup\medbreak}% | |
4841 \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% | |
4842 \parindent=0in | |
4843 \advance\leftskip by \defbodyindent | |
4844 \exdentamount=\defbodyindent | |
4845 \begingroup\obeylines | 5191 \begingroup\obeylines |
5192 \spacesplit#3% | |
5193 } | |
5194 | |
5195 % @defopvar. | |
5196 \def\defopvarparsebody #1#2#3#4#5 {% | |
5197 \parsebodycommon{#1}{#2}{#3}% | |
5198 \def#2##1 ##2 {\def#4{##1}% | |
5199 \defxbodycommon \spacesplit{#3{##2}}}% | |
5200 \begingroup\obeylines | |
5201 \spacesplit{#3{#5}}% | |
4846 } | 5202 } |
4847 | 5203 |
4848 \def\defvrparsebody#1#2#3#4 {% | 5204 \def\defvrparsebody#1#2#3#4 {% |
4849 \parsebodycommon{#1}{#2}{#3}% | 5205 \parsebodycommon{#1}{#2}{#3}% |
5206 \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% | |
5207 \begingroup\obeylines | |
4850 \spacesplit{#3{#4}}% | 5208 \spacesplit{#3{#4}}% |
4851 } | 5209 } |
4852 | 5210 |
4853 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the | 5211 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the |
4854 % type is just `struct', because we lose the braces in `{struct | 5212 % type is just `struct', because we lose the braces in `{struct |
4859 % way, TeX won't find exactly `{...}' as an undelimited argument, and | 5217 % way, TeX won't find exactly `{...}' as an undelimited argument, and |
4860 % won't strip off the braces. | 5218 % won't strip off the braces. |
4861 % | 5219 % |
4862 \def\deftpparsebody #1#2#3#4 {% | 5220 \def\deftpparsebody #1#2#3#4 {% |
4863 \parsebodycommon{#1}{#2}{#3}% | 5221 \parsebodycommon{#1}{#2}{#3}% |
5222 \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% | |
5223 \begingroup\obeylines | |
4864 \spacesplit{\parsetpheaderline{#3{#4}}}\empty | 5224 \spacesplit{\parsetpheaderline{#3{#4}}}\empty |
4865 } | 5225 } |
4866 | 5226 |
4867 % Fine, but then we have to eventually remove the \empty *and* the | 5227 % Fine, but then we have to eventually remove the \empty *and* the |
4868 % braces (if any). That's what this does. | 5228 % braces (if any). That's what this does. |
4875 % | 5235 % |
4876 \def\parsetpheaderline#1#2#3{% | 5236 \def\parsetpheaderline#1#2#3{% |
4877 #1{\removeemptybraces#2\relax}{#3}% | 5237 #1{\removeemptybraces#2\relax}{#3}% |
4878 }% | 5238 }% |
4879 | 5239 |
4880 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % | 5240 % Split up #2 (the rest of the input line) at the first space token. |
4881 \medbreak % | |
4882 % Define the end token that this defining construct specifies | |
4883 % so that it will exit this group. | |
4884 \def#1{\endgraf\endgroup\medbreak}% | |
4885 \def#2##1 ##2 {\def#4{##1}% | |
4886 \begingroup\obeylines\spacesplit{#3{##2}}}% | |
4887 \parindent=0in | |
4888 \advance\leftskip by \defbodyindent | |
4889 \exdentamount=\defbodyindent | |
4890 \begingroup\obeylines\spacesplit{#3{#5}}} | |
4891 | |
4892 % Split up #2 at the first space token. | |
4893 % call #1 with two arguments: | 5241 % call #1 with two arguments: |
4894 % the first is all of #2 before the space token, | 5242 % the first is all of #2 before the space token, |
4895 % the second is all of #2 after that space token. | 5243 % the second is all of #2 after that space token. |
4896 % If #2 contains no space token, all of it is passed as the first arg | 5244 % If #2 contains no space token, all of it is passed as the first arg |
4897 % and the second is passed as empty. | 5245 % and the second is passed as empty. |
4898 | 5246 % |
4899 {\obeylines | 5247 {\obeylines % |
4900 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% | 5248 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}% |
4901 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% | 5249 \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{% |
4902 \ifx\relax #3% | 5250 \ifx\relax #3% |
4903 #1{#2}{}\else #1{#2}{#3#4}\fi}} | 5251 #1{#2}{}% |
4904 | 5252 \else % |
4905 % So much for the things common to all kinds of definitions. | 5253 #1{#2}{#3#4}% |
5254 \fi}% | |
5255 } | |
4906 | 5256 |
4907 % Define @defun. | 5257 % Define @defun. |
4908 | 5258 |
4909 % First, define the processing that is wanted for arguments of \defun | 5259 % This is called to end the arguments processing for all the @def... commands. |
4910 % Use this to expand the args and terminate the paragraph they make up | 5260 % |
4911 | 5261 \def\defargscommonending{% |
5262 \interlinepenalty = 10000 | |
5263 \advance\rightskip by 0pt plus 1fil | |
5264 \endgraf | |
5265 \nobreak\vskip -\parskip | |
5266 \penalty 10002 % signal to \parsebodycommon. | |
5267 } | |
5268 | |
5269 % This expands the args and terminates the paragraph they comprise. | |
5270 % | |
4912 \def\defunargs#1{\functionparens \sl | 5271 \def\defunargs#1{\functionparens \sl |
4913 % Expand, preventing hyphenation at `-' chars. | 5272 % Expand, preventing hyphenation at `-' chars. |
4914 % Note that groups don't affect changes in \hyphenchar. | 5273 % Note that groups don't affect changes in \hyphenchar. |
4915 % Set the font temporarily and use \font in case \setfont made \tensl a macro. | 5274 % Set the font temporarily and use \font in case \setfont made \tensl a macro. |
4916 {\tensl\hyphenchar\font=0}% | 5275 {\tensl\hyphenchar\font=0}% |
4917 #1% | 5276 #1% |
4918 {\tensl\hyphenchar\font=45}% | 5277 {\tensl\hyphenchar\font=45}% |
4919 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% | 5278 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% |
4920 \interlinepenalty=10000 | 5279 \defargscommonending |
4921 \advance\rightskip by 0pt plus 1fil | |
4922 \endgraf\nobreak\vskip -\parskip\nobreak | |
4923 } | 5280 } |
4924 | 5281 |
4925 \def\deftypefunargs #1{% | 5282 \def\deftypefunargs #1{% |
4926 % Expand, preventing hyphenation at `-' chars. | 5283 % Expand, preventing hyphenation at `-' chars. |
4927 % Note that groups don't affect changes in \hyphenchar. | 5284 % Note that groups don't affect changes in \hyphenchar. |
4928 % Use \boldbraxnoamp, not \functionparens, so that & is not special. | 5285 % Use \boldbraxnoamp, not \functionparens, so that & is not special. |
4929 \boldbraxnoamp | 5286 \boldbraxnoamp |
4930 \tclose{#1}% avoid \code because of side effects on active chars | 5287 \tclose{#1}% avoid \code because of side effects on active chars |
4931 \interlinepenalty=10000 | 5288 \defargscommonending |
4932 \advance\rightskip by 0pt plus 1fil | |
4933 \endgraf\nobreak\vskip -\parskip\nobreak | |
4934 } | 5289 } |
4935 | 5290 |
4936 % Do complete processing of one @defun or @defunx line already parsed. | 5291 % Do complete processing of one @defun or @defunx line already parsed. |
4937 | 5292 |
4938 % @deffn Command forward-char nchars | 5293 % @deffn Command forward-char nchars |
4939 | 5294 |
4940 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} | 5295 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} |
4941 | 5296 |
4942 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% | 5297 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% |
4943 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % | 5298 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % |
4944 \catcode 61=\other % Turn off change made in \defparsebody | 5299 \catcode\equalChar=\other % Turn off change made in \defparsebody |
4945 } | 5300 } |
4946 | 5301 |
4947 % @defun == @deffn Function | 5302 % @defun == @deffn Function |
4948 | 5303 |
4949 \def\defun{\defparsebody\Edefun\defunx\defunheader} | 5304 \def\defun{\defparsebody\Edefun\defunx\defunheader} |
4950 | 5305 |
4951 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | 5306 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
4952 \begingroup\defname {#1}{\putwordDeffunc}% | 5307 \begingroup\defname {#1}{\putwordDeffunc}% |
4953 \defunargs {#2}\endgroup % | 5308 \defunargs {#2}\endgroup % |
4954 \catcode 61=\other % Turn off change made in \defparsebody | 5309 \catcode\equalChar=\other % Turn off change made in \defparsebody |
4955 } | 5310 } |
4956 | 5311 |
4957 % @deftypefun int foobar (int @var{foo}, float @var{bar}) | 5312 % @deftypefun int foobar (int @var{foo}, float @var{bar}) |
4958 | 5313 |
4959 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} | 5314 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} |
4963 % #1 is the data type, #2 the name, #3 the args. | 5318 % #1 is the data type, #2 the name, #3 the args. |
4964 \def\deftypefunheaderx #1#2 #3\relax{% | 5319 \def\deftypefunheaderx #1#2 #3\relax{% |
4965 \doind {fn}{\code{#2}}% Make entry in function index | 5320 \doind {fn}{\code{#2}}% Make entry in function index |
4966 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% | 5321 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% |
4967 \deftypefunargs {#3}\endgroup % | 5322 \deftypefunargs {#3}\endgroup % |
4968 \catcode 61=\other % Turn off change made in \defparsebody | 5323 \catcode\equalChar=\other % Turn off change made in \defparsebody |
4969 } | 5324 } |
4970 | 5325 |
4971 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) | 5326 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) |
4972 | 5327 |
4973 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} | 5328 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} |
4984 \begingroup | 5339 \begingroup |
4985 \normalparens % notably, turn off `&' magic, which prevents | 5340 \normalparens % notably, turn off `&' magic, which prevents |
4986 % at least some C++ text from working | 5341 % at least some C++ text from working |
4987 \defname {\defheaderxcond#2\relax$.$#3}{#1}% | 5342 \defname {\defheaderxcond#2\relax$.$#3}{#1}% |
4988 \deftypefunargs {#4}\endgroup % | 5343 \deftypefunargs {#4}\endgroup % |
4989 \catcode 61=\other % Turn off change made in \defparsebody | 5344 \catcode\equalChar=\other % Turn off change made in \defparsebody |
4990 } | 5345 } |
4991 | 5346 |
4992 % @defmac == @deffn Macro | 5347 % @defmac == @deffn Macro |
4993 | 5348 |
4994 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} | 5349 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} |
4995 | 5350 |
4996 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | 5351 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
4997 \begingroup\defname {#1}{\putwordDefmac}% | 5352 \begingroup\defname {#1}{\putwordDefmac}% |
4998 \defunargs {#2}\endgroup % | 5353 \defunargs {#2}\endgroup % |
4999 \catcode 61=\other % Turn off change made in \defparsebody | 5354 \catcode\equalChar=\other % Turn off change made in \defparsebody |
5000 } | 5355 } |
5001 | 5356 |
5002 % @defspec == @deffn Special Form | 5357 % @defspec == @deffn Special Form |
5003 | 5358 |
5004 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} | 5359 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} |
5005 | 5360 |
5006 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | 5361 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
5007 \begingroup\defname {#1}{\putwordDefspec}% | 5362 \begingroup\defname {#1}{\putwordDefspec}% |
5008 \defunargs {#2}\endgroup % | 5363 \defunargs {#2}\endgroup % |
5009 \catcode 61=\other % Turn off change made in \defparsebody | 5364 \catcode\equalChar=\other % Turn off change made in \defparsebody |
5010 } | 5365 } |
5011 | 5366 |
5012 % @defop CATEGORY CLASS OPERATION ARG... | 5367 % @defop CATEGORY CLASS OPERATION ARG... |
5013 % | 5368 % |
5014 \def\defop #1 {\def\defoptype{#1}% | 5369 \def\defop #1 {\def\defoptype{#1}% |
5015 \defopparsebody\Edefop\defopx\defopheader\defoptype} | 5370 \defopparsebody\Edefop\defopx\defopheader\defoptype} |
5016 % | 5371 % |
5017 \def\defopheader#1#2#3{% | 5372 \def\defopheader#1#2#3{% |
5018 \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index | 5373 \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry |
5019 \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% | 5374 \begingroup |
5020 \defunargs {#3}\endgroup % | 5375 \defname{#2}{\defoptype\ \putwordon\ #1}% |
5376 \defunargs{#3}% | |
5377 \endgroup | |
5021 } | 5378 } |
5022 | 5379 |
5023 % @deftypeop CATEGORY CLASS TYPE OPERATION ARG... | 5380 % @deftypeop CATEGORY CLASS TYPE OPERATION ARG... |
5024 % | 5381 % |
5025 \def\deftypeop #1 {\def\deftypeopcategory{#1}% | 5382 \def\deftypeop #1 {\def\deftypeopcategory{#1}% |
5082 | 5439 |
5083 \def\defcv #1 {\def\defcvtype{#1}% | 5440 \def\defcv #1 {\def\defcvtype{#1}% |
5084 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} | 5441 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} |
5085 | 5442 |
5086 \def\defcvarheader #1#2#3{% | 5443 \def\defcvarheader #1#2#3{% |
5087 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index | 5444 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry |
5088 \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% | 5445 \begingroup |
5089 \defvarargs {#3}\endgroup % | 5446 \defname{#2}{\defcvtype\ \putwordof\ #1}% |
5447 \defvarargs{#3}% | |
5448 \endgroup | |
5090 } | 5449 } |
5091 | 5450 |
5092 % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME | 5451 % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME |
5093 % | 5452 % |
5094 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} | 5453 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} |
5095 % | 5454 % |
5096 \def\defivarheader#1#2#3{% | 5455 \def\defivarheader#1#2#3{% |
5097 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index | 5456 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index |
5098 \begingroup | 5457 \begingroup |
5099 \defname{#2}{\putwordInstanceVariableof\ #1}% | 5458 \defname{#2}{\putwordInstanceVariableof\ #1}% |
5100 \defvarargs{#3}% | 5459 \defvarargs{#3}% |
5101 \endgroup | 5460 \endgroup |
5102 } | 5461 } |
5104 % @defvar | 5463 % @defvar |
5105 % First, define the processing that is wanted for arguments of @defvar. | 5464 % First, define the processing that is wanted for arguments of @defvar. |
5106 % This is actually simple: just print them in roman. | 5465 % This is actually simple: just print them in roman. |
5107 % This must expand the args and terminate the paragraph they make up | 5466 % This must expand the args and terminate the paragraph they make up |
5108 \def\defvarargs #1{\normalparens #1% | 5467 \def\defvarargs #1{\normalparens #1% |
5109 \interlinepenalty=10000 | 5468 \defargscommonending |
5110 \endgraf\nobreak\vskip -\parskip\nobreak} | 5469 } |
5111 | 5470 |
5112 % @defvr Counter foo-count | 5471 % @defvr Counter foo-count |
5113 | 5472 |
5114 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} | 5473 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} |
5115 | 5474 |
5141 % #1 is the data type. #2 is the name, perhaps followed by text that | 5500 % #1 is the data type. #2 is the name, perhaps followed by text that |
5142 % is actually part of the data type, which should not be put into the index. | 5501 % is actually part of the data type, which should not be put into the index. |
5143 \def\deftypevarheader #1#2{% | 5502 \def\deftypevarheader #1#2{% |
5144 \dovarind#2 \relax% Make entry in variables index | 5503 \dovarind#2 \relax% Make entry in variables index |
5145 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% | 5504 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% |
5146 \interlinepenalty=10000 | 5505 \defargscommonending |
5147 \endgraf\nobreak\vskip -\parskip\nobreak | |
5148 \endgroup} | 5506 \endgroup} |
5149 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} | 5507 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} |
5150 | 5508 |
5151 % @deftypevr {Global Flag} int enable | 5509 % @deftypevr {Global Flag} int enable |
5152 | 5510 |
5153 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} | 5511 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} |
5154 | 5512 |
5155 \def\deftypevrheader #1#2#3{\dovarind#3 \relax% | 5513 \def\deftypevrheader #1#2#3{\dovarind#3 \relax% |
5156 \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} | 5514 \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} |
5157 \interlinepenalty=10000 | 5515 \defargscommonending |
5158 \endgraf\nobreak\vskip -\parskip\nobreak | |
5159 \endgroup} | 5516 \endgroup} |
5160 | 5517 |
5161 % Now define @deftp | 5518 % Now define @deftp |
5162 % Args are printed in bold, a slight difference from @defvar. | 5519 % Args are printed in bold, a slight difference from @defvar. |
5163 | 5520 |
5202 \ifx\eTeXversion\undefined | 5559 \ifx\eTeXversion\undefined |
5203 \newwrite\macscribble | 5560 \newwrite\macscribble |
5204 \def\scanmacro#1{% | 5561 \def\scanmacro#1{% |
5205 \begingroup \newlinechar`\^^M | 5562 \begingroup \newlinechar`\^^M |
5206 % Undo catcode changes of \startcontents and \doprintindex | 5563 % Undo catcode changes of \startcontents and \doprintindex |
5207 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ | 5564 \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ |
5208 % Append \endinput to make sure that TeX does not see the ending newline. | 5565 % Append \endinput to make sure that TeX does not see the ending newline. |
5209 \toks0={#1\endinput}% | 5566 \toks0={#1\endinput}% |
5210 \immediate\openout\macscribble=\jobname.tmp | 5567 \immediate\openout\macscribble=\jobname.tmp |
5211 \immediate\write\macscribble{\the\toks0}% | 5568 \immediate\write\macscribble{\the\toks0}% |
5212 \immediate\closeout\macscribble | 5569 \immediate\closeout\macscribble |
5216 } | 5573 } |
5217 \else | 5574 \else |
5218 \def\scanmacro#1{% | 5575 \def\scanmacro#1{% |
5219 \begingroup \newlinechar`\^^M | 5576 \begingroup \newlinechar`\^^M |
5220 % Undo catcode changes of \startcontents and \doprintindex | 5577 % Undo catcode changes of \startcontents and \doprintindex |
5221 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ | 5578 \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ |
5222 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} | 5579 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} |
5223 \fi | 5580 \fi |
5224 | 5581 |
5225 \newcount\paramno % Count of parameters | 5582 \newcount\paramno % Count of parameters |
5226 \newtoks\macname % Macro name | 5583 \newtoks\macname % Macro name |
5246 \def\unbrace#1{#1} | 5603 \def\unbrace#1{#1} |
5247 \unbrace{\gdef\trim@@@ #1 } #2@{#1} | 5604 \unbrace{\gdef\trim@@@ #1 } #2@{#1} |
5248 } | 5605 } |
5249 | 5606 |
5250 % Trim a single trailing ^^M off a string. | 5607 % Trim a single trailing ^^M off a string. |
5251 {\catcode`\^^M=12\catcode`\Q=3% | 5608 {\catcode`\^^M=\other \catcode`\Q=3% |
5252 \gdef\eatcr #1{\eatcra #1Q^^MQ}% | 5609 \gdef\eatcr #1{\eatcra #1Q^^MQ}% |
5253 \gdef\eatcra#1^^MQ{\eatcrb#1Q}% | 5610 \gdef\eatcra#1^^MQ{\eatcrb#1Q}% |
5254 \gdef\eatcrb#1Q#2Q{#1}% | 5611 \gdef\eatcrb#1Q#2Q{#1}% |
5255 } | 5612 } |
5256 | 5613 |
5261 % It's necessary to have hard CRs when the macro is executed. This is | 5618 % It's necessary to have hard CRs when the macro is executed. This is |
5262 % done by making ^^M (\endlinechar) catcode 12 when reading the macro | 5619 % done by making ^^M (\endlinechar) catcode 12 when reading the macro |
5263 % body, and then making it the \newlinechar in \scanmacro. | 5620 % body, and then making it the \newlinechar in \scanmacro. |
5264 | 5621 |
5265 \def\macrobodyctxt{% | 5622 \def\macrobodyctxt{% |
5266 \catcode`\~=12 | 5623 \catcode`\~=\other |
5267 \catcode`\^=12 | 5624 \catcode`\^=\other |
5268 \catcode`\_=12 | 5625 \catcode`\_=\other |
5269 \catcode`\|=12 | 5626 \catcode`\|=\other |
5270 \catcode`\<=12 | 5627 \catcode`\<=\other |
5271 \catcode`\>=12 | 5628 \catcode`\>=\other |
5272 \catcode`\+=12 | 5629 \catcode`\+=\other |
5273 \catcode`\{=12 | 5630 \catcode`\{=\other |
5274 \catcode`\}=12 | 5631 \catcode`\}=\other |
5275 \catcode`\@=12 | 5632 \catcode`\@=\other |
5276 \catcode`\^^M=12 | 5633 \catcode`\^^M=\other |
5277 \usembodybackslash} | 5634 \usembodybackslash} |
5278 | 5635 |
5279 \def\macroargctxt{% | 5636 \def\macroargctxt{% |
5280 \catcode`\~=12 | 5637 \catcode`\~=\other |
5281 \catcode`\^=12 | 5638 \catcode`\^=\other |
5282 \catcode`\_=12 | 5639 \catcode`\_=\other |
5283 \catcode`\|=12 | 5640 \catcode`\|=\other |
5284 \catcode`\<=12 | 5641 \catcode`\<=\other |
5285 \catcode`\>=12 | 5642 \catcode`\>=\other |
5286 \catcode`\+=12 | 5643 \catcode`\+=\other |
5287 \catcode`\@=12 | 5644 \catcode`\@=\other |
5288 \catcode`\\=12} | 5645 \catcode`\\=\other} |
5289 | 5646 |
5290 % \mbodybackslash is the definition of \ in @macro bodies. | 5647 % \mbodybackslash is the definition of \ in @macro bodies. |
5291 % It maps \foo\ => \csname macarg.foo\endcsname => #N | 5648 % It maps \foo\ => \csname macarg.foo\endcsname => #N |
5292 % where N is the macro parameter number. | 5649 % where N is the macro parameter number. |
5293 % We define \csname macarg.\endcsname to be \realbackslash, so | 5650 % We define \csname macarg.\endcsname to be \realbackslash, so |
5324 \begingroup \macrobodyctxt | 5681 \begingroup \macrobodyctxt |
5325 \ifrecursive \expandafter\parsermacbody | 5682 \ifrecursive \expandafter\parsermacbody |
5326 \else \expandafter\parsemacbody | 5683 \else \expandafter\parsemacbody |
5327 \fi} | 5684 \fi} |
5328 | 5685 |
5329 \def\unmacro{\parsearg\unmacroxxx} | 5686 \def\unmacro{\parsearg\dounmacro} |
5330 \def\unmacroxxx#1{% | 5687 \def\dounmacro#1{% |
5331 \if1\csname ismacro.#1\endcsname | 5688 \if1\csname ismacro.#1\endcsname |
5332 \global\cslet{#1}{macsave.#1}% | 5689 \global\cslet{#1}{macsave.#1}% |
5333 \global\expandafter\let \csname ismacro.#1\endcsname=0% | 5690 \global\expandafter\let \csname ismacro.#1\endcsname=0% |
5334 % Remove the macro name from \macrolist | 5691 % Remove the macro name from \macrolist: |
5335 \begingroup | 5692 \begingroup |
5336 \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% | 5693 \expandafter\let\csname#1\endcsname \relax |
5337 \def\do##1{% | 5694 \let\do\unmacrodo |
5338 \def\tempb{##1}% | 5695 \xdef\macrolist{\macrolist}% |
5339 \ifx\tempa\tempb | |
5340 % remove this | |
5341 \else | |
5342 \toks0 = \expandafter{\newmacrolist\do}% | |
5343 \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% | |
5344 \fi}% | |
5345 \def\newmacrolist{}% | |
5346 % Execute macro list to define \newmacrolist | |
5347 \macrolist | |
5348 \global\let\macrolist\newmacrolist | |
5349 \endgroup | 5696 \endgroup |
5350 \else | 5697 \else |
5351 \errmessage{Macro #1 not defined}% | 5698 \errmessage{Macro #1 not defined}% |
5699 \fi | |
5700 } | |
5701 | |
5702 % Called by \do from \dounmacro on each macro. The idea is to omit any | |
5703 % macro definitions that have been changed to \relax. | |
5704 % | |
5705 \def\unmacrodo#1{% | |
5706 \ifx#1\relax | |
5707 % remove this | |
5708 \else | |
5709 \noexpand\do \noexpand #1% | |
5352 \fi | 5710 \fi |
5353 } | 5711 } |
5354 | 5712 |
5355 % This makes use of the obscure feature that if the last token of a | 5713 % This makes use of the obscure feature that if the last token of a |
5356 % <parameter list> is #, then the preceding argument is delimited by | 5714 % <parameter list> is #, then the preceding argument is delimited by |
5497 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | 5855 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, |
5498 node \samp{\ignorespaces#1{}}} | 5856 node \samp{\ignorespaces#1{}}} |
5499 | 5857 |
5500 % @node's job is to define \lastnode. | 5858 % @node's job is to define \lastnode. |
5501 \def\node{\ENVcheck\parsearg\nodezzz} | 5859 \def\node{\ENVcheck\parsearg\nodezzz} |
5502 \def\nodezzz#1{\nodexxx [#1,]} | 5860 \def\nodezzz#1{\nodexxx #1,\finishnodeparse} |
5503 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} | 5861 \def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}} |
5504 \let\nwnode=\node | 5862 \let\nwnode=\node |
5505 \let\lastnode=\relax | 5863 \let\lastnode=\relax |
5506 | 5864 |
5507 % The sectioning commands (@chapter, etc.) call these. | 5865 % The sectioning commands (@chapter, etc.) call these. |
5508 \def\donoderef{% | 5866 \def\donoderef{% |
5532 \newcount\savesfregister | 5890 \newcount\savesfregister |
5533 \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} | 5891 \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} |
5534 \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} | 5892 \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} |
5535 \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} | 5893 \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} |
5536 | 5894 |
5537 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely | 5895 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an |
5538 % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have | 5896 % anchor), namely NAME-title (the corresponding @chapter/etc. name), |
5539 % to set \indexdummies so commands such as @code in a section title | 5897 % NAME-pg (the page number), and NAME-snt (section number and type). |
5540 % aren't expanded. It would be nicer not to expand the titles in the | 5898 % Called from \foonoderef. |
5541 % first place, but there's so many layers that that is hard to do. | 5899 % |
5900 % We have to set \indexdummies so commands such as @code in a section | |
5901 % title aren't expanded. It would be nicer not to expand the titles in | |
5902 % the first place, but there's so many layers that that is hard to do. | |
5903 % | |
5904 % Likewise, use \turnoffactive so that punctuation chars such as underscore | |
5905 % and backslash work in node names. | |
5542 % | 5906 % |
5543 \def\setref#1#2{{% | 5907 \def\setref#1#2{{% |
5544 \indexdummies | 5908 \atdummies |
5545 \pdfmkdest{#1}% | 5909 \pdfmkdest{#1}% |
5910 % | |
5911 \turnoffactive | |
5546 \dosetq{#1-title}{Ytitle}% | 5912 \dosetq{#1-title}{Ytitle}% |
5547 \dosetq{#1-pg}{Ypagenumber}% | 5913 \dosetq{#1-pg}{Ypagenumber}% |
5548 \dosetq{#1-snt}{#2}% | 5914 \dosetq{#1-snt}{#2}% |
5549 }} | 5915 }} |
5550 | 5916 |
5592 % is a loss. Therefore, we give the text of the node name again, so it | 5958 % is a loss. Therefore, we give the text of the node name again, so it |
5593 % is as if TeX is seeing it for the first time. | 5959 % is as if TeX is seeing it for the first time. |
5594 \ifpdf | 5960 \ifpdf |
5595 \leavevmode | 5961 \leavevmode |
5596 \getfilename{#4}% | 5962 \getfilename{#4}% |
5597 {\normalturnoffactive | 5963 {\turnoffactive \otherbackslash |
5598 \ifnum\filenamelength>0 | 5964 \ifnum\filenamelength>0 |
5599 \startlink attr{/Border [0 0 0]}% | 5965 \startlink attr{/Border [0 0 0]}% |
5600 goto file{\the\filename.pdf} name{#1}% | 5966 goto file{\the\filename.pdf} name{#1}% |
5601 \else | 5967 \else |
5602 \startlink attr{/Border [0 0 0]}% | 5968 \startlink attr{/Border [0 0 0]}% |
5612 % _ (for example) has to be the character _ for the purposes of the | 5978 % _ (for example) has to be the character _ for the purposes of the |
5613 % control sequence corresponding to the node, but it has to expand | 5979 % control sequence corresponding to the node, but it has to expand |
5614 % into the usual \leavevmode...\vrule stuff for purposes of | 5980 % into the usual \leavevmode...\vrule stuff for purposes of |
5615 % printing. So we \turnoffactive for the \refx-snt, back on for the | 5981 % printing. So we \turnoffactive for the \refx-snt, back on for the |
5616 % printing, back off for the \refx-pg. | 5982 % printing, back off for the \refx-pg. |
5617 {\normalturnoffactive | 5983 {\turnoffactive \otherbackslash |
5618 % Only output a following space if the -snt ref is nonempty; for | 5984 % Only output a following space if the -snt ref is nonempty; for |
5619 % @unnumbered and @anchor, it won't be. | 5985 % @unnumbered and @anchor, it won't be. |
5620 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% | 5986 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% |
5621 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi | 5987 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi |
5622 }% | 5988 }% |
5623 % [mynode], | 5989 % output the `[mynode]' via a macro. |
5624 [\printednodename],\space | 5990 \xrefprintnodename\printednodename |
5625 % page 3 | 5991 % |
5626 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% | 5992 % But we always want a comma and a space: |
5993 ,\space | |
5994 % | |
5995 % output the `page 3'. | |
5996 \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% | |
5627 \fi | 5997 \fi |
5628 \endlink | 5998 \endlink |
5629 \endgroup} | 5999 \endgroup} |
5630 | 6000 |
5631 % \dosetq is the interface for calls from other macros | 6001 % This macro is called from \xrefX for the `[nodename]' part of xref |
5632 | 6002 % output. It's a separate macro only so it can be changed more easily, |
5633 % Use \normalturnoffactive so that punctuation chars such as underscore | 6003 % since not square brackets don't work in some documents. Particularly |
5634 % and backslash work in node names. (\turnoffactive doesn't do \.) | 6004 % one that Bob is working on :). |
6005 % | |
6006 \def\xrefprintnodename#1{[#1]} | |
6007 | |
6008 % \dosetq is called from \setref to do the actual \write (\iflinks). | |
6009 % | |
5635 \def\dosetq#1#2{% | 6010 \def\dosetq#1#2{% |
5636 {\let\folio=0% | 6011 {\let\folio=0% |
5637 \normalturnoffactive | |
5638 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% | 6012 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% |
5639 \iflinks | 6013 \iflinks \next \fi |
5640 \next | |
5641 \fi | |
5642 }% | 6014 }% |
5643 } | 6015 } |
5644 | 6016 |
5645 % \internalsetq {foo}{page} expands into | 6017 % \internalsetq{foo}{page} expands into |
5646 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} | 6018 % CHARACTERS @xrdef{foo}{...expansion of \page...} |
5647 % When the aux file is read, ' is the escape character | 6019 \def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}} |
5648 | 6020 |
5649 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} | 6021 % Things to be expanded by \internalsetq. |
5650 | 6022 % |
5651 % Things to be expanded by \internalsetq | |
5652 | |
5653 \def\Ypagenumber{\folio} | 6023 \def\Ypagenumber{\folio} |
5654 | |
5655 \def\Ytitle{\thissection} | 6024 \def\Ytitle{\thissection} |
5656 | |
5657 \def\Ynothing{} | 6025 \def\Ynothing{} |
5658 | |
5659 \def\Ysectionnumberandtype{% | 6026 \def\Ysectionnumberandtype{% |
5660 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno % | 6027 \ifnum\secno=0 |
5661 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % | 6028 \putwordChapter@tie \the\chapno |
5662 \else \ifnum \subsubsecno=0 % | 6029 \else \ifnum\subsecno=0 |
5663 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % | 6030 \putwordSection@tie \the\chapno.\the\secno |
5664 \else % | 6031 \else \ifnum\subsubsecno=0 |
5665 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % | 6032 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno |
5666 \fi \fi \fi } | 6033 \else |
6034 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno | |
6035 \fi\fi\fi | |
6036 } | |
5667 | 6037 |
5668 \def\Yappendixletterandtype{% | 6038 \def\Yappendixletterandtype{% |
5669 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% | 6039 \ifnum\secno=0 |
5670 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % | 6040 \putwordAppendix@tie @char\the\appendixno{}% |
5671 \else \ifnum \subsubsecno=0 % | 6041 \else \ifnum\subsecno=0 |
5672 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % | 6042 \putwordSection@tie @char\the\appendixno.\the\secno |
5673 \else % | 6043 \else \ifnum\subsubsecno=0 |
5674 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % | 6044 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno |
5675 \fi \fi \fi } | 6045 \else |
5676 | 6046 \putwordSection@tie |
5677 \gdef\xreftie{'tie} | 6047 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno |
6048 \fi\fi\fi | |
6049 } | |
5678 | 6050 |
5679 % Use TeX 3.0's \inputlineno to get the line number, for better error | 6051 % Use TeX 3.0's \inputlineno to get the line number, for better error |
5680 % messages, but if we're using an old version of TeX, don't do anything. | 6052 % messages, but if we're using an old version of TeX, don't do anything. |
5681 % | 6053 % |
5682 \ifx\inputlineno\thisisundefined | 6054 \ifx\inputlineno\thisisundefined |
5683 \let\linenumber = \empty % Non-3.0. | 6055 \let\linenumber = \empty % Pre-3.0. |
5684 \else | 6056 \else |
5685 \def\linenumber{\the\inputlineno:\space} | 6057 \def\linenumber{\the\inputlineno:\space} |
5686 \fi | 6058 \fi |
5687 | 6059 |
5688 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. | 6060 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. |
5689 % If its value is nonempty, SUFFIX is output afterward. | 6061 % If its value is nonempty, SUFFIX is output afterward. |
5690 | 6062 % |
5691 \def\refx#1#2{% | 6063 \def\refx#1#2{% |
5692 \expandafter\ifx\csname X#1\endcsname\relax | 6064 {% |
6065 \indexnofonts | |
6066 \otherbackslash | |
6067 \expandafter\global\expandafter\let\expandafter\thisrefX | |
6068 \csname X#1\endcsname | |
6069 }% | |
6070 \ifx\thisrefX\relax | |
5693 % If not defined, say something at least. | 6071 % If not defined, say something at least. |
5694 \angleleft un\-de\-fined\angleright | 6072 \angleleft un\-de\-fined\angleright |
5695 \iflinks | 6073 \iflinks |
5696 \ifhavexrefs | 6074 \ifhavexrefs |
5697 \message{\linenumber Undefined cross reference `#1'.}% | 6075 \message{\linenumber Undefined cross reference `#1'.}% |
5702 \fi | 6080 \fi |
5703 \fi | 6081 \fi |
5704 \fi | 6082 \fi |
5705 \else | 6083 \else |
5706 % It's defined, so just use it. | 6084 % It's defined, so just use it. |
5707 \csname X#1\endcsname | 6085 \thisrefX |
5708 \fi | 6086 \fi |
5709 #2% Output the suffix in any case. | 6087 #2% Output the suffix in any case. |
5710 } | 6088 } |
5711 | 6089 |
5712 % This is the macro invoked by entries in the aux file. | 6090 % This is the macro invoked by entries in the aux file. |
5713 % | 6091 % |
5714 \def\xrdef#1{\begingroup | 6092 \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname} |
5715 % Reenable \ as an escape while reading the second argument. | |
5716 \catcode`\\ = 0 | |
5717 \afterassignment\endgroup | |
5718 \expandafter\gdef\csname X#1\endcsname | |
5719 } | |
5720 | 6093 |
5721 % Read the last existing aux file, if any. No error if none exists. | 6094 % Read the last existing aux file, if any. No error if none exists. |
5722 \def\readauxfile{\begingroup | 6095 \def\readauxfile{\begingroup |
5723 \catcode`\^^@=\other | 6096 \catcode`\^^@=\other |
5724 \catcode`\^^A=\other | 6097 \catcode`\^^A=\other |
5745 \catcode`\^^[=\other | 6118 \catcode`\^^[=\other |
5746 \catcode`\^^\=\other | 6119 \catcode`\^^\=\other |
5747 \catcode`\^^]=\other | 6120 \catcode`\^^]=\other |
5748 \catcode`\^^^=\other | 6121 \catcode`\^^^=\other |
5749 \catcode`\^^_=\other | 6122 \catcode`\^^_=\other |
5750 \catcode`\@=\other | 6123 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. |
5751 \catcode`\^=\other | |
5752 % It was suggested to define this as 7, which would allow ^^e4 etc. | |
5753 % in xref tags, i.e., node names. But since ^^e4 notation isn't | 6124 % in xref tags, i.e., node names. But since ^^e4 notation isn't |
5754 % supported in the main text, it doesn't seem desirable. Furthermore, | 6125 % supported in the main text, it doesn't seem desirable. Furthermore, |
5755 % that is not enough: for node names that actually contain a ^ | 6126 % that is not enough: for node names that actually contain a ^ |
5756 % character, we would end up writing a line like this: 'xrdef {'hat | 6127 % character, we would end up writing a line like this: 'xrdef {'hat |
5757 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first | 6128 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first |
5760 % | 6131 % |
5761 % The other change necessary for this was to define \auxhat: | 6132 % The other change necessary for this was to define \auxhat: |
5762 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter | 6133 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter |
5763 % and then to call \auxhat in \setq. | 6134 % and then to call \auxhat in \setq. |
5764 % | 6135 % |
6136 \catcode`\^=\other | |
6137 % | |
6138 % Special characters. Should be turned off anyway, but... | |
5765 \catcode`\~=\other | 6139 \catcode`\~=\other |
5766 \catcode`\[=\other | 6140 \catcode`\[=\other |
5767 \catcode`\]=\other | 6141 \catcode`\]=\other |
5768 \catcode`\"=\other | 6142 \catcode`\"=\other |
5769 \catcode`\_=\other | 6143 \catcode`\_=\other |
5771 \catcode`\<=\other | 6145 \catcode`\<=\other |
5772 \catcode`\>=\other | 6146 \catcode`\>=\other |
5773 \catcode`\$=\other | 6147 \catcode`\$=\other |
5774 \catcode`\#=\other | 6148 \catcode`\#=\other |
5775 \catcode`\&=\other | 6149 \catcode`\&=\other |
6150 \catcode`\%=\other | |
5776 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off | 6151 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off |
6152 % | |
5777 % Make the characters 128-255 be printing characters | 6153 % Make the characters 128-255 be printing characters |
5778 {% | 6154 {% |
5779 \count 1=128 | 6155 \count 1=128 |
5780 \def\loop{% | 6156 \def\loop{% |
5781 \catcode\count 1=\other | 6157 \catcode\count 1=\other |
5782 \advance\count 1 by 1 | 6158 \advance\count 1 by 1 |
5783 \ifnum \count 1<256 \loop \fi | 6159 \ifnum \count 1<256 \loop \fi |
5784 }% | 6160 }% |
5785 }% | 6161 }% |
5786 % The aux file uses ' as the escape (for now). | 6162 % |
5787 % Turn off \ as an escape so we do not lose on | 6163 % Turn off \ as an escape so we do not lose on |
5788 % entries which were dumped with control sequences in their names. | 6164 % entries which were dumped with control sequences in their names. |
5789 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ | 6165 % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^ |
5790 % Reference to such entries still does not work the way one would wish, | 6166 % Reference to such entries still does not work the way one would wish, |
5791 % but at least they do not bomb out when the aux file is read in. | 6167 % but at least they do not bomb out when the aux file is read in. |
6168 \catcode`\\=\other | |
6169 % | |
6170 % @ is our escape character in .aux files. | |
5792 \catcode`\{=1 | 6171 \catcode`\{=1 |
5793 \catcode`\}=2 | 6172 \catcode`\}=2 |
5794 \catcode`\%=\other | 6173 \catcode`\@=0 |
5795 \catcode`\'=0 | |
5796 \catcode`\\=\other | |
5797 % | 6174 % |
5798 \openin 1 \jobname.aux | 6175 \openin 1 \jobname.aux |
5799 \ifeof 1 \else | 6176 \ifeof 1 \else |
5800 \closein 1 | 6177 \closein 1 |
5801 \input \jobname.aux | 6178 \input \jobname.aux |
5825 | 6202 |
5826 {\catcode `\@=11 | 6203 {\catcode `\@=11 |
5827 % | 6204 % |
5828 % Auto-number footnotes. Otherwise like plain. | 6205 % Auto-number footnotes. Otherwise like plain. |
5829 \gdef\footnote{% | 6206 \gdef\footnote{% |
6207 \let\indent=\ptexindent | |
5830 \global\advance\footnoteno by \@ne | 6208 \global\advance\footnoteno by \@ne |
5831 \edef\thisfootno{$^{\the\footnoteno}$}% | 6209 \edef\thisfootno{$^{\the\footnoteno}$}% |
5832 % | 6210 % |
5833 % In case the footnote comes at the end of a sentence, preserve the | 6211 % In case the footnote comes at the end of a sentence, preserve the |
5834 % extra spacing after we do the footnote number. | 6212 % extra spacing after we do the footnote number. |
5835 \let\@sf\empty | 6213 \let\@sf\empty |
5836 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi | 6214 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi |
5837 % | 6215 % |
5838 % Remove inadvertent blank space before typesetting the footnote number. | 6216 % Remove inadvertent blank space before typesetting the footnote number. |
5839 \unskip | 6217 \unskip |
5840 \thisfootno\@sf | 6218 \thisfootno\@sf |
5841 \footnotezzz | 6219 \dofootnote |
5842 }% | 6220 }% |
5843 | 6221 |
5844 % Don't bother with the trickery in plain.tex to not require the | 6222 % Don't bother with the trickery in plain.tex to not require the |
5845 % footnote text as a parameter. Our footnotes don't need to be so general. | 6223 % footnote text as a parameter. Our footnotes don't need to be so general. |
5846 % | 6224 % |
5847 % Oh yes, they do; otherwise, @ifset and anything else that uses | 6225 % Oh yes, they do; otherwise, @ifset and anything else that uses |
5848 % \parseargline fail inside footnotes because the tokens are fixed when | 6226 % \parseargline fail inside footnotes because the tokens are fixed when |
5849 % the footnote is read. --karl, 16nov96. | 6227 % the footnote is read. --karl, 16nov96. |
5850 % | 6228 % |
5851 \long\gdef\footnotezzz{\insert\footins\bgroup | 6229 % The start of the footnote looks usually like this: |
6230 \gdef\startfootins{\insert\footins\bgroup} | |
6231 % | |
6232 % ... but this macro is redefined inside @multitable. | |
6233 % | |
6234 \gdef\dofootnote{% | |
6235 \startfootins | |
5852 % We want to typeset this text as a normal paragraph, even if the | 6236 % We want to typeset this text as a normal paragraph, even if the |
5853 % footnote reference occurs in (for example) a display environment. | 6237 % footnote reference occurs in (for example) a display environment. |
5854 % So reset some parameters. | 6238 % So reset some parameters. |
6239 \hsize=\pagewidth | |
5855 \interlinepenalty\interfootnotelinepenalty | 6240 \interlinepenalty\interfootnotelinepenalty |
5856 \splittopskip\ht\strutbox % top baseline for broken footnotes | 6241 \splittopskip\ht\strutbox % top baseline for broken footnotes |
5857 \splitmaxdepth\dp\strutbox | 6242 \splitmaxdepth\dp\strutbox |
5858 \floatingpenalty\@MM | 6243 \floatingpenalty\@MM |
5859 \leftskip\z@skip | 6244 \leftskip\z@skip |
5879 % expands into a box, it must come within the paragraph, lest it | 6264 % expands into a box, it must come within the paragraph, lest it |
5880 % provide a place where TeX can split the footnote. | 6265 % provide a place where TeX can split the footnote. |
5881 \footstrut | 6266 \footstrut |
5882 \futurelet\next\fo@t | 6267 \futurelet\next\fo@t |
5883 } | 6268 } |
5884 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t | |
5885 \else\let\next\f@t\fi \next} | |
5886 \def\f@@t{\bgroup\aftergroup\@foot\let\next} | |
5887 \def\f@t#1{#1\@foot} | |
5888 \def\@foot{\strut\par\egroup} | |
5889 | |
5890 }%end \catcode `\@=11 | 6269 }%end \catcode `\@=11 |
5891 | 6270 |
5892 % @| inserts a changebar to the left of the current line. It should | 6271 % @| inserts a changebar to the left of the current line. It should |
5893 % surround any changed text. This approach does *not* work if the | 6272 % surround any changed text. This approach does *not* work if the |
5894 % change spans more than two lines of output. To handle that, we would | 6273 % change spans more than two lines of output. To handle that, we would |
5931 % time, we might be inside a group, and then its definitions would get | 6310 % time, we might be inside a group, and then its definitions would get |
5932 % undone and the next image would fail. | 6311 % undone and the next image would fail. |
5933 \openin 1 = epsf.tex | 6312 \openin 1 = epsf.tex |
5934 \ifeof 1 \else | 6313 \ifeof 1 \else |
5935 \closein 1 | 6314 \closein 1 |
5936 % Do not bother showing banner with post-v2.7 epsf.tex (available in | 6315 % Do not bother showing banner with epsf.tex v2.7k (available in |
5937 % doc/epsf.tex until it shows up on ctan). | 6316 % doc/epsf.tex and on ctan). |
5938 \def\epsfannounce{\toks0 = }% | 6317 \def\epsfannounce{\toks0 = }% |
5939 \input epsf.tex | 6318 \input epsf.tex |
5940 \fi | 6319 \fi |
5941 % | 6320 % |
5942 % We will only complain once about lack of epsf.tex. | 6321 % We will only complain once about lack of epsf.tex. |
6057 \emergencystretch = .15\hsize | 6436 \emergencystretch = .15\hsize |
6058 \fi | 6437 \fi |
6059 } | 6438 } |
6060 | 6439 |
6061 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; | 6440 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; |
6062 % 4) hoffset; 5) binding offset; 6) topskip. We also call | 6441 % 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) |
6063 % \setleading{\textleading}, so the caller should define \textleading. | 6442 % physical page width. |
6064 % The caller should also set \parskip. | 6443 % |
6065 % | 6444 % We also call \setleading{\textleading}, so the caller should define |
6066 \def\internalpagesizes#1#2#3#4#5#6{% | 6445 % \textleading. The caller should also set \parskip. |
6446 % | |
6447 \def\internalpagesizes#1#2#3#4#5#6#7#8{% | |
6067 \voffset = #3\relax | 6448 \voffset = #3\relax |
6068 \topskip = #6\relax | 6449 \topskip = #6\relax |
6069 \splittopskip = \topskip | 6450 \splittopskip = \topskip |
6070 % | 6451 % |
6071 \vsize = #1\relax | 6452 \vsize = #1\relax |
6080 \pagewidth = \hsize | 6461 \pagewidth = \hsize |
6081 % | 6462 % |
6082 \normaloffset = #4\relax | 6463 \normaloffset = #4\relax |
6083 \bindingoffset = #5\relax | 6464 \bindingoffset = #5\relax |
6084 % | 6465 % |
6466 \ifpdf | |
6467 \pdfpageheight #7\relax | |
6468 \pdfpagewidth #8\relax | |
6469 \fi | |
6470 % | |
6085 \setleading{\textleading} | 6471 \setleading{\textleading} |
6086 % | 6472 % |
6087 \parindent = \defaultparindent | 6473 \parindent = \defaultparindent |
6088 \setemergencystretch | 6474 \setemergencystretch |
6089 } | |
6090 | |
6091 % Use `small' versions. | |
6092 % | |
6093 \def\smallenvironments{% | |
6094 \let\smalldisplay = \smalldisplayx | |
6095 \let\smallexample = \smalllispx | |
6096 \let\smallformat = \smallformatx | |
6097 \let\smalllisp = \smalllispx | |
6098 } | 6475 } |
6099 | 6476 |
6100 % @letterpaper (the default). | 6477 % @letterpaper (the default). |
6101 \def\letterpaper{{\globaldefs = 1 | 6478 \def\letterpaper{{\globaldefs = 1 |
6102 \parskip = 3pt plus 2pt minus 1pt | 6479 \parskip = 3pt plus 2pt minus 1pt |
6103 \textleading = 13.2pt | 6480 \textleading = 13.2pt |
6104 % | 6481 % |
6105 % If page is nothing but text, make it come out even. | 6482 % If page is nothing but text, make it come out even. |
6106 \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% | 6483 \internalpagesizes{46\baselineskip}{6in}% |
6484 {\voffset}{.25in}% | |
6485 {\bindingoffset}{36pt}% | |
6486 {11in}{8.5in}% | |
6107 }} | 6487 }} |
6108 | 6488 |
6109 % Use @smallbook to reset parameters for 7x9.5 (or so) format. | 6489 % Use @smallbook to reset parameters for 7x9.5 (or so) format. |
6110 \def\smallbook{{\globaldefs = 1 | 6490 \def\smallbook{{\globaldefs = 1 |
6111 \parskip = 2pt plus 1pt | 6491 \parskip = 2pt plus 1pt |
6112 \textleading = 12pt | 6492 \textleading = 12pt |
6113 % | 6493 % |
6114 \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% | 6494 \internalpagesizes{7.5in}{5in}% |
6495 {\voffset}{.25in}% | |
6496 {\bindingoffset}{16pt}% | |
6497 {9.25in}{7in}% | |
6115 % | 6498 % |
6116 \lispnarrowing = 0.3in | 6499 \lispnarrowing = 0.3in |
6117 \tolerance = 700 | 6500 \tolerance = 700 |
6118 \hfuzz = 1pt | 6501 \hfuzz = 1pt |
6119 \contentsrightmargin = 0pt | 6502 \contentsrightmargin = 0pt |
6120 \deftypemargin = 0pt | |
6121 \defbodyindent = .5cm | 6503 \defbodyindent = .5cm |
6122 \smallenvironments | |
6123 }} | 6504 }} |
6124 | 6505 |
6125 % Use @afourpaper to print on European A4 paper. | 6506 % Use @afourpaper to print on European A4 paper. |
6126 \def\afourpaper{{\globaldefs = 1 | 6507 \def\afourpaper{{\globaldefs = 1 |
6127 \parskip = 3pt plus 2pt minus 1pt | 6508 \parskip = 3pt plus 2pt minus 1pt |
6128 \textleading = 12pt | 6509 \textleading = 13.2pt |
6129 % | 6510 % |
6130 \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% | 6511 % Double-side printing via postscript on Laserjet 4050 |
6512 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. | |
6513 % To change the settings for a different printer or situation, adjust | |
6514 % \normaloffset until the front-side and back-side texts align. Then | |
6515 % do the same for \bindingoffset. You can set these for testing in | |
6516 % your texinfo source file like this: | |
6517 % @tex | |
6518 % \global\normaloffset = -6mm | |
6519 % \global\bindingoffset = 10mm | |
6520 % @end tex | |
6521 \internalpagesizes{51\baselineskip}{160mm} | |
6522 {\voffset}{\hoffset}% | |
6523 {\bindingoffset}{44pt}% | |
6524 {297mm}{210mm}% | |
6131 % | 6525 % |
6132 \tolerance = 700 | 6526 \tolerance = 700 |
6133 \hfuzz = 1pt | 6527 \hfuzz = 1pt |
6528 \contentsrightmargin = 0pt | |
6529 \defbodyindent = 5mm | |
6134 }} | 6530 }} |
6135 | 6531 |
6136 % Use @afivepaper to print on European A5 paper. | 6532 % Use @afivepaper to print on European A5 paper. |
6137 % From romildo@urano.iceb.ufop.br, 2 July 2000. | 6533 % From romildo@urano.iceb.ufop.br, 2 July 2000. |
6138 % He also recommends making @example and @lisp be small. | 6534 % He also recommends making @example and @lisp be small. |
6139 \def\afivepaper{{\globaldefs = 1 | 6535 \def\afivepaper{{\globaldefs = 1 |
6140 \parskip = 2pt plus 1pt minus 0.1pt | 6536 \parskip = 2pt plus 1pt minus 0.1pt |
6141 \textleading = 12.5pt | 6537 \textleading = 12.5pt |
6142 % | 6538 % |
6143 \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% | 6539 \internalpagesizes{160mm}{120mm}% |
6540 {\voffset}{\hoffset}% | |
6541 {\bindingoffset}{8pt}% | |
6542 {210mm}{148mm}% | |
6144 % | 6543 % |
6145 \lispnarrowing = 0.2in | 6544 \lispnarrowing = 0.2in |
6146 \tolerance = 800 | 6545 \tolerance = 800 |
6147 \hfuzz = 1.2pt | 6546 \hfuzz = 1.2pt |
6148 \contentsrightmargin = 0mm | 6547 \contentsrightmargin = 0pt |
6149 \deftypemargin = 0pt | |
6150 \defbodyindent = 2mm | 6548 \defbodyindent = 2mm |
6151 \tableindent = 12mm | 6549 \tableindent = 12mm |
6152 % | |
6153 \smallenvironments | |
6154 }} | 6550 }} |
6155 | 6551 |
6156 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin | 6552 % A specific text layout, 24x15cm overall, intended for A4 paper. |
6157 % 29mm, hence bottom margin 28mm, nominal side margin 3cm. | |
6158 \def\afourlatex{{\globaldefs = 1 | 6553 \def\afourlatex{{\globaldefs = 1 |
6159 \textleading = 13.6pt | |
6160 % | |
6161 \afourpaper | 6554 \afourpaper |
6162 \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% | 6555 \internalpagesizes{237mm}{150mm}% |
6163 % | 6556 {\voffset}{4.6mm}% |
6164 % Must explicitly reset to 0 because we call \afourpaper, apparently, | 6557 {\bindingoffset}{7mm}% |
6165 % although this does not entirely make sense. | 6558 {297mm}{210mm}% |
6559 % | |
6560 % Must explicitly reset to 0 because we call \afourpaper. | |
6166 \globaldefs = 0 | 6561 \globaldefs = 0 |
6167 }} | 6562 }} |
6168 | 6563 |
6169 % Use @afourwide to print on European A4 paper in wide format. | 6564 % Use @afourwide to print on A4 paper in landscape format. |
6170 \def\afourwide{% | 6565 \def\afourwide{{\globaldefs = 1 |
6171 \afourpaper | 6566 \afourpaper |
6172 \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% | 6567 \internalpagesizes{241mm}{165mm}% |
6173 } | 6568 {\voffset}{-2.95mm}% |
6569 {\bindingoffset}{7mm}% | |
6570 {297mm}{210mm}% | |
6571 \globaldefs = 0 | |
6572 }} | |
6174 | 6573 |
6175 % @pagesizes TEXTHEIGHT[,TEXTWIDTH] | 6574 % @pagesizes TEXTHEIGHT[,TEXTWIDTH] |
6176 % Perhaps we should allow setting the margins, \topskip, \parskip, | 6575 % Perhaps we should allow setting the margins, \topskip, \parskip, |
6177 % and/or leading, also. Or perhaps we should compute them somehow. | 6576 % and/or leading, also. Or perhaps we should compute them somehow. |
6178 % | 6577 % |
6183 \globaldefs = 1 | 6582 \globaldefs = 1 |
6184 % | 6583 % |
6185 \parskip = 3pt plus 2pt minus 1pt | 6584 \parskip = 3pt plus 2pt minus 1pt |
6186 \setleading{\textleading}% | 6585 \setleading{\textleading}% |
6187 % | 6586 % |
6188 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% | 6587 \dimen0 = #1 |
6588 \advance\dimen0 by \voffset | |
6589 % | |
6590 \dimen2 = \hsize | |
6591 \advance\dimen2 by \normaloffset | |
6592 % | |
6593 \internalpagesizes{#1}{\hsize}% | |
6594 {\voffset}{\normaloffset}% | |
6595 {\bindingoffset}{44pt}% | |
6596 {\dimen0}{\dimen2}% | |
6189 }} | 6597 }} |
6190 | 6598 |
6191 % Set default to letter. | 6599 % Set default to letter. |
6192 % | 6600 % |
6193 \letterpaper | 6601 \letterpaper |
6247 \def^{{\tt \hat}} | 6655 \def^{{\tt \hat}} |
6248 | 6656 |
6249 \catcode`\_=\active | 6657 \catcode`\_=\active |
6250 \def_{\ifusingtt\normalunderscore\_} | 6658 \def_{\ifusingtt\normalunderscore\_} |
6251 % Subroutine for the previous macro. | 6659 % Subroutine for the previous macro. |
6252 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} | 6660 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } |
6253 | 6661 |
6254 \catcode`\|=\active | 6662 \catcode`\|=\active |
6255 \def|{{\tt\char124}} | 6663 \def|{{\tt\char124}} |
6256 \chardef \less=`\< | 6664 \chardef \less=`\< |
6257 \catcode`\<=\active | 6665 \catcode`\<=\active |
6261 \def>{{\tt \gtr}} | 6669 \def>{{\tt \gtr}} |
6262 \catcode`\+=\active | 6670 \catcode`\+=\active |
6263 \def+{{\tt \char 43}} | 6671 \def+{{\tt \char 43}} |
6264 \catcode`\$=\active | 6672 \catcode`\$=\active |
6265 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix | 6673 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix |
6266 %\catcode 27=\active | |
6267 %\def^^[{$\diamondsuit$} | |
6268 | 6674 |
6269 % Set up an active definition for =, but don't enable it most of the time. | 6675 % Set up an active definition for =, but don't enable it most of the time. |
6270 {\catcode`\==\active | 6676 {\catcode`\==\active |
6271 \global\def={{\tt \char 61}}} | 6677 \global\def={{\tt \char 61}}} |
6272 | 6678 |
6279 % \otherifyactive is called near the end of this file. | 6685 % \otherifyactive is called near the end of this file. |
6280 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} | 6686 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} |
6281 | 6687 |
6282 \catcode`\@=0 | 6688 \catcode`\@=0 |
6283 | 6689 |
6284 % \rawbackslashxx output one backslash character in current font | 6690 % \rawbackslashxx outputs one backslash character in current font, |
6691 % as in \char`\\. | |
6285 \global\chardef\rawbackslashxx=`\\ | 6692 \global\chardef\rawbackslashxx=`\\ |
6286 %{\catcode`\\=\other | 6693 |
6287 %@gdef@rawbackslashxx{\}} | 6694 % \rawbackslash defines an active \ to do \rawbackslashxx. |
6288 | 6695 % \otherbackslash defines an active \ to be a literal `\' character with |
6289 % \rawbackslash redefines \ as input to do \rawbackslashxx. | 6696 % catcode other. |
6290 {\catcode`\\=\active | 6697 {\catcode`\\=\active |
6291 @gdef@rawbackslash{@let\=@rawbackslashxx }} | 6698 @gdef@rawbackslash{@let\=@rawbackslashxx} |
6699 @gdef@otherbackslash{@let\=@realbackslash} | |
6700 } | |
6701 | |
6702 % \realbackslash is an actual character `\' with catcode other. | |
6703 {\catcode`\\=\other @gdef@realbackslash{\}} | |
6292 | 6704 |
6293 % \normalbackslash outputs one backslash in fixed width font. | 6705 % \normalbackslash outputs one backslash in fixed width font. |
6294 \def\normalbackslash{{\tt\rawbackslashxx}} | 6706 \def\normalbackslash{{\tt\rawbackslashxx}} |
6295 | 6707 |
6296 % \catcode 17=0 % Define control-q | |
6297 \catcode`\\=\active | 6708 \catcode`\\=\active |
6298 | 6709 |
6299 % Used sometimes to turn off (effectively) the active characters | 6710 % Used sometimes to turn off (effectively) the active characters |
6300 % even after parsing them. | 6711 % even after parsing them. |
6301 @def@turnoffactive{@let"=@normaldoublequote | 6712 @def@turnoffactive{% |
6302 @let\=@realbackslash | 6713 @let"=@normaldoublequote |
6303 @let~=@normaltilde | 6714 @let\=@realbackslash |
6304 @let^=@normalcaret | 6715 @let~=@normaltilde |
6305 @let_=@normalunderscore | 6716 @let^=@normalcaret |
6306 @let|=@normalverticalbar | 6717 @let_=@normalunderscore |
6307 @let<=@normalless | 6718 @let|=@normalverticalbar |
6308 @let>=@normalgreater | 6719 @let<=@normalless |
6309 @let+=@normalplus | 6720 @let>=@normalgreater |
6310 @let$=@normaldollar}%$ font-lock fix | 6721 @let+=@normalplus |
6311 | 6722 @let$=@normaldollar %$ font-lock fix |
6312 @def@normalturnoffactive{@let"=@normaldoublequote | 6723 } |
6313 @let\=@normalbackslash | 6724 |
6314 @let~=@normaltilde | 6725 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of |
6315 @let^=@normalcaret | 6726 % the literal character `\'. (Thus, \ is not expandable when this is in |
6316 @let_=@normalunderscore | 6727 % effect.) |
6317 @let|=@normalverticalbar | 6728 % |
6318 @let<=@normalless | 6729 @def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} |
6319 @let>=@normalgreater | |
6320 @let+=@normalplus | |
6321 @let$=@normaldollar}%$ font-lock fix | |
6322 | 6730 |
6323 % Make _ and + \other characters, temporarily. | 6731 % Make _ and + \other characters, temporarily. |
6324 % This is canceled by @fixbackslash. | 6732 % This is canceled by @fixbackslash. |
6325 @otherifyactive | 6733 @otherifyactive |
6326 | 6734 |