Deleted Added
full compact
texinfo.tex (117395) texinfo.tex (119256)
1% texinfo.tex -- TeX macros to handle Texinfo files.
2%
3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5%
1% texinfo.tex -- TeX macros to handle Texinfo files.
2%
3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5%
6\def\texinfoversion{2002-12-26.16}
6\def\texinfoversion{2003-05-04.08}
7%
8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
7%
8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
10%
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
13% published by the Free Software Foundation; either version 2, or (at
14% your option) any later version.
15%
16% This texinfo.tex file is distributed in the hope that it will be
17% useful, but WITHOUT ANY WARRANTY; without even the implied warranty

--- 11 unchanged lines hidden (view full) ---

29%
30% Please try the latest version of texinfo.tex before submitting bug
31% reports; you can get the latest version from:
32% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
33% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
34% ftp://tug.org/tex/texinfo.tex
35% (and all CTAN mirrors, see http://www.ctan.org),
36% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
10%
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
13% published by the Free Software Foundation; either version 2, or (at
14% your option) any later version.
15%
16% This texinfo.tex file is distributed in the hope that it will be
17% useful, but WITHOUT ANY WARRANTY; without even the implied warranty

--- 11 unchanged lines hidden (view full) ---

29%
30% Please try the latest version of texinfo.tex before submitting bug
31% reports; you can get the latest version from:
32% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
33% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
34% ftp://tug.org/tex/texinfo.tex
35% (and all CTAN mirrors, see http://www.ctan.org),
36% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
37%
37%
38% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
38% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
39%
39%
40% The texinfo.tex in any given Texinfo distribution could well be out
41% of date, so if that's what you're using, please check.
40% The texinfo.tex in any given Texinfo distribution could well be out
41% of date, so if that's what you're using, please check.
42%
42%
43% Send bug reports to bug-texinfo@gnu.org. Please include including a
44% complete document in each bug report with which we can reproduce the
45% problem. Patches are, of course, greatly appreciated.
46%
47% To process a Texinfo manual with TeX, it's most reliable to use the
48% texi2dvi shell script that comes with the distribution. For a simple
49% manual foo.texi, however, you can get away with this:
50% tex foo.texi
51% texindex foo.??
52% tex foo.texi
53% tex foo.texi
54% dvips foo.dvi -o # or whatever; this makes foo.ps.
55% The extra TeX runs get the cross-reference information correct.
56% Sometimes one run after texindex suffices, and sometimes you need more
57% than two; texi2dvi does it as many times as necessary.
58%
43% Send bug reports to bug-texinfo@gnu.org. Please include including a
44% complete document in each bug report with which we can reproduce the
45% problem. Patches are, of course, greatly appreciated.
46%
47% To process a Texinfo manual with TeX, it's most reliable to use the
48% texi2dvi shell script that comes with the distribution. For a simple
49% manual foo.texi, however, you can get away with this:
50% tex foo.texi
51% texindex foo.??
52% tex foo.texi
53% tex foo.texi
54% dvips foo.dvi -o # or whatever; this makes foo.ps.
55% The extra TeX runs get the cross-reference information correct.
56% Sometimes one run after texindex suffices, and sometimes you need more
57% than two; texi2dvi does it as many times as necessary.
58%
59% It is possible to adapt texinfo.tex for other languages. You can get
60% the existing language-specific files from the full Texinfo distribution.
59% It is possible to adapt texinfo.tex for other languages, to some
60% extent. You can get the existing language-specific files from the
61% full Texinfo distribution.
61
62\message{Loading texinfo [version \texinfoversion]:}
63
64% If in a .fmt file, print the version number
65% and turn on active characters that we couldn't do earlier because
66% they might have appeared in the input file name.
67\everyjob{\message{[Texinfo version \texinfoversion]}%
68 \catcode`+=\active \catcode`\_=\active}
69
70\message{Basics,}
71\chardef\other=12
72
62
63\message{Loading texinfo [version \texinfoversion]:}
64
65% If in a .fmt file, print the version number
66% and turn on active characters that we couldn't do earlier because
67% they might have appeared in the input file name.
68\everyjob{\message{[Texinfo version \texinfoversion]}%
69 \catcode`+=\active \catcode`\_=\active}
70
71\message{Basics,}
72\chardef\other=12
73
73% We never want plain's outer \+ definition in Texinfo.
74% We never want plain's \outer definition of \+ in Texinfo.
74% For @tex, we can use \tabalign.
75\let\+ = \relax
76
75% For @tex, we can use \tabalign.
76\let\+ = \relax
77
77% Save some parts of plain tex whose names we will redefine.
78% Save some plain tex macros whose names we will redefine.
78\let\ptexb=\b
79\let\ptexbullet=\bullet
80\let\ptexc=\c
81\let\ptexcomma=\,
82\let\ptexdot=\.
83\let\ptexdots=\dots
84\let\ptexend=\end
85\let\ptexequiv=\equiv
86\let\ptexexclam=\!
87\let\ptexgtr=>
88\let\ptexhat=^
89\let\ptexi=\i
79\let\ptexb=\b
80\let\ptexbullet=\bullet
81\let\ptexc=\c
82\let\ptexcomma=\,
83\let\ptexdot=\.
84\let\ptexdots=\dots
85\let\ptexend=\end
86\let\ptexequiv=\equiv
87\let\ptexexclam=\!
88\let\ptexgtr=>
89\let\ptexhat=^
90\let\ptexi=\i
91\let\ptexindent=\indent
90\let\ptexlbrace=\{
91\let\ptexless=<
92\let\ptexplus=+
93\let\ptexrbrace=\}
92\let\ptexlbrace=\{
93\let\ptexless=<
94\let\ptexplus=+
95\let\ptexrbrace=\}
96\let\ptexslash=\/
94\let\ptexstar=\*
95\let\ptext=\t
96
97% If this character appears in an error message or help string, it
98% starts a new line in the output.
99\newlinechar = `^^J
100
101% Set up fixed words for English if not already set.

--- 33 unchanged lines hidden (view full) ---

135\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
136\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
137\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
138\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
139\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
140\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
141\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
142
97\let\ptexstar=\*
98\let\ptext=\t
99
100% If this character appears in an error message or help string, it
101% starts a new line in the output.
102\newlinechar = `^^J
103
104% Set up fixed words for English if not already set.

--- 33 unchanged lines hidden (view full) ---

138\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
139\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
140\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
141\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
142\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
143\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
144\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
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
143% Ignore a token.
144%
145\def\gobble#1{}
146
147% True if #1 is the empty string, i.e., called like `\ifempty{}'.
148%
149\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
150\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
151
152% Hyphenation fixes.
153\hyphenation{ap-pen-dix}
158% Ignore a token.
159%
160\def\gobble#1{}
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.
168\hyphenation{ap-pen-dix}
154\hyphenation{mini-buf-fer mini-buf-fers}
155\hyphenation{eshell}
169\hyphenation{eshell}
170\hyphenation{mini-buf-fer mini-buf-fers}
171\hyphenation{time-stamp}
156\hyphenation{white-space}
157
158% Margin to add to right of even pages, to left of odd pages.
159\newdimen\bindingoffset
160\newdimen\normaloffset
161\newdimen\pagewidth \newdimen\pageheight
162
163% Sometimes it is convenient to have everything in the transcript file

--- 20 unchanged lines hidden (view full) ---

184 \tracingassigns1
185 \fi
186 \tracingcommands3 % 3 gives us more in etex
187 \errorcontextlines\maxdimen
188}%
189
190% add check for \lastpenalty to plain's definitions. If the last thing
191% we did was a \nobreak, we don't want to insert more space.
172\hyphenation{white-space}
173
174% Margin to add to right of even pages, to left of odd pages.
175\newdimen\bindingoffset
176\newdimen\normaloffset
177\newdimen\pagewidth \newdimen\pageheight
178
179% Sometimes it is convenient to have everything in the transcript file

--- 20 unchanged lines hidden (view full) ---

200 \tracingassigns1
201 \fi
202 \tracingcommands3 % 3 gives us more in etex
203 \errorcontextlines\maxdimen
204}%
205
206% add check for \lastpenalty to plain's definitions. If the last thing
207% we did was a \nobreak, we don't want to insert more space.
192%
208%
193\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
194 \removelastskip\penalty-50\smallskip\fi\fi}
195\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
196 \removelastskip\penalty-100\medskip\fi\fi}
197\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
198 \removelastskip\penalty-200\bigskip\fi\fi}
199
200% For @cropmarks command.

--- 84 unchanged lines hidden (view full) ---

285 \vbox{\moveright\cornerthick\nsbot}%
286 }%
287 \nointerlineskip
288 \line{\ewbot\hfil\ewbot}%
289 }%
290 \egroup % \vbox from first cropmarks clause
291 \fi
292 }% end of \shipout\vbox
209\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
210 \removelastskip\penalty-50\smallskip\fi\fi}
211\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
212 \removelastskip\penalty-100\medskip\fi\fi}
213\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
214 \removelastskip\penalty-200\bigskip\fi\fi}
215
216% For @cropmarks command.

--- 84 unchanged lines hidden (view full) ---

301 \vbox{\moveright\cornerthick\nsbot}%
302 }%
303 \nointerlineskip
304 \line{\ewbot\hfil\ewbot}%
305 }%
306 \egroup % \vbox from first cropmarks clause
307 \fi
308 }% end of \shipout\vbox
293 }% end of group with \turnoffactive
309 }% end of group with \normalturnoffactive
294 \advancepageno
295 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
296}
297
298\newinsert\margin \dimen\margin=\maxdimen
299
300\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
301{\catcode`\@ =11

--- 162 unchanged lines hidden (view full) ---

464%\def\'{{'}}
465
466% Used to generate quoted braces.
467\def\mylbrace {{\tt\char123}}
468\def\myrbrace {{\tt\char125}}
469\let\{=\mylbrace
470\let\}=\myrbrace
471\begingroup
310 \advancepageno
311 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
312}
313
314\newinsert\margin \dimen\margin=\maxdimen
315
316\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
317{\catcode`\@ =11

--- 162 unchanged lines hidden (view full) ---

480%\def\'{{'}}
481
482% Used to generate quoted braces.
483\def\mylbrace {{\tt\char123}}
484\def\myrbrace {{\tt\char125}}
485\let\{=\mylbrace
486\let\}=\myrbrace
487\begingroup
472 % Definitions to produce actual \{ & \} command in an index.
473 \catcode`\{ = 12 \catcode`\} = 12
488 % Definitions to produce \{ and \} commands for indices,
489 % and @{ and @} for the aux file.
490 \catcode`\{ = \other \catcode`\} = \other
474 \catcode`\[ = 1 \catcode`\] = 2
491 \catcode`\[ = 1 \catcode`\] = 2
475 \catcode`\@ = 0 \catcode`\\ = 12
476 @gdef@lbracecmd[\{]%
477 @gdef@rbracecmd[\}]%
478@endgroup
492 \catcode`\! = 0 \catcode`\\ = \other
493 !gdef!lbracecmd[\{]%
494 !gdef!rbracecmd[\}]%
495 !gdef!lbraceatcmd[@{]%
496 !gdef!rbraceatcmd[@}]%
497!endgroup
479
480% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
498
499% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
481% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
500% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
482\let\, = \c
483\let\dotaccent = \.
484\def\ringaccent#1{{\accent23 #1}}
485\let\tieaccent = \t
486\let\ubaraccent = \b
487\let\udotaccent = \d
488
489% Other special characters: @questiondown @exclamdown
501\let\, = \c
502\let\dotaccent = \.
503\def\ringaccent#1{{\accent23 #1}}
504\let\tieaccent = \t
505\let\ubaraccent = \b
506\let\udotaccent = \d
507
508% Other special characters: @questiondown @exclamdown
490% 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.
491\def\questiondown{?`}
492\def\exclamdown{!`}
493
494% Dotless i and dotless j, used for accents.
495\def\imacro{i}
496\def\jmacro{j}
497\def\dotless#1{%
498 \def\temp{#1}%

--- 16 unchanged lines hidden (view full) ---

515}
516
517% @: forces normal size whitespace following.
518\def\:{\spacefactor=1000 }
519
520% @* forces a line break.
521\def\*{\hfil\break\hbox{}\ignorespaces}
522
510\def\questiondown{?`}
511\def\exclamdown{!`}
512
513% Dotless i and dotless j, used for accents.
514\def\imacro{i}
515\def\jmacro{j}
516\def\dotless#1{%
517 \def\temp{#1}%

--- 16 unchanged lines hidden (view full) ---

534}
535
536% @: forces normal size whitespace following.
537\def\:{\spacefactor=1000 }
538
539% @* forces a line break.
540\def\*{\hfil\break\hbox{}\ignorespaces}
541
542% @/ allows a line break.
543\let\/=\allowbreak
544
523% @. is an end-of-sentence period.
524\def\.{.\spacefactor=3000 }
525
526% @! is an end-of-sentence bang.
527\def\!{!\spacefactor=3000 }
528
529% @? is an end-of-sentence query.
530\def\?{?\spacefactor=3000 }

--- 6 unchanged lines hidden (view full) ---

537% @group ... @end group forces ... to be all on one page, by enclosing
538% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
539% to keep its height that of a normal line. According to the rules for
540% \topskip (p.114 of the TeXbook), the glue inserted is
541% max (\topskip - \ht (first item), 0). If that height is large,
542% therefore, no glue is inserted, and the space between the headline and
543% the text is small, which looks bad.
544%
545% @. is an end-of-sentence period.
546\def\.{.\spacefactor=3000 }
547
548% @! is an end-of-sentence bang.
549\def\!{!\spacefactor=3000 }
550
551% @? is an end-of-sentence query.
552\def\?{?\spacefactor=3000 }

--- 6 unchanged lines hidden (view full) ---

559% @group ... @end group forces ... to be all on one page, by enclosing
560% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
561% to keep its height that of a normal line. According to the rules for
562% \topskip (p.114 of the TeXbook), the glue inserted is
563% max (\topskip - \ht (first item), 0). If that height is large,
564% therefore, no glue is inserted, and the space between the headline and
565% the text is small, which looks bad.
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%
545\def\group{\begingroup
546 \ifnum\catcode13=\active \else
547 \errhelp = \groupinvalidhelp
548 \errmessage{@group invalid in context where filling is enabled}%
549 \fi
550 %
551 % The \vtop we start below produces a box with normal height and large
552 % depth; thus, TeX puts \baselineskip glue before it, and (when the
553 % next line of text is done) \lineskip glue after it. (See p.82 of
554 % the TeXbook.) Thus, space below is not quite equal to space
555 % above. But it's pretty close.
556 \def\Egroup{%
557 \egroup % End the \vtop.
577\def\group{\begingroup
578 \ifnum\catcode13=\active \else
579 \errhelp = \groupinvalidhelp
580 \errmessage{@group invalid in context where filling is enabled}%
581 \fi
582 %
583 % The \vtop we start below produces a box with normal height and large
584 % depth; thus, TeX puts \baselineskip glue before it, and (when the
585 % next line of text is done) \lineskip glue after it. (See p.82 of
586 % the TeXbook.) Thus, space below is not quite equal to space
587 % above. But it's pretty close.
588 \def\Egroup{%
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
558 \endgroup % End the \group.
559 }%
560 %
602 \endgroup % End the \group.
603 }%
604 %
561 \vtop\bgroup
605 \setbox\groupbox = \vtop\bgroup
562 % We have to put a strut on the last line in case the @group is in
563 % the midst of an example, rather than completely enclosing it.
564 % Otherwise, the interline space between the last line of the group
565 % and the first line afterwards is too small. But we can't put the
566 % strut in \Egroup, since there it would be on a line by itself.
567 % Hence this just inserts a strut at the beginning of each line.
568 \everypar = {\strut}%
569 %

--- 108 unchanged lines hidden (view full) ---

678 \hbox to 2em{%
679 \hskip 0pt plus 0.25fil minus 0.25fil
680 .\hss.\hss.\hss.%
681 \hskip 0pt plus 0.5fil minus 0.5fil
682 }%
683 \spacefactor=3000
684}
685
606 % We have to put a strut on the last line in case the @group is in
607 % the midst of an example, rather than completely enclosing it.
608 % Otherwise, the interline space between the last line of the group
609 % and the first line afterwards is too small. But we can't put the
610 % strut in \Egroup, since there it would be on a line by itself.
611 % Hence this just inserts a strut at the beginning of each line.
612 \everypar = {\strut}%
613 %

--- 108 unchanged lines hidden (view full) ---

722 \hbox to 2em{%
723 \hskip 0pt plus 0.25fil minus 0.25fil
724 .\hss.\hss.\hss.%
725 \hskip 0pt plus 0.5fil minus 0.5fil
726 }%
727 \spacefactor=3000
728}
729
686
687% @page forces the start of a new page
730% @page forces the start of a new page.
688%
689\def\page{\par\vfill\supereject}
690
691% @exdent text....
692% outputs text on separate line in roman font, starting at standard page margin
693
694% This records the amount of indent in the innermost environment.
695% That's how much \exdent should take out.

--- 32 unchanged lines hidden (view full) ---

728 }%
729}}
730\def\inleftmargin{\doinmargin l}
731\def\inrightmargin{\doinmargin r}
732%
733% @inmargin{TEXT [, RIGHT-TEXT]}
734% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
735% else use TEXT for both).
731%
732\def\page{\par\vfill\supereject}
733
734% @exdent text....
735% outputs text on separate line in roman font, starting at standard page margin
736
737% This records the amount of indent in the innermost environment.
738% That's how much \exdent should take out.

--- 32 unchanged lines hidden (view full) ---

771 }%
772}}
773\def\inleftmargin{\doinmargin l}
774\def\inrightmargin{\doinmargin r}
775%
776% @inmargin{TEXT [, RIGHT-TEXT]}
777% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
778% else use TEXT for both).
736%
779%
737\def\inmargin#1{\parseinmargin #1,,\finish}
738\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
780\def\inmargin#1{\parseinmargin #1,,\finish}
781\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
739 \setbox0 = \hbox{\ignorespaces #2}%
782 \setbox0 = \hbox{\ignorespaces #2}%
740 \ifdim\wd0 > 0pt
741 \def\lefttext{#1}% have both texts
742 \def\righttext{#2}%
743 \else
744 \def\lefttext{#1}% have only one text
745 \def\righttext{#1}%
746 \fi
747 %
748 \ifodd\pageno
749 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
750 \else
751 \def\temp{\inleftmargin\lefttext}%
752 \fi
753 \temp
754}
755
756% @include file insert text of that file as input.
757% Allow normal characters that we make active in the argument (a file name).
758\def\include{\begingroup
783 \ifdim\wd0 > 0pt
784 \def\lefttext{#1}% have both texts
785 \def\righttext{#2}%
786 \else
787 \def\lefttext{#1}% have only one text
788 \def\righttext{#1}%
789 \fi
790 %
791 \ifodd\pageno
792 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
793 \else
794 \def\temp{\inleftmargin\lefttext}%
795 \fi
796 \temp
797}
798
799% @include file insert text of that file as input.
800% Allow normal characters that we make active in the argument (a file name).
801\def\include{\begingroup
759 \catcode`\\=12
760 \catcode`~=12
761 \catcode`^=12
762 \catcode`_=12
763 \catcode`|=12
764 \catcode`<=12
765 \catcode`>=12
766 \catcode`+=12
802 \catcode`\\=\other
803 \catcode`~=\other
804 \catcode`^=\other
805 \catcode`_=\other
806 \catcode`|=\other
807 \catcode`<=\other
808 \catcode`>=\other
809 \catcode`+=\other
767 \parsearg\includezzz}
768% Restore active chars for included file.
769\def\includezzz#1{\endgroup\begingroup
770 % Read the included file in a group so nested @include's work.
771 \def\thisfile{#1}%
810 \parsearg\includezzz}
811% Restore active chars for included file.
812\def\includezzz#1{\endgroup\begingroup
813 % Read the included file in a group so nested @include's work.
814 \def\thisfile{#1}%
815 \let\value=\expandablevalue
772 \input\thisfile
773\endgroup}
774
775\def\thisfile{}
776
816 \input\thisfile
817\endgroup}
818
819\def\thisfile{}
820
777% @center line outputs that line, centered
821% @center line
822% outputs that line, centered.
823%
824\def\center{\parsearg\docenter}
825\def\docenter#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}}
778
832
779\def\center{\parsearg\centerzzz}
780\def\centerzzz #1{{\advance\hsize by -\leftskip
781\advance\hsize by -\rightskip
782\centerline{#1}}}
783
784% @sp n outputs n lines of vertical space
785
786\def\sp{\parsearg\spxxx}
787\def\spxxx #1{\vskip #1\baselineskip}
788
789% @comment ...line which is ignored...
790% @c is the same as @comment
791% @ignore ... @end ignore is another way to write a comment
792
793\def\comment{\begingroup \catcode`\^^M=\other%
794\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
795\commentxxx}
796{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
797
798\let\c=\comment
799
800% @paragraphindent NCHARS
801% We'll use ems for NCHARS, close enough.
833% @sp n outputs n lines of vertical space
834
835\def\sp{\parsearg\spxxx}
836\def\spxxx #1{\vskip #1\baselineskip}
837
838% @comment ...line which is ignored...
839% @c is the same as @comment
840% @ignore ... @end ignore is another way to write a comment
841
842\def\comment{\begingroup \catcode`\^^M=\other%
843\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
844\commentxxx}
845{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
846
847\let\c=\comment
848
849% @paragraphindent NCHARS
850% We'll use ems for NCHARS, close enough.
802% We cannot implement @paragraphindent asis, though.
803%
851% NCHARS can also be the word `asis' or `none'.
852% We cannot feasibly implement @paragraphindent asis, though.
853%
804\def\asisword{asis} % no translation, these are keywords
805\def\noneword{none}
806%
807\def\paragraphindent{\parsearg\doparagraphindent}
808\def\doparagraphindent#1{%
809 \def\temp{#1}%
810 \ifx\temp\asisword
811 \else

--- 18 unchanged lines hidden (view full) ---

830 \ifx\temp\noneword
831 \lispnarrowing = 0pt
832 \else
833 \lispnarrowing = #1em
834 \fi
835 \fi
836}
837
854\def\asisword{asis} % no translation, these are keywords
855\def\noneword{none}
856%
857\def\paragraphindent{\parsearg\doparagraphindent}
858\def\doparagraphindent#1{%
859 \def\temp{#1}%
860 \ifx\temp\asisword
861 \else

--- 18 unchanged lines hidden (view full) ---

880 \ifx\temp\noneword
881 \lispnarrowing = 0pt
882 \else
883 \lispnarrowing = #1em
884 \fi
885 \fi
886}
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
838% @asis just yields its argument. Used with @table, for example.
839%
840\def\asis#1{#1}
841
842% @math outputs its argument in math mode.
843% We don't use $'s directly in the definition of \math because we need
844% to set catcodes according to plain TeX first, to allow for subscripts,
845% superscripts, special math chars, etc.
935% @asis just yields its argument. Used with @table, for example.
936%
937\def\asis#1{#1}
938
939% @math outputs its argument in math mode.
940% We don't use $'s directly in the definition of \math because we need
941% to set catcodes according to plain TeX first, to allow for subscripts,
942% superscripts, special math chars, etc.
846%
943%
847\let\implicitmath = $%$ font-lock fix
848%
849% One complication: _ usually means subscripts, but it could also mean
850% an actual _ character, as in @math{@var{some_variable} + 1}. So make
851% _ within @math be active (mathcode "8000), and distinguish by seeing
852% if the current family is \slfam, which is what @var uses.
944\let\implicitmath = $%$ font-lock fix
945%
946% One complication: _ usually means subscripts, but it could also mean
947% an actual _ character, as in @math{@var{some_variable} + 1}. So make
948% _ within @math be active (mathcode "8000), and distinguish by seeing
949% if the current family is \slfam, which is what @var uses.
853%
854{\catcode95 = \active % 95 = _
950%
951{\catcode\underChar = \active
855\gdef\mathunderscore{%
952\gdef\mathunderscore{%
856 \catcode95=\active
953 \catcode\underChar=\active
857 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
858}}
859%
860% Another complication: we want \\ (and @\) to output a \ character.
861% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
862% this is not advertised and we don't care. Texinfo does not
863% otherwise define @\.
954 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
955}}
956%
957% Another complication: we want \\ (and @\) to output a \ character.
958% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
959% this is not advertised and we don't care. Texinfo does not
960% otherwise define @\.
864%
961%
865% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
866\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
867%
868\def\math{%
869 \tex
870 \mathcode`\_="8000 \mathunderscore
871 \let\\ = \mathbackslash
872 \mathactive
873 \implicitmath\finishmath}
874\def\finishmath#1{#1\implicitmath\Etex}
875
876% Some active characters (such as <) are spaced differently in math.
877% We have to reset their definitions in case the @math was an
878% argument to a command which set the catcodes (such as @item or @section).
962% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
963\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
964%
965\def\math{%
966 \tex
967 \mathcode`\_="8000 \mathunderscore
968 \let\\ = \mathbackslash
969 \mathactive
970 \implicitmath\finishmath}
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).
879%
976%
880{
881 \catcode`^ = \active
882 \catcode`< = \active
883 \catcode`> = \active
884 \catcode`+ = \active
885 \gdef\mathactive{%
886 \let^ = \ptexhat
887 \let< = \ptexless

--- 109 unchanged lines hidden (view full) ---

997 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
998 \else \csname#1\endcsname \fi}
999 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1000 \advance\tempnum by1
1001 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1002 \def\pdfmakeoutlines{{%
1003 \openin 1 \jobname.toc
1004 \ifeof 1\else\begingroup
977{
978 \catcode`^ = \active
979 \catcode`< = \active
980 \catcode`> = \active
981 \catcode`+ = \active
982 \gdef\mathactive{%
983 \let^ = \ptexhat
984 \let< = \ptexless

--- 109 unchanged lines hidden (view full) ---

1094 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1095 \else \csname#1\endcsname \fi}
1096 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1097 \advance\tempnum by1
1098 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1099 \def\pdfmakeoutlines{{%
1100 \openin 1 \jobname.toc
1101 \ifeof 1\else\begingroup
1005 \closein 1
1006 % Thanh's hack / proper braces in bookmarks
1102 \closein 1
1103 % Thanh's hack / proper braces in bookmarks
1007 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
1008 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1009 %
1010 \def\chapentry ##1##2##3{}
1011 \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
1012 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
1013 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
1014 \let\appendixentry = \chapentry

--- 12 unchanged lines hidden (view full) ---

1027 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
1028 \let\appendixentry = \chapentry
1029 \let\unnumbchapentry = \chapentry
1030 \let\unnumbsecentry = \secentry
1031 \let\unnumbsubsecentry = \subsecentry
1032 \let\unnumbsubsubsecentry = \subsubsecentry
1033 %
1034 % Make special characters normal for writing to the pdf file.
1104 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
1105 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1106 %
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}}
1111 \let\appendixentry = \chapentry

--- 12 unchanged lines hidden (view full) ---

1124 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
1125 \let\appendixentry = \chapentry
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.
1035 %
1132 %
1036 \indexnofonts
1037 \let\tt=\relax
1038 \turnoffactive
1039 \input \jobname.toc
1040 \endgroup\fi
1041 }}
1042 \def\makelinks #1,{%
1043 \def\params{#1}\def\E{END}%
1044 \ifx\params\E
1045 \let\nextmakelinks=\relax
1046 \else
1047 \let\nextmakelinks=\makelinks
1048 \ifnum\lnkcount>0,\fi
1049 \picknum{#1}%
1133 \indexnofonts
1134 \let\tt=\relax
1135 \turnoffactive
1136 \input \jobname.toc
1137 \endgroup\fi
1138 }}
1139 \def\makelinks #1,{%
1140 \def\params{#1}\def\E{END}%
1141 \ifx\params\E
1142 \let\nextmakelinks=\relax
1143 \else
1144 \let\nextmakelinks=\makelinks
1145 \ifnum\lnkcount>0,\fi
1146 \picknum{#1}%
1050 \startlink attr{/Border [0 0 0]}
1147 \startlink attr{/Border [0 0 0]}
1051 goto name{\pdfmkpgn{\the\pgn}}%
1052 \linkcolor #1%
1053 \advance\lnkcount by 1%
1054 \endlink
1055 \fi
1056 \nextmakelinks
1057 }
1058 \def\picknum#1{\expandafter\pn#1}

--- 38 unchanged lines hidden (view full) ---

1097 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1098 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1099 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1100 \def\maketoks{%
1101 \expandafter\poptoks\the\toksA|ENDTOKS|
1102 \ifx\first0\adn0
1103 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1104 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1148 goto name{\pdfmkpgn{\the\pgn}}%
1149 \linkcolor #1%
1150 \advance\lnkcount by 1%
1151 \endlink
1152 \fi
1153 \nextmakelinks
1154 }
1155 \def\picknum#1{\expandafter\pn#1}

--- 38 unchanged lines hidden (view full) ---

1194 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1195 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1196 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1197 \def\maketoks{%
1198 \expandafter\poptoks\the\toksA|ENDTOKS|
1199 \ifx\first0\adn0
1200 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1201 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1105 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1202 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1106 \else
1107 \ifnum0=\countA\else\makelink\fi
1108 \ifx\first.\let\next=\done\else
1109 \let\next=\maketoks
1110 \addtokens{\toksB}{\the\toksD}
1111 \ifx\first,\addtokens{\toksB}{\space}\fi
1112 \fi
1113 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi

--- 74 unchanged lines hidden (view full) ---

1188 \mainmagstep=\magstep1
1189 \setfont\textrm\rmshape{12}{1000}
1190 \setfont\texttt\ttshape{12}{1000}
1191\else
1192 \mainmagstep=\magstephalf
1193 \setfont\textrm\rmshape{10}{\mainmagstep}
1194 \setfont\texttt\ttshape{10}{\mainmagstep}
1195\fi
1203 \else
1204 \ifnum0=\countA\else\makelink\fi
1205 \ifx\first.\let\next=\done\else
1206 \let\next=\maketoks
1207 \addtokens{\toksB}{\the\toksD}
1208 \ifx\first,\addtokens{\toksB}{\space}\fi
1209 \fi
1210 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi

--- 74 unchanged lines hidden (view full) ---

1285 \mainmagstep=\magstep1
1286 \setfont\textrm\rmshape{12}{1000}
1287 \setfont\texttt\ttshape{12}{1000}
1288\else
1289 \mainmagstep=\magstephalf
1290 \setfont\textrm\rmshape{10}{\mainmagstep}
1291 \setfont\texttt\ttshape{10}{\mainmagstep}
1292\fi
1196% Instead of cmb10, you many want to use cmbx10.
1293% Instead of cmb10, you may want to use cmbx10.
1197% cmbx10 is a prettier font on its own, but cmb10
1294% cmbx10 is a prettier font on its own, but cmb10
1198% looks better when embedded in a line with cmr10.
1295% looks better when embedded in a line with cmr10
1296% (in Bob's opinion).
1199\setfont\textbf\bfshape{10}{\mainmagstep}
1200\setfont\textit\itshape{10}{\mainmagstep}
1201\setfont\textsl\slshape{10}{\mainmagstep}
1202\setfont\textsf\sfshape{10}{\mainmagstep}
1203\setfont\textsc\scshape{10}{\mainmagstep}
1204\setfont\textttsl\ttslshape{10}{\mainmagstep}
1205\font\texti=cmmi10 scaled \mainmagstep
1206\font\textsy=cmsy10 scaled \mainmagstep

--- 132 unchanged lines hidden (view full) ---

1339 \let\tenttsl=\smallttsl
1340 \resetmathfonts \setleading{10.5pt}}
1341\def\smallerfonts{%
1342 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
1343 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
1344 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
1345 \let\tenttsl=\smallerttsl
1346 \resetmathfonts \setleading{9.5pt}}
1297\setfont\textbf\bfshape{10}{\mainmagstep}
1298\setfont\textit\itshape{10}{\mainmagstep}
1299\setfont\textsl\slshape{10}{\mainmagstep}
1300\setfont\textsf\sfshape{10}{\mainmagstep}
1301\setfont\textsc\scshape{10}{\mainmagstep}
1302\setfont\textttsl\ttslshape{10}{\mainmagstep}
1303\font\texti=cmmi10 scaled \mainmagstep
1304\font\textsy=cmsy10 scaled \mainmagstep

--- 132 unchanged lines hidden (view full) ---

1437 \let\tenttsl=\smallttsl
1438 \resetmathfonts \setleading{10.5pt}}
1439\def\smallerfonts{%
1440 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
1441 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
1442 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
1443 \let\tenttsl=\smallerttsl
1444 \resetmathfonts \setleading{9.5pt}}
1347\let\smallexamplefonts = \smallerfonts
1348
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
1464
1349% Set up the default fonts, so we can use them for creating boxes.
1350%
1351\textfonts
1352
1353% Define these so they can be easily changed for other fonts.
1354\def\angleleft{$\langle$}
1355\def\angleright{$\rangle$}
1356

--- 6 unchanged lines hidden (view full) ---

1363\setfont\shortcontsl\slshape{12}{1000}
1364\setfont\shortconttt\ttshape{12}{1000}
1365
1366%% Add scribe-like font environments, plus @l for inline lisp (usually sans
1367%% serif) and @ii for TeX italic
1368
1369% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1370% unless the following character is such as not to need one.
1465% Set up the default fonts, so we can use them for creating boxes.
1466%
1467\textfonts
1468
1469% Define these so they can be easily changed for other fonts.
1470\def\angleleft{$\langle$}
1471\def\angleright{$\rangle$}
1472

--- 6 unchanged lines hidden (view full) ---

1479\setfont\shortcontsl\slshape{12}{1000}
1480\setfont\shortconttt\ttshape{12}{1000}
1481
1482%% Add scribe-like font environments, plus @l for inline lisp (usually sans
1483%% serif) and @ii for TeX italic
1484
1485% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1486% unless the following character is such as not to need one.
1371\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
1488 \ptexslash\fi\fi\fi}
1372\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
1373\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
1374
1375\let\i=\smartitalic
1376\let\var=\smartslanted
1377\let\dfn=\smartslanted
1378\let\emph=\smartitalic
1379\let\cite=\smartslanted
1380
1381\def\b#1{{\bf #1}}
1382\let\strong=\b
1383
1384% We can't just use \exhyphenpenalty, because that only has effect at
1385% the end of a paragraph. Restore normal hyphenation at the end of the
1386% group within which \nohyphenation is presumably called.
1387%
1388\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
1389\def\restorehyphenation{\hyphenchar\font = `- }
1390
1489\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
1490\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
1491
1492\let\i=\smartitalic
1493\let\var=\smartslanted
1494\let\dfn=\smartslanted
1495\let\emph=\smartitalic
1496\let\cite=\smartslanted
1497
1498\def\b#1{{\bf #1}}
1499\let\strong=\b
1500
1501% We can't just use \exhyphenpenalty, because that only has effect at
1502% the end of a paragraph. Restore normal hyphenation at the end of the
1503% group within which \nohyphenation is presumably called.
1504%
1505\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
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
1518
1391\def\t#1{%
1392 {\tt \rawbackslash \frenchspacing #1}%
1393 \null
1394}
1395\let\ttfont=\t
1396\def\samp#1{`\tclose{#1}'\null}
1397\setfont\keyrm\rmshape{8}{1000}
1398\font\keysy=cmsy9

--- 83 unchanged lines hidden (view full) ---

1482\def\kbdinputstylexxx#1{%
1483 \def\arg{#1}%
1484 \ifx\arg\worddistinct
1485 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1486 \else\ifx\arg\wordexample
1487 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1488 \else\ifx\arg\wordcode
1489 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1519\def\t#1{%
1520 {\tt \rawbackslash \frenchspacing #1}%
1521 \null
1522}
1523\let\ttfont=\t
1524\def\samp#1{`\tclose{#1}'\null}
1525\setfont\keyrm\rmshape{8}{1000}
1526\font\keysy=cmsy9

--- 83 unchanged lines hidden (view full) ---

1610\def\kbdinputstylexxx#1{%
1611 \def\arg{#1}%
1612 \ifx\arg\worddistinct
1613 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1614 \else\ifx\arg\wordexample
1615 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1616 \else\ifx\arg\wordcode
1617 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1618 \else
1619 \errhelp = \EMsimple
1620 \errmessage{Unknown @kbdinputstyle option `\arg'}%
1490 \fi\fi\fi
1491}
1492\def\worddistinct{distinct}
1493\def\wordexample{example}
1494\def\wordcode{code}
1495
1621 \fi\fi\fi
1622}
1623\def\worddistinct{distinct}
1624\def\wordexample{example}
1625\def\wordcode{code}
1626
1496% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1497% the catcodes are wrong for parsearg to work.)
1498\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1627% Default is `distinct.'
1628\kbdinputstyle distinct
1499
1500\def\xkey{\key}
1501\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1502\ifx\one\xkey\ifx\threex\three \key{#2}%
1503\else{\tclose{\kbdfont\look}}\fi
1504\else{\tclose{\kbdfont\look}}\fi}
1505
1506% For @url, @env, @command quotes seem unnecessary, so use \code.

--- 26 unchanged lines hidden (view full) ---

1533 \code{#1}% only url given, so show it
1534 \fi
1535 \fi
1536 \endlink
1537\endgroup}
1538
1539% rms does not like angle brackets --karl, 17may97.
1540% So now @email is just like @uref, unless we are pdf.
1629
1630\def\xkey{\key}
1631\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1632\ifx\one\xkey\ifx\threex\three \key{#2}%
1633\else{\tclose{\kbdfont\look}}\fi
1634\else{\tclose{\kbdfont\look}}\fi}
1635
1636% For @url, @env, @command quotes seem unnecessary, so use \code.

--- 26 unchanged lines hidden (view full) ---

1663 \code{#1}% only url given, so show it
1664 \fi
1665 \fi
1666 \endlink
1667\endgroup}
1668
1669% rms does not like angle brackets --karl, 17may97.
1670% So now @email is just like @uref, unless we are pdf.
1541%
1671%
1542%\def\email#1{\angleleft{\tt #1}\angleright}
1543\ifpdf
1544 \def\email#1{\doemail#1,,\finish}
1545 \def\doemail#1,#2,#3\finish{\begingroup
1546 \unsepspaces
1547 \pdfurl{mailto:#1}%
1548 \setbox0 = \hbox{\ignorespaces #2}%
1549 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi

--- 28 unchanged lines hidden (view full) ---

1578\def\ii#1{{\it #1}} % italic font
1579
1580% @acronym downcases the argument and prints in smallcaps.
1581\def\acronym#1{{\smallcaps \lowercase{#1}}}
1582
1583% @pounds{} is a sterling sign.
1584\def\pounds{{\it\$}}
1585
1672%\def\email#1{\angleleft{\tt #1}\angleright}
1673\ifpdf
1674 \def\email#1{\doemail#1,,\finish}
1675 \def\doemail#1,#2,#3\finish{\begingroup
1676 \unsepspaces
1677 \pdfurl{mailto:#1}%
1678 \setbox0 = \hbox{\ignorespaces #2}%
1679 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi

--- 28 unchanged lines hidden (view full) ---

1708\def\ii#1{{\it #1}} % italic font
1709
1710% @acronym downcases the argument and prints in smallcaps.
1711\def\acronym#1{{\smallcaps \lowercase{#1}}}
1712
1713% @pounds{} is a sterling sign.
1714\def\pounds{{\it\$}}
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}
1586
1725
1726
1587\message{page headings,}
1588
1589\newskip\titlepagetopglue \titlepagetopglue = 1.5in
1590\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1591
1592% First the title page. Must do @settitle before @titlepage.
1593\newif\ifseenauthor
1594\newif\iffinishedtitlepage

--- 395 unchanged lines hidden (view full) ---

1990
1991\def\itemize{\parsearg\itemizezzz}
1992
1993\def\itemizezzz #1{%
1994 \begingroup % ended by the @end itemize
1995 \itemizey {#1}{\Eitemize}
1996}
1997
1727\message{page headings,}
1728
1729\newskip\titlepagetopglue \titlepagetopglue = 1.5in
1730\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1731
1732% First the title page. Must do @settitle before @titlepage.
1733\newif\ifseenauthor
1734\newif\iffinishedtitlepage

--- 395 unchanged lines hidden (view full) ---

2130
2131\def\itemize{\parsearg\itemizezzz}
2132
2133\def\itemizezzz #1{%
2134 \begingroup % ended by the @end itemize
2135 \itemizey {#1}{\Eitemize}
2136}
2137
1998\def\itemizey #1#2{%
1999\aboveenvbreak %
2000\itemmax=\itemindent %
2001\advance \itemmax by -\itemmargin %
2002\advance \leftskip by \itemindent %
2003\exdentamount=\itemindent
2004\parindent = 0pt %
2005\parskip = \smallskipamount %
2006\ifdim \parskip=0pt \parskip=2pt \fi%
2007\def#2{\endgraf\afterenvbreak\endgroup}%
2008\def\itemcontents{#1}%
2009\let\item=\itemizeitem}
2138\def\itemizey#1#2{%
2139 \aboveenvbreak
2140 \itemmax=\itemindent
2141 \advance\itemmax by -\itemmargin
2142 \advance\leftskip by \itemindent
2143 \exdentamount=\itemindent
2144 \parindent=0pt
2145 \parskip=\smallskipamount
2146 \ifdim\parskip=0pt \parskip=2pt \fi
2147 \def#2{\endgraf\afterenvbreak\endgroup}%
2148 \def\itemcontents{#1}%
2149 % @itemize with no arg is equivalent to @itemize @bullet.
2150 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
2151 \let\item=\itemizeitem
2152}
2010
2153
2011% Set sfcode to normal for the chars that usually have another value.
2012% These are `.?!:;,'
2013\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
2014 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
2015
2016% \splitoff TOKENS\endmark defines \first to be the first token in
2017% TOKENS, and \rest to be the remainder.
2018%
2019\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
2020
2021% Allow an optional argument of an uppercase letter, lowercase letter,
2022% or number, to specify the first label in the enumerated list. No
2023% argument is the same as `1'.

--- 205 unchanged lines hidden (view full) ---

2229 \else
2230 \ifx\firstarg\xcolumnfractions
2231 \global\setpercenttrue
2232 \else
2233 \ifsetpercent
2234 \let\go\pickupwholefraction
2235 \else
2236 \global\advance\colcount by 1
2154% \splitoff TOKENS\endmark defines \first to be the first token in
2155% TOKENS, and \rest to be the remainder.
2156%
2157\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
2158
2159% Allow an optional argument of an uppercase letter, lowercase letter,
2160% or number, to specify the first label in the enumerated list. No
2161% argument is the same as `1'.

--- 205 unchanged lines hidden (view full) ---

2367 \else
2368 \ifx\firstarg\xcolumnfractions
2369 \global\setpercenttrue
2370 \else
2371 \ifsetpercent
2372 \let\go\pickupwholefraction
2373 \else
2374 \global\advance\colcount by 1
2237 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
2238 % typically that is always in the input, anyway.
2375 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
2376 % separator; typically that is always in the input, anyway.
2239 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
2240 \fi
2241 \fi
2242 \ifx\go\pickupwholefraction
2243 % Put the argument back for the \pickupwholefraction call, so
2244 % we'll always have a period there to be parsed.
2245 \def\go{\pickupwholefraction#1}%
2246 \else
2247 \let\go = \setuptable
2248 \fi%
2249 \fi
2250 \go
2251}
2252
2377 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
2378 \fi
2379 \fi
2380 \ifx\go\pickupwholefraction
2381 % Put the argument back for the \pickupwholefraction call, so
2382 % we'll always have a period there to be parsed.
2383 \def\go{\pickupwholefraction#1}%
2384 \else
2385 \let\go = \setuptable
2386 \fi%
2387 \fi
2388 \go
2389}
2390
2253% This used to have \hskip1sp. But then the space in a template line is
2254% not enough. That is bad. So let's go back to just & until we
2255% encounter the problem it was intended to solve again.
2256% --karl, nathan@acm.org, 20apr99.
2257\def\tab{&}
2258
2259% @multitable ... @end multitable definitions:
2260%
2261\def\multitable{\parsearg\dotable}
2262\def\dotable#1{\bgroup
2263 \vskip\parskip
2391% @multitable ... @end multitable definitions:
2392%
2393\def\multitable{\parsearg\dotable}
2394\def\dotable#1{\bgroup
2395 \vskip\parskip
2264 \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
2265 \tolerance=9500
2266 \hbadness=9500
2267 \setmultitablespacing
2268 \parskip=\multitableparskip
2269 \parindent=\multitableparindent
2270 \overfullrule=0pt
2271 \global\colcount=0
2403 \tolerance=9500
2404 \hbadness=9500
2405 \setmultitablespacing
2406 \parskip=\multitableparskip
2407 \parindent=\multitableparindent
2408 \overfullrule=0pt
2409 \global\colcount=0
2272 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
2410 \def\Emultitable{%
2411 \global\setpercentfalse
2412 \crcrwithfootnotes\crcr
2413 \egroup\egroup
2414 }%
2273 %
2274 % To parse everything between @multitable and @item:
2275 \setuptable#1 \endsetuptable
2276 %
2277 % \everycr will reset column counter, \colcount, at the end of
2278 % each line. Every column entry will cause \colcount to advance by one.
2279 % The table preamble
2280 % looks at the current \colcount to find the correct column width.

--- 72 unchanged lines hidden (view full) ---

2353 %% than skip between lines in the table.
2354\fi%
2355\ifdim\multitableparskip=0pt
2356\global\multitableparskip=\multitablelinespace
2357\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2358 %% than skip between lines in the table.
2359\fi}
2360
2415 %
2416 % To parse everything between @multitable and @item:
2417 \setuptable#1 \endsetuptable
2418 %
2419 % \everycr will reset column counter, \colcount, at the end of
2420 % each line. Every column entry will cause \colcount to advance by one.
2421 % The table preamble
2422 % looks at the current \colcount to find the correct column width.

--- 72 unchanged lines hidden (view full) ---

2495 %% than skip between lines in the table.
2496\fi%
2497\ifdim\multitableparskip=0pt
2498\global\multitableparskip=\multitablelinespace
2499\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2500 %% than skip between lines in the table.
2501\fi}
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}
2361
2362\message{conditionals,}
2363% Prevent errors for section commands.
2364% Used in @ignore and in failing conditionals.
2365\def\ignoresections{%
2366 \let\chapter=\relax
2367 \let\unnumbered=\relax
2368 \let\top=\relax

--- 19 unchanged lines hidden (view full) ---

2388 \let\smallbook=\relax
2389 \let\titlepage=\relax
2390}
2391
2392% Used in nested conditionals, where we have to parse the Texinfo source
2393% and so want to turn off most commands, in case they are used
2394% incorrectly.
2395%
2522
2523\message{conditionals,}
2524% Prevent errors for section commands.
2525% Used in @ignore and in failing conditionals.
2526\def\ignoresections{%
2527 \let\chapter=\relax
2528 \let\unnumbered=\relax
2529 \let\top=\relax

--- 19 unchanged lines hidden (view full) ---

2549 \let\smallbook=\relax
2550 \let\titlepage=\relax
2551}
2552
2553% Used in nested conditionals, where we have to parse the Texinfo source
2554% and so want to turn off most commands, in case they are used
2555% incorrectly.
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%
2396\def\ignoremorecommands{%
2397 \let\defcodeindex = \relax
2569\def\ignoremorecommands{%
2570 \let\defcodeindex = \relax
2398 \let\defcv = \relax
2399 \let\deffn = \relax
2400 \let\deffnx = \relax
2571 \let\defcv = \empty
2572 \let\defcvx = \empty
2573 \let\Edefcv = \empty
2574 \let\deffn = \empty
2575 \let\deffnx = \empty
2576 \let\Edeffn = \empty
2401 \let\defindex = \relax
2577 \let\defindex = \relax
2402 \let\defivar = \relax
2403 \let\defmac = \relax
2404 \let\defmethod = \relax
2405 \let\defop = \relax
2406 \let\defopt = \relax
2407 \let\defspec = \relax
2408 \let\deftp = \relax
2409 \let\deftypefn = \relax
2410 \let\deftypefun = \relax
2411 \let\deftypeivar = \relax
2412 \let\deftypeop = \relax
2413 \let\deftypevar = \relax
2414 \let\deftypevr = \relax
2415 \let\defun = \relax
2416 \let\defvar = \relax
2417 \let\defvr = \relax
2418 \let\ref = \relax
2419 \let\xref = \relax
2420 \let\printindex = \relax
2421 \let\pxref = \relax
2422 \let\settitle = \relax
2423 \let\setchapternewpage = \relax
2424 \let\setchapterstyle = \relax
2425 \let\everyheading = \relax
2578 \let\defivar = \empty
2579 \let\defivarx = \empty
2580 \let\Edefivar = \empty
2581 \let\defmac = \empty
2582 \let\defmacx = \empty
2583 \let\Edefmac = \empty
2584 \let\defmethod = \empty
2585 \let\defmethodx = \empty
2586 \let\Edefmethod = \empty
2587 \let\defop = \empty
2588 \let\defopx = \empty
2589 \let\Edefop = \empty
2590 \let\defopt = \empty
2591 \let\defoptx = \empty
2592 \let\Edefopt = \empty
2593 \let\defspec = \empty
2594 \let\defspecx = \empty
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
2426 \let\evenheading = \relax
2632 \let\evenheading = \relax
2427 \let\oddheading = \relax
2428 \let\everyfooting = \relax
2633 \let\everyfooting = \relax
2429 \let\evenfooting = \relax
2430 \let\oddfooting = \relax
2634 \let\everyheading = \relax
2431 \let\headings = \relax
2432 \let\include = \relax
2635 \let\headings = \relax
2636 \let\include = \relax
2637 \let\item = \relax
2433 \let\lowersections = \relax
2638 \let\lowersections = \relax
2434 \let\down = \relax
2639 \let\oddfooting = \relax
2640 \let\oddheading = \relax
2641 \let\printindex = \relax
2642 \let\pxref = \relax
2435 \let\raisesections = \relax
2643 \let\raisesections = \relax
2436 \let\up = \relax
2644 \let\ref = \relax
2437 \let\set = \relax
2645 \let\set = \relax
2438 \let\clear = \relax
2439 \let\item = \relax
2646 \let\setchapternewpage = \relax
2647 \let\setchapterstyle = \relax
2648 \let\settitle = \relax
2649 \let\up = \relax
2650 \let\verbatiminclude = \relax
2651 \let\xref = \relax
2440}
2441
2442% Ignore @ignore, @ifhtml, @ifinfo, and the like.
2443%
2444\def\direntry{\doignore{direntry}}
2445\def\documentdescriptionword{documentdescription}
2446\def\documentdescription{\doignore{documentdescription}}
2447\def\html{\doignore{html}}

--- 17 unchanged lines hidden (view full) ---

2465 \ignoresections
2466 %
2467 % Define a command to swallow text until we reach `@end #1'.
2468 % This @ is a catcode 12 token (that is the normal catcode of @ in
2469 % this texinfo.tex file). We change the catcode of @ below to match.
2470 \long\def\doignoretext##1@end #1{\enddoignore}%
2471 %
2472 % Make sure that spaces turn into tokens that match what \doignoretext wants.
2652}
2653
2654% Ignore @ignore, @ifhtml, @ifinfo, and the like.
2655%
2656\def\direntry{\doignore{direntry}}
2657\def\documentdescriptionword{documentdescription}
2658\def\documentdescription{\doignore{documentdescription}}
2659\def\html{\doignore{html}}

--- 17 unchanged lines hidden (view full) ---

2677 \ignoresections
2678 %
2679 % Define a command to swallow text until we reach `@end #1'.
2680 % This @ is a catcode 12 token (that is the normal catcode of @ in
2681 % this texinfo.tex file). We change the catcode of @ below to match.
2682 \long\def\doignoretext##1@end #1{\enddoignore}%
2683 %
2684 % Make sure that spaces turn into tokens that match what \doignoretext wants.
2473 \catcode32 = 10
2685 \catcode\spaceChar = 10
2474 %
2475 % Ignore braces, too, so mismatched braces don't cause trouble.
2476 \catcode`\{ = 9
2477 \catcode`\} = 9
2478 %
2479 % We must not have @c interpreted as a control sequence.
2480 \catcode`\@ = 12
2481 %

--- 48 unchanged lines hidden (view full) ---

2530% purposes of nesting, up to an `@end #1' command.
2531%
2532\def\nestedignore#1{%
2533 \obstexwarn
2534 % We must actually expand the ignored text to look for the @end
2535 % command, so that nested ignore constructs work. Thus, we put the
2536 % text into a \vbox and then do nothing with the result. To minimize
2537 % the chance of memory overflow, we follow the approach outlined on
2686 %
2687 % Ignore braces, too, so mismatched braces don't cause trouble.
2688 \catcode`\{ = 9
2689 \catcode`\} = 9
2690 %
2691 % We must not have @c interpreted as a control sequence.
2692 \catcode`\@ = 12
2693 %

--- 48 unchanged lines hidden (view full) ---

2742% purposes of nesting, up to an `@end #1' command.
2743%
2744\def\nestedignore#1{%
2745 \obstexwarn
2746 % We must actually expand the ignored text to look for the @end
2747 % command, so that nested ignore constructs work. Thus, we put the
2748 % text into a \vbox and then do nothing with the result. To minimize
2749 % the chance of memory overflow, we follow the approach outlined on
2538 % page 401 of the TeXbook: make the current font be a dummy font.
2750 % page 401 of the TeXbook.
2539 %
2540 \setbox0 = \vbox\bgroup
2541 % Don't complain about control sequences we have declared \outer.
2542 \ignoresections
2543 %
2544 % Define `@end #1' to end the box, which will in turn undefine the
2545 % @end command again.
2546 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%

--- 4 unchanged lines hidden (view full) ---

2551 % undefine them.
2552 %
2553 % We can't do anything about stray @-signs, unfortunately;
2554 % they'll produce `undefined control sequence' errors.
2555 \ignoremorecommands
2556 %
2557 % Set the current font to be \nullfont, a TeX primitive, and define
2558 % all the font commands to also use \nullfont. We don't use
2751 %
2752 \setbox0 = \vbox\bgroup
2753 % Don't complain about control sequences we have declared \outer.
2754 \ignoresections
2755 %
2756 % Define `@end #1' to end the box, which will in turn undefine the
2757 % @end command again.
2758 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%

--- 4 unchanged lines hidden (view full) ---

2763 % undefine them.
2764 %
2765 % We can't do anything about stray @-signs, unfortunately;
2766 % they'll produce `undefined control sequence' errors.
2767 \ignoremorecommands
2768 %
2769 % Set the current font to be \nullfont, a TeX primitive, and define
2770 % all the font commands to also use \nullfont. We don't use
2559 % dummy.tfm, as suggested in the TeXbook, because not all sites
2560 % might have that installed. Therefore, math mode will still
2771 % dummy.tfm, as suggested in the TeXbook, because some sites
2772 % might not have that installed. Therefore, math mode will still
2561 % produce output, but that should be an extremely small amount of
2562 % stuff compared to the main input.
2563 %
2564 \nullfont
2565 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
2566 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
2567 \let\tensf=\nullfont
2568 % Similarly for index fonts.

--- 57 unchanged lines hidden (view full) ---

2626% @value{foo} gets the text saved in variable foo.
2627{
2628 \catcode`\_ = \active
2629 %
2630 % We might end up with active _ or - characters in the argument if
2631 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
2632 % such active characters to their normal equivalents.
2633 \gdef\value{\begingroup
2773 % produce output, but that should be an extremely small amount of
2774 % stuff compared to the main input.
2775 %
2776 \nullfont
2777 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
2778 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
2779 \let\tensf=\nullfont
2780 % Similarly for index fonts.

--- 57 unchanged lines hidden (view full) ---

2838% @value{foo} gets the text saved in variable foo.
2839{
2840 \catcode`\_ = \active
2841 %
2842 % We might end up with active _ or - characters in the argument if
2843 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
2844 % such active characters to their normal equivalents.
2845 \gdef\value{\begingroup
2634 \catcode`\-=12 \catcode`\_=12
2846 \catcode`\-=\other \catcode`\_=\other
2635 \indexbreaks \let_\normalunderscore
2636 \valuexxx}
2637}
2638\def\valuexxx#1{\expandablevalue{#1}\endgroup}
2639
2640% We have this subroutine so that we can handle at least some @value's
2641% properly in indexes (we \let\value to this in \indexdummies). Ones
2642% whose names contain - or _ still won't work, but we can't do anything
2847 \indexbreaks \let_\normalunderscore
2848 \valuexxx}
2849}
2850\def\valuexxx#1{\expandablevalue{#1}\endgroup}
2851
2852% We have this subroutine so that we can handle at least some @value's
2853% properly in indexes (we \let\value to this in \indexdummies). Ones
2854% whose names contain - or _ still won't work, but we can't do anything
2643% about that. The command has to be fully expandable, since the result
2644% winds up in the index file. This means that if the variable's value
2645% contains other Texinfo commands, it's almost certain it will fail
2646% (although perhaps we could fix that with sufficient work to do a
2647% one-level expansion on the result, instead of complete).
2855% about that. The command has to be fully expandable (if the variable
2856% is set), since the result winds up in the index file. This means that
2857% if the variable's value contains other Texinfo commands, it's almost
2858% certain it will fail (although perhaps we could fix that with
2859% sufficient work to do a one-level expansion on the result, instead of
2860% complete).
2648%
2649\def\expandablevalue#1{%
2650 \expandafter\ifx\csname SET#1\endcsname\relax
2651 {[No value for ``#1'']}%
2861%
2862\def\expandablevalue#1{%
2863 \expandafter\ifx\csname SET#1\endcsname\relax
2864 {[No value for ``#1'']}%
2865 \message{Variable `#1', used in @value, is not set.}%
2652 \else
2653 \csname SET#1\endcsname
2654 \fi
2655}
2656
2657% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
2658% with @set.
2659%
2866 \else
2867 \csname SET#1\endcsname
2868 \fi
2869}
2870
2871% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
2872% with @set.
2873%
2660\def\ifset{\parsearg\ifsetxxx}
2661\def\ifsetxxx #1{%
2874\def\ifset{\parsearg\doifset}
2875\def\doifset#1{%
2662 \expandafter\ifx\csname SET#1\endcsname\relax
2876 \expandafter\ifx\csname SET#1\endcsname\relax
2663 \expandafter\ifsetfail
2877 \let\next=\ifsetfail
2664 \else
2878 \else
2665 \expandafter\ifsetsucceed
2879 \let\next=\ifsetsucceed
2666 \fi
2880 \fi
2881 \next
2667}
2668\def\ifsetsucceed{\conditionalsucceed{ifset}}
2669\def\ifsetfail{\nestedignore{ifset}}
2670\defineunmatchedend{ifset}
2671
2672% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
2673% defined with @set, or has been undefined with @clear.
2674%
2882}
2883\def\ifsetsucceed{\conditionalsucceed{ifset}}
2884\def\ifsetfail{\nestedignore{ifset}}
2885\defineunmatchedend{ifset}
2886
2887% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
2888% defined with @set, or has been undefined with @clear.
2889%
2675\def\ifclear{\parsearg\ifclearxxx}
2676\def\ifclearxxx #1{%
2890\def\ifclear{\parsearg\doifclear}
2891\def\doifclear#1{%
2677 \expandafter\ifx\csname SET#1\endcsname\relax
2892 \expandafter\ifx\csname SET#1\endcsname\relax
2678 \expandafter\ifclearsucceed
2893 \let\next=\ifclearsucceed
2679 \else
2894 \else
2680 \expandafter\ifclearfail
2895 \let\next=\ifclearfail
2681 \fi
2896 \fi
2897 \next
2682}
2683\def\ifclearsucceed{\conditionalsucceed{ifclear}}
2684\def\ifclearfail{\nestedignore{ifclear}}
2685\defineunmatchedend{ifclear}
2686
2687% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
2688% read the text following, through the first @end iftex (etc.). Make
2689% `@end iftex' (etc.) valid only after an @iftex.
2690%
2691\def\iftex{\conditionalsucceed{iftex}}
2692\def\ifnothtml{\conditionalsucceed{ifnothtml}}
2693\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
2694\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
2695\defineunmatchedend{iftex}
2696\defineunmatchedend{ifnothtml}
2697\defineunmatchedend{ifnotinfo}
2698\defineunmatchedend{ifnotplaintext}
2699
2898}
2899\def\ifclearsucceed{\conditionalsucceed{ifclear}}
2900\def\ifclearfail{\nestedignore{ifclear}}
2901\defineunmatchedend{ifclear}
2902
2903% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
2904% read the text following, through the first @end iftex (etc.). Make
2905% `@end iftex' (etc.) valid only after an @iftex.
2906%
2907\def\iftex{\conditionalsucceed{iftex}}
2908\def\ifnothtml{\conditionalsucceed{ifnothtml}}
2909\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
2910\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
2911\defineunmatchedend{iftex}
2912\defineunmatchedend{ifnothtml}
2913\defineunmatchedend{ifnotinfo}
2914\defineunmatchedend{ifnotplaintext}
2915
2700% We can't just want to start a group at @iftex (etc.) and end it at
2701% @end iftex, since then @set commands inside the conditional have no
2702% effect (they'd get reverted at the end of the group). So we must
2703% define \Eiftex to redefine itself to be its previous value. (We can't
2704% just define it to fail again with an ``unmatched end'' error, since
2705% the @ifset might be nested.)
2916% True conditional. Since \set globally defines its variables, we can
2917% just start and end a group (to keep the @end definition undefined at
2918% the outer level).
2706%
2919%
2707\def\conditionalsucceed#1{%
2708 \edef\temp{%
2709 % Remember the current value of \E#1.
2710 \let\nece{prevE#1} = \nece{E#1}%
2711 %
2712 % At the `@end #1', redefine \E#1 to be its previous value.
2713 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
2714 }%
2715 \temp
2920\def\conditionalsucceed#1{\begingroup
2921 \expandafter\def\csname E#1\endcsname{\endgroup}%
2716}
2717
2922}
2923
2718% We need to expand lots of \csname's, but we don't want to expand the
2719% control sequences after we've constructed them.
2720%
2721\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
2722
2723% @defininfoenclose.
2724\let\definfoenclose=\comment
2725
2726
2727\message{indexing,}
2728% Index generation facilities
2729
2730% Define \newwrite to be identical to plain tex's \newwrite

--- 33 unchanged lines hidden (view full) ---

2764 \fi
2765 \expandafter\xdef\csname#1index\endcsname{%
2766 \noexpand\docodeindex{#1}}%
2767}
2768
2769
2770% @synindex foo bar makes index foo feed into index bar.
2771% Do this instead of @defindex foo if you don't want it as a separate index.
2924% @defininfoenclose.
2925\let\definfoenclose=\comment
2926
2927
2928\message{indexing,}
2929% Index generation facilities
2930
2931% Define \newwrite to be identical to plain tex's \newwrite

--- 33 unchanged lines hidden (view full) ---

2965 \fi
2966 \expandafter\xdef\csname#1index\endcsname{%
2967 \noexpand\docodeindex{#1}}%
2968}
2969
2970
2971% @synindex foo bar makes index foo feed into index bar.
2972% Do this instead of @defindex foo if you don't want it as a separate index.
2772%
2973%
2773% @syncodeindex foo bar similar, but put all entries made for index foo
2774% inside @code.
2974% @syncodeindex foo bar similar, but put all entries made for index foo
2975% inside @code.
2775%
2976%
2776\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
2777\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
2778
2779% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
2780% #3 the target index (bar).
2781\def\dosynindex#1#2#3{%
2782 % Only do \closeout if we haven't already done it, else we'll end up
2783 % closing the target index.

--- 22 unchanged lines hidden (view full) ---

2806
2807\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2808\def\singleindexer #1{\doind{\indexname}{#1}}
2809
2810% like the previous two, but they put @code around the argument.
2811\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2812\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2813
2977\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
2978\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
2979
2980% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
2981% #3 the target index (bar).
2982\def\dosynindex#1#2#3{%
2983 % Only do \closeout if we haven't already done it, else we'll end up
2984 % closing the target index.

--- 22 unchanged lines hidden (view full) ---

3007
3008\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
3009\def\singleindexer #1{\doind{\indexname}{#1}}
3010
3011% like the previous two, but they put @code around the argument.
3012\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
3013\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
3014
2814% Take care of texinfo commands likely to appear in an index entry.
2815% (Must be a way to avoid doing expansion at all, and thus not have to
2816% laboriously list every single command here.)
2817%
3015% Take care of Texinfo commands that can appear in an index entry.
3016% Since there are some commands we want to expand, and others we don't,
3017% we have to laboriously prevent expansion for those that we don't.
3018%
2818\def\indexdummies{%
3019\def\indexdummies{%
2819\def\ { }%
2820\def\@{@}% change to @@ when we switch to @ as escape char in aux files.
2821% Need these in case \tex is in effect and \{ is a \delimiter again.
2822% But can't use \lbracecmd and \rbracecmd because texindex assumes
2823% braces and backslashes are used only as delimiters.
2824\let\{ = \mylbrace
2825\let\} = \myrbrace
2826\def\_{{\realbackslash _}}%
2827\normalturnoffactive
3020 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
3021 \def\ {\realbackslash\space }%
3022 % Need these in case \tex is in effect and \{ is a \delimiter again.
3023 % But can't use \lbracecmd and \rbracecmd because texindex assumes
3024 % braces and backslashes are used only as delimiters.
3025 \let\{ = \mylbrace
3026 \let\} = \myrbrace
3027 %
3028 % \definedummyword defines \#1 as \realbackslash #1\space, thus
3029 % effectively preventing its expansion. This is used only for control
3030 % words, not control letters, because the \space would be incorrect
3031 % for control characters, but is needed to separate the control word
3032 % from whatever follows.
3033 %
3034 % For control letters, we have \definedummyletter, which omits the
3035 % space.
3036 %
3037 % These can be used both for control words that take an argument and
3038 % those that do not. If it is followed by {arg} in the input, then
3039 % that will dutifully get written to the index (or wherever).
3040 %
3041 \def\definedummyword##1{%
3042 \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
3043 }%
3044 \def\definedummyletter##1{%
3045 \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
3046 }%
3047 %
3048 % Do the redefinitions.
3049 \commondummies
3050}
3051
3052% For the aux file, @ is the escape character. So we want to redefine
3053% everything using @ instead of \realbackslash. When everything uses
3054% @, this will be simpler.
2828%
3055%
2829% Take care of the plain tex accent commands.
2830\def\,##1{\realbackslash ,{##1}}%
2831\def\"{\realbackslash "}%
2832\def\`{\realbackslash `}%
2833\def\'{\realbackslash '}%
2834\def\^{\realbackslash ^}%
2835\def\~{\realbackslash ~}%
2836\def\={\realbackslash =}%
2837\def\b{\realbackslash b}%
2838\def\c{\realbackslash c}%
2839\def\d{\realbackslash d}%
2840\def\u{\realbackslash u}%
2841\def\v{\realbackslash v}%
2842\def\H{\realbackslash H}%
2843\def\dotless##1{\realbackslash dotless {##1}}%
2844% Take care of the plain tex special European modified letters.
2845\def\AA{\realbackslash AA}%
2846\def\AE{\realbackslash AE}%
2847\def\L{\realbackslash L}%
2848\def\OE{\realbackslash OE}%
2849\def\O{\realbackslash O}%
2850\def\aa{\realbackslash aa}%
2851\def\ae{\realbackslash ae}%
2852\def\l{\realbackslash l}%
2853\def\oe{\realbackslash oe}%
2854\def\o{\realbackslash o}%
2855\def\ss{\realbackslash ss}%
3056\def\atdummies{%
3057 \def\@{@@}%
3058 \def\ {@ }%
3059 \let\{ = \lbraceatcmd
3060 \let\} = \rbraceatcmd
3061 %
3062 % (See comments in \indexdummies.)
3063 \def\definedummyword##1{%
3064 \expandafter\def\csname ##1\endcsname{@##1\space}%
3065 }%
3066 \def\definedummyletter##1{%
3067 \expandafter\def\csname ##1\endcsname{@##1}%
3068 }%
3069 %
3070 % Do the redefinitions.
3071 \commondummies
3072}
3073
3074% Called from \indexdummies and \atdummies. \definedummyword and
3075% \definedummyletter must be defined first.
2856%
3076%
2857% Although these internals commands shouldn't show up, sometimes they do.
2858\def\bf{\realbackslash bf }%
2859\def\gtr{\realbackslash gtr}%
2860\def\hat{\realbackslash hat}%
2861\def\less{\realbackslash less}%
2862%\def\rm{\realbackslash rm }%
2863\def\sf{\realbackslash sf}%
2864\def\sl{\realbackslash sl }%
2865\def\tclose##1{\realbackslash tclose {##1}}%
2866\def\tt{\realbackslash tt}%
2867%
2868\def\b##1{\realbackslash b {##1}}%
2869\def\i##1{\realbackslash i {##1}}%
2870\def\sc##1{\realbackslash sc {##1}}%
2871\def\t##1{\realbackslash t {##1}}%
2872\def\r##1{\realbackslash r {##1}}%
2873%
2874\def\TeX{\realbackslash TeX}%
2875\def\acronym##1{\realbackslash acronym {##1}}%
2876\def\cite##1{\realbackslash cite {##1}}%
2877\def\code##1{\realbackslash code {##1}}%
2878\def\command##1{\realbackslash command {##1}}%
2879\def\dfn##1{\realbackslash dfn {##1}}%
2880\def\dots{\realbackslash dots }%
2881\def\emph##1{\realbackslash emph {##1}}%
2882\def\env##1{\realbackslash env {##1}}%
2883\def\file##1{\realbackslash file {##1}}%
2884\def\kbd##1{\realbackslash kbd {##1}}%
2885\def\key##1{\realbackslash key {##1}}%
2886\def\math##1{\realbackslash math {##1}}%
2887\def\option##1{\realbackslash option {##1}}%
2888\def\samp##1{\realbackslash samp {##1}}%
2889\def\strong##1{\realbackslash strong {##1}}%
2890\def\uref##1{\realbackslash uref {##1}}%
2891\def\url##1{\realbackslash url {##1}}%
2892\def\var##1{\realbackslash var {##1}}%
2893\def\w{\realbackslash w }%
2894%
2895% These math commands don't seem likely to be used in index entries.
2896\def\copyright{\realbackslash copyright}%
2897\def\equiv{\realbackslash equiv}%
2898\def\error{\realbackslash error}%
2899\def\expansion{\realbackslash expansion}%
2900\def\point{\realbackslash point}%
2901\def\print{\realbackslash print}%
2902\def\result{\realbackslash result}%
2903%
2904% Handle some cases of @value -- where the variable name does not
2905% contain - or _, and the value does not contain any
2906% (non-fully-expandable) commands.
2907\let\value = \expandablevalue
2908%
2909\unsepspaces
2910% Turn off macro expansion
2911\turnoffmacros
3077\def\commondummies{%
3078 %
3079 \normalturnoffactive
3080 %
3081 % Control letters and accents.
3082 \definedummyletter{_}%
3083 \definedummyletter{,}%
3084 \definedummyletter{"}%
3085 \definedummyletter{`}%
3086 \definedummyletter{'}%
3087 \definedummyletter{^}%
3088 \definedummyletter{~}%
3089 \definedummyletter{=}%
3090 \definedummyword{u}%
3091 \definedummyword{v}%
3092 \definedummyword{H}%
3093 \definedummyword{dotaccent}%
3094 \definedummyword{ringaccent}%
3095 \definedummyword{tieaccent}%
3096 \definedummyword{ubaraccent}%
3097 \definedummyword{udotaccent}%
3098 \definedummyword{dotless}%
3099 %
3100 % Other non-English letters.
3101 \definedummyword{AA}%
3102 \definedummyword{AE}%
3103 \definedummyword{L}%
3104 \definedummyword{OE}%
3105 \definedummyword{O}%
3106 \definedummyword{aa}%
3107 \definedummyword{ae}%
3108 \definedummyword{l}%
3109 \definedummyword{oe}%
3110 \definedummyword{o}%
3111 \definedummyword{ss}%
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
2912}
2913
2914% If an index command is used in an @example environment, any spaces
2915% therein should become regular spaces in the raw index file, not the
2916% expansion of \tie (\leavevmode \penalty \@M \ ).
2917{\obeyspaces
2918 \gdef\unsepspaces{\obeyspaces\let =\space}}
2919
3175}
3176
3177% If an index command is used in an @example environment, any spaces
3178% therein should become regular spaces in the raw index file, not the
3179% expansion of \tie (\leavevmode \penalty \@M \ ).
3180{\obeyspaces
3181 \gdef\unsepspaces{\obeyspaces\let =\space}}
3182
2920% \indexnofonts no-ops all font-change commands.
2921% This is used when outputting the strings to sort the index by.
2922\def\indexdummyfont#1{#1}
3183
3184% \indexnofonts is used when outputting the strings to sort the index
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%
2923\def\indexdummytex{TeX}
2924\def\indexdummydots{...}
3189\def\indexdummytex{TeX}
3190\def\indexdummydots{...}
2925
2926\def\indexnofonts{%
2927\def\@{@}%
2928% how to handle braces?
2929\def\_{\normalunderscore}%
2930%
3191%
2931\let\,=\indexdummyfont
2932\let\"=\indexdummyfont
2933\let\`=\indexdummyfont
2934\let\'=\indexdummyfont
2935\let\^=\indexdummyfont
2936\let\~=\indexdummyfont
2937\let\==\indexdummyfont
2938\let\b=\indexdummyfont
2939\let\c=\indexdummyfont
2940\let\d=\indexdummyfont
2941\let\u=\indexdummyfont
2942\let\v=\indexdummyfont
2943\let\H=\indexdummyfont
2944\let\dotless=\indexdummyfont
2945% Take care of the plain tex special European modified letters.
2946\def\AA{AA}%
2947\def\AE{AE}%
2948\def\L{L}%
2949\def\OE{OE}%
2950\def\O{O}%
2951\def\aa{aa}%
2952\def\ae{ae}%
2953\def\l{l}%
2954\def\oe{oe}%
2955\def\o{o}%
2956\def\ss{ss}%
2957%
2958% Don't no-op \tt, since it isn't a user-level command
2959% and is used in the definitions of the active chars like <, >, |, etc.
2960% Likewise with the other plain tex font commands.
2961%\let\tt=\indexdummyfont
2962%
2963\let\b=\indexdummyfont
2964\let\i=\indexdummyfont
2965\let\r=\indexdummyfont
2966\let\sc=\indexdummyfont
2967\let\t=\indexdummyfont
2968%
2969\let\TeX=\indexdummytex
2970\let\acronym=\indexdummyfont
2971\let\cite=\indexdummyfont
2972\let\code=\indexdummyfont
2973\let\command=\indexdummyfont
2974\let\dfn=\indexdummyfont
2975\let\dots=\indexdummydots
2976\let\emph=\indexdummyfont
2977\let\env=\indexdummyfont
2978\let\file=\indexdummyfont
2979\let\kbd=\indexdummyfont
2980\let\key=\indexdummyfont
2981\let\math=\indexdummyfont
2982\let\option=\indexdummyfont
2983\let\samp=\indexdummyfont
2984\let\strong=\indexdummyfont
2985\let\uref=\indexdummyfont
2986\let\url=\indexdummyfont
2987\let\var=\indexdummyfont
2988\let\w=\indexdummyfont
3192\def\indexnofonts{%
3193 \def\ { }%
3194 \def\@{@}%
3195 % how to handle braces?
3196 \def\_{\normalunderscore}%
3197 %
3198 \let\,=\asis
3199 \let\"=\asis
3200 \let\`=\asis
3201 \let\'=\asis
3202 \let\^=\asis
3203 \let\~=\asis
3204 \let\==\asis
3205 \let\u=\asis
3206 \let\v=\asis
3207 \let\H=\asis
3208 \let\dotaccent=\asis
3209 \let\ringaccent=\asis
3210 \let\tieaccent=\asis
3211 \let\ubaraccent=\asis
3212 \let\udotaccent=\asis
3213 \let\dotless=\asis
3214 %
3215 % Other non-English letters.
3216 \def\AA{AA}%
3217 \def\AE{AE}%
3218 \def\L{L}%
3219 \def\OE{OE}%
3220 \def\O{O}%
3221 \def\aa{aa}%
3222 \def\ae{ae}%
3223 \def\l{l}%
3224 \def\oe{oe}%
3225 \def\o{o}%
3226 \def\ss{ss}%
3227 \def\exclamdown{!}%
3228 \def\questiondown{?}%
3229 %
3230 % Don't no-op \tt, since it isn't a user-level command
3231 % and is used in the definitions of the active chars like <, >, |, etc.
3232 % Likewise with the other plain tex font commands.
3233 %\let\tt=\asis
3234 %
3235 % Texinfo font commands.
3236 \let\b=\asis
3237 \let\i=\asis
3238 \let\r=\asis
3239 \let\sc=\asis
3240 \let\t=\asis
3241 %
3242 \let\TeX=\indexdummytex
3243 \let\acronym=\asis
3244 \let\cite=\asis
3245 \let\code=\asis
3246 \let\command=\asis
3247 \let\dfn=\asis
3248 \let\dots=\indexdummydots
3249 \let\emph=\asis
3250 \let\env=\asis
3251 \let\file=\asis
3252 \let\kbd=\asis
3253 \let\key=\asis
3254 \let\math=\asis
3255 \let\option=\asis
3256 \let\samp=\asis
3257 \let\strong=\asis
3258 \let\uref=\asis
3259 \let\url=\asis
3260 \let\var=\asis
3261 \let\w=\asis
2989}
2990
3262}
3263
2991% To define \realbackslash, we must make \ not be an escape.
2992% We must first make another character (@) an escape
2993% so we do not become unable to do a definition.
2994
2995{\catcode`\@=0 \catcode`\\=\other
2996 @gdef@realbackslash{\}}
2997
2998\let\indexbackslash=0 %overridden during \printindex.
2999\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
3000
3001% For \ifx comparisons.
3002\def\emptymacro{\empty}
3003
3004% Most index entries go through here, but \dosubind is the general case.
3005%

--- 14 unchanged lines hidden (view full) ---

3020 {%
3021 \indexdummies % Must do this here, since \bf, etc expand at this stage
3022 \escapechar=`\\
3023 {%
3024 \let\folio = 0% We will expand all macros now EXCEPT \folio.
3025 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
3026 % so it will be output as is; and it will print as backslash.
3027 %
3264\let\indexbackslash=0 %overridden during \printindex.
3265\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
3266
3267% For \ifx comparisons.
3268\def\emptymacro{\empty}
3269
3270% Most index entries go through here, but \dosubind is the general case.
3271%

--- 14 unchanged lines hidden (view full) ---

3286 {%
3287 \indexdummies % Must do this here, since \bf, etc expand at this stage
3288 \escapechar=`\\
3289 {%
3290 \let\folio = 0% We will expand all macros now EXCEPT \folio.
3291 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
3292 % so it will be output as is; and it will print as backslash.
3293 %
3028 \def\thirdarg{#3}%
3029 %
3030 % If third arg is present, precede it with space in sort key.
3031 \ifx\thirdarg\emptymacro
3032 \let\subentry = \empty
3033 \else
3034 \def\subentry{ #3}%
3035 \fi
3036 %
3037 % First process the index entry with all font commands turned
3038 % off to get the string to sort by.
3039 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
3040 %
3041 % Now the real index entry with the fonts.
3294 % The main index entry text.
3042 \toks0 = {#2}%
3043 %
3295 \toks0 = {#2}%
3296 %
3044 % If the third (subentry) arg is present, add it to the index
3045 % line to write.
3297 % If third arg is present, precede it with space in sort key.
3298 \def\thirdarg{#3}%
3046 \ifx\thirdarg\emptymacro \else
3299 \ifx\thirdarg\emptymacro \else
3047 \toks0 = \expandafter{\the\toks0{#3}}%
3300 % If the third (subentry) arg is present, add it to the index
3301 % line to write.
3302 \toks0 = \expandafter{\the\toks0 \space #3}%
3048 \fi
3049 %
3303 \fi
3304 %
3305 % Process the index entry with all font commands turned off, to
3306 % get the string to sort by.
3307 {\indexnofonts
3308 \edef\temp{\the\toks0}% need full expansion
3309 \xdef\indexsorttmp{\temp}%
3310 }%
3311 %
3050 % Set up the complete index entry, with both the sort key and
3051 % the original text, including any font commands. We write
3052 % three arguments to \entry to the .?? file (four in the
3053 % subentry case), texindex reduces to two when writing the .??s
3054 % sorted result.
3055 \edef\temp{%
3056 \write\csname#1indfile\endcsname{%
3057 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%

--- 14 unchanged lines hidden (view full) ---

3072 % But don't do any of this if we're not in vertical mode. We
3073 % don't want to do a \vskip and prematurely end a paragraph.
3074 %
3075 % Avoid page breaks due to these extra skips, too.
3076 %
3077 \iflinks
3078 \ifvmode
3079 \skip0 = \lastskip
3312 % Set up the complete index entry, with both the sort key and
3313 % the original text, including any font commands. We write
3314 % three arguments to \entry to the .?? file (four in the
3315 % subentry case), texindex reduces to two when writing the .??s
3316 % sorted result.
3317 \edef\temp{%
3318 \write\csname#1indfile\endcsname{%
3319 \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%

--- 14 unchanged lines hidden (view full) ---

3334 % But don't do any of this if we're not in vertical mode. We
3335 % don't want to do a \vskip and prematurely end a paragraph.
3336 %
3337 % Avoid page breaks due to these extra skips, too.
3338 %
3339 \iflinks
3340 \ifvmode
3341 \skip0 = \lastskip
3080 \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
3342 \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
3081 \fi
3082 %
3083 \temp % do the write
3084 %
3343 \fi
3344 %
3345 \temp % do the write
3346 %
3085 %
3086 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
3087 \fi
3088 }%
3089 }%
3090 \penalty\count255
3091 }%
3092}
3093

--- 33 unchanged lines hidden (view full) ---

3127% It does not print any chapter heading (usually an @unnumbered).
3128%
3129\def\printindex{\parsearg\doprintindex}
3130\def\doprintindex#1{\begingroup
3131 \dobreak \chapheadingskip{10000}%
3132 %
3133 \smallfonts \rm
3134 \tolerance = 9500
3347 \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
3348 \fi
3349 }%
3350 }%
3351 \penalty\count255
3352 }%
3353}
3354

--- 33 unchanged lines hidden (view full) ---

3388% It does not print any chapter heading (usually an @unnumbered).
3389%
3390\def\printindex{\parsearg\doprintindex}
3391\def\doprintindex#1{\begingroup
3392 \dobreak \chapheadingskip{10000}%
3393 %
3394 \smallfonts \rm
3395 \tolerance = 9500
3396 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
3135 \indexbreaks
3136 %
3137 % See if the index file exists and is nonempty.
3138 % Change catcode of @ here so that if the index file contains
3139 % \initial {@}
3140 % as its first line, TeX doesn't complain about mismatched braces
3141 % (because it thinks @} is a control sequence).
3142 \catcode`\@ = 11

--- 227 unchanged lines hidden (view full) ---

3370% followed by the two boxes we just split, in box0 and box2.
3371\def\pagesofar{%
3372 \unvbox\partialpage
3373 %
3374 \hsize = \doublecolumnhsize
3375 \wd0=\hsize \wd2=\hsize
3376 \hbox to\pagewidth{\box0\hfil\box2}%
3377}
3397 \indexbreaks
3398 %
3399 % See if the index file exists and is nonempty.
3400 % Change catcode of @ here so that if the index file contains
3401 % \initial {@}
3402 % as its first line, TeX doesn't complain about mismatched braces
3403 % (because it thinks @} is a control sequence).
3404 \catcode`\@ = 11

--- 227 unchanged lines hidden (view full) ---

3632% followed by the two boxes we just split, in box0 and box2.
3633\def\pagesofar{%
3634 \unvbox\partialpage
3635 %
3636 \hsize = \doublecolumnhsize
3637 \wd0=\hsize \wd2=\hsize
3638 \hbox to\pagewidth{\box0\hfil\box2}%
3639}
3378%
3640%
3379% All done with double columns.
3380\def\enddoublecolumns{%
3381 \output = {%
3382 % Split the last of the double-column material. Leave it on the
3383 % current page, no automatic page break.
3384 \balancecolumns
3385 %
3386 % If we end up splitting too much material for the current page,

--- 121 unchanged lines hidden (view full) ---

3508 \numberedsubsubseczzz{#2}
3509\else
3510 \ifnum \absseclevel<0
3511 \chapterzzz{#2}
3512 \else
3513 \numberedsubsubseczzz{#2}
3514 \fi
3515\fi
3641% All done with double columns.
3642\def\enddoublecolumns{%
3643 \output = {%
3644 % Split the last of the double-column material. Leave it on the
3645 % current page, no automatic page break.
3646 \balancecolumns
3647 %
3648 % If we end up splitting too much material for the current page,

--- 121 unchanged lines hidden (view full) ---

3770 \numberedsubsubseczzz{#2}
3771\else
3772 \ifnum \absseclevel<0
3773 \chapterzzz{#2}
3774 \else
3775 \numberedsubsubseczzz{#2}
3776 \fi
3777\fi
3778\suppressfirstparagraphindent
3516}
3517
3518% like \numhead, but chooses appendix heading levels
3519\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3520\ifcase\absseclevel
3521 \appendixzzz{#2}
3522\or
3523 \appendixsectionzzz{#2}
3524\or
3525 \appendixsubseczzz{#2}
3526\or
3527 \appendixsubsubseczzz{#2}
3528\else
3529 \ifnum \absseclevel<0
3530 \appendixzzz{#2}
3531 \else
3532 \appendixsubsubseczzz{#2}
3533 \fi
3534\fi
3779}
3780
3781% like \numhead, but chooses appendix heading levels
3782\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3783\ifcase\absseclevel
3784 \appendixzzz{#2}
3785\or
3786 \appendixsectionzzz{#2}
3787\or
3788 \appendixsubseczzz{#2}
3789\or
3790 \appendixsubsubseczzz{#2}
3791\else
3792 \ifnum \absseclevel<0
3793 \appendixzzz{#2}
3794 \else
3795 \appendixsubsubseczzz{#2}
3796 \fi
3797\fi
3798\suppressfirstparagraphindent
3535}
3536
3537% like \numhead, but chooses numberless heading levels
3538\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3539\ifcase\absseclevel
3540 \unnumberedzzz{#2}
3541\or
3542 \unnumberedseczzz{#2}
3543\or
3544 \unnumberedsubseczzz{#2}
3545\or
3546 \unnumberedsubsubseczzz{#2}
3547\else
3548 \ifnum \absseclevel<0
3549 \unnumberedzzz{#2}
3550 \else
3551 \unnumberedsubsubseczzz{#2}
3552 \fi
3553\fi
3799}
3800
3801% like \numhead, but chooses numberless heading levels
3802\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3803\ifcase\absseclevel
3804 \unnumberedzzz{#2}
3805\or
3806 \unnumberedseczzz{#2}
3807\or
3808 \unnumberedsubseczzz{#2}
3809\or
3810 \unnumberedsubsubseczzz{#2}
3811\else
3812 \ifnum \absseclevel<0
3813 \unnumberedzzz{#2}
3814 \else
3815 \unnumberedsubsubseczzz{#2}
3816 \fi
3817\fi
3818\suppressfirstparagraphindent
3554}
3555
3556% @chapter, @appendix, @unnumbered.
3557\def\thischaptername{No Chapter Title}
3558\outer\def\chapter{\parsearg\chapteryyy}
3559\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3560\def\chapterzzz #1{%
3819}
3820
3821% @chapter, @appendix, @unnumbered.
3822\def\thischaptername{No Chapter Title}
3823\outer\def\chapter{\parsearg\chapteryyy}
3824\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3825\def\chapterzzz #1{%
3561\secno=0 \subsecno=0 \subsubsecno=0
3562\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
3563\chapmacro {#1}{\the\chapno}%
3564\gdef\thissection{#1}%
3565\gdef\thischaptername{#1}%
3566% We don't substitute the actual chapter name into \thischapter
3567% because we don't want its macros evaluated now.
3568\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
3569\toks0 = {#1}%
3570\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3571 {\the\chapno}}}%
3572\temp
3573\donoderef
3574\global\let\section = \numberedsec
3575\global\let\subsection = \numberedsubsec
3576\global\let\subsubsection = \numberedsubsubsec
3826 \secno=0 \subsecno=0 \subsubsecno=0
3827 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
3828 \chapmacro {#1}{\the\chapno}%
3829 \gdef\thissection{#1}%
3830 \gdef\thischaptername{#1}%
3831 % We don't substitute the actual chapter name into \thischapter
3832 % because we don't want its macros evaluated now.
3833 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
3834 \writetocentry{chap}{#1}{{\the\chapno}}
3835 \donoderef
3836 \global\let\section = \numberedsec
3837 \global\let\subsection = \numberedsubsec
3838 \global\let\subsubsection = \numberedsubsubsec
3577}
3578
3579% we use \chapno to avoid indenting back
3580\def\appendixbox#1{%
3581 \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
3582 \hbox to \wd0{#1\hss}}
3583
3584\outer\def\appendix{\parsearg\appendixyyy}
3585\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3586\def\appendixzzz #1{%
3839}
3840
3841% we use \chapno to avoid indenting back
3842\def\appendixbox#1{%
3843 \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
3844 \hbox to \wd0{#1\hss}}
3845
3846\outer\def\appendix{\parsearg\appendixyyy}
3847\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3848\def\appendixzzz #1{%
3587\secno=0 \subsecno=0 \subsubsecno=0
3588\global\advance \appendixno by 1
3589\message{\putwordAppendix\space \appendixletter}%
3590\chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
3591\gdef\thissection{#1}%
3592\gdef\thischaptername{#1}%
3593\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
3594\toks0 = {#1}%
3595\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
3596 {\appendixletter}}}%
3597\temp
3598\appendixnoderef
3599\global\let\section = \appendixsec
3600\global\let\subsection = \appendixsubsec
3601\global\let\subsubsection = \appendixsubsubsec
3849 \secno=0 \subsecno=0 \subsubsecno=0
3850 \global\advance \appendixno by 1
3851 \message{\putwordAppendix\space \appendixletter}%
3852 \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
3853 \gdef\thissection{#1}%
3854 \gdef\thischaptername{#1}%
3855 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
3856 \writetocentry{appendix}{#1}{{\appendixletter}}
3857 \appendixnoderef
3858 \global\let\section = \appendixsec
3859 \global\let\subsection = \appendixsubsec
3860 \global\let\subsubsection = \appendixsubsubsec
3602}
3603
3604% @centerchap is like @unnumbered, but the heading is centered.
3605\outer\def\centerchap{\parsearg\centerchapyyy}
3606\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
3607
3608% @top is like @unnumbered.
3609\outer\def\top{\parsearg\unnumberedyyy}
3610
3611\outer\def\unnumbered{\parsearg\unnumberedyyy}
3612\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3613\def\unnumberedzzz #1{%
3861}
3862
3863% @centerchap is like @unnumbered, but the heading is centered.
3864\outer\def\centerchap{\parsearg\centerchapyyy}
3865\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
3866
3867% @top is like @unnumbered.
3868\outer\def\top{\parsearg\unnumberedyyy}
3869
3870\outer\def\unnumbered{\parsearg\unnumberedyyy}
3871\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3872\def\unnumberedzzz #1{%
3614\secno=0 \subsecno=0 \subsubsecno=0
3615%
3616% This used to be simply \message{#1}, but TeX fully expands the
3617% argument to \message. Therefore, if #1 contained @-commands, TeX
3618% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3619% expanded @cite (which turns out to cause errors because \cite is meant
3620% to be executed, not expanded).
3621%
3622% Anyway, we don't want the fully-expanded definition of @cite to appear
3623% as a result of the \message, we just want `@cite' itself. We use
3624% \the to achieve this: TeX expands \the only once,
3625% simply yielding the contents of . (We also do this for
3626% the toc entries.)
3627\toks0 = {#1}\message{(\the\toks0)}%
3628%
3629\unnumbchapmacro {#1}%
3630\gdef\thischapter{#1}\gdef\thissection{#1}%
3631\toks0 = {#1}%
3632\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}{\the\chapno}}}%
3633\temp
3634\unnumbnoderef
3635\global\let\section = \unnumberedsec
3636\global\let\subsection = \unnumberedsubsec
3637\global\let\subsubsection = \unnumberedsubsubsec
3873 \secno=0 \subsecno=0 \subsubsecno=0
3874 %
3875 % This used to be simply \message{#1}, but TeX fully expands the
3876 % argument to \message. Therefore, if #1 contained @-commands, TeX
3877 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3878 % expanded @cite (which turns out to cause errors because \cite is meant
3879 % to be executed, not expanded).
3880 %
3881 % Anyway, we don't want the fully-expanded definition of @cite to appear
3882 % as a result of the \message, we just want `@cite' itself. We use
3883 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3884 % simply yielding the contents of <toks register>. (We also do this for
3885 % the toc entries.)
3886 \toks0 = {#1}\message{(\the\toks0)}%
3887 %
3888 \unnumbchapmacro {#1}%
3889 \gdef\thischapter{#1}\gdef\thissection{#1}%
3890 \writetocentry{unnumbchap}{#1}{{\the\chapno}}
3891 \unnumbnoderef
3892 \global\let\section = \unnumberedsec
3893 \global\let\subsection = \unnumberedsubsec
3894 \global\let\subsubsection = \unnumberedsubsubsec
3638}
3639
3640% Sections.
3641\outer\def\numberedsec{\parsearg\secyyy}
3642\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3643\def\seczzz #1{%
3895}
3896
3897% Sections.
3898\outer\def\numberedsec{\parsearg\secyyy}
3899\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3900\def\seczzz #1{%
3644\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3645\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3646\toks0 = {#1}%
3647\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3648 {\the\chapno}{\the\secno}}}%
3649\temp
3650\donoderef
3651\nobreak
3901 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3902 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3903 \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
3904 \donoderef
3905 \nobreak
3652}
3653
3654\outer\def\appendixsection{\parsearg\appendixsecyyy}
3655\outer\def\appendixsec{\parsearg\appendixsecyyy}
3656\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3657\def\appendixsectionzzz #1{%
3906}
3907
3908\outer\def\appendixsection{\parsearg\appendixsecyyy}
3909\outer\def\appendixsec{\parsearg\appendixsecyyy}
3910\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3911\def\appendixsectionzzz #1{%
3658\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3659\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3660\toks0 = {#1}%
3661\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3662 {\appendixletter}{\the\secno}}}%
3663\temp
3664\appendixnoderef
3665\nobreak
3912 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3913 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3914 \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
3915 \appendixnoderef
3916 \nobreak
3666}
3667
3668\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3669\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3670\def\unnumberedseczzz #1{%
3917}
3918
3919\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3920\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3921\def\unnumberedseczzz #1{%
3671\plainsecheading {#1}\gdef\thissection{#1}%
3672\toks0 = {#1}%
3673\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
3674 {\the\toks0}{\the\chapno}{\the\secno}}}%
3675\temp
3676\unnumbnoderef
3677\nobreak
3922 \plainsecheading {#1}\gdef\thissection{#1}%
3923 \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
3924 \unnumbnoderef
3925 \nobreak
3678}
3679
3680% Subsections.
3681\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3682\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3683\def\numberedsubseczzz #1{%
3926}
3927
3928% Subsections.
3929\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3930\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3931\def\numberedsubseczzz #1{%
3684\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3685\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3686\toks0 = {#1}%
3687\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3688 {\the\chapno}{\the\secno}{\the\subsecno}}}%
3689\temp
3690\donoderef
3691\nobreak
3932 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3933 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3934 \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
3935 \donoderef
3936 \nobreak
3692}
3693
3694\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3695\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3696\def\appendixsubseczzz #1{%
3937}
3938
3939\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3940\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3941\def\appendixsubseczzz #1{%
3697\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3698\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3699\toks0 = {#1}%
3700\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3701 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3702\temp
3703\appendixnoderef
3704\nobreak
3942 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3943 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3944 \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
3945 \appendixnoderef
3946 \nobreak
3705}
3706
3707\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3708\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3709\def\unnumberedsubseczzz #1{%
3947}
3948
3949\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3950\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3951\def\unnumberedsubseczzz #1{%
3710\plainsubsecheading {#1}\gdef\thissection{#1}%
3711\toks0 = {#1}%
3712\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
3713 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
3714\temp
3715\unnumbnoderef
3716\nobreak
3952 \plainsubsecheading {#1}\gdef\thissection{#1}%
3953 \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
3954 \unnumbnoderef
3955 \nobreak
3717}
3718
3719% Subsubsections.
3720\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3721\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3722\def\numberedsubsubseczzz #1{%
3956}
3957
3958% Subsubsections.
3959\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3960\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3961\def\numberedsubsubseczzz #1{%
3723\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3724\subsubsecheading {#1}
3725 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3726\toks0 = {#1}%
3727\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3728 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3729\temp
3730\donoderef
3731\nobreak
3962 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3963 \subsubsecheading {#1}
3964 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3965 \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
3966 \donoderef
3967 \nobreak
3732}
3733
3734\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3735\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3736\def\appendixsubsubseczzz #1{%
3968}
3969
3970\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3971\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3972\def\appendixsubsubseczzz #1{%
3737\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3738\subsubsecheading {#1}
3739 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3740\toks0 = {#1}%
3741\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3742 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3743\temp
3744\appendixnoderef
3745\nobreak
3973 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3974 \subsubsecheading {#1}
3975 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3976 \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
3977 \appendixnoderef
3978 \nobreak
3746}
3747
3748\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3749\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3750\def\unnumberedsubsubseczzz #1{%
3979}
3980
3981\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3982\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3983\def\unnumberedsubsubseczzz #1{%
3751\plainsubsubsecheading {#1}\gdef\thissection{#1}%
3752\toks0 = {#1}%
3753\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
3754 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3755\temp
3756\unnumbnoderef
3757\nobreak
3984 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3985 \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
3986 \unnumbnoderef
3987 \nobreak
3758}
3759
3760% These are variants which are not "outer", so they can appear in @ifinfo.
3761% Actually, they should now be obsolete; ordinary section commands should work.
3762\def\infotop{\parsearg\unnumberedzzz}
3763\def\infounnumbered{\parsearg\unnumberedzzz}
3764\def\infounnumberedsec{\parsearg\unnumberedseczzz}
3765\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}

--- 24 unchanged lines hidden (view full) ---

3790% 2) \hyphenpenalty is set to 10000 because hyphenation in a
3791% heading is obnoxious; this forbids it.
3792% 3) Likewise, headings look best if no \parindent is used, and
3793% if justification is not attempted. Hence \raggedright.
3794
3795
3796\def\majorheading{\parsearg\majorheadingzzz}
3797\def\majorheadingzzz #1{%
3988}
3989
3990% These are variants which are not "outer", so they can appear in @ifinfo.
3991% Actually, they should now be obsolete; ordinary section commands should work.
3992\def\infotop{\parsearg\unnumberedzzz}
3993\def\infounnumbered{\parsearg\unnumberedzzz}
3994\def\infounnumberedsec{\parsearg\unnumberedseczzz}
3995\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}

--- 24 unchanged lines hidden (view full) ---

4020% 2) \hyphenpenalty is set to 10000 because hyphenation in a
4021% heading is obnoxious; this forbids it.
4022% 3) Likewise, headings look best if no \parindent is used, and
4023% if justification is not attempted. Hence \raggedright.
4024
4025
4026\def\majorheading{\parsearg\majorheadingzzz}
4027\def\majorheadingzzz #1{%
3798{\advance\chapheadingskip by 10pt \chapbreak }%
3799{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3800 \parindent=0pt\raggedright
3801 \rm #1\hfill}}\bigskip \par\penalty 200}
4028 {\advance\chapheadingskip by 10pt \chapbreak }%
4029 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4030 \parindent=0pt\raggedright
4031 \rm #1\hfill}}\bigskip \par\penalty 200}
3802
3803\def\chapheading{\parsearg\chapheadingzzz}
3804\def\chapheadingzzz #1{\chapbreak %
4032
4033\def\chapheading{\parsearg\chapheadingzzz}
4034\def\chapheadingzzz #1{\chapbreak %
3805{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3806 \parindent=0pt\raggedright
3807 \rm #1\hfill}}\bigskip \par\penalty 200}
4035 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
4036 \parindent=0pt\raggedright
4037 \rm #1\hfill}}\bigskip \par\penalty 200}
3808
3809% @heading, @subheading, @subsubheading.
3810\def\heading{\parsearg\plainsecheading}
3811\def\subheading{\parsearg\plainsubsecheading}
3812\def\subsubheading{\parsearg\plainsubsubsecheading}
3813
3814% These macros generate a chapter, section, etc. heading only
3815% (including whitespace, linebreaking, etc. around it),

--- 131 unchanged lines hidden (view full) ---

3947 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3948 %
3949 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3950 \hangindent = \wd0 % zero if no section number
3951 \unhbox0 #3}%
3952 }%
3953 % Add extra space after the heading -- either a line space or a
3954 % paragraph space, whichever is more. (Some people like to set
4038
4039% @heading, @subheading, @subsubheading.
4040\def\heading{\parsearg\plainsecheading}
4041\def\subheading{\parsearg\plainsubsecheading}
4042\def\subsubheading{\parsearg\plainsubsubsecheading}
4043
4044% These macros generate a chapter, section, etc. heading only
4045% (including whitespace, linebreaking, etc. around it),

--- 131 unchanged lines hidden (view full) ---

4177 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
4178 %
4179 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
4180 \hangindent = \wd0 % zero if no section number
4181 \unhbox0 #3}%
4182 }%
4183 % Add extra space after the heading -- either a line space or a
4184 % paragraph space, whichever is more. (Some people like to set
3955 % \parskip to large values for some reason.)
4185 % \parskip to large values for some reason.) Don't allow stretch, though.
3956 \nobreak
3957 \ifdim\parskip>\normalbaselineskip
3958 \kern\parskip
3959 \else
3960 \kern\normalbaselineskip
3961 \fi
3962 \nobreak
3963}
3964
3965
3966\message{toc,}
3967% Table of contents.
3968\newwrite\tocfile
3969
3970% Write an entry to the toc file, opening it if necessary.
3971% Called from @chapter, etc. We supply {\folio} at the end of the
3972% argument, which will end up as the last argument to the \...entry macro.
3973%
4186 \nobreak
4187 \ifdim\parskip>\normalbaselineskip
4188 \kern\parskip
4189 \else
4190 \kern\normalbaselineskip
4191 \fi
4192 \nobreak
4193}
4194
4195
4196\message{toc,}
4197% Table of contents.
4198\newwrite\tocfile
4199
4200% Write an entry to the toc file, opening it if necessary.
4201% Called from @chapter, etc. We supply {\folio} at the end of the
4202% argument, which will end up as the last argument to the \...entry macro.
4203%
3974% We open the .toc file here instead of at @setfilename or any other
3975% fixed time so that @contents can be put in the document anywhere.
4204% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
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.
3976%
3977\newif\iftocfileopened
4207%
4208\newif\iftocfileopened
3978\def\writetocentry#1{%
4209\def\writetocentry#1#2#3{%
3979 \iftocfileopened\else
3980 \immediate\openout\tocfile = \jobname.toc
3981 \global\tocfileopenedtrue
3982 \fi
4210 \iftocfileopened\else
4211 \immediate\openout\tocfile = \jobname.toc
4212 \global\tocfileopenedtrue
4213 \fi
3983 \iflinks \write\tocfile{#1{\folio}}\fi
3984 %
4214 %
4215 \iflinks
4216 \toks0 = {#2}%
4217 \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
4218 \temp
4219 \fi
4220 %
3985 % Tell \shipout to create a page destination if we're doing pdf, which
3986 % will be the target of the links in the table of contents. We can't
3987 % just do it on every page because the title pages are numbered 1 and
3988 % 2 (the page numbers aren't printed), and so are the first two pages
3989 % of the document. Thus, we'd have two destinations named `1', and
3990 % two named `2'.
3991 \ifpdf \pdfmakepagedesttrue \fi
3992}

--- 21 unchanged lines hidden (view full) ---

4014 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
4015 % We can't do this, because then an actual ^ in a section
4016 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
4017 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
4018 \raggedbottom % Worry more about breakpoints than the bottom.
4019 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
4020 %
4021 % Roman numerals for page numbers.
4221 % Tell \shipout to create a page destination if we're doing pdf, which
4222 % will be the target of the links in the table of contents. We can't
4223 % just do it on every page because the title pages are numbered 1 and
4224 % 2 (the page numbers aren't printed), and so are the first two pages
4225 % of the document. Thus, we'd have two destinations named `1', and
4226 % two named `2'.
4227 \ifpdf \pdfmakepagedesttrue \fi
4228}

--- 21 unchanged lines hidden (view full) ---

4250 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
4251 % We can't do this, because then an actual ^ in a section
4252 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
4253 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
4254 \raggedbottom % Worry more about breakpoints than the bottom.
4255 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
4256 %
4257 % Roman numerals for page numbers.
4022 \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
4258 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
4023}
4024
4025
4026% Normal (long) toc.
4027\def\contents{%
4028 \startcontents{\putwordTOC}%
4029 \openin 1 \jobname.toc
4030 \ifeof 1 \else
4031 \closein 1
4032 \input \jobname.toc
4033 \fi
4034 \vfill \eject
4035 \contentsalignmacro % in case @setchapternewpage odd is in effect
4036 \pdfmakeoutlines
4037 \endgroup
4038 \lastnegativepageno = \pageno
4259}
4260
4261
4262% Normal (long) toc.
4263\def\contents{%
4264 \startcontents{\putwordTOC}%
4265 \openin 1 \jobname.toc
4266 \ifeof 1 \else
4267 \closein 1
4268 \input \jobname.toc
4269 \fi
4270 \vfill \eject
4271 \contentsalignmacro % in case @setchapternewpage odd is in effect
4272 \pdfmakeoutlines
4273 \endgroup
4274 \lastnegativepageno = \pageno
4039 \pageno = \savepageno
4275 \global\pageno = \savepageno
4040}
4041
4042% And just the chapters.
4043\def\summarycontents{%
4044 \startcontents{\putwordShortTOC}%
4045 %
4046 \let\chapentry = \shortchapentry
4047 \let\appendixentry = \shortappendixentry

--- 15 unchanged lines hidden (view full) ---

4063 \ifeof 1 \else
4064 \closein 1
4065 \input \jobname.toc
4066 \fi
4067 \vfill \eject
4068 \contentsalignmacro % in case @setchapternewpage odd is in effect
4069 \endgroup
4070 \lastnegativepageno = \pageno
4276}
4277
4278% And just the chapters.
4279\def\summarycontents{%
4280 \startcontents{\putwordShortTOC}%
4281 %
4282 \let\chapentry = \shortchapentry
4283 \let\appendixentry = \shortappendixentry

--- 15 unchanged lines hidden (view full) ---

4299 \ifeof 1 \else
4300 \closein 1
4301 \input \jobname.toc
4302 \fi
4303 \vfill \eject
4304 \contentsalignmacro % in case @setchapternewpage odd is in effect
4305 \endgroup
4306 \lastnegativepageno = \pageno
4071 \pageno = \savepageno
4307 \global\pageno = \savepageno
4072}
4073\let\shortcontents = \summarycontents
4074
4075\ifpdf
4076 \pdfcatalog{/PageMode /UseOutlines}%
4077\fi
4078
4079% These macros generate individual entries in the table of contents.

--- 107 unchanged lines hidden (view full) ---

4187\let\subsecentryfonts = \textfonts
4188\let\subsubsecentryfonts = \textfonts
4189
4190
4191\message{environments,}
4192% @foo ... @end foo.
4193
4194% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
4308}
4309\let\shortcontents = \summarycontents
4310
4311\ifpdf
4312 \pdfcatalog{/PageMode /UseOutlines}%
4313\fi
4314
4315% These macros generate individual entries in the table of contents.

--- 107 unchanged lines hidden (view full) ---

4423\let\subsecentryfonts = \textfonts
4424\let\subsubsecentryfonts = \textfonts
4425
4426
4427\message{environments,}
4428% @foo ... @end foo.
4429
4430% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
4195%
4431%
4196% Since these characters are used in examples, it should be an even number of
4197% \tt widths. Each \tt character is 1en, so two makes it 1em.
4198%
4199\def\point{$\star$}
4200\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
4201\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
4202\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
4203\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
4204
4205% The @error{} command.
4206% Adapted from the TeXbook's \boxit.
4432% Since these characters are used in examples, it should be an even number of
4433% \tt widths. Each \tt character is 1en, so two makes it 1em.
4434%
4435\def\point{$\star$}
4436\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
4437\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
4438\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
4439\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
4440
4441% The @error{} command.
4442% Adapted from the TeXbook's \boxit.
4207%
4443%
4208\newbox\errorbox
4209%
4210{\tentt \global\dimen0 = 3em}% Width of the box.
4211\dimen2 = .55pt % Thickness of rules
4212% The text. (`r' is open on the right, `e' somewhat less so on the left.)
4213\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
4214%
4215\global\setbox\errorbox=\hbox to \dimen0{\hfil

--- 11 unchanged lines hidden (view full) ---

4227
4228% @tex ... @end tex escapes into raw Tex temporarily.
4229% One exception: @ is still an escape character, so that @end tex works.
4230% But \@ or @@ will get a plain tex @ character.
4231
4232\def\tex{\begingroup
4233 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
4234 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
4444\newbox\errorbox
4445%
4446{\tentt \global\dimen0 = 3em}% Width of the box.
4447\dimen2 = .55pt % Thickness of rules
4448% The text. (`r' is open on the right, `e' somewhat less so on the left.)
4449\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
4450%
4451\global\setbox\errorbox=\hbox to \dimen0{\hfil

--- 11 unchanged lines hidden (view full) ---

4463
4464% @tex ... @end tex escapes into raw Tex temporarily.
4465% One exception: @ is still an escape character, so that @end tex works.
4466% But \@ or @@ will get a plain tex @ character.
4467
4468\def\tex{\begingroup
4469 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
4470 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
4235 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
4471 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
4236 \catcode `\%=14
4472 \catcode `\%=14
4237 \catcode 43=12 % plus
4238 \catcode`\"=12
4239 \catcode`\==12
4240 \catcode`\|=12
4241 \catcode`\<=12
4242 \catcode`\>=12
4473 \catcode `\+=\other
4474 \catcode `\"=\other
4475 \catcode `\==\other
4476 \catcode `\|=\other
4477 \catcode `\<=\other
4478 \catcode `\>=\other
4243 \escapechar=`\\
4244 %
4245 \let\b=\ptexb
4246 \let\bullet=\ptexbullet
4247 \let\c=\ptexc
4248 \let\,=\ptexcomma
4249 \let\.=\ptexdot
4250 \let\dots=\ptexdots
4251 \let\equiv=\ptexequiv
4252 \let\!=\ptexexclam
4253 \let\i=\ptexi
4479 \escapechar=`\\
4480 %
4481 \let\b=\ptexb
4482 \let\bullet=\ptexbullet
4483 \let\c=\ptexc
4484 \let\,=\ptexcomma
4485 \let\.=\ptexdot
4486 \let\dots=\ptexdots
4487 \let\equiv=\ptexequiv
4488 \let\!=\ptexexclam
4489 \let\i=\ptexi
4490 \let\indent=\ptexindent
4254 \let\{=\ptexlbrace
4255 \let\+=\tabalign
4256 \let\}=\ptexrbrace
4491 \let\{=\ptexlbrace
4492 \let\+=\tabalign
4493 \let\}=\ptexrbrace
4494 \let\/=\ptexslash
4257 \let\*=\ptexstar
4258 \let\t=\ptext
4259 %
4260 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
4261 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
4262 \def\@{@}%
4263\let\Etex=\endgroup}
4264

--- 66 unchanged lines hidden (view full) ---

4331 \ctl\leaders\hrule height\circthick\hfil\ctr
4332 \hskip\rskip}}
4333\def\cartbot{\hbox to \cartouter{\hskip\lskip
4334 \cbl\leaders\hrule height\circthick\hfil\cbr
4335 \hskip\rskip}}
4336%
4337\newskip\lskip\newskip\rskip
4338
4495 \let\*=\ptexstar
4496 \let\t=\ptext
4497 %
4498 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
4499 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
4500 \def\@{@}%
4501\let\Etex=\endgroup}
4502

--- 66 unchanged lines hidden (view full) ---

4569 \ctl\leaders\hrule height\circthick\hfil\ctr
4570 \hskip\rskip}}
4571\def\cartbot{\hbox to \cartouter{\hskip\lskip
4572 \cbl\leaders\hrule height\circthick\hfil\cbr
4573 \hskip\rskip}}
4574%
4575\newskip\lskip\newskip\rskip
4576
4339\long\def\cartouche{%
4577\def\cartouche{%
4578\par % can't be in the midst of a paragraph.
4340\begingroup
4341 \lskip=\leftskip \rskip=\rightskip
4342 \leftskip=0pt\rightskip=0pt %we want these *outside*.
4343 \cartinner=\hsize \advance\cartinner by-\lskip
4344 \advance\cartinner by-\rskip
4345 \cartouter=\hsize
4346 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
4347% side, and for 6pt waste from

--- 68 unchanged lines hidden (view full) ---

4416 \tt
4417 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
4418 \gobble % eat return
4419}
4420
4421% @example: Same as @lisp.
4422\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
4423
4579\begingroup
4580 \lskip=\leftskip \rskip=\rightskip
4581 \leftskip=0pt\rightskip=0pt %we want these *outside*.
4582 \cartinner=\hsize \advance\cartinner by-\lskip
4583 \advance\cartinner by-\rskip
4584 \cartouter=\hsize
4585 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
4586% side, and for 6pt waste from

--- 68 unchanged lines hidden (view full) ---

4655 \tt
4656 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
4657 \gobble % eat return
4658}
4659
4660% @example: Same as @lisp.
4661\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
4662
4424% @small... is usually equivalent to the non-small (@smallbook
4425% redefines). We must call \example (or whatever) last in the
4426% definition, since it reads the return following the @example (or
4427% whatever) command.
4428%
4429% This actually allows (for example) @end display inside an
4430% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
4431%
4432\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
4433\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
4434\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
4435\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
4436
4437% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
4663% @smallexample and @smalllisp: use smaller fonts.
4438% Originally contributed by Pavel@xerox.
4664% Originally contributed by Pavel@xerox.
4439\def\smalllispx{\begingroup
4665\def\smalllisp{\begingroup
4440 \def\Esmalllisp{\nonfillfinish\endgroup}%
4441 \def\Esmallexample{\nonfillfinish\endgroup}%
4442 \smallexamplefonts
4443 \lisp
4444}
4666 \def\Esmalllisp{\nonfillfinish\endgroup}%
4667 \def\Esmallexample{\nonfillfinish\endgroup}%
4668 \smallexamplefonts
4669 \lisp
4670}
4671\let\smallexample = \smalllisp
4445
4672
4673
4446% @display: same as @lisp except keep current font.
4447%
4448\def\display{\begingroup
4449 \nonfillstart
4450 \let\Edisplay = \nonfillfinish
4451 \gobble
4452}
4453%
4674% @display: same as @lisp except keep current font.
4675%
4676\def\display{\begingroup
4677 \nonfillstart
4678 \let\Edisplay = \nonfillfinish
4679 \gobble
4680}
4681%
4454% @smalldisplay (when @smallbook): @display plus smaller fonts.
4682% @smalldisplay: @display plus smaller fonts.
4455%
4683%
4456\def\smalldisplayx{\begingroup
4684\def\smalldisplay{\begingroup
4457 \def\Esmalldisplay{\nonfillfinish\endgroup}%
4458 \smallexamplefonts \rm
4459 \display
4460}
4461
4462% @format: same as @display except don't narrow margins.
4463%
4464\def\format{\begingroup
4465 \let\nonarrowing = t
4466 \nonfillstart
4467 \let\Eformat = \nonfillfinish
4468 \gobble
4469}
4470%
4685 \def\Esmalldisplay{\nonfillfinish\endgroup}%
4686 \smallexamplefonts \rm
4687 \display
4688}
4689
4690% @format: same as @display except don't narrow margins.
4691%
4692\def\format{\begingroup
4693 \let\nonarrowing = t
4694 \nonfillstart
4695 \let\Eformat = \nonfillfinish
4696 \gobble
4697}
4698%
4471% @smallformat (when @smallbook): @format plus smaller fonts.
4699% @smallformat: @format plus smaller fonts.
4472%
4700%
4473\def\smallformatx{\begingroup
4701\def\smallformat{\begingroup
4474 \def\Esmallformat{\nonfillfinish\endgroup}%
4475 \smallexamplefonts \rm
4476 \format
4477}
4478
4479% @flushleft (same as @format).
4480%
4481\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}

--- 26 unchanged lines hidden (view full) ---

4508 \advance\rightskip by \lispnarrowing
4509 \exdentamount = \lispnarrowing
4510 \let\nonarrowing = \relax
4511 \fi
4512}
4513
4514
4515% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
4702 \def\Esmallformat{\nonfillfinish\endgroup}%
4703 \smallexamplefonts \rm
4704 \format
4705}
4706
4707% @flushleft (same as @format).
4708%
4709\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}

--- 26 unchanged lines hidden (view full) ---

4736 \advance\rightskip by \lispnarrowing
4737 \exdentamount = \lispnarrowing
4738 \let\nonarrowing = \relax
4739 \fi
4740}
4741
4742
4743% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
4516% If we want to allow any <char> as delimiter,
4744% If we want to allow any as delimiter,
4517% we need the curly braces so that makeinfo sees the @verb command, eg:
4518% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
4519%
4520% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
4521%
4522% [Knuth] p.344; only we need to do the other characters Texinfo sets
4523% active too. Otherwise, they get lost as the first character on a
4524% verbatim line.

--- 61 unchanged lines hidden (view full) ---

4586 % Respect line breaks,
4587 % print special symbols as themselves, and
4588 % make each space count
4589 % must do in this order:
4590 \obeylines \uncatcodespecials \sepspaces
4591 \everypar{\starttabbox}%
4592}
4593
4745% we need the curly braces so that makeinfo sees the @verb command, eg:
4746% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
4747%
4748% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
4749%
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.

--- 61 unchanged lines hidden (view full) ---

4814 % Respect line breaks,
4815 % print special symbols as themselves, and
4816 % make each space count
4817 % must do in this order:
4818 \obeylines \uncatcodespecials \sepspaces
4819 \everypar{\starttabbox}%
4820}
4821
4594% Do the @verb magic: verbatim text is quoted by unique
4595% delimiter characters. Before first delimiter expect a
4822% Do the @verb magic: verbatim text is quoted by unique
4823% delimiter characters. Before first delimiter expect a
4596% right brace, after last delimiter expect closing brace:
4597%
4598% \def\doverb'{'<char>#1<char>'}'{#1}
4599%
4600% [Knuth] p. 382; only eat outer {}
4601\begingroup
4602 \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
4603 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
4604\endgroup
4605%
4606\def\verb{\begingroup\setupverb\doverb}
4607%
4608%
4609% Do the @verbatim magic: define the macro \doverbatim so that
4610% the (first) argument ends when '@end verbatim' is reached, ie:
4611%
4612% \def\doverbatim#1@end verbatim{#1}
4613%
4824% right brace, after last delimiter expect closing brace:
4825%
4826% \def\doverb'{'<char>#1<char>'}'{#1}
4827%
4828% [Knuth] p. 382; only eat outer {}
4829\begingroup
4830 \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
4831 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
4832\endgroup
4833%
4834\def\verb{\begingroup\setupverb\doverb}
4835%
4836%
4837% Do the @verbatim magic: define the macro \doverbatim so that
4838% the (first) argument ends when '@end verbatim' is reached, ie:
4839%
4840% \def\doverbatim#1@end verbatim{#1}
4841%
4614% For Texinfo it's a lot easier than for LaTeX,
4842% For Texinfo it's a lot easier than for LaTeX,
4615% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
4616% we need not redefine '\', '{' and '}'.
4617%
4618% Inspired by LaTeX's verbatim command set [latex.ltx]
4619%% Include LaTeX hack for completeness -- never know
4620%% \begingroup
4621%% \catcode`|=0 \catcode`[=1
4622%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active

--- 18 unchanged lines hidden (view full) ---

4641 \begingroup\setupverbatim\doverbatim
4642}
4643
4644% @verbatiminclude FILE - insert text of file in verbatim environment.
4645%
4646% Allow normal characters that we make active in the argument (a file name).
4647\def\verbatiminclude{%
4648 \begingroup
4843% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
4844% we need not redefine '\', '{' and '}'.
4845%
4846% Inspired by LaTeX's verbatim command set [latex.ltx]
4847%% Include LaTeX hack for completeness -- never know
4848%% \begingroup
4849%% \catcode`|=0 \catcode`[=1
4850%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active

--- 18 unchanged lines hidden (view full) ---

4869 \begingroup\setupverbatim\doverbatim
4870}
4871
4872% @verbatiminclude FILE - insert text of file in verbatim environment.
4873%
4874% Allow normal characters that we make active in the argument (a file name).
4875\def\verbatiminclude{%
4876 \begingroup
4649 \catcode`\\=12
4650 \catcode`~=12
4651 \catcode`^=12
4652 \catcode`_=12
4653 \catcode`|=12
4654 \catcode`<=12
4655 \catcode`>=12
4656 \catcode`+=12
4877 \catcode`\\=\other
4878 \catcode`~=\other
4879 \catcode`^=\other
4880 \catcode`_=\other
4881 \catcode`|=\other
4882 \catcode`<=\other
4883 \catcode`>=\other
4884 \catcode`+=\other
4657 \parsearg\doverbatiminclude
4658}
4659\def\setupverbatiminclude{%
4660 \begingroup
4661 \nonfillstart
4662 \advance\leftskip by -\defbodyindent
4663 \begingroup\setupverbatim
4664}
4665%
4666\def\doverbatiminclude#1{%
4667 % Restore active chars for included file.
4668 \endgroup
4669 \begingroup
4885 \parsearg\doverbatiminclude
4886}
4887\def\setupverbatiminclude{%
4888 \begingroup
4889 \nonfillstart
4890 \advance\leftskip by -\defbodyindent
4891 \begingroup\setupverbatim
4892}
4893%
4894\def\doverbatiminclude#1{%
4895 % Restore active chars for included file.
4896 \endgroup
4897 \begingroup
4670 \def\thisfile{#1}%
4671 \expandafter\expandafter\setupverbatiminclude\input\thisfile
4672 \endgroup\nonfillfinish\endgroup
4898 \let\value=\expandablevalue
4899 \def\thisfile{#1}%
4900 \expandafter\expandafter\setupverbatiminclude\input\thisfile
4901 \endgroup
4902 \nonfillfinish
4903 \endgroup
4673}
4674
4675% @copying ... @end copying.
4676% Save the text away for @insertcopying later. Many commands won't be
4677% allowed in this context, but that's ok.
4904}
4905
4906% @copying ... @end copying.
4907% Save the text away for @insertcopying later. Many commands won't be
4908% allowed in this context, but that's ok.
4678%
4909%
4679% We save the uninterpreted tokens, rather than creating a box.
4680% Saving the text in a box would be much easier, but then all the
4681% typesetting commands (@smallbook, font changes, etc.) have to be done
4682% beforehand -- and a) we want @copying to be done first in the source
4683% file; b) letting users define the frontmatter in as flexible order as
4684% possible is very desirable.
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.
4685%
4916%
4686\def\copying{\begingroup
4687 % Define a command to swallow text until we reach `@end copying'.
4688 % \ is the escape char in this texinfo.tex file, so it is the
4689 % delimiter for the command; @ will be the escape char when we read
4690 % it, but that doesn't matter.
4691 \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
4692 %
4693 % We must preserve ^^M's in the input file; see \insertcopying below.

--- 6 unchanged lines hidden (view full) ---

4700\def\enddocopying{\endgroup\ignorespaces}
4701
4702% @insertcopying. Here we must play games with ^^M's. On the one hand,
4703% we need them to delimit commands such as `@end quotation', so they
4704% must be active. On the other hand, we certainly don't want every
4705% end-of-line to be a \par, as would happen with the normal active
4706% definition of ^^M. On the third hand, two ^^M's in a row should still
4707% generate a \par.
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.

--- 6 unchanged lines hidden (view full) ---

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.
4708%
4939%
4709% Our approach is to make ^^M insert a space and a penalty1 normally;
4710% then it can also check if \lastpenalty=1. If it does, then manually
4711% do \par.
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.
4712%
4943%
4713% This messes up the normal definitions of @c[omment], so we redefine
4714% it. Similarly for @ignore. (These commands are used in the gcc
4715% manual for man page generation.)
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.)
4716%
4947%
4717% Seems pretty fragile, most line-oriented commands will presumably
4718% fail, but for the limited use of getting the copying text (which
4719% should be quite simple) inserted, we can hope it's ok.
4720%
4721{\catcode`\^^M=\active %
4722\gdef\insertcopying{\begingroup %
4723 \parindent = 0pt % looks wrong on title page
4724 \def^^M{%

--- 24 unchanged lines hidden (view full) ---

4749
4750\newskip\defbodyindent \defbodyindent=.4in
4751\newskip\defargsindent \defargsindent=50pt
4752\newskip\deflastargmargin \deflastargmargin=18pt
4753
4754\newcount\parencount
4755
4756% We want ()&[] to print specially on the defun line.
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 %
4954 \parindent = 0pt % looks wrong on title page
4955 \def^^M{%

--- 24 unchanged lines hidden (view full) ---

4980
4981\newskip\defbodyindent \defbodyindent=.4in
4982\newskip\defargsindent \defargsindent=50pt
4983\newskip\deflastargmargin \deflastargmargin=18pt
4984
4985\newcount\parencount
4986
4987% We want ()&[] to print specially on the defun line.
4757%
4988%
4758\def\activeparens{%
4759 \catcode`\(=\active \catcode`\)=\active
4760 \catcode`\&=\active
4761 \catcode`\[=\active \catcode`\]=\active
4762}
4763
4764% Make control sequences which act like normal parenthesis chars.
4765\let\lparen = ( \let\rparen = )

--- 35 unchanged lines hidden (view full) ---

4801\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
4802\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
4803\let\ampnr = \&
4804\def\lbrb{{\bf\char`\[}}
4805\def\rbrb{{\bf\char`\]}}
4806
4807% Active &'s sneak into the index arguments, so make sure it's defined.
4808{
4989\def\activeparens{%
4990 \catcode`\(=\active \catcode`\)=\active
4991 \catcode`\&=\active
4992 \catcode`\[=\active \catcode`\]=\active
4993}
4994
4995% Make control sequences which act like normal parenthesis chars.
4996\let\lparen = ( \let\rparen = )

--- 35 unchanged lines hidden (view full) ---

5032\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
5033\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
5034\let\ampnr = \&
5035\def\lbrb{{\bf\char`\[}}
5036\def\rbrb{{\bf\char`\]}}
5037
5038% Active &'s sneak into the index arguments, so make sure it's defined.
5039{
4809 \catcode`& = 13
5040 \catcode`& = \active
4810 \global\let& = \ampnr
4811}
4812
4813% \defname, which formats the name of the @def (not the args).
4814% #1 is the function name.
4815% #2 is the type of definition, such as "Function".
4816%
4817\def\defname#1#2{%

--- 34 unchanged lines hidden (view full) ---

4852 {\df #1}\enskip % output function name
4853 % \defunargs will be called next to output the arguments, if any.
4854}
4855
4856% Common pieces to start any @def...
4857% #1 is the \E... control sequence to end the definition (which we define).
4858% #2 is the \...x control sequence (which our caller defines).
4859% #3 is the control sequence to process the header, such as \defunheader.
5041 \global\let& = \ampnr
5042}
5043
5044% \defname, which formats the name of the @def (not the args).
5045% #1 is the function name.
5046% #2 is the type of definition, such as "Function".
5047%
5048\def\defname#1#2{%

--- 34 unchanged lines hidden (view full) ---

5083 {\df #1}\enskip % output function name
5084 % \defunargs will be called next to output the arguments, if any.
5085}
5086
5087% Common pieces to start any @def...
5088% #1 is the \E... control sequence to end the definition (which we define).
5089% #2 is the \...x control sequence (which our caller defines).
5090% #3 is the control sequence to process the header, such as \defunheader.
4860%
5091%
4861\def\parsebodycommon#1#2#3{%
4862 \begingroup\inENV
4863 % If there are two @def commands in a row, we'll have a \nobreak,
4864 % which is there to keep the function description together with its
4865 % header. But if there's nothing but headers, we want to allow a
5092\def\parsebodycommon#1#2#3{%
5093 \begingroup\inENV
5094 % If there are two @def commands in a row, we'll have a \nobreak,
5095 % which is there to keep the function description together with its
5096 % header. But if there's nothing but headers, we want to allow a
4866 % break after all.
4867 \ifnum\lastpenalty=10000 \penalty0 \fi
5097 % break after all. Check for penalty 10002 (inserted by
5098 % \defargscommonending) instead of 10000, since the sectioning
5099 % commands insert a \penalty10000, and we don't want to allow a break
5100 % between a section heading and a defun.
5101 \ifnum\lastpenalty=10002 \penalty0 \fi
4868 \medbreak
4869 %
4870 % Define the \E... end token that this defining construct specifies
4871 % so that it will exit this group.
4872 \def#1{\endgraf\endgroup\medbreak}%
4873 %
4874 \parindent=0in
4875 \advance\leftskip by \defbodyindent
4876 \exdentamount=\defbodyindent
4877}
4878
4879% Common part of the \...x definitions.
5102 \medbreak
5103 %
5104 % Define the \E... end token that this defining construct specifies
5105 % so that it will exit this group.
5106 \def#1{\endgraf\endgroup\medbreak}%
5107 %
5108 \parindent=0in
5109 \advance\leftskip by \defbodyindent
5110 \exdentamount=\defbodyindent
5111}
5112
5113% Common part of the \...x definitions.
4880%
5114%
4881\def\defxbodycommon{%
4882 % As with \parsebodycommon above, allow line break if we have multiple
4883 % x headers in a row. It's not a great place, though.
4884 \ifnum\lastpenalty=10000 \penalty1000 \fi
4885 %
4886 \begingroup\obeylines
4887}
4888
4889% Process body of @defun, @deffn, @defmac, etc.
4890%
4891\def\defparsebody#1#2#3{%
4892 \parsebodycommon{#1}{#2}{#3}%
4893 \def#2{\defxbodycommon \activeparens \spacesplit#3}%
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}%
4894 \catcode61=\active % 61 is `='
5128 \catcode\equalChar=\active
4895 \begingroup\obeylines\activeparens
4896 \spacesplit#3%
4897}
4898
4899% #1, #2, #3 are the common arguments (see \parsebodycommon above).
4900% #4, delimited by the space, is the class name.
4901%
4902\def\defmethparsebody#1#2#3#4 {%

--- 20 unchanged lines hidden (view full) ---

4923}
4924
4925% Used for @deftypeop. The change from \deftypemethparsebody is an
4926% extra argument at the beginning which is the `category', instead of it
4927% being the hardwired string `Method' or `Instance Variable'. We have
4928% to account for this both in the \...x definition and in parsing the
4929% input at hand. Thus also need a control sequence (passed as #5) for
4930% the \E... definition to assign the category name to.
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 {%

--- 20 unchanged lines hidden (view full) ---

5157}
5158
5159% Used for @deftypeop. The change from \deftypemethparsebody is an
5160% extra argument at the beginning which is the `category', instead of it
5161% being the hardwired string `Method' or `Instance Variable'. We have
5162% to account for this both in the \...x definition and in parsing the
5163% input at hand. Thus also need a control sequence (passed as #5) for
5164% the \E... definition to assign the category name to.
4931%
5165%
4932\def\deftypeopparsebody#1#2#3#4#5 #6 {%
4933 \parsebodycommon{#1}{#2}{#3}%
4934 \def#2##1 ##2 ##3 {\def#4{##1}%
4935 \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
4936 \begingroup\obeylines\activeparens
4937 \spacesplit{#3{#5}{#6}}%
4938}
4939

--- 8 unchanged lines hidden (view full) ---

4948
4949% These parsing functions are similar to the preceding ones
4950% except that they do not make parens into active characters.
4951% These are used for "variables" since they have no arguments.
4952%
4953\def\defvarparsebody #1#2#3{%
4954 \parsebodycommon{#1}{#2}{#3}%
4955 \def#2{\defxbodycommon \spacesplit#3}%
5166\def\deftypeopparsebody#1#2#3#4#5 #6 {%
5167 \parsebodycommon{#1}{#2}{#3}%
5168 \def#2##1 ##2 ##3 {\def#4{##1}%
5169 \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
5170 \begingroup\obeylines\activeparens
5171 \spacesplit{#3{#5}{#6}}%
5172}
5173

--- 8 unchanged lines hidden (view full) ---

5182
5183% These parsing functions are similar to the preceding ones
5184% except that they do not make parens into active characters.
5185% These are used for "variables" since they have no arguments.
5186%
5187\def\defvarparsebody #1#2#3{%
5188 \parsebodycommon{#1}{#2}{#3}%
5189 \def#2{\defxbodycommon \spacesplit#3}%
4956 \catcode61=\active %
5190 \catcode\equalChar=\active
4957 \begingroup\obeylines
4958 \spacesplit#3%
4959}
4960
4961% @defopvar.
4962\def\defopvarparsebody #1#2#3#4#5 {%
4963 \parsebodycommon{#1}{#2}{#3}%
4964 \def#2##1 ##2 {\def#4{##1}%

--- 52 unchanged lines hidden (view full) ---

5017 #1{#2}{}%
5018 \else %
5019 #1{#2}{#3#4}%
5020 \fi}%
5021}
5022
5023% Define @defun.
5024
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}%

--- 52 unchanged lines hidden (view full) ---

5251 #1{#2}{}%
5252 \else %
5253 #1{#2}{#3#4}%
5254 \fi}%
5255}
5256
5257% Define @defun.
5258
5025% First, define the processing that is wanted for arguments of \defun
5026% Use this to expand the args and terminate the paragraph they make up
5259% This is called to end the arguments processing for all the @def... commands.
5260%
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}
5027
5268
5269% This expands the args and terminates the paragraph they comprise.
5270%
5028\def\defunargs#1{\functionparens \sl
5029% Expand, preventing hyphenation at `-' chars.
5030% Note that groups don't affect changes in \hyphenchar.
5031% Set the font temporarily and use \font in case \setfont made \tensl a macro.
5032{\tensl\hyphenchar\font=0}%
5033#1%
5034{\tensl\hyphenchar\font=45}%
5035\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
5271\def\defunargs#1{\functionparens \sl
5272% Expand, preventing hyphenation at `-' chars.
5273% Note that groups don't affect changes in \hyphenchar.
5274% Set the font temporarily and use \font in case \setfont made \tensl a macro.
5275{\tensl\hyphenchar\font=0}%
5276#1%
5277{\tensl\hyphenchar\font=45}%
5278\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
5036\interlinepenalty=10000
5037\advance\rightskip by 0pt plus 1fil
5038\endgraf\nobreak\vskip -\parskip\nobreak
5279 \defargscommonending
5039}
5040
5041\def\deftypefunargs #1{%
5042% Expand, preventing hyphenation at `-' chars.
5043% Note that groups don't affect changes in \hyphenchar.
5044% Use \boldbraxnoamp, not \functionparens, so that & is not special.
5045\boldbraxnoamp
5046\tclose{#1}% avoid \code because of side effects on active chars
5280}
5281
5282\def\deftypefunargs #1{%
5283% Expand, preventing hyphenation at `-' chars.
5284% Note that groups don't affect changes in \hyphenchar.
5285% Use \boldbraxnoamp, not \functionparens, so that & is not special.
5286\boldbraxnoamp
5287\tclose{#1}% avoid \code because of side effects on active chars
5047\interlinepenalty=10000
5048\advance\rightskip by 0pt plus 1fil
5049\endgraf\nobreak\vskip -\parskip\nobreak
5288 \defargscommonending
5050}
5051
5052% Do complete processing of one @defun or @defunx line already parsed.
5053
5054% @deffn Command forward-char nchars
5055
5056\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
5057
5058\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
5059\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
5289}
5290
5291% Do complete processing of one @defun or @defunx line already parsed.
5292
5293% @deffn Command forward-char nchars
5294
5295\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
5296
5297\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
5298\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
5060\catcode 61=\other % Turn off change made in \defparsebody
5299\catcode\equalChar=\other % Turn off change made in \defparsebody
5061}
5062
5063% @defun == @deffn Function
5064
5065\def\defun{\defparsebody\Edefun\defunx\defunheader}
5066
5067\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5068\begingroup\defname {#1}{\putwordDeffunc}%
5069\defunargs {#2}\endgroup %
5300}
5301
5302% @defun == @deffn Function
5303
5304\def\defun{\defparsebody\Edefun\defunx\defunheader}
5305
5306\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5307\begingroup\defname {#1}{\putwordDeffunc}%
5308\defunargs {#2}\endgroup %
5070\catcode 61=\other % Turn off change made in \defparsebody
5309\catcode\equalChar=\other % Turn off change made in \defparsebody
5071}
5072
5073% @deftypefun int foobar (int @var{foo}, float @var{bar})
5074
5075\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
5076
5077% #1 is the data type. #2 is the name and args.
5078\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
5079% #1 is the data type, #2 the name, #3 the args.
5080\def\deftypefunheaderx #1#2 #3\relax{%
5081\doind {fn}{\code{#2}}% Make entry in function index
5082\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
5083\deftypefunargs {#3}\endgroup %
5310}
5311
5312% @deftypefun int foobar (int @var{foo}, float @var{bar})
5313
5314\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
5315
5316% #1 is the data type. #2 is the name and args.
5317\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
5318% #1 is the data type, #2 the name, #3 the args.
5319\def\deftypefunheaderx #1#2 #3\relax{%
5320\doind {fn}{\code{#2}}% Make entry in function index
5321\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
5322\deftypefunargs {#3}\endgroup %
5084\catcode 61=\other % Turn off change made in \defparsebody
5323\catcode\equalChar=\other % Turn off change made in \defparsebody
5085}
5086
5087% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
5088
5089\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
5090
5091% \defheaderxcond#1\relax$.$
5092% puts #1 in @code, followed by a space, but does nothing if #1 is null.

--- 4 unchanged lines hidden (view full) ---

5097% #1 is the classification, #2 the data type, #3 the name, #4 the args.
5098\def\deftypefnheaderx #1#2#3 #4\relax{%
5099\doind {fn}{\code{#3}}% Make entry in function index
5100\begingroup
5101\normalparens % notably, turn off `&' magic, which prevents
5102% at least some C++ text from working
5103\defname {\defheaderxcond#2\relax$.$#3}{#1}%
5104\deftypefunargs {#4}\endgroup %
5324}
5325
5326% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
5327
5328\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
5329
5330% \defheaderxcond#1\relax$.$
5331% puts #1 in @code, followed by a space, but does nothing if #1 is null.

--- 4 unchanged lines hidden (view full) ---

5336% #1 is the classification, #2 the data type, #3 the name, #4 the args.
5337\def\deftypefnheaderx #1#2#3 #4\relax{%
5338\doind {fn}{\code{#3}}% Make entry in function index
5339\begingroup
5340\normalparens % notably, turn off `&' magic, which prevents
5341% at least some C++ text from working
5342\defname {\defheaderxcond#2\relax$.$#3}{#1}%
5343\deftypefunargs {#4}\endgroup %
5105\catcode 61=\other % Turn off change made in \defparsebody
5344\catcode\equalChar=\other % Turn off change made in \defparsebody
5106}
5107
5108% @defmac == @deffn Macro
5109
5110\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
5111
5112\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5113\begingroup\defname {#1}{\putwordDefmac}%
5114\defunargs {#2}\endgroup %
5345}
5346
5347% @defmac == @deffn Macro
5348
5349\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
5350
5351\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5352\begingroup\defname {#1}{\putwordDefmac}%
5353\defunargs {#2}\endgroup %
5115\catcode 61=\other % Turn off change made in \defparsebody
5354\catcode\equalChar=\other % Turn off change made in \defparsebody
5116}
5117
5118% @defspec == @deffn Special Form
5119
5120\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
5121
5122\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5123\begingroup\defname {#1}{\putwordDefspec}%
5124\defunargs {#2}\endgroup %
5355}
5356
5357% @defspec == @deffn Special Form
5358
5359\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
5360
5361\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
5362\begingroup\defname {#1}{\putwordDefspec}%
5363\defunargs {#2}\endgroup %
5125\catcode 61=\other % Turn off change made in \defparsebody
5364\catcode\equalChar=\other % Turn off change made in \defparsebody
5126}
5127
5128% @defop CATEGORY CLASS OPERATION ARG...
5129%
5130\def\defop #1 {\def\defoptype{#1}%
5131\defopparsebody\Edefop\defopx\defopheader\defoptype}
5132%
5133\def\defopheader#1#2#3{%
5365}
5366
5367% @defop CATEGORY CLASS OPERATION ARG...
5368%
5369\def\defop #1 {\def\defoptype{#1}%
5370\defopparsebody\Edefop\defopx\defopheader\defoptype}
5371%
5372\def\defopheader#1#2#3{%
5134\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
5135\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
5136\defunargs {#3}\endgroup %
5373 \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
5374 \begingroup
5375 \defname{#2}{\defoptype\ \putwordon\ #1}%
5376 \defunargs{#3}%
5377 \endgroup
5137}
5138
5139% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
5140%
5141\def\deftypeop #1 {\def\deftypeopcategory{#1}%
5142 \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
5143 \deftypeopcategory}
5144%

--- 50 unchanged lines hidden (view full) ---

5195}
5196
5197% @defcv {Class Option} foo-class foo-flag
5198
5199\def\defcv #1 {\def\defcvtype{#1}%
5200\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
5201
5202\def\defcvarheader #1#2#3{%
5378}
5379
5380% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
5381%
5382\def\deftypeop #1 {\def\deftypeopcategory{#1}%
5383 \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
5384 \deftypeopcategory}
5385%

--- 50 unchanged lines hidden (view full) ---

5436}
5437
5438% @defcv {Class Option} foo-class foo-flag
5439
5440\def\defcv #1 {\def\defcvtype{#1}%
5441\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
5442
5443\def\defcvarheader #1#2#3{%
5203\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
5204\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
5205\defvarargs {#3}\endgroup %
5444 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
5445 \begingroup
5446 \defname{#2}{\defcvtype\ \putwordof\ #1}%
5447 \defvarargs{#3}%
5448 \endgroup
5206}
5207
5208% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
5209%
5210\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
5211%
5212\def\defivarheader#1#2#3{%
5449}
5450
5451% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
5452%
5453\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
5454%
5455\def\defivarheader#1#2#3{%
5213 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
5456 \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
5214 \begingroup
5215 \defname{#2}{\putwordInstanceVariableof\ #1}%
5216 \defvarargs{#3}%
5217 \endgroup
5218}
5219
5220% @defvar
5221% First, define the processing that is wanted for arguments of @defvar.
5222% This is actually simple: just print them in roman.
5223% This must expand the args and terminate the paragraph they make up
5224\def\defvarargs #1{\normalparens #1%
5457 \begingroup
5458 \defname{#2}{\putwordInstanceVariableof\ #1}%
5459 \defvarargs{#3}%
5460 \endgroup
5461}
5462
5463% @defvar
5464% First, define the processing that is wanted for arguments of @defvar.
5465% This is actually simple: just print them in roman.
5466% This must expand the args and terminate the paragraph they make up
5467\def\defvarargs #1{\normalparens #1%
5225\interlinepenalty=10000
5226\endgraf\nobreak\vskip -\parskip\nobreak}
5468 \defargscommonending
5469}
5227
5228% @defvr Counter foo-count
5229
5230\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
5231
5232\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
5233\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
5234

--- 19 unchanged lines hidden (view full) ---

5254
5255\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
5256
5257% #1 is the data type. #2 is the name, perhaps followed by text that
5258% is actually part of the data type, which should not be put into the index.
5259\def\deftypevarheader #1#2{%
5260\dovarind#2 \relax% Make entry in variables index
5261\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
5470
5471% @defvr Counter foo-count
5472
5473\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
5474
5475\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
5476\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
5477

--- 19 unchanged lines hidden (view full) ---

5497
5498\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
5499
5500% #1 is the data type. #2 is the name, perhaps followed by text that
5501% is actually part of the data type, which should not be put into the index.
5502\def\deftypevarheader #1#2{%
5503\dovarind#2 \relax% Make entry in variables index
5504\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
5262\interlinepenalty=10000
5263\endgraf\nobreak\vskip -\parskip\nobreak
5505 \defargscommonending
5264\endgroup}
5265\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
5266
5267% @deftypevr {Global Flag} int enable
5268
5269\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
5270
5271\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
5272\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
5506\endgroup}
5507\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
5508
5509% @deftypevr {Global Flag} int enable
5510
5511\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
5512
5513\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
5514\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
5273\interlinepenalty=10000
5274\endgraf\nobreak\vskip -\parskip\nobreak
5515 \defargscommonending
5275\endgroup}
5276
5277% Now define @deftp
5278% Args are printed in bold, a slight difference from @defvar.
5279
5280\def\deftpargs #1{\bf \defvarargs{#1}}
5281
5282% @deftp Class window height width ...
5283
5284\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
5285
5286\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
5287\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
5288
5289% These definitions are used if you use @defunx (etc.)
5290% anywhere other than immediately after a @defun or @defunx.
5516\endgroup}
5517
5518% Now define @deftp
5519% Args are printed in bold, a slight difference from @defvar.
5520
5521\def\deftpargs #1{\bf \defvarargs{#1}}
5522
5523% @deftp Class window height width ...
5524
5525\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
5526
5527\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
5528\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
5529
5530% These definitions are used if you use @defunx (etc.)
5531% anywhere other than immediately after a @defun or @defunx.
5291%
5532%
5292\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
5293\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
5294\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
5295\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
5296\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
5297\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
5298\def\defopx#1 {\errmessage{@defopx in invalid context}}
5299\def\defspecx#1 {\errmessage{@defspecx in invalid context}}

--- 15 unchanged lines hidden (view full) ---

5315
5316% To do this right we need a feature of e-TeX, \scantokens,
5317% which we arrange to emulate with a temporary file in ordinary TeX.
5318\ifx\eTeXversion\undefined
5319 \newwrite\macscribble
5320 \def\scanmacro#1{%
5321 \begingroup \newlinechar`\^^M
5322 % Undo catcode changes of \startcontents and \doprintindex
5533\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
5534\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
5535\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
5536\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
5537\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
5538\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
5539\def\defopx#1 {\errmessage{@defopx in invalid context}}
5540\def\defspecx#1 {\errmessage{@defspecx in invalid context}}

--- 15 unchanged lines hidden (view full) ---

5556
5557% To do this right we need a feature of e-TeX, \scantokens,
5558% which we arrange to emulate with a temporary file in ordinary TeX.
5559\ifx\eTeXversion\undefined
5560 \newwrite\macscribble
5561 \def\scanmacro#1{%
5562 \begingroup \newlinechar`\^^M
5563 % Undo catcode changes of \startcontents and \doprintindex
5323 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
5564 \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
5324 % Append \endinput to make sure that TeX does not see the ending newline.
5325 \toks0={#1\endinput}%
5326 \immediate\openout\macscribble=\jobname.tmp
5327 \immediate\write\macscribble{\the\toks0}%
5328 \immediate\closeout\macscribble
5329 \let\xeatspaces\eatspaces
5330 \input \jobname.tmp
5331 \endgroup
5332}
5333\else
5334\def\scanmacro#1{%
5335\begingroup \newlinechar`\^^M
5336% Undo catcode changes of \startcontents and \doprintindex
5565 % Append \endinput to make sure that TeX does not see the ending newline.
5566 \toks0={#1\endinput}%
5567 \immediate\openout\macscribble=\jobname.tmp
5568 \immediate\write\macscribble{\the\toks0}%
5569 \immediate\closeout\macscribble
5570 \let\xeatspaces\eatspaces
5571 \input \jobname.tmp
5572 \endgroup
5573}
5574\else
5575\def\scanmacro#1{%
5576\begingroup \newlinechar`\^^M
5577% Undo catcode changes of \startcontents and \doprintindex
5337\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
5578\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
5338\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
5339\fi
5340
5341\newcount\paramno % Count of parameters
5342\newtoks\macname % Macro name
5343\newif\ifrecursive % Is it recursive?
5344\def\macrolist{} % List of all defined macros in the form
5345 % \do\macro1\do\macro2...

--- 13 unchanged lines hidden (view full) ---

5359\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
5360\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
5361\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
5362\def\unbrace#1{#1}
5363\unbrace{\gdef\trim@@@ #1 } #2@{#1}
5364}
5365
5366% Trim a single trailing ^^M off a string.
5579\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
5580\fi
5581
5582\newcount\paramno % Count of parameters
5583\newtoks\macname % Macro name
5584\newif\ifrecursive % Is it recursive?
5585\def\macrolist{} % List of all defined macros in the form
5586 % \do\macro1\do\macro2...

--- 13 unchanged lines hidden (view full) ---

5600\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
5601\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
5602\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
5603\def\unbrace#1{#1}
5604\unbrace{\gdef\trim@@@ #1 } #2@{#1}
5605}
5606
5607% Trim a single trailing ^^M off a string.
5367{\catcode`\^^M=12\catcode`\Q=3%
5608{\catcode`\^^M=\other \catcode`\Q=3%
5368\gdef\eatcr #1{\eatcra #1Q^^MQ}%
5369\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
5370\gdef\eatcrb#1Q#2Q{#1}%
5371}
5372
5373% Macro bodies are absorbed as an argument in a context where
5374% all characters are catcode 10, 11 or 12, except \ which is active
5375% (as in normal texinfo). It is necessary to change the definition of \.
5376
5377% It's necessary to have hard CRs when the macro is executed. This is
5378% done by making ^^M (\endlinechar) catcode 12 when reading the macro
5379% body, and then making it the \newlinechar in \scanmacro.
5380
5381\def\macrobodyctxt{%
5609\gdef\eatcr #1{\eatcra #1Q^^MQ}%
5610\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
5611\gdef\eatcrb#1Q#2Q{#1}%
5612}
5613
5614% Macro bodies are absorbed as an argument in a context where
5615% all characters are catcode 10, 11 or 12, except \ which is active
5616% (as in normal texinfo). It is necessary to change the definition of \.
5617
5618% It's necessary to have hard CRs when the macro is executed. This is
5619% done by making ^^M (\endlinechar) catcode 12 when reading the macro
5620% body, and then making it the \newlinechar in \scanmacro.
5621
5622\def\macrobodyctxt{%
5382 \catcode`\~=12
5383 \catcode`\^=12
5384 \catcode`\_=12
5385 \catcode`\|=12
5386 \catcode`\<=12
5387 \catcode`\>=12
5388 \catcode`\+=12
5389 \catcode`\{=12
5390 \catcode`\}=12
5391 \catcode`\@=12
5392 \catcode`\^^M=12
5623 \catcode`\~=\other
5624 \catcode`\^=\other
5625 \catcode`\_=\other
5626 \catcode`\|=\other
5627 \catcode`\<=\other
5628 \catcode`\>=\other
5629 \catcode`\+=\other
5630 \catcode`\{=\other
5631 \catcode`\}=\other
5632 \catcode`\@=\other
5633 \catcode`\^^M=\other
5393 \usembodybackslash}
5394
5395\def\macroargctxt{%
5634 \usembodybackslash}
5635
5636\def\macroargctxt{%
5396 \catcode`\~=12
5397 \catcode`\^=12
5398 \catcode`\_=12
5399 \catcode`\|=12
5400 \catcode`\<=12
5401 \catcode`\>=12
5402 \catcode`\+=12
5403 \catcode`\@=12
5404 \catcode`\\=12}
5637 \catcode`\~=\other
5638 \catcode`\^=\other
5639 \catcode`\_=\other
5640 \catcode`\|=\other
5641 \catcode`\<=\other
5642 \catcode`\>=\other
5643 \catcode`\+=\other
5644 \catcode`\@=\other
5645 \catcode`\\=\other}
5405
5406% \mbodybackslash is the definition of \ in @macro bodies.
5407% It maps \foo\ => \csname macarg.foo\endcsname => #N
5408% where N is the macro parameter number.
5409% We define \csname macarg.\endcsname to be \realbackslash, so
5410% \\ in macro replacement text gets you a backslash.
5411
5412{\catcode`@=0 @catcode`@\=@active

--- 24 unchanged lines hidden (view full) ---

5437 \xdef\macrolist{\the\toks0
5438 \expandafter\noexpand\csname\the\macname\endcsname}%
5439 \fi
5440 \begingroup \macrobodyctxt
5441 \ifrecursive \expandafter\parsermacbody
5442 \else \expandafter\parsemacbody
5443 \fi}
5444
5646
5647% \mbodybackslash is the definition of \ in @macro bodies.
5648% It maps \foo\ => \csname macarg.foo\endcsname => #N
5649% where N is the macro parameter number.
5650% We define \csname macarg.\endcsname to be \realbackslash, so
5651% \\ in macro replacement text gets you a backslash.
5652
5653{\catcode`@=0 @catcode`@\=@active

--- 24 unchanged lines hidden (view full) ---

5678 \xdef\macrolist{\the\toks0
5679 \expandafter\noexpand\csname\the\macname\endcsname}%
5680 \fi
5681 \begingroup \macrobodyctxt
5682 \ifrecursive \expandafter\parsermacbody
5683 \else \expandafter\parsemacbody
5684 \fi}
5685
5445\def\unmacro{\parsearg\unmacroxxx}
5446\def\unmacroxxx#1{%
5686\def\unmacro{\parsearg\dounmacro}
5687\def\dounmacro#1{%
5447 \if1\csname ismacro.#1\endcsname
5448 \global\cslet{#1}{macsave.#1}%
5449 \global\expandafter\let \csname ismacro.#1\endcsname=0%
5688 \if1\csname ismacro.#1\endcsname
5689 \global\cslet{#1}{macsave.#1}%
5690 \global\expandafter\let \csname ismacro.#1\endcsname=0%
5450 % Remove the macro name from \macrolist
5691 % Remove the macro name from \macrolist:
5451 \begingroup
5692 \begingroup
5452 \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
5453 \def\do##1{%
5454 \def\tempb{##1}%
5455 \ifx\tempa\tempb
5456 % remove this
5457 \else
5458 \toks0 = \expandafter{\newmacrolist\do}%
5459 \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
5460 \fi}%
5461 \def\newmacrolist{}%
5462 % Execute macro list to define \newmacrolist
5463 \macrolist
5464 \global\let\macrolist\newmacrolist
5693 \expandafter\let\csname#1\endcsname \relax
5694 \let\do\unmacrodo
5695 \xdef\macrolist{\macrolist}%
5465 \endgroup
5466 \else
5467 \errmessage{Macro #1 not defined}%
5468 \fi
5469}
5470
5696 \endgroup
5697 \else
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%
5710 \fi
5711}
5712
5471% This makes use of the obscure feature that if the last token of a
5472% <parameter list> is #, then the preceding argument is delimited by
5473% an opening brace, and that opening brace is not consumed.
5474\def\getargs#1{\getargsxxx#1{}}
5475\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
5476\def\getmacname #1 #2\relax{\macname={#1}}
5477\def\getmacargs#1{\def\argl{#1}}
5478

--- 131 unchanged lines hidden (view full) ---

5610
5611% @inforef is relatively simple.
5612\def\inforef #1{\inforefzzz #1,,,,**}
5613\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
5614 node \samp{\ignorespaces#1{}}}
5615
5616% @node's job is to define \lastnode.
5617\def\node{\ENVcheck\parsearg\nodezzz}
5713% This makes use of the obscure feature that if the last token of a
5714% <parameter list> is #, then the preceding argument is delimited by
5715% an opening brace, and that opening brace is not consumed.
5716\def\getargs#1{\getargsxxx#1{}}
5717\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
5718\def\getmacname #1 #2\relax{\macname={#1}}
5719\def\getmacargs#1{\def\argl{#1}}
5720

--- 131 unchanged lines hidden (view full) ---

5852
5853% @inforef is relatively simple.
5854\def\inforef #1{\inforefzzz #1,,,,**}
5855\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
5856 node \samp{\ignorespaces#1{}}}
5857
5858% @node's job is to define \lastnode.
5859\def\node{\ENVcheck\parsearg\nodezzz}
5618\def\nodezzz#1{\nodexxx [#1,]}
5619\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
5860\def\nodezzz#1{\nodexxx #1,\finishnodeparse}
5861\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
5620\let\nwnode=\node
5621\let\lastnode=\relax
5622
5623% The sectioning commands (@chapter, etc.) call these.
5624\def\donoderef{%
5625 \ifx\lastnode\relax\else
5626 \expandafter\expandafter\expandafter\setref{\lastnode}%
5627 {Ysectionnumberandtype}%

--- 17 unchanged lines hidden (view full) ---

5645
5646% @anchor{NAME} -- define xref target at arbitrary point.
5647%
5648\newcount\savesfregister
5649\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
5650\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
5651\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
5652
5862\let\nwnode=\node
5863\let\lastnode=\relax
5864
5865% The sectioning commands (@chapter, etc.) call these.
5866\def\donoderef{%
5867 \ifx\lastnode\relax\else
5868 \expandafter\expandafter\expandafter\setref{\lastnode}%
5869 {Ysectionnumberandtype}%

--- 17 unchanged lines hidden (view full) ---

5887
5888% @anchor{NAME} -- define xref target at arbitrary point.
5889%
5890\newcount\savesfregister
5891\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
5892\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
5893\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
5894
5653% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
5654% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
5655% to set \indexdummies so commands such as @code in a section title
5656% aren't expanded. It would be nicer not to expand the titles in the
5657% first place, but there's so many layers that that is hard to do.
5895% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
5896% anchor), namely NAME-title (the corresponding @chapter/etc. name),
5897% NAME-pg (the page number), and NAME-snt (section number and type).
5898% Called from \foonoderef.
5658%
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.
5906%
5659\def\setref#1#2{{%
5907\def\setref#1#2{{%
5660 \indexdummies
5908 \atdummies
5661 \pdfmkdest{#1}%
5909 \pdfmkdest{#1}%
5910 %
5911 \turnoffactive
5662 \dosetq{#1-title}{Ytitle}%
5663 \dosetq{#1-pg}{Ypagenumber}%
5664 \dosetq{#1-snt}{#2}%
5665}}
5666
5667% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
5668% the node name, #2 the name of the Info cross-reference, #3 the printed
5669% node name, #4 the name of the Info file, #5 the name of the printed

--- 35 unchanged lines hidden (view full) ---

5705 % insert empty discretionaries after hyphens, which means that it will
5706 % not find a line break at a hyphen in a node names. Since some manuals
5707 % are best written with fairly long node names, containing hyphens, this
5708 % is a loss. Therefore, we give the text of the node name again, so it
5709 % is as if TeX is seeing it for the first time.
5710 \ifpdf
5711 \leavevmode
5712 \getfilename{#4}%
5912 \dosetq{#1-title}{Ytitle}%
5913 \dosetq{#1-pg}{Ypagenumber}%
5914 \dosetq{#1-snt}{#2}%
5915}}
5916
5917% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
5918% the node name, #2 the name of the Info cross-reference, #3 the printed
5919% node name, #4 the name of the Info file, #5 the name of the printed

--- 35 unchanged lines hidden (view full) ---

5955 % insert empty discretionaries after hyphens, which means that it will
5956 % not find a line break at a hyphen in a node names. Since some manuals
5957 % are best written with fairly long node names, containing hyphens, this
5958 % is a loss. Therefore, we give the text of the node name again, so it
5959 % is as if TeX is seeing it for the first time.
5960 \ifpdf
5961 \leavevmode
5962 \getfilename{#4}%
5713 {\normalturnoffactive
5963 {\turnoffactive \otherbackslash
5714 \ifnum\filenamelength>0
5715 \startlink attr{/Border [0 0 0]}%
5716 goto file{\the\filename.pdf} name{#1}%
5717 \else
5718 \startlink attr{/Border [0 0 0]}%
5719 goto name{#1}%
5720 \fi
5721 }%
5722 \linkcolor
5723 \fi
5724 %
5725 \ifdim \wd1 > 0pt
5726 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
5727 \else
5728 % _ (for example) has to be the character _ for the purposes of the
5729 % control sequence corresponding to the node, but it has to expand
5730 % into the usual \leavevmode...\vrule stuff for purposes of
5731 % printing. So we \turnoffactive for the \refx-snt, back on for the
5732 % printing, back off for the \refx-pg.
5964 \ifnum\filenamelength>0
5965 \startlink attr{/Border [0 0 0]}%
5966 goto file{\the\filename.pdf} name{#1}%
5967 \else
5968 \startlink attr{/Border [0 0 0]}%
5969 goto name{#1}%
5970 \fi
5971 }%
5972 \linkcolor
5973 \fi
5974 %
5975 \ifdim \wd1 > 0pt
5976 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
5977 \else
5978 % _ (for example) has to be the character _ for the purposes of the
5979 % control sequence corresponding to the node, but it has to expand
5980 % into the usual \leavevmode...\vrule stuff for purposes of
5981 % printing. So we \turnoffactive for the \refx-snt, back on for the
5982 % printing, back off for the \refx-pg.
5733 {\normalturnoffactive
5983 {\turnoffactive \otherbackslash
5734 % Only output a following space if the -snt ref is nonempty; for
5735 % @unnumbered and @anchor, it won't be.
5736 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
5737 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
5738 }%
5984 % Only output a following space if the -snt ref is nonempty; for
5985 % @unnumbered and @anchor, it won't be.
5986 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
5987 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
5988 }%
5739 % [mynode],
5740 [\printednodename],\space
5741 % page 3
5742 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
5989 % output the `[mynode]' via a macro.
5990 \xrefprintnodename\printednodename
5991 %
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}{}%
5743 \fi
5744 \endlink
5745\endgroup}
5746
5997 \fi
5998 \endlink
5999\endgroup}
6000
5747% \dosetq is the interface for calls from other macros
6001% This macro is called from \xrefX for the `[nodename]' part of xref
6002% output. It's a separate macro only so it can be changed more easily,
6003% since not square brackets don't work in some documents. Particularly
6004% one that Bob is working on :).
6005%
6006\def\xrefprintnodename#1{[#1]}
5748
6007
5749% Use \normalturnoffactive so that punctuation chars such as underscore
5750% and backslash work in node names. (\turnoffactive doesn't do \.)
6008% \dosetq is called from \setref to do the actual \write (\iflinks).
6009%
5751\def\dosetq#1#2{%
5752 {\let\folio=0%
6010\def\dosetq#1#2{%
6011 {\let\folio=0%
5753 \normalturnoffactive
5754 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
6012 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
5755 \iflinks
5756 \next
5757 \fi
6013 \iflinks \next \fi
5758 }%
5759}
5760
6014 }%
6015}
6016
5761% \internalsetq {foo}{page} expands into
5762% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
5763% When the aux file is read, ' is the escape character
6017% \internalsetq{foo}{page} expands into
6018% CHARACTERS @xrdef{foo}{...expansion of \page...}
6019\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
5764
6020
5765\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
5766
5767% Things to be expanded by \internalsetq
5768
6021% Things to be expanded by \internalsetq.
6022%
5769\def\Ypagenumber{\folio}
6023\def\Ypagenumber{\folio}
5770
5771\def\Ytitle{\thissection}
6024\def\Ytitle{\thissection}
5772
5773\def\Ynothing{}
6025\def\Ynothing{}
5774
5775\def\Ysectionnumberandtype{%
6026\def\Ysectionnumberandtype{%
5776\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
5777\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
5778\else \ifnum \subsubsecno=0 %
5779\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
5780\else %
5781\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
5782\fi \fi \fi }
6027 \ifnum\secno=0
6028 \putwordChapter@tie \the\chapno
6029 \else \ifnum\subsecno=0
6030 \putwordSection@tie \the\chapno.\the\secno
6031 \else \ifnum\subsubsecno=0
6032 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
6033 \else
6034 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
6035 \fi\fi\fi
6036}
5783
5784\def\Yappendixletterandtype{%
6037
6038\def\Yappendixletterandtype{%
5785\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
5786\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
5787\else \ifnum \subsubsecno=0 %
5788\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
5789\else %
5790\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
5791\fi \fi \fi }
6039 \ifnum\secno=0
6040 \putwordAppendix@tie @char\the\appendixno{}%
6041 \else \ifnum\subsecno=0
6042 \putwordSection@tie @char\the\appendixno.\the\secno
6043 \else \ifnum\subsubsecno=0
6044 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
6045 \else
6046 \putwordSection@tie
6047 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
6048 \fi\fi\fi
6049}
5792
6050
5793\gdef\xreftie{'tie}
5794
5795% Use TeX 3.0's \inputlineno to get the line number, for better error
5796% messages, but if we're using an old version of TeX, don't do anything.
5797%
5798\ifx\inputlineno\thisisundefined
6051% Use TeX 3.0's \inputlineno to get the line number, for better error
6052% messages, but if we're using an old version of TeX, don't do anything.
6053%
6054\ifx\inputlineno\thisisundefined
5799 \let\linenumber = \empty % Non-3.0.
6055 \let\linenumber = \empty % Pre-3.0.
5800\else
5801 \def\linenumber{\the\inputlineno:\space}
5802\fi
5803
5804% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
5805% If its value is nonempty, SUFFIX is output afterward.
6056\else
6057 \def\linenumber{\the\inputlineno:\space}
6058\fi
6059
6060% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
6061% If its value is nonempty, SUFFIX is output afterward.
5806
6062%
5807\def\refx#1#2{%
6063\def\refx#1#2{%
5808 \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
5809 % If not defined, say something at least.
5810 \angleleft un\-de\-fined\angleright
5811 \iflinks
5812 \ifhavexrefs
5813 \message{\linenumber Undefined cross reference `#1'.}%
5814 \else
5815 \ifwarnedxrefs\else
5816 \global\warnedxrefstrue
5817 \message{Cross reference values unknown; you must run TeX again.}%
5818 \fi
5819 \fi
5820 \fi
5821 \else
5822 % It's defined, so just use it.
6071 % If not defined, say something at least.
6072 \angleleft un\-de\-fined\angleright
6073 \iflinks
6074 \ifhavexrefs
6075 \message{\linenumber Undefined cross reference `#1'.}%
6076 \else
6077 \ifwarnedxrefs\else
6078 \global\warnedxrefstrue
6079 \message{Cross reference values unknown; you must run TeX again.}%
6080 \fi
6081 \fi
6082 \fi
6083 \else
6084 % It's defined, so just use it.
5823 \csname X#1\endcsname
6085 \thisrefX
5824 \fi
5825 #2% Output the suffix in any case.
5826}
5827
5828% This is the macro invoked by entries in the aux file.
5829%
6086 \fi
6087 #2% Output the suffix in any case.
6088}
6089
6090% This is the macro invoked by entries in the aux file.
6091%
5830\def\xrdef#1{\begingroup
5831 % Reenable \ as an escape while reading the second argument.
5832 \catcode`\\ = 0
5833 \afterassignment\endgroup
5834 \expandafter\gdef\csname X#1\endcsname
5835}
6092\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
5836
5837% Read the last existing aux file, if any. No error if none exists.
5838\def\readauxfile{\begingroup
5839 \catcode`\^^@=\other
5840 \catcode`\^^A=\other
5841 \catcode`\^^B=\other
5842 \catcode`\^^C=\other
5843 \catcode`\^^D=\other

--- 14 unchanged lines hidden (view full) ---

5858 \catcode`\^^W=\other
5859 \catcode`\^^X=\other
5860 \catcode`\^^Z=\other
5861 \catcode`\^^[=\other
5862 \catcode`\^^\=\other
5863 \catcode`\^^]=\other
5864 \catcode`\^^^=\other
5865 \catcode`\^^_=\other
6093
6094% Read the last existing aux file, if any. No error if none exists.
6095\def\readauxfile{\begingroup
6096 \catcode`\^^@=\other
6097 \catcode`\^^A=\other
6098 \catcode`\^^B=\other
6099 \catcode`\^^C=\other
6100 \catcode`\^^D=\other

--- 14 unchanged lines hidden (view full) ---

6115 \catcode`\^^W=\other
6116 \catcode`\^^X=\other
6117 \catcode`\^^Z=\other
6118 \catcode`\^^[=\other
6119 \catcode`\^^\=\other
6120 \catcode`\^^]=\other
6121 \catcode`\^^^=\other
6122 \catcode`\^^_=\other
5866 \catcode`\@=\other
5867 \catcode`\^=\other
5868 % It was suggested to define this as 7, which would allow ^^e4 etc.
6123 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
5869 % in xref tags, i.e., node names. But since ^^e4 notation isn't
5870 % supported in the main text, it doesn't seem desirable. Furthermore,
5871 % that is not enough: for node names that actually contain a ^
5872 % character, we would end up writing a line like this: 'xrdef {'hat
5873 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
5874 % argument, and \hat is not an expandable control sequence. It could
5875 % all be worked out, but why? Either we support ^^ or we don't.
5876 %
5877 % The other change necessary for this was to define \auxhat:
5878 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
5879 % and then to call \auxhat in \setq.
5880 %
6124 % in xref tags, i.e., node names. But since ^^e4 notation isn't
6125 % supported in the main text, it doesn't seem desirable. Furthermore,
6126 % that is not enough: for node names that actually contain a ^
6127 % character, we would end up writing a line like this: 'xrdef {'hat
6128 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
6129 % argument, and \hat is not an expandable control sequence. It could
6130 % all be worked out, but why? Either we support ^^ or we don't.
6131 %
6132 % The other change necessary for this was to define \auxhat:
6133 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
6134 % and then to call \auxhat in \setq.
6135 %
6136 \catcode`\^=\other
6137 %
6138 % Special characters. Should be turned off anyway, but...
5881 \catcode`\~=\other
5882 \catcode`\[=\other
5883 \catcode`\]=\other
5884 \catcode`\"=\other
5885 \catcode`\_=\other
5886 \catcode`\|=\other
5887 \catcode`\<=\other
5888 \catcode`\>=\other
5889 \catcode`\$=\other
5890 \catcode`\#=\other
5891 \catcode`\&=\other
6139 \catcode`\~=\other
6140 \catcode`\[=\other
6141 \catcode`\]=\other
6142 \catcode`\"=\other
6143 \catcode`\_=\other
6144 \catcode`\|=\other
6145 \catcode`\<=\other
6146 \catcode`\>=\other
6147 \catcode`\$=\other
6148 \catcode`\#=\other
6149 \catcode`\&=\other
6150 \catcode`\%=\other
5892 \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 %
5893 % Make the characters 128-255 be printing characters
5894 {%
5895 \count 1=128
5896 \def\loop{%
5897 \catcode\count 1=\other
5898 \advance\count 1 by 1
5899 \ifnum \count 1<256 \loop \fi
5900 }%
5901 }%
6153 % Make the characters 128-255 be printing characters
6154 {%
6155 \count 1=128
6156 \def\loop{%
6157 \catcode\count 1=\other
6158 \advance\count 1 by 1
6159 \ifnum \count 1<256 \loop \fi
6160 }%
6161 }%
5902 % The aux file uses ' as the escape (for now).
6162 %
5903 % Turn off \ as an escape so we do not lose on
5904 % entries which were dumped with control sequences in their names.
6163 % Turn off \ as an escape so we do not lose on
6164 % entries which were dumped with control sequences in their names.
5905 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
6165 % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
5906 % Reference to such entries still does not work the way one would wish,
5907 % but at least they do not bomb out when the aux file is read in.
6166 % Reference to such entries still does not work the way one would wish,
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.
5908 \catcode`\{=1
5909 \catcode`\}=2
6171 \catcode`\{=1
6172 \catcode`\}=2
5910 \catcode`\%=\other
5911 \catcode`\'=0
5912 \catcode`\\=\other
6173 \catcode`\@=0
5913 %
5914 \openin 1 \jobname.aux
5915 \ifeof 1 \else
5916 \closein 1
5917 \input \jobname.aux
5918 \global\havexrefstrue
5919 \global\warnedobstrue
5920 \fi

--- 17 unchanged lines hidden (view full) ---

5938\let\footnotestyle=\comment
5939
5940\let\ptexfootnote=\footnote
5941
5942{\catcode `\@=11
5943%
5944% Auto-number footnotes. Otherwise like plain.
5945\gdef\footnote{%
6174 %
6175 \openin 1 \jobname.aux
6176 \ifeof 1 \else
6177 \closein 1
6178 \input \jobname.aux
6179 \global\havexrefstrue
6180 \global\warnedobstrue
6181 \fi

--- 17 unchanged lines hidden (view full) ---

6199\let\footnotestyle=\comment
6200
6201\let\ptexfootnote=\footnote
6202
6203{\catcode `\@=11
6204%
6205% Auto-number footnotes. Otherwise like plain.
6206\gdef\footnote{%
6207 \let\indent=\ptexindent
5946 \global\advance\footnoteno by \@ne
5947 \edef\thisfootno{$^{\the\footnoteno}$}%
5948 %
5949 % In case the footnote comes at the end of a sentence, preserve the
5950 % extra spacing after we do the footnote number.
5951 \let\@sf\empty
6208 \global\advance\footnoteno by \@ne
6209 \edef\thisfootno{$^{\the\footnoteno}$}%
6210 %
6211 % In case the footnote comes at the end of a sentence, preserve the
6212 % extra spacing after we do the footnote number.
6213 \let\@sf\empty
5952 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
6214 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
5953 %
5954 % Remove inadvertent blank space before typesetting the footnote number.
5955 \unskip
5956 \thisfootno\@sf
6215 %
6216 % Remove inadvertent blank space before typesetting the footnote number.
6217 \unskip
6218 \thisfootno\@sf
5957 \footnotezzz
6219 \dofootnote
5958}%
5959
5960% Don't bother with the trickery in plain.tex to not require the
5961% footnote text as a parameter. Our footnotes don't need to be so general.
5962%
5963% Oh yes, they do; otherwise, @ifset and anything else that uses
5964% \parseargline fail inside footnotes because the tokens are fixed when
5965% the footnote is read. --karl, 16nov96.
5966%
6220}%
6221
6222% Don't bother with the trickery in plain.tex to not require the
6223% footnote text as a parameter. Our footnotes don't need to be so general.
6224%
6225% Oh yes, they do; otherwise, @ifset and anything else that uses
6226% \parseargline fail inside footnotes because the tokens are fixed when
6227% the footnote is read. --karl, 16nov96.
6228%
5967\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
5968 % We want to typeset this text as a normal paragraph, even if the
5969 % footnote reference occurs in (for example) a display environment.
5970 % So reset some parameters.
6236 % We want to typeset this text as a normal paragraph, even if the
6237 % footnote reference occurs in (for example) a display environment.
6238 % So reset some parameters.
6239 \hsize=\pagewidth
5971 \interlinepenalty\interfootnotelinepenalty
5972 \splittopskip\ht\strutbox % top baseline for broken footnotes
5973 \splitmaxdepth\dp\strutbox
5974 \floatingpenalty\@MM
5975 \leftskip\z@skip
5976 \rightskip\z@skip
5977 \spaceskip\z@skip
5978 \xspaceskip\z@skip

--- 13 unchanged lines hidden (view full) ---

5992 \textindent{\thisfootno}%
5993 %
5994 % Don't crash into the line above the footnote text. Since this
5995 % expands into a box, it must come within the paragraph, lest it
5996 % provide a place where TeX can split the footnote.
5997 \footstrut
5998 \futurelet\next\fo@t
5999}
6240 \interlinepenalty\interfootnotelinepenalty
6241 \splittopskip\ht\strutbox % top baseline for broken footnotes
6242 \splitmaxdepth\dp\strutbox
6243 \floatingpenalty\@MM
6244 \leftskip\z@skip
6245 \rightskip\z@skip
6246 \spaceskip\z@skip
6247 \xspaceskip\z@skip

--- 13 unchanged lines hidden (view full) ---

6261 \textindent{\thisfootno}%
6262 %
6263 % Don't crash into the line above the footnote text. Since this
6264 % expands into a box, it must come within the paragraph, lest it
6265 % provide a place where TeX can split the footnote.
6266 \footstrut
6267 \futurelet\next\fo@t
6268}
6000\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
6001 \else\let\next\f@t\fi \next}
6002\def\f@@t{\bgroup\aftergroup\@foot\let\next}
6003\def\f@t#1{#1\@foot}
6004\def\@foot{\strut\par\egroup}
6005
6006}%end \catcode `\@=11
6007
6008% @| inserts a changebar to the left of the current line. It should
6009% surround any changed text. This approach does *not* work if the
6010% change spans more than two lines of output. To handle that, we would
6011% have adopt a much more difficult approach (putting marks into the main
6012% vertical list for the beginning and end of each change).
6013%

--- 30 unchanged lines hidden (view full) ---

6044% If epsf.tex is not installed and @image is used, we complain.
6045%
6046% Check for and read epsf.tex up front. If we read it only at @image
6047% time, we might be inside a group, and then its definitions would get
6048% undone and the next image would fail.
6049\openin 1 = epsf.tex
6050\ifeof 1 \else
6051 \closein 1
6269}%end \catcode `\@=11
6270
6271% @| inserts a changebar to the left of the current line. It should
6272% surround any changed text. This approach does *not* work if the
6273% change spans more than two lines of output. To handle that, we would
6274% have adopt a much more difficult approach (putting marks into the main
6275% vertical list for the beginning and end of each change).
6276%

--- 30 unchanged lines hidden (view full) ---

6307% If epsf.tex is not installed and @image is used, we complain.
6308%
6309% Check for and read epsf.tex up front. If we read it only at @image
6310% time, we might be inside a group, and then its definitions would get
6311% undone and the next image would fail.
6312\openin 1 = epsf.tex
6313\ifeof 1 \else
6314 \closein 1
6052 % Do not bother showing banner with post-v2.7 epsf.tex (available in
6053 % doc/epsf.tex until it shows up on ctan).
6315 % Do not bother showing banner with epsf.tex v2.7k (available in
6316 % doc/epsf.tex and on ctan).
6054 \def\epsfannounce{\toks0 = }%
6055 \input epsf.tex
6056\fi
6057%
6058% We will only complain once about lack of epsf.tex.
6059\newif\ifwarnednoepsf
6060\newhelp\noepsfhelp{epsf.tex must be installed for images to
6061 work. It is also included in the Texinfo distribution, or you can get

--- 22 unchanged lines hidden (view full) ---

6084 \catcode`\^^M = 5 % in case we're inside an example
6085 \normalturnoffactive % allow _ et al. in names
6086 % If the image is by itself, center it.
6087 \ifvmode
6088 \imagevmodetrue
6089 \nobreak\bigskip
6090 % Usually we'll have text after the image which will insert
6091 % \parskip glue, so insert it here too to equalize the space
6317 \def\epsfannounce{\toks0 = }%
6318 \input epsf.tex
6319\fi
6320%
6321% We will only complain once about lack of epsf.tex.
6322\newif\ifwarnednoepsf
6323\newhelp\noepsfhelp{epsf.tex must be installed for images to
6324 work. It is also included in the Texinfo distribution, or you can get

--- 22 unchanged lines hidden (view full) ---

6347 \catcode`\^^M = 5 % in case we're inside an example
6348 \normalturnoffactive % allow _ et al. in names
6349 % If the image is by itself, center it.
6350 \ifvmode
6351 \imagevmodetrue
6352 \nobreak\bigskip
6353 % Usually we'll have text after the image which will insert
6354 % \parskip glue, so insert it here too to equalize the space
6092 % above and below.
6355 % above and below.
6093 \nobreak\vskip\parskip
6094 \nobreak
6095 \line\bgroup\hss
6096 \fi
6097 %
6098 % Output the image.
6099 \ifpdf
6100 \dopdfimage{#1}{#2}{#3}%

--- 71 unchanged lines hidden (view full) ---

6172 \else
6173 \emergencystretch = .15\hsize
6174 \fi
6175}
6176
6177% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
6178% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
6179% physical page width.
6356 \nobreak\vskip\parskip
6357 \nobreak
6358 \line\bgroup\hss
6359 \fi
6360 %
6361 % Output the image.
6362 \ifpdf
6363 \dopdfimage{#1}{#2}{#3}%

--- 71 unchanged lines hidden (view full) ---

6435 \else
6436 \emergencystretch = .15\hsize
6437 \fi
6438}
6439
6440% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
6441% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
6442% physical page width.
6180%
6443%
6181% We also call \setleading{\textleading}, so the caller should define
6182% \textleading. The caller should also set \parskip.
6183%
6184\def\internalpagesizes#1#2#3#4#5#6#7#8{%
6185 \voffset = #3\relax
6186 \topskip = #6\relax
6187 \splittopskip = \topskip
6188 %

--- 17 unchanged lines hidden (view full) ---

6206 \fi
6207 %
6208 \setleading{\textleading}
6209 %
6210 \parindent = \defaultparindent
6211 \setemergencystretch
6212}
6213
6444% We also call \setleading{\textleading}, so the caller should define
6445% \textleading. The caller should also set \parskip.
6446%
6447\def\internalpagesizes#1#2#3#4#5#6#7#8{%
6448 \voffset = #3\relax
6449 \topskip = #6\relax
6450 \splittopskip = \topskip
6451 %

--- 17 unchanged lines hidden (view full) ---

6469 \fi
6470 %
6471 \setleading{\textleading}
6472 %
6473 \parindent = \defaultparindent
6474 \setemergencystretch
6475}
6476
6214% Use `small' versions.
6215%
6216\def\smallenvironments{%
6217 \let\smalldisplay = \smalldisplayx
6218 \let\smallexample = \smalllispx
6219 \let\smallformat = \smallformatx
6220 \let\smalllisp = \smalllispx
6221}
6222
6223% @letterpaper (the default).
6224\def\letterpaper{{\globaldefs = 1
6225 \parskip = 3pt plus 2pt minus 1pt
6226 \textleading = 13.2pt
6227 %
6228 % If page is nothing but text, make it come out even.
6229 \internalpagesizes{46\baselineskip}{6in}%
6230 {\voffset}{.25in}%

--- 11 unchanged lines hidden (view full) ---

6242 {\bindingoffset}{16pt}%
6243 {9.25in}{7in}%
6244 %
6245 \lispnarrowing = 0.3in
6246 \tolerance = 700
6247 \hfuzz = 1pt
6248 \contentsrightmargin = 0pt
6249 \defbodyindent = .5cm
6477% @letterpaper (the default).
6478\def\letterpaper{{\globaldefs = 1
6479 \parskip = 3pt plus 2pt minus 1pt
6480 \textleading = 13.2pt
6481 %
6482 % If page is nothing but text, make it come out even.
6483 \internalpagesizes{46\baselineskip}{6in}%
6484 {\voffset}{.25in}%

--- 11 unchanged lines hidden (view full) ---

6496 {\bindingoffset}{16pt}%
6497 {9.25in}{7in}%
6498 %
6499 \lispnarrowing = 0.3in
6500 \tolerance = 700
6501 \hfuzz = 1pt
6502 \contentsrightmargin = 0pt
6503 \defbodyindent = .5cm
6250 \smallenvironments
6251}}
6252
6253% Use @afourpaper to print on European A4 paper.
6254\def\afourpaper{{\globaldefs = 1
6255 \parskip = 3pt plus 2pt minus 1pt
6256 \textleading = 13.2pt
6257 %
6504}}
6505
6506% Use @afourpaper to print on European A4 paper.
6507\def\afourpaper{{\globaldefs = 1
6508 \parskip = 3pt plus 2pt minus 1pt
6509 \textleading = 13.2pt
6510 %
6258 % Double-side printing via postscript on Laserjet 4050
6511 % Double-side printing via postscript on Laserjet 4050
6259 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
6260 % To change the settings for a different printer or situation, adjust
6261 % \normaloffset until the front-side and back-side texts align. Then
6262 % do the same for \bindingoffset. You can set these for testing in
6263 % your texinfo source file like this:
6264 % @tex
6265 % \global\normaloffset = -6mm
6266 % \global\bindingoffset = 10mm

--- 22 unchanged lines hidden (view full) ---

6289 {210mm}{148mm}%
6290 %
6291 \lispnarrowing = 0.2in
6292 \tolerance = 800
6293 \hfuzz = 1.2pt
6294 \contentsrightmargin = 0pt
6295 \defbodyindent = 2mm
6296 \tableindent = 12mm
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

--- 22 unchanged lines hidden (view full) ---

6542 {210mm}{148mm}%
6543 %
6544 \lispnarrowing = 0.2in
6545 \tolerance = 800
6546 \hfuzz = 1.2pt
6547 \contentsrightmargin = 0pt
6548 \defbodyindent = 2mm
6549 \tableindent = 12mm
6297 %
6298 \smallenvironments
6299}}
6300
6550}}
6551
6301% A specific text layout, 24x15cm overall, intended for A4 paper.
6552% A specific text layout, 24x15cm overall, intended for A4 paper.
6302\def\afourlatex{{\globaldefs = 1
6303 \afourpaper
6304 \internalpagesizes{237mm}{150mm}%
6305 {\voffset}{4.6mm}%
6306 {\bindingoffset}{7mm}%
6307 {297mm}{210mm}%
6308 %
6309 % Must explicitly reset to 0 because we call \afourpaper.

--- 91 unchanged lines hidden (view full) ---

6401\def~{{\tt\char126}}
6402\chardef\hat=`\^
6403\catcode`\^=\active
6404\def^{{\tt \hat}}
6405
6406\catcode`\_=\active
6407\def_{\ifusingtt\normalunderscore\_}
6408% Subroutine for the previous macro.
6553\def\afourlatex{{\globaldefs = 1
6554 \afourpaper
6555 \internalpagesizes{237mm}{150mm}%
6556 {\voffset}{4.6mm}%
6557 {\bindingoffset}{7mm}%
6558 {297mm}{210mm}%
6559 %
6560 % Must explicitly reset to 0 because we call \afourpaper.

--- 91 unchanged lines hidden (view full) ---

6652\def~{{\tt\char126}}
6653\chardef\hat=`\^
6654\catcode`\^=\active
6655\def^{{\tt \hat}}
6656
6657\catcode`\_=\active
6658\def_{\ifusingtt\normalunderscore\_}
6659% Subroutine for the previous macro.
6409\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
6660\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
6410
6411\catcode`\|=\active
6412\def|{{\tt\char124}}
6413\chardef \less=`\<
6414\catcode`\<=\active
6415\def<{{\tt \less}}
6416\chardef \gtr=`\>
6417\catcode`\>=\active
6418\def>{{\tt \gtr}}
6419\catcode`\+=\active
6420\def+{{\tt \char 43}}
6421\catcode`\$=\active
6422\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
6661
6662\catcode`\|=\active
6663\def|{{\tt\char124}}
6664\chardef \less=`\<
6665\catcode`\<=\active
6666\def<{{\tt \less}}
6667\chardef \gtr=`\>
6668\catcode`\>=\active
6669\def>{{\tt \gtr}}
6670\catcode`\+=\active
6671\def+{{\tt \char 43}}
6672\catcode`\$=\active
6673\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
6423%\catcode 27=\active
6424%\def^^[{$\diamondsuit$}
6425
6426% Set up an active definition for =, but don't enable it most of the time.
6427{\catcode`\==\active
6428\global\def={{\tt \char 61}}}
6429
6430\catcode`+=\active
6431\catcode`\_=\active
6432
6433% If a .fmt file is being used, characters that might appear in a file
6434% name cannot be active until we have parsed the command line.
6435% So turn them off again, and have \everyjob (or @setfilename) turn them on.
6436% \otherifyactive is called near the end of this file.
6437\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
6438
6439\catcode`\@=0
6440
6674
6675% Set up an active definition for =, but don't enable it most of the time.
6676{\catcode`\==\active
6677\global\def={{\tt \char 61}}}
6678
6679\catcode`+=\active
6680\catcode`\_=\active
6681
6682% If a .fmt file is being used, characters that might appear in a file
6683% name cannot be active until we have parsed the command line.
6684% So turn them off again, and have \everyjob (or @setfilename) turn them on.
6685% \otherifyactive is called near the end of this file.
6686\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
6687
6688\catcode`\@=0
6689
6441% \rawbackslashxx output one backslash character in current font
6690% \rawbackslashxx outputs one backslash character in current font,
6691% as in \char`\\.
6442\global\chardef\rawbackslashxx=`\\
6692\global\chardef\rawbackslashxx=`\\
6443%{\catcode`\\=\other
6444%@gdef@rawbackslashxx{\}}
6445
6693
6446% \rawbackslash redefines \ as input to do \rawbackslashxx.
6694% \rawbackslash defines an active \ to do \rawbackslashxx.
6695% \otherbackslash defines an active \ to be a literal `\' character with
6696% catcode other.
6447{\catcode`\\=\active
6697{\catcode`\\=\active
6448@gdef@rawbackslash{@let\=@rawbackslashxx }}
6698 @gdef@rawbackslash{@let\=@rawbackslashxx}
6699 @gdef@otherbackslash{@let\=@realbackslash}
6700}
6449
6701
6702% \realbackslash is an actual character `\' with catcode other.
6703{\catcode`\\=\other @gdef@realbackslash{\}}
6704
6450% \normalbackslash outputs one backslash in fixed width font.
6451\def\normalbackslash{{\tt\rawbackslashxx}}
6452
6705% \normalbackslash outputs one backslash in fixed width font.
6706\def\normalbackslash{{\tt\rawbackslashxx}}
6707
6453% \catcode 17=0 % Define control-q
6454\catcode`\\=\active
6455
6456% Used sometimes to turn off (effectively) the active characters
6457% even after parsing them.
6708\catcode`\\=\active
6709
6710% Used sometimes to turn off (effectively) the active characters
6711% even after parsing them.
6458@def@turnoffactive{@let"=@normaldoublequote
6459@let\=@realbackslash
6460@let~=@normaltilde
6461@let^=@normalcaret
6462@let_=@normalunderscore
6463@let|=@normalverticalbar
6464@let<=@normalless
6465@let>=@normalgreater
6466@let+=@normalplus
6467@let$=@normaldollar}%$ font-lock fix
6712@def@turnoffactive{%
6713 @let"=@normaldoublequote
6714 @let\=@realbackslash
6715 @let~=@normaltilde
6716 @let^=@normalcaret
6717 @let_=@normalunderscore
6718 @let|=@normalverticalbar
6719 @let<=@normalless
6720 @let>=@normalgreater
6721 @let+=@normalplus
6722 @let$=@normaldollar %$ font-lock fix
6723}
6468
6724
6469% Same as @turnoffactive except for \.
6725% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
6726% the literal character `\'. (Thus, \ is not expandable when this is in
6727% effect.)
6728%
6470@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
6471
6472% Make _ and + \other characters, temporarily.
6473% This is canceled by @fixbackslash.
6474@otherifyactive
6475
6476% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
6477% That is what \eatinput is for; after that, the `\' should revert to printing

--- 12 unchanged lines hidden (view full) ---

6490 @ifx\@eatinput @let\ = @normalbackslash @fi
6491 @catcode`+=@active
6492 @catcode`@_=@active
6493}
6494
6495% Say @foo, not \foo, in error messages.
6496@escapechar = `@@
6497
6729@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
6730
6731% Make _ and + \other characters, temporarily.
6732% This is canceled by @fixbackslash.
6733@otherifyactive
6734
6735% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
6736% That is what \eatinput is for; after that, the `\' should revert to printing

--- 12 unchanged lines hidden (view full) ---

6749 @ifx\@eatinput @let\ = @normalbackslash @fi
6750 @catcode`+=@active
6751 @catcode`@_=@active
6752}
6753
6754% Say @foo, not \foo, in error messages.
6755@escapechar = `@@
6756
6498% These look ok in all fonts, so just make them not special.
6757% These look ok in all fonts, so just make them not special.
6499@catcode`@& = @other
6500@catcode`@# = @other
6501@catcode`@% = @other
6502
6503@c Set initial fonts.
6504@textfonts
6505@rm
6506
6507
6508@c Local variables:
6509@c eval: (add-hook 'write-file-hooks 'time-stamp)
6510@c page-delimiter: "^\\\\message"
6511@c time-stamp-start: "def\\\\texinfoversion{"
6512@c time-stamp-format: "%:y-%02m-%02d.%02H"
6513@c time-stamp-end: "}"
6514@c End:
6758@catcode`@& = @other
6759@catcode`@# = @other
6760@catcode`@% = @other
6761
6762@c Set initial fonts.
6763@textfonts
6764@rm
6765
6766
6767@c Local variables:
6768@c eval: (add-hook 'write-file-hooks 'time-stamp)
6769@c page-delimiter: "^\\\\message"
6770@c time-stamp-start: "def\\\\texinfoversion{"
6771@c time-stamp-format: "%:y-%02m-%02d.%02H"
6772@c time-stamp-end: "}"
6773@c End: