Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/texinfo/texinfo.tex

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    44\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
    55%
    6 \def\texinfoversion{2000-05-28.15}
    7 %
    8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
    9 % Free Software Foundation, Inc.
     6\def\texinfoversion{2003-02-03.16}
     7%
     8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
     9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    1010%
    1111% This texinfo.tex file is free software; you can redistribute it and/or
     
    3030% Please try the latest version of texinfo.tex before submitting bug
    3131% reports; you can get the latest version from:
    32 %   ftp://ftp.gnu.org/gnu/texinfo.tex
    33 %   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
    34 %   ftp://texinfo.org/tex/texinfo.tex
    35 %   ftp://us.ctan.org/macros/texinfo/texinfo.tex
    36 %   (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
    37 %   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
     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%
     38% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
     39%
    3840% The texinfo.tex in any given Texinfo distribution could well be out
    3941% of date, so if that's what you're using, please check.
    40 % Texinfo has a small home page at http://texinfo.org/.
    41 %
     42%
    4243% Send bug reports to bug-texinfo@gnu.org.  Please include including a
    4344% complete document in each bug report with which we can reproduce the
     
    5152%   tex foo.texi
    5253%   tex foo.texi
    53 %   dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
    54 % The extra runs of TeX get the cross-reference information correct.
     54%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
     55% The extra TeX runs get the cross-reference information correct.
    5556% Sometimes one run after texindex suffices, and sometimes you need more
    5657% than two; texi2dvi does it as many times as necessary.
    57 %
    58 % It is possible to adapt texinfo.tex for other languages.  You can get
    59 % the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
     58%
     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.
    6062
    6163\message{Loading texinfo [version \texinfoversion]:}
     
    6668\everyjob{\message{[Texinfo version \texinfoversion]}%
    6769  \catcode`+=\active \catcode`\_=\active}
     70
     71\message{Basics,}
     72\chardef\other=12
     73
     74% We never want plain's outer \+ definition in Texinfo.
     75% For @tex, we can use \tabalign.
     76\let\+ = \relax
    6877
    6978% Save some parts of plain tex whose names we will redefine.
     
    7786\let\ptexequiv=\equiv
    7887\let\ptexexclam=\!
     88\let\ptexgtr=>
     89\let\ptexhat=^
    7990\let\ptexi=\i
    8091\let\ptexlbrace=\{
     92\let\ptexless=<
     93\let\ptexplus=+
    8194\let\ptexrbrace=\}
    8295\let\ptexstar=\*
    8396\let\ptext=\t
    84 
    85 % We never want plain's outer \+ definition in Texinfo.
    86 % For @tex, we can use \tabalign.
    87 \let\+ = \relax
    88 
    89 \message{Basics,}
    90 \chardef\other=12
    9197
    9298% If this character appears in an error message or help string, it
     
    136142\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
    137143
     144% In some macros, we cannot use the `\? notation---the left quote is
     145% in some cases the escape char.
     146\chardef\colonChar = `\:
     147\chardef\commaChar = `\,
     148\chardef\dotChar   = `\.
     149\chardef\equalChar = `\=
     150\chardef\exclamChar= `\!
     151\chardef\questChar = `\?
     152\chardef\semiChar  = `\;
     153\chardef\spaceChar = `\ %
     154\chardef\underChar = `\_
     155
    138156% Ignore a token.
    139157%
    140158\def\gobble#1{}
    141159
     160% True if #1 is the empty string, i.e., called like `\ifempty{}'.
     161%
     162\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
     163\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
     164
     165% Hyphenation fixes.
    142166\hyphenation{ap-pen-dix}
    143167\hyphenation{mini-buf-fer mini-buf-fers}
     
    146170
    147171% Margin to add to right of even pages, to left of odd pages.
    148 \newdimen \bindingoffset
    149 \newdimen \normaloffset
     172\newdimen\bindingoffset
     173\newdimen\normaloffset
    150174\newdimen\pagewidth \newdimen\pageheight
    151175
    152176% Sometimes it is convenient to have everything in the transcript file
    153177% and nothing on the terminal.  We don't just call \tracingall here,
    154 % since that produces some useless output on the terminal.
     178% since that produces some useless output on the terminal.  We also make
     179% some effort to order the tracing commands to reduce output in the log
     180% file; cf. trace.sty in LaTeX.
    155181%
    156182\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
    157 \ifx\eTeXversion\undefined
    158 \def\loggingall{\tracingcommands2 \tracingstats2
    159    \tracingpages1 \tracingoutput1 \tracinglostchars1
    160    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
    161    \showboxbreadth\maxdimen\showboxdepth\maxdimen
     183\def\loggingall{%
     184  \tracingstats2
     185  \tracingpages1
     186  \tracinglostchars2  % 2 gives us more in etex
     187  \tracingparagraphs1
     188  \tracingoutput1
     189  \tracingmacros2
     190  \tracingrestores1
     191  \showboxbreadth\maxdimen \showboxdepth\maxdimen
     192  \ifx\eTeXversion\undefined\else % etex gives us more logging
     193    \tracingscantokens1
     194    \tracingifs1
     195    \tracinggroups1
     196    \tracingnesting2
     197    \tracingassigns1
     198  \fi
     199  \tracingcommands3  % 3 gives us more in etex
     200  \errorcontextlines\maxdimen
    162201}%
    163 \else
    164 \def\loggingall{\tracingcommands3 \tracingstats2
    165    \tracingpages1 \tracingoutput1 \tracinglostchars1
    166    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
    167    \tracingscantokens1 \tracingassigns1 \tracingifs1
    168    \tracinggroups1 \tracingnesting2
    169    \showboxbreadth\maxdimen\showboxdepth\maxdimen
    170 }%
    171 \fi
     202
     203% add check for \lastpenalty to plain's definitions.  If the last thing
     204% we did was a \nobreak, we don't want to insert more space.
     205%
     206\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
     207  \removelastskip\penalty-50\smallskip\fi\fi}
     208\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
     209  \removelastskip\penalty-100\medskip\fi\fi}
     210\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
     211  \removelastskip\penalty-200\bigskip\fi\fi}
    172212
    173213% For @cropmarks command.
     
    264304      \fi
    265305    }% end of \shipout\vbox
    266   }% end of group with \turnoffactive
     306  }% end of group with \normalturnoffactive
    267307  \advancepageno
    268308  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
     
    424464
    425465
    426 % Single-spacing is done by various environments (specifically, in
    427 % \nonfillstart and \quotations).
    428 \newskip\singlespaceskip \singlespaceskip = 12.5pt
    429 \def\singlespace{%
    430   % Why was this kern here?  It messes up equalizing space above and below
    431   % environments.  --karl, 6may93
    432   %{\advance \baselineskip by -\singlespaceskip
    433   %\kern \baselineskip}%
    434   \setleading \singlespaceskip
    435 }
    436 
    437466%% Simple single-character @ commands
    438467
     
    454483\let\}=\myrbrace
    455484\begingroup
    456   % Definitions to produce actual \{ & \} command in an index.
    457   \catcode`\{ = 12 \catcode`\} = 12
     485  % Definitions to produce \{ and \} commands for indices,
     486  % and @{ and @} for the aux file.
     487  \catcode`\{ = \other \catcode`\} = \other
    458488  \catcode`\[ = 1 \catcode`\] = 2
    459   \catcode`\@ = 0 \catcode`\\ = 12
    460   @gdef@lbracecmd[\{]%
    461   @gdef@rbracecmd[\}]%
    462 @endgroup
     489  \catcode`\! = 0 \catcode`\\ = \other
     490  !gdef!lbracecmd[\{]%
     491  !gdef!rbracecmd[\}]%
     492  !gdef!lbraceatcmd[@{]%
     493  !gdef!rbraceatcmd[@}]%
     494!endgroup
    463495
    464496% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
    465 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
     497% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
    466498\let\, = \c
    467499\let\dotaccent = \.
     
    472504
    473505% Other special characters: @questiondown @exclamdown
    474 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
     506% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
    475507\def\questiondown{?`}
    476508\def\exclamdown{!`}
     
    527559% the text is small, which looks bad.
    528560%
     561% Another complication is that the group might be very large.  This can
     562% cause the glue on the previous page to be unduly stretched, because it
     563% does not have much material.  In this case, it's better to add an
     564% explicit \vfill so that the extra space is at the bottom.  The
     565% threshold for doing this is if the group is more than \vfilllimit
     566% percent of a page (\vfilllimit can be changed inside of @tex).
     567%
     568\newbox\groupbox
     569\def\vfilllimit{0.7}
     570%
    529571\def\group{\begingroup
    530572  \ifnum\catcode13=\active \else
     
    540582  \def\Egroup{%
    541583    \egroup           % End the \vtop.
     584    % \dimen0 is the vertical size of the group's box.
     585    \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
     586    % \dimen2 is how much space is left on the page (more or less).
     587    \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
     588    % if the group doesn't fit on the current page, and it's a big big
     589    % group, force a page break.
     590    \ifdim \dimen0 > \dimen2
     591      \ifdim \pagetotal < \vfilllimit\pageheight
     592        \page
     593      \fi
     594    \fi
     595    \copy\groupbox
    542596    \endgroup         % End the \group.
    543597  }%
    544598  %
    545   \vtop\bgroup
     599  \setbox\groupbox = \vtop\bgroup
    546600    % We have to put a strut on the last line in case the @group is in
    547601    % the midst of an example, rather than completely enclosing it.
     
    689743\leftline{\hskip\leftskip{\rm#1}}}}
    690744
    691 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
    692 
    693 \def\inmargin#1{%
    694 \strut\vadjust{\nobreak\kern-\strutdepth
    695   \vtop to \strutdepth{\baselineskip\strutdepth\vss
    696   \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
     745% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
     746% paragraph.  For more general purposes, use the \margin insertion
     747% class.  WHICH is `l' or `r'.
     748%
    697749\newskip\inmarginspacing \inmarginspacing=1cm
    698750\def\strutdepth{\dp\strutbox}
    699 
    700 %\hbox{{\rm#1}}\hfil\break}}
     751%
     752\def\doinmargin#1#2{\strut\vadjust{%
     753  \nobreak
     754  \kern-\strutdepth
     755  \vtop to \strutdepth{%
     756    \baselineskip=\strutdepth
     757    \vss
     758    % if you have multiple lines of stuff to put here, you'll need to
     759    % make the vbox yourself of the appropriate size.
     760    \ifx#1l%
     761      \llap{\ignorespaces #2\hskip\inmarginspacing}%
     762    \else
     763      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
     764    \fi
     765    \null
     766  }%
     767}}
     768\def\inleftmargin{\doinmargin l}
     769\def\inrightmargin{\doinmargin r}
     770%
     771% @inmargin{TEXT [, RIGHT-TEXT]}
     772% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
     773% else use TEXT for both).
     774%
     775\def\inmargin#1{\parseinmargin #1,,\finish}
     776\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
     777  \setbox0 = \hbox{\ignorespaces #2}%
     778  \ifdim\wd0 > 0pt
     779    \def\lefttext{#1}%  have both texts
     780    \def\righttext{#2}%
     781  \else
     782    \def\lefttext{#1}%  have only one text
     783    \def\righttext{#1}%
     784  \fi
     785  %
     786  \ifodd\pageno
     787    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
     788  \else
     789    \def\temp{\inleftmargin\lefttext}%
     790  \fi
     791  \temp
     792}
    701793
    702794% @include file    insert text of that file as input.
    703795% Allow normal characters that  we make active in the argument (a file name).
    704796\def\include{\begingroup
    705   \catcode`\\=12
    706   \catcode`~=12
    707   \catcode`^=12
    708   \catcode`_=12
    709   \catcode`|=12
    710   \catcode`<=12
    711   \catcode`>=12
    712   \catcode`+=12
     797  \catcode`\\=\other
     798  \catcode`~=\other
     799  \catcode`^=\other
     800  \catcode`_=\other
     801  \catcode`|=\other
     802  \catcode`<=\other
     803  \catcode`>=\other
     804  \catcode`+=\other
    713805  \parsearg\includezzz}
    714806% Restore active chars for included file.
     
    716808  % Read the included file in a group so nested @include's work.
    717809  \def\thisfile{#1}%
     810  \let\value=\expandablevalue
    718811  \input\thisfile
    719812\endgroup}
     
    721814\def\thisfile{}
    722815
    723 % @center line   outputs that line, centered
    724 
    725 \def\center{\parsearg\centerzzz}
    726 \def\centerzzz #1{{\advance\hsize by -\leftskip
    727 \advance\hsize by -\rightskip
    728 \centerline{#1}}}
     816% @center line
     817% outputs that line, centered.
     818%
     819\def\center{\parsearg\docenter}
     820\def\docenter#1{{%
     821  \ifhmode \hfil\break \fi
     822  \advance\hsize by -\leftskip
     823  \advance\hsize by -\rightskip
     824  \line{\hfil \ignorespaces#1\unskip \hfil}%
     825  \ifhmode \break \fi
     826}}
    729827
    730828% @sp n   outputs n lines of vertical space
     
    786884\def\asis#1{#1}
    787885
    788 % @math means output in math mode.
    789 % We don't use $'s directly in the definition of \math because control
    790 % sequences like \math are expanded when the toc file is written.  Then,
    791 % we read the toc file back, the $'s will be normal characters (as they
    792 % should be, according to the definition of Texinfo).  So we must use a
    793 % control sequence to switch into and out of math mode.
    794 %
    795 % This isn't quite enough for @math to work properly in indices, but it
    796 % seems unlikely it will ever be needed there.
    797 %
    798 \let\implicitmath = $
    799 \def\math#1{\implicitmath #1\implicitmath}
     886% @math outputs its argument in math mode.
     887% We don't use $'s directly in the definition of \math because we need
     888% to set catcodes according to plain TeX first, to allow for subscripts,
     889% superscripts, special math chars, etc.
     890%
     891\let\implicitmath = $%$ font-lock fix
     892%
     893% One complication: _ usually means subscripts, but it could also mean
     894% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
     895% _ within @math be active (mathcode "8000), and distinguish by seeing
     896% if the current family is \slfam, which is what @var uses.
     897%
     898{\catcode\underChar = \active
     899\gdef\mathunderscore{%
     900  \catcode\underChar=\active
     901  \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
     902}}
     903%
     904% Another complication: we want \\ (and @\) to output a \ character.
     905% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
     906% this is not advertised and we don't care.  Texinfo does not
     907% otherwise define @\.
     908%
     909% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
     910\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
     911%
     912\def\math{%
     913  \tex
     914  \mathcode`\_="8000 \mathunderscore
     915  \let\\ = \mathbackslash
     916  \mathactive
     917  \implicitmath\finishmath}
     918\def\finishmath#1{#1\implicitmath\Etex}
     919
     920% Some active characters (such as <) are spaced differently in math.
     921% We have to reset their definitions in case the @math was an
     922% argument to a command which set the catcodes (such as @item or @section).
     923%
     924{
     925  \catcode`^ = \active
     926  \catcode`< = \active
     927  \catcode`> = \active
     928  \catcode`+ = \active
     929  \gdef\mathactive{%
     930    \let^ = \ptexhat
     931    \let< = \ptexless
     932    \let> = \ptexgtr
     933    \let+ = \ptexplus
     934  }
     935}
    800936
    801937% @bullet and @minus need the same treatment as @math, just above.
     
    8801016    \def\imagewidth{#2}%
    8811017    \def\imageheight{#3}%
     1018    % without \immediate, pdftex seg faults when the same image is
     1019    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
    8821020    \ifnum\pdftexversion < 14
    883       \pdfimage
     1021      \immediate\pdfimage
    8841022    \else
    885       \pdfximage
     1023      \immediate\pdfximage
    8861024    \fi
    8871025      \ifx\empty\imagewidth\else width \imagewidth \fi
    8881026      \ifx\empty\imageheight\else height \imageheight \fi
    889       {#1.pdf}%
     1027      \ifnum\pdftexversion<13
     1028         #1.pdf%
     1029       \else
     1030         {#1.pdf}%
     1031       \fi
    8901032    \ifnum\pdftexversion < 14 \else
    8911033      \pdfrefximage \pdflastximage
    8921034    \fi}
    893   \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
    894   \def\pdfmkpgn#1{#1@}
     1035  \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
     1036  \def\pdfmkpgn#1{#1}
    8951037  \let\linkcolor = \Blue  % was Cyan, but that seems light?
    8961038  \def\endlink{\Black\pdfendlink}
     
    9041046  \def\pdfmakeoutlines{{%
    9051047    \openin 1 \jobname.toc
    906     \ifeof 1\else\bgroup
     1048    \ifeof 1\else\begingroup
    9071049      \closein 1
    908       \indexnofonts
    909       \def\tt{}
    910       \let\_ = \normalunderscore
    9111050      % Thanh's hack / proper braces in bookmarks 
    9121051      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
     
    9141053      %
    9151054      \def\chapentry ##1##2##3{}
    916       \def\unnumbchapentry ##1##2{}
    9171055      \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
    918       \def\unnumbsecentry ##1##2{}
    9191056      \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
    920       \def\unnumbsubsecentry ##1##2{}
    9211057      \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
    922       \def\unnumbsubsubsecentry ##1##2{}
     1058      \let\appendixentry = \chapentry
     1059      \let\unnumbchapentry = \chapentry
     1060      \let\unnumbsecentry = \secentry
     1061      \let\unnumbsubsecentry = \subsecentry
     1062      \let\unnumbsubsubsecentry = \subsubsecentry
    9231063      \input \jobname.toc
    9241064      \def\chapentry ##1##2##3{%
    9251065        \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
    926       \def\unnumbchapentry ##1##2{%
    927         \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
    9281066      \def\secentry ##1##2##3##4{%
    9291067        \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
    930       \def\unnumbsecentry ##1##2{%
    931         \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
    9321068      \def\subsecentry ##1##2##3##4##5{%
    9331069        \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
    934       \def\unnumbsubsecentry ##1##2{%
    935         \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
    9361070      \def\subsubsecentry ##1##2##3##4##5##6{%
    9371071        \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
    938       \def\unnumbsubsubsecentry ##1##2{%
    939         \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
     1072      \let\appendixentry = \chapentry
     1073      \let\unnumbchapentry = \chapentry
     1074      \let\unnumbsecentry = \secentry
     1075      \let\unnumbsubsecentry = \subsecentry
     1076      \let\unnumbsubsubsecentry = \subsubsecentry
     1077      %
     1078      % Make special characters normal for writing to the pdf file.
     1079      %
     1080      \indexnofonts
     1081      \let\tt=\relax
     1082      \turnoffactive
    9401083      \input \jobname.toc
    941     \egroup\fi
     1084    \endgroup\fi
    9421085  }}
    9431086  \def\makelinks #1,{%
     
    9891132    \begingroup
    9901133      \normalturnoffactive\def\@{@}%
     1134      \let\value=\expandablevalue
    9911135      \leavevmode\Red
    9921136      \startlink attr{/Border [0 0 0]}%
     
    10161160    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
    10171161  \def\pdflink#1{%
    1018     \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
     1162    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
    10191163    \linkcolor #1\endlink}
    1020   \def\mkpgn#1{#1@}
    10211164  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
    10221165\fi % \ifx\pdfoutput
     
    10351178\def\ttsl{\tenttsl}
    10361179
    1037 % Use Computer Modern fonts at \magstephalf (11pt).
    1038 \newcount\mainmagstep
    1039 \mainmagstep=\magstephalf
     1180% Default leading.
     1181\newdimen\textleading  \textleading = 13.2pt
     1182
     1183% Set the baselineskip to #1, and the lineskip and strut size
     1184% correspondingly.  There is no deep meaning behind these magic numbers
     1185% used as factors; they just match (closely enough) what Knuth defined.
     1186%
     1187\def\lineskipfactor{.08333}
     1188\def\strutheightpercent{.70833}
     1189\def\strutdepthpercent {.29167}
     1190%
     1191\def\setleading#1{%
     1192  \normalbaselineskip = #1\relax
     1193  \normallineskip = \lineskipfactor\normalbaselineskip
     1194  \normalbaselines
     1195  \setbox\strutbox =\hbox{%
     1196    \vrule width0pt height\strutheightpercent\baselineskip
     1197                    depth \strutdepthpercent \baselineskip
     1198  }%
     1199}
    10401200
    10411201% Set the font macro #1 to the font named #2, adding on the
     
    10671227\def\scbshape{csc}
    10681228
     1229\newcount\mainmagstep
    10691230\ifx\bigger\relax
    1070 \let\mainmagstep=\magstep1
    1071 \setfont\textrm\rmshape{12}{1000}
    1072 \setfont\texttt\ttshape{12}{1000}
     1231  % not really supported.
     1232  \mainmagstep=\magstep1
     1233  \setfont\textrm\rmshape{12}{1000}
     1234  \setfont\texttt\ttshape{12}{1000}
    10731235\else
    1074 \setfont\textrm\rmshape{10}{\mainmagstep}
    1075 \setfont\texttt\ttshape{10}{\mainmagstep}
     1236  \mainmagstep=\magstephalf
     1237  \setfont\textrm\rmshape{10}{\mainmagstep}
     1238  \setfont\texttt\ttshape{10}{\mainmagstep}
    10761239\fi
    1077 % Instead of cmb10, you many want to use cmbx10.
     1240% Instead of cmb10, you may want to use cmbx10.
    10781241% cmbx10 is a prettier font on its own, but cmb10
    1079 % looks better when embedded in a line with cmr10.
     1242% looks better when embedded in a line with cmr10
     1243% (in Bob's opinion).
    10801244\setfont\textbf\bfshape{10}{\mainmagstep}
    10811245\setfont\textit\itshape{10}{\mainmagstep}
     
    11031267\font\smalli=cmmi9
    11041268\font\smallsy=cmsy9
     1269
     1270% Fonts for small examples (8pt).
     1271\setfont\smallerrm\rmshape{8}{1000}
     1272\setfont\smallertt\ttshape{8}{1000}
     1273\setfont\smallerbf\bfshape{10}{800}
     1274\setfont\smallerit\itshape{8}{1000}
     1275\setfont\smallersl\slshape{8}{1000}
     1276\setfont\smallersf\sfshape{8}{1000}
     1277\setfont\smallersc\scshape{10}{800}
     1278\setfont\smallerttsl\ttslshape{10}{800}
     1279\font\smalleri=cmmi8
     1280\font\smallersy=cmsy8
    11051281
    11061282% Fonts for title page:
     
    11161292\font\titlesy=cmsy10 scaled \magstep4
    11171293\def\authorrm{\secrm}
     1294\def\authortt{\sectt}
    11181295
    11191296% Chapter (and unnumbered) fonts (17.28pt).
     
    11401317\font\seci=cmmi12 scaled \magstep1
    11411318\font\secsy=cmsy10 scaled \magstep2
    1142 
    1143 % \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
    1144 % \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
    1145 % \setfont\ssecsl\slshape{10}{\magstep1}
    1146 % \setfont\ssectt\ttshape{10}{\magstep1}
    1147 % \setfont\ssecsf\sfshape{10}{\magstep1}
    1148 
    1149 %\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
    1150 %\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
    1151 %\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
    1152 %\setfont\ssectt\ttshape{10}{1315}
    1153 %\setfont\ssecsf\sfshape{10}{1315}
    1154 
    1155 %\let\ssecbf=\ssecrm
    11561319
    11571320% Subsection fonts (13.15pt).
     
    11711334% In order for the font changes to affect most math symbols and letters,
    11721335% we have to define the \textfont of the standard families.  Since
    1173 % texinfo doesn't allow for producing subscripts and superscripts, we
    1174 % don't bother to reset \scriptfont and \scriptscriptfont (which would
    1175 % also require loading a lot more fonts).
     1336% texinfo doesn't allow for producing subscripts and superscripts except
     1337% in the main text, we don't bother to reset \scriptfont and
     1338% \scriptscriptfont (which would also require loading a lot more fonts).
    11761339%
    11771340\def\resetmathfonts{%
    1178   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
    1179   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
    1180   \textfont\ttfam = \tentt \textfont\sffam = \tensf
    1181 }
    1182 
     1341  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
     1342  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
     1343  \textfont\ttfam=\tentt \textfont\sffam=\tensf
     1344}
    11831345
    11841346% The font-changing commands redefine the meanings of \tenSTYLE, instead
     
    11921354  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
    11931355  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
    1194   \resetmathfonts}
     1356  \resetmathfonts \setleading{\textleading}}
    11951357\def\titlefonts{%
    11961358  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
     
    12211383  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
    12221384  \let\tenttsl=\smallttsl
    1223   \resetmathfonts \setleading{11pt}}
     1385  \resetmathfonts \setleading{10.5pt}}
     1386\def\smallerfonts{%
     1387  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
     1388  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
     1389  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
     1390  \let\tenttsl=\smallerttsl
     1391  \resetmathfonts \setleading{9.5pt}}
     1392
     1393% Set the fonts to use with the @small... environments.
     1394\let\smallexamplefonts = \smallfonts
     1395
     1396% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
     1397% can fit this many characters:
     1398%   8.5x11=86   smallbook=72  a4=90  a5=69
     1399% If we use \smallerfonts (8pt), then we can fit this many characters:
     1400%   8.5x11=90+  smallbook=80  a4=90+  a5=77
     1401% For me, subjectively, the few extra characters that fit aren't worth
     1402% the additional smallness of 8pt.  So I'm making the default 9pt.
     1403%
     1404% By the way, for comparison, here's what fits with @example (10pt):
     1405%   8.5x11=71  smallbook=60  a4=75  a5=58
     1406%
     1407% I wish we used A4 paper on this side of the Atlantic.
     1408%
     1409% --karl, 24jan03.
     1410
    12241411
    12251412% Set up the default fonts, so we can use them for creating boxes.
     
    12381425\setfont\shortcontbf\bxshape{12}{1000}
    12391426\setfont\shortcontsl\slshape{12}{1000}
     1427\setfont\shortconttt\ttshape{12}{1000}
    12401428
    12411429%% Add scribe-like font environments, plus @l for inline lisp (usually sans
     
    12451433% unless the following character is such as not to need one.
    12461434\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
    1247 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
    1248 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
     1435\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
     1436\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
    12491437
    12501438\let\i=\smartitalic
     
    12631451\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
    12641452\def\restorehyphenation{\hyphenchar\font = `- }
     1453
     1454% Set sfcode to normal for the chars that usually have another value.
     1455% Can't use plain's \frenchspacing because it uses the `\x notation, and
     1456% sometimes \x has an active definition that messes things up.
     1457%
     1458\catcode`@=11
     1459  \def\frenchspacing{%
     1460    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
     1461    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
     1462  }
     1463\catcode`@=\other
    12651464
    12661465\def\t#1{%
     
    13351534\def\realdash{-}
    13361535\def\codedash{-\discretionary{}{}{}}
    1337 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
     1536\def\codeunder{%
     1537  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
     1538  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
     1539  % will therefore expand the active definition of _, which is us
     1540  % (inside @code that is), therefore an endless loop.
     1541  \ifusingtt{\ifmmode
     1542               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
     1543             \else\normalunderscore \fi
     1544             \discretionary{}{}{}}%
     1545            {\_}%
     1546}
    13381547\def\codex #1{\tclose{#1}\endgroup}
    1339 
    1340 %\let\exp=\tclose  %Was temporary
    13411548
    13421549% @kbd is like @code, except that if the argument is just one @key command,
     
    13551562  \else\ifx\arg\wordcode
    13561563    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
     1564  \else
     1565    \errhelp = \EMsimple
     1566    \errmessage{Unknown @kbdinputstyle `\arg'}%
    13571567  \fi\fi\fi
    13581568}
     
    13611571\def\wordcode{code}
    13621572
    1363 % Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
    1364 % the catcodes are wrong for parsearg to work.)
    1365 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
     1573% Default is `distinct.'
     1574\kbdinputstyle distinct
    13661575
    13671576\def\xkey{\key}
     
    14771686   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
    14781687   %
    1479    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
     1688   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
     1689                   \let\tt=\authortt}%
    14801690   %
    14811691   % Leave some space at the very top of the page.
     
    15241734   \endgroup
    15251735   %
     1736   % Need this before the \...aftertitlepage checks so that if they are
     1737   % in effect the toc pages will come out with page numbers.
     1738   \HEADINGSon
     1739   %
    15261740   % If they want short, they certainly want long too.
    15271741   \ifsetshortcontentsaftertitlepage
     
    15371751     \global\let\shortcontents = \relax
    15381752   \fi
    1539    %
    1540    \ifpdf \pdfmakepagedesttrue \fi
    1541    %
    1542    \HEADINGSon
    15431753}
    15441754
     
    17581968    \nobreak \vskip-\parskip
    17591969    %
    1760     % Stop a page break at the \parskip glue coming up.  Unfortunately
     1970    % Stop a page break at the \parskip glue coming up.  (Unfortunately
    17611971    % we can't prevent a possible page break at the following
    1762     % \baselineskip glue.
    1763     \nobreak
     1972    % \baselineskip glue.)  However, if what follows is an environment
     1973    % such as @example, there will be no \parskip glue; then
     1974    % the negative vskip we just would cause the example and the item to
     1975    % crash together.  So we use this bizarre value of 10001 as a signal
     1976    % to \aboveenvbreak to insert \parskip glue after all.
     1977    % (Possibly there are other commands that could be followed by
     1978    % @example which need the same treatment, but not section titles; or
     1979    % maybe section titles are the only special case and they should be
     1980    % penalty 10001...)
     1981    \penalty 10001
    17641982    \endgroup
    17651983    \itemxneedsnegativevskipfalse
     
    18662084\def\itemcontents{#1}%
    18672085\let\item=\itemizeitem}
    1868 
    1869 % Set sfcode to normal for the chars that usually have another value.
    1870 % These are `.?!:;,'
    1871 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
    1872   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
    18732086
    18742087% \splitoff TOKENS\endmark defines \first to be the first token in
     
    20932306      \else
    20942307         \global\advance\colcount by 1
    2095          \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
    2096                             % typically that is always in the input, anyway.
     2308         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
     2309                   % separator; typically that is always in the input, anyway.
    20972310         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
    20982311      \fi
     
    21092322}
    21102323
    2111 % This used to have \hskip1sp.  But then the space in a template line is
    2112 % not enough.  That is bad.  So let's go back to just & until we
    2113 % encounter the problem it was intended to solve again.
    2114 % --karl, nathan@acm.org, 20apr99.
    2115 \def\tab{&}
    2116 
    21172324% @multitable ... @end multitable definitions:
    21182325%
     
    21202327\def\dotable#1{\bgroup
    21212328  \vskip\parskip
    2122   \let\item\crcr
     2329  \let\item=\crcrwithfootnotes
     2330  % A \tab used to include \hskip1sp.  But then the space in a template
     2331  % line is not enough.  That is bad.  So let's go back to just & until
     2332  % we encounter the problem it was intended to solve again.  --karl,
     2333  % nathan@acm.org, 20apr99.
     2334  \let\tab=&%
     2335  \let\startfootins=\startsavedfootnote
    21232336  \tolerance=9500
    21242337  \hbadness=9500
     
    21282341  \overfullrule=0pt
    21292342  \global\colcount=0
    2130   \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
     2343  \def\Emultitable{%
     2344    \global\setpercentfalse
     2345    \crcrwithfootnotes\crcr
     2346    \egroup\egroup
     2347  }%
    21312348  %
    21322349  % To parse everything between @multitable and @item:
     
    22172434\fi}
    22182435
     2436% In case a @footnote appears inside an alignment, save the footnote
     2437% text to a box and make the \insert when a row of the table is
     2438% finished.  Otherwise, the insertion is lost, it never migrates to the
     2439% main vertical list.  --kasal, 22jan03.
     2440%
     2441\newbox\savedfootnotes
     2442%
     2443% \dotable \let's \startfootins to this, so that \dofootnote will call
     2444% it instead of starting the insertion right away.
     2445\def\startsavedfootnote{%
     2446  \global\setbox\savedfootnotes = \vbox\bgroup
     2447    \unvbox\savedfootnotes
     2448}
     2449\def\crcrwithfootnotes{%
     2450  \crcr
     2451  \ifvoid\savedfootnotes \else
     2452    \noalign{\insert\footins{\box\savedfootnotes}}%
     2453  \fi
     2454}
    22192455
    22202456\message{conditionals,}
     
    22522488% incorrectly.
    22532489%
     2490% We use \empty instead of \relax for the @def... commands, so that \end
     2491% doesn't throw an error.  For instance:
     2492% @ignore
     2493% @deffn ...
     2494% @end deffn
     2495% @end ignore
     2496%
     2497% The @end deffn is going to get expanded, because we're trying to allow
     2498% nested conditionals.  But we don't want to expand the actual @deffn,
     2499% since it might be syntactically correct and intended to be ignored.
     2500% Since \end checks for \relax, using \empty does not cause an error.
     2501%
    22542502\def\ignoremorecommands{%
    22552503  \let\defcodeindex = \relax
    2256   \let\defcv = \relax
    2257   \let\deffn = \relax
    2258   \let\deffnx = \relax
     2504  \let\defcv = \empty
     2505  \let\defcvx = \empty
     2506  \let\Edefcv = \empty
     2507  \let\deffn = \empty
     2508  \let\deffnx = \empty
     2509  \let\Edeffn = \empty
    22592510  \let\defindex = \relax
    2260   \let\defivar = \relax
    2261   \let\defmac = \relax
    2262   \let\defmethod = \relax
    2263   \let\defop = \relax
    2264   \let\defopt = \relax
    2265   \let\defspec = \relax
    2266   \let\deftp = \relax
    2267   \let\deftypefn = \relax
    2268   \let\deftypefun = \relax
    2269   \let\deftypeivar = \relax
    2270   \let\deftypeop = \relax
    2271   \let\deftypevar = \relax
    2272   \let\deftypevr = \relax
    2273   \let\defun = \relax
    2274   \let\defvar = \relax
    2275   \let\defvr = \relax
    2276   \let\ref = \relax
    2277   \let\xref = \relax
     2511  \let\defivar = \empty
     2512  \let\defivarx = \empty
     2513  \let\Edefivar = \empty
     2514  \let\defmac = \empty
     2515  \let\defmacx = \empty
     2516  \let\Edefmac = \empty
     2517  \let\defmethod = \empty
     2518  \let\defmethodx = \empty
     2519  \let\Edefmethod = \empty
     2520  \let\defop = \empty
     2521  \let\defopx = \empty
     2522  \let\Edefop = \empty
     2523  \let\defopt = \empty
     2524  \let\defoptx = \empty
     2525  \let\Edefopt = \empty
     2526  \let\defspec = \empty
     2527  \let\defspecx = \empty
     2528  \let\Edefspec = \empty
     2529  \let\deftp = \empty
     2530  \let\deftpx = \empty
     2531  \let\Edeftp = \empty
     2532  \let\deftypefn = \empty
     2533  \let\deftypefnx = \empty
     2534  \let\Edeftypefn = \empty
     2535  \let\deftypefun = \empty
     2536  \let\deftypefunx = \empty
     2537  \let\Edeftypefun = \empty
     2538  \let\deftypeivar = \empty
     2539  \let\deftypeivarx = \empty
     2540  \let\Edeftypeivar = \empty
     2541  \let\deftypemethod = \empty
     2542  \let\deftypemethodx = \empty
     2543  \let\Edeftypemethod = \empty
     2544  \let\deftypeop = \empty
     2545  \let\deftypeopx = \empty
     2546  \let\Edeftypeop = \empty
     2547  \let\deftypevar = \empty
     2548  \let\deftypevarx = \empty
     2549  \let\Edeftypevar = \empty
     2550  \let\deftypevr = \empty
     2551  \let\deftypevrx = \empty
     2552  \let\Edeftypevr = \empty
     2553  \let\defun = \empty
     2554  \let\defunx = \empty
     2555  \let\Edefun = \empty
     2556  \let\defvar = \empty
     2557  \let\defvarx = \empty
     2558  \let\Edefvar = \empty
     2559  \let\defvr = \empty
     2560  \let\defvrx = \empty
     2561  \let\Edefvr = \empty
     2562  \let\clear = \relax
     2563  \let\down = \relax
     2564  \let\evenfooting = \relax
     2565  \let\evenheading = \relax
     2566  \let\everyfooting = \relax
     2567  \let\everyheading = \relax
     2568  \let\headings = \relax
     2569  \let\include = \relax
     2570  \let\item = \relax
     2571  \let\lowersections = \relax
     2572  \let\oddfooting = \relax
     2573  \let\oddheading = \relax
    22782574  \let\printindex = \relax
    22792575  \let\pxref = \relax
    2280   \let\settitle = \relax
     2576  \let\raisesections = \relax
     2577  \let\ref = \relax
     2578  \let\set = \relax
    22812579  \let\setchapternewpage = \relax
    22822580  \let\setchapterstyle = \relax
    2283   \let\everyheading = \relax
    2284   \let\evenheading = \relax
    2285   \let\oddheading = \relax
    2286   \let\everyfooting = \relax
    2287   \let\evenfooting = \relax
    2288   \let\oddfooting = \relax
    2289   \let\headings = \relax
    2290   \let\include = \relax
    2291   \let\lowersections = \relax
    2292   \let\down = \relax
    2293   \let\raisesections = \relax
     2581  \let\settitle = \relax
    22942582  \let\up = \relax
    2295   \let\set = \relax
    2296   \let\clear = \relax
    2297   \let\item = \relax
    2298 }
    2299 
    2300 % Ignore @ignore ... @end ignore.
    2301 %
     2583  \let\verbatiminclude = \relax
     2584  \let\xref = \relax
     2585}
     2586
     2587% Ignore @ignore, @ifhtml, @ifinfo, and the like.
     2588%
     2589\def\direntry{\doignore{direntry}}
     2590\def\documentdescriptionword{documentdescription}
     2591\def\documentdescription{\doignore{documentdescription}}
     2592\def\html{\doignore{html}}
     2593\def\ifhtml{\doignore{ifhtml}}
     2594\def\ifinfo{\doignore{ifinfo}}
     2595\def\ifnottex{\doignore{ifnottex}}
     2596\def\ifplaintext{\doignore{ifplaintext}}
     2597\def\ifxml{\doignore{ifxml}}
    23022598\def\ignore{\doignore{ignore}}
    2303 
    2304 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
    2305 %
    2306 \def\ifinfo{\doignore{ifinfo}}
    2307 \def\ifhtml{\doignore{ifhtml}}
    2308 \def\ifnottex{\doignore{ifnottex}}
    2309 \def\html{\doignore{html}}
    23102599\def\menu{\doignore{menu}}
    2311 \def\direntry{\doignore{direntry}}
     2600\def\xml{\doignore{xml}}
    23122601
    23132602% @dircategory CATEGORY  -- specify a category of the dir file
     
    23272616  %
    23282617  % Make sure that spaces turn into tokens that match what \doignoretext wants.
    2329   \catcode32 = 10
     2618  \catcode\spaceChar = 10
    23302619  %
    23312620  % Ignore braces, too, so mismatched braces don't cause trouble.
     
    23362625  \catcode`\@ = 12
    23372626  %
    2338   % Make the letter c a comment character so that the rest of the line
    2339   % will be ignored. This way, the document can have (for example)
    2340   %   @c @end ifinfo
    2341   % and the @end ifinfo will be properly ignored.
    2342   % (We've just changed @ to catcode 12.)
    2343   \catcode`\c = 14
    2344   %
    2345   % And now expand that command.
     2627  \def\ignoreword{#1}%
     2628  \ifx\ignoreword\documentdescriptionword
     2629    % The c kludge breaks documentdescription, since
     2630    % `documentdescription' contains a `c'.  Means not everything will
     2631    % be ignored inside @documentdescription, but oh well...
     2632  \else
     2633    % Make the letter c a comment character so that the rest of the line
     2634    % will be ignored. This way, the document can have (for example)
     2635    %   @c @end ifinfo
     2636    % and the @end ifinfo will be properly ignored.
     2637    % (We've just changed @ to catcode 12.)
     2638    \catcode`\c = 14
     2639  \fi
     2640  %
     2641  % And now expand the command defined above.
    23462642  \doignoretext
    23472643}
     
    23622658    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
    23632659    \immediate\write16{  Then upgrade your TeX installation if you can.}
    2364     \immediate\write16{  (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
     2660    \immediate\write16{  (See ftp://ftp.gnu.org/non-gnu/TeX.README.)}
    23652661    \immediate\write16{If you are stuck with version 3.0, run the}
    23662662    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
     
    23842680  % command, so that nested ignore constructs work.  Thus, we put the
    23852681  % text into a \vbox and then do nothing with the result.  To minimize
    2386   % the change of memory overflow, we follow the approach outlined on
    2387   % page 401 of the TeXbook: make the current font be a dummy font.
     2682  % the chance of memory overflow, we follow the approach outlined on
     2683  % page 401 of the TeXbook.
    23882684  %
    23892685  \setbox0 = \vbox\bgroup
     
    24062702    % Set the current font to be \nullfont, a TeX primitive, and define
    24072703    % all the font commands to also use \nullfont.  We don't use
    2408     % dummy.tfm, as suggested in the TeXbook, because not all sites
    2409     % might have that installed.  Therefore, math mode will still
     2704    % dummy.tfm, as suggested in the TeXbook, because some sites
     2705    % might not have that installed.  Therefore, math mode will still
    24102706    % produce output, but that should be an extremely small amount of
    24112707    % stuff compared to the main input.
     
    24152711    \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
    24162712    \let\tensf=\nullfont
    2417     % Similarly for index fonts (mostly for their use in smallexample).
     2713    % Similarly for index fonts.
    24182714    \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
    24192715    \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
    24202716    \let\smallsf=\nullfont
     2717    % Similarly for smallexample fonts.
     2718    \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont
     2719    \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont
     2720    \let\smallersf=\nullfont
    24212721    %
    24222722    % Don't complain when characters are missing from the fonts.
     
    24322732    \pretolerance = 10000
    24332733    %
    2434     % Do not execute instructions in @tex
     2734    % Do not execute instructions in @tex.
    24352735    \def\tex{\doignore{tex}}%
    24362736    % Do not execute macro definitions.
     
    24772777  % such active characters to their normal equivalents.
    24782778  \gdef\value{\begingroup
    2479     \catcode`\-=12 \catcode`\_=12
     2779    \catcode`\-=\other \catcode`\_=\other
    24802780    \indexbreaks \let_\normalunderscore
    24812781    \valuexxx}
     
    24862786% properly in indexes (we \let\value to this in \indexdummies).  Ones
    24872787% whose names contain - or _ still won't work, but we can't do anything
    2488 % about that.  The command has to be fully expandable, since the result
    2489 % winds up in the index file.  This means that if the variable's value
    2490 % contains other Texinfo commands, it's almost certain it will fail
    2491 % (although perhaps we could fix that with sufficient work to do a
    2492 % one-level expansion on the result, instead of complete).
     2788% about that.  The command has to be fully expandable (if the variable
     2789% is set), since the result winds up in the index file.  This means that
     2790% if the variable's value contains other Texinfo commands, it's almost
     2791% certain it will fail (although perhaps we could fix that with
     2792% sufficient work to do a one-level expansion on the result, instead of
     2793% complete).
    24932794%
    24942795\def\expandablevalue#1{%
    24952796  \expandafter\ifx\csname SET#1\endcsname\relax
    24962797    {[No value for ``#1'']}%
     2798    \message{Variable `#1', used in @value, is not set.}%
    24972799  \else
    24982800    \csname SET#1\endcsname
     
    25032805% with @set.
    25042806%
    2505 \def\ifset{\parsearg\ifsetxxx}
    2506 \def\ifsetxxx #1{%
     2807\def\ifset{\parsearg\doifset}
     2808\def\doifset#1{%
    25072809  \expandafter\ifx\csname SET#1\endcsname\relax
    2508     \expandafter\ifsetfail
     2810    \let\next=\ifsetfail
    25092811  \else
    2510     \expandafter\ifsetsucceed
     2812    \let\next=\ifsetsucceed
    25112813  \fi
     2814  \next
    25122815}
    25132816\def\ifsetsucceed{\conditionalsucceed{ifset}}
     
    25182821% defined with @set, or has been undefined with @clear.
    25192822%
    2520 \def\ifclear{\parsearg\ifclearxxx}
    2521 \def\ifclearxxx #1{%
     2823\def\ifclear{\parsearg\doifclear}
     2824\def\doifclear#1{%
    25222825  \expandafter\ifx\csname SET#1\endcsname\relax
    2523     \expandafter\ifclearsucceed
     2826    \let\next=\ifclearsucceed
    25242827  \else
    2525     \expandafter\ifclearfail
     2828    \let\next=\ifclearfail
    25262829  \fi
     2830  \next
    25272831}
    25282832\def\ifclearsucceed{\conditionalsucceed{ifclear}}
     
    25302834\defineunmatchedend{ifclear}
    25312835
    2532 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
    2533 % following, through the first @end iftex (etc.).  Make `@end iftex'
    2534 % (etc.) valid only after an @iftex.
     2836% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
     2837% read the text following, through the first @end iftex (etc.).  Make
     2838% `@end iftex' (etc.) valid only after an @iftex.
    25352839%
    25362840\def\iftex{\conditionalsucceed{iftex}}
    25372841\def\ifnothtml{\conditionalsucceed{ifnothtml}}
    25382842\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
     2843\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
    25392844\defineunmatchedend{iftex}
    25402845\defineunmatchedend{ifnothtml}
    25412846\defineunmatchedend{ifnotinfo}
    2542 
    2543 % We can't just want to start a group at @iftex (for example) and end it
    2544 % at @end iftex, since then @set commands inside the conditional have no
    2545 % effect (they'd get reverted at the end of the group).  So we must
    2546 % define \Eiftex to redefine itself to be its previous value.  (We can't
    2547 % just define it to fail again with an ``unmatched end'' error, since
    2548 % the @ifset might be nested.)
    2549 %
    2550 \def\conditionalsucceed#1{%
    2551   \edef\temp{%
    2552     % Remember the current value of \E#1.
    2553     \let\nece{prevE#1} = \nece{E#1}%
    2554     %
    2555     % At the `@end #1', redefine \E#1 to be its previous value.
    2556     \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
    2557   }%
    2558   \temp
    2559 }
    2560 
    2561 % We need to expand lots of \csname's, but we don't want to expand the
    2562 % control sequences after we've constructed them.
    2563 %
    2564 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
     2847\defineunmatchedend{ifnotplaintext}
     2848
     2849% True conditional.  Since \set globally defines its variables, we can
     2850% just start and end a group (to keep the @end definition undefined at
     2851% the outer level).
     2852%
     2853\def\conditionalsucceed#1{\begingroup
     2854  \expandafter\def\csname E#1\endcsname{\endgroup}%
     2855}
    25652856
    25662857% @defininfoenclose.
     
    25942885
    25952886% @defindex foo  ==  \newindex{foo}
    2596 
     2887%
    25972888\def\defindex{\parsearg\newindex}
    25982889
    25992890% Define @defcodeindex, like @defindex except put all entries in @code.
    2600 
     2891%
     2892\def\defcodeindex{\parsearg\newcodeindex}
     2893%
    26012894\def\newcodeindex#1{%
    26022895  \iflinks
     
    26052898  \fi
    26062899  \expandafter\xdef\csname#1index\endcsname{%
    2607     \noexpand\docodeindex{#1}}
    2608 }
    2609 
    2610 \def\defcodeindex{\parsearg\newcodeindex}
     2900    \noexpand\docodeindex{#1}}%
     2901}
     2902
    26112903
    26122904% @synindex foo bar    makes index foo feed into index bar.
    26132905% Do this instead of @defindex foo if you don't want it as a separate index.
    2614 % The \closeout helps reduce unnecessary open files; the limit on the
    2615 % Acorn RISC OS is a mere 16 files.
    2616 \def\synindex#1 #2 {%
    2617   \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
    2618   \expandafter\closeout\csname#1indfile\endcsname
    2619   \expandafter\let\csname#1indfile\endcsname=\synindexfoo
    2620   \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
    2621     \noexpand\doindex{#2}}%
    2622 }
    2623 
     2906%
    26242907% @syncodeindex foo bar   similar, but put all entries made for index foo
    26252908% inside @code.
    2626 \def\syncodeindex#1 #2 {%
    2627   \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
    2628   \expandafter\closeout\csname#1indfile\endcsname
    2629   \expandafter\let\csname#1indfile\endcsname=\synindexfoo
    2630   \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
    2631     \noexpand\docodeindex{#2}}%
     2909%
     2910\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
     2911\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
     2912
     2913% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
     2914% #3 the target index (bar).
     2915\def\dosynindex#1#2#3{%
     2916  % Only do \closeout if we haven't already done it, else we'll end up
     2917  % closing the target index.
     2918  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
     2919    % The \closeout helps reduce unnecessary open files; the limit on the
     2920    % Acorn RISC OS is a mere 16 files.
     2921    \expandafter\closeout\csname#2indfile\endcsname
     2922    \expandafter\let\csname\donesynindex#2\endcsname = 1
     2923  \fi
     2924  % redefine \fooindfile:
     2925  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
     2926  \expandafter\let\csname#2indfile\endcsname=\temp
     2927  % redefine \fooindex:
     2928  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
    26322929}
    26332930
     
    26492946\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
    26502947
     2948% Take care of Texinfo commands that can appear in an index entry.
     2949% Since there are some commands we want to expand, and others we don't,
     2950% we have to laboriously prevent expansion for those that we don't.
     2951%
    26512952\def\indexdummies{%
    2652 \def\ { }%
    2653 % Take care of the plain tex accent commands.
    2654 \def\"{\realbackslash "}%
    2655 \def\`{\realbackslash `}%
    2656 \def\'{\realbackslash '}%
    2657 \def\^{\realbackslash ^}%
    2658 \def\~{\realbackslash ~}%
    2659 \def\={\realbackslash =}%
    2660 \def\b{\realbackslash b}%
    2661 \def\c{\realbackslash c}%
    2662 \def\d{\realbackslash d}%
    2663 \def\u{\realbackslash u}%
    2664 \def\v{\realbackslash v}%
    2665 \def\H{\realbackslash H}%
    2666 % Take care of the plain tex special European modified letters.
    2667 \def\oe{\realbackslash oe}%
    2668 \def\ae{\realbackslash ae}%
    2669 \def\aa{\realbackslash aa}%
    2670 \def\OE{\realbackslash OE}%
    2671 \def\AE{\realbackslash AE}%
    2672 \def\AA{\realbackslash AA}%
    2673 \def\o{\realbackslash o}%
    2674 \def\O{\realbackslash O}%
    2675 \def\l{\realbackslash l}%
    2676 \def\L{\realbackslash L}%
    2677 \def\ss{\realbackslash ss}%
    2678 % Take care of texinfo commands likely to appear in an index entry.
    2679 % (Must be a way to avoid doing expansion at all, and thus not have to
    2680 % laboriously list every single command here.)
    2681 \def\@{@}% will be @@ when we switch to @ as escape char.
    2682 % Need these in case \tex is in effect and \{ is a \delimiter again.
    2683 % But can't use \lbracecmd and \rbracecmd because texindex assumes
    2684 % braces and backslashes are used only as delimiters. 
    2685 \let\{ = \mylbrace
    2686 \let\} = \myrbrace
    2687 \def\_{{\realbackslash _}}%
    2688 \def\w{\realbackslash w }%
    2689 \def\bf{\realbackslash bf }%
    2690 %\def\rm{\realbackslash rm }%
    2691 \def\sl{\realbackslash sl }%
    2692 \def\sf{\realbackslash sf}%
    2693 \def\tt{\realbackslash tt}%
    2694 \def\gtr{\realbackslash gtr}%
    2695 \def\less{\realbackslash less}%
    2696 \def\hat{\realbackslash hat}%
    2697 \def\TeX{\realbackslash TeX}%
    2698 \def\dots{\realbackslash dots }%
    2699 \def\result{\realbackslash result}%
    2700 \def\equiv{\realbackslash equiv}%
    2701 \def\expansion{\realbackslash expansion}%
    2702 \def\print{\realbackslash print}%
    2703 \def\error{\realbackslash error}%
    2704 \def\point{\realbackslash point}%
    2705 \def\copyright{\realbackslash copyright}%
    2706 \def\tclose##1{\realbackslash tclose {##1}}%
    2707 \def\code##1{\realbackslash code {##1}}%
    2708 \def\uref##1{\realbackslash uref {##1}}%
    2709 \def\url##1{\realbackslash url {##1}}%
    2710 \def\env##1{\realbackslash env {##1}}%
    2711 \def\command##1{\realbackslash command {##1}}%
    2712 \def\option##1{\realbackslash option {##1}}%
    2713 \def\dotless##1{\realbackslash dotless {##1}}%
    2714 \def\samp##1{\realbackslash samp {##1}}%
    2715 \def\,##1{\realbackslash ,{##1}}%
    2716 \def\t##1{\realbackslash t {##1}}%
    2717 \def\r##1{\realbackslash r {##1}}%
    2718 \def\i##1{\realbackslash i {##1}}%
    2719 \def\b##1{\realbackslash b {##1}}%
    2720 \def\sc##1{\realbackslash sc {##1}}%
    2721 \def\cite##1{\realbackslash cite {##1}}%
    2722 \def\key##1{\realbackslash key {##1}}%
    2723 \def\file##1{\realbackslash file {##1}}%
    2724 \def\var##1{\realbackslash var {##1}}%
    2725 \def\kbd##1{\realbackslash kbd {##1}}%
    2726 \def\dfn##1{\realbackslash dfn {##1}}%
    2727 \def\emph##1{\realbackslash emph {##1}}%
    2728 \def\acronym##1{\realbackslash acronym {##1}}%
    2729 %
    2730 % Handle some cases of @value -- where the variable name does not
    2731 % contain - or _, and the value does not contain any
    2732 % (non-fully-expandable) commands.
    2733 \let\value = \expandablevalue
    2734 %
    2735 \unsepspaces
    2736 % Turn off macro expansion
    2737 \turnoffmacros
     2953  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
     2954  \def\ {\realbackslash\space }%
     2955  % Need these in case \tex is in effect and \{ is a \delimiter again.
     2956  % But can't use \lbracecmd and \rbracecmd because texindex assumes
     2957  % braces and backslashes are used only as delimiters. 
     2958  \let\{ = \mylbrace
     2959  \let\} = \myrbrace
     2960  %
     2961  % \definedummyword defines \#1 as \realbackslash #1\space, thus
     2962  % effectively preventing its expansion.  This is used only for control
     2963  % words, not control letters, because the \space would be incorrect
     2964  % for control characters, but is needed to separate the control word
     2965  % from whatever follows.
     2966  %
     2967  % For control letters, we have \definedummyletter, which omits the
     2968  % space.
     2969  %
     2970  % These can be used both for control words that take an argument and
     2971  % those that do not.  If it is followed by {arg} in the input, then
     2972  % that will dutifully get written to the index (or wherever).
     2973  %
     2974  \def\definedummyword##1{%
     2975    \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
     2976  }%
     2977  \def\definedummyletter##1{%
     2978    \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
     2979  }%
     2980  %
     2981  % Do the redefinitions.
     2982  \commondummies
     2983}
     2984
     2985% For the aux file, @ is the escape character.  So we want to redefine
     2986% everything using @ instead of \realbackslash.  When everything uses
     2987% @, this will be simpler.
     2988%
     2989\def\atdummies{%
     2990  \def\@{@@}%
     2991  \def\ {@ }%
     2992  \let\{ = \lbraceatcmd
     2993  \let\} = \rbraceatcmd
     2994  %
     2995  % (See comments in \indexdummies.)
     2996  \def\definedummyword##1{%
     2997    \expandafter\def\csname ##1\endcsname{@##1\space}%
     2998  }%
     2999  \def\definedummyletter##1{%
     3000    \expandafter\def\csname ##1\endcsname{@##1}%
     3001  }%
     3002  %
     3003  % Do the redefinitions.
     3004  \commondummies
     3005}
     3006
     3007% Called from \indexdummies and \atdummies.  \definedummyword and
     3008% \definedummyletter must be defined first.
     3009%
     3010\def\commondummies{%
     3011  %
     3012  \normalturnoffactive
     3013  %
     3014  % Control letters and accents.
     3015  \definedummyletter{_}%
     3016  \definedummyletter{,}%
     3017  \definedummyletter{"}%
     3018  \definedummyletter{`}%
     3019  \definedummyletter{'}%
     3020  \definedummyletter{^}%
     3021  \definedummyletter{~}%
     3022  \definedummyletter{=}%
     3023  \definedummyword{u}%
     3024  \definedummyword{v}%
     3025  \definedummyword{H}%
     3026  \definedummyword{dotaccent}%
     3027  \definedummyword{ringaccent}%
     3028  \definedummyword{tieaccent}%
     3029  \definedummyword{ubaraccent}%
     3030  \definedummyword{udotaccent}%
     3031  \definedummyword{dotless}%
     3032  %
     3033  % Other non-English letters.
     3034  \definedummyword{AA}%
     3035  \definedummyword{AE}%
     3036  \definedummyword{L}%
     3037  \definedummyword{OE}%
     3038  \definedummyword{O}%
     3039  \definedummyword{aa}%
     3040  \definedummyword{ae}%
     3041  \definedummyword{l}%
     3042  \definedummyword{oe}%
     3043  \definedummyword{o}%
     3044  \definedummyword{ss}%
     3045  %
     3046  % Although these internal commands shouldn't show up, sometimes they do.
     3047  \definedummyword{bf}%
     3048  \definedummyword{gtr}%
     3049  \definedummyword{hat}%
     3050  \definedummyword{less}%
     3051  \definedummyword{sf}%
     3052  \definedummyword{sl}%
     3053  \definedummyword{tclose}%
     3054  \definedummyword{tt}%
     3055  %
     3056  % Texinfo font commands.
     3057  \definedummyword{b}%
     3058  \definedummyword{i}%
     3059  \definedummyword{r}%
     3060  \definedummyword{sc}%
     3061  \definedummyword{t}%
     3062  %
     3063  \definedummyword{TeX}%
     3064  \definedummyword{acronym}%
     3065  \definedummyword{cite}%
     3066  \definedummyword{code}%
     3067  \definedummyword{command}%
     3068  \definedummyword{dfn}%
     3069  \definedummyword{dots}%
     3070  \definedummyword{emph}%
     3071  \definedummyword{env}%
     3072  \definedummyword{file}%
     3073  \definedummyword{kbd}%
     3074  \definedummyword{key}%
     3075  \definedummyword{math}%
     3076  \definedummyword{option}%
     3077  \definedummyword{samp}%
     3078  \definedummyword{strong}%
     3079  \definedummyword{uref}%
     3080  \definedummyword{url}%
     3081  \definedummyword{var}%
     3082  \definedummyword{w}%
     3083  %
     3084  % Assorted special characters.
     3085  \definedummyword{bullet}%
     3086  \definedummyword{copyright}%
     3087  \definedummyword{dots}%
     3088  \definedummyword{enddots}%
     3089  \definedummyword{equiv}%
     3090  \definedummyword{error}%
     3091  \definedummyword{expansion}%
     3092  \definedummyword{minus}%
     3093  \definedummyword{pounds}%
     3094  \definedummyword{point}%
     3095  \definedummyword{print}%
     3096  \definedummyword{result}%
     3097  %
     3098  % Handle some cases of @value -- where the variable name does not
     3099  % contain - or _, and the value does not contain any
     3100  % (non-fully-expandable) commands.
     3101  \let\value = \expandablevalue
     3102  %
     3103  % Normal spaces, not active ones.
     3104  \unsepspaces
     3105  %
     3106  % No macro expansion.
     3107  \turnoffmacros
    27383108}
    27393109
    27403110% If an index command is used in an @example environment, any spaces
    27413111% therein should become regular spaces in the raw index file, not the
    2742 % expansion of \tie (\\leavevmode \penalty \@M \ ).
     3112% expansion of \tie (\leavevmode \penalty \@M \ ).
    27433113{\obeyspaces
    27443114 \gdef\unsepspaces{\obeyspaces\let =\space}}
    27453115
    2746 % \indexnofonts no-ops all font-change commands.
    2747 % This is used when outputting the strings to sort the index by.
    2748 \def\indexdummyfont#1{#1}
     3116
     3117% \indexnofonts is used when outputting the strings to sort the index
     3118% by, and when constructing control sequence names.  It eliminates all
     3119% control sequences and just writes whatever the best ASCII sort string
     3120% would be for a given command (usually its argument).
     3121%
    27493122\def\indexdummytex{TeX}
    27503123\def\indexdummydots{...}
    2751 
     3124%
    27523125\def\indexnofonts{%
    2753 % Just ignore accents.
    2754 \let\,=\indexdummyfont
    2755 \let\"=\indexdummyfont
    2756 \let\`=\indexdummyfont
    2757 \let\'=\indexdummyfont
    2758 \let\^=\indexdummyfont
    2759 \let\~=\indexdummyfont
    2760 \let\==\indexdummyfont
    2761 \let\b=\indexdummyfont
    2762 \let\c=\indexdummyfont
    2763 \let\d=\indexdummyfont
    2764 \let\u=\indexdummyfont
    2765 \let\v=\indexdummyfont
    2766 \let\H=\indexdummyfont
    2767 \let\dotless=\indexdummyfont
    2768 % Take care of the plain tex special European modified letters.
    2769 \def\oe{oe}%
    2770 \def\ae{ae}%
    2771 \def\aa{aa}%
    2772 \def\OE{OE}%
    2773 \def\AE{AE}%
    2774 \def\AA{AA}%
    2775 \def\o{o}%
    2776 \def\O{O}%
    2777 \def\l{l}%
    2778 \def\L{L}%
    2779 \def\ss{ss}%
    2780 \let\w=\indexdummyfont
    2781 \let\t=\indexdummyfont
    2782 \let\r=\indexdummyfont
    2783 \let\i=\indexdummyfont
    2784 \let\b=\indexdummyfont
    2785 \let\emph=\indexdummyfont
    2786 \let\strong=\indexdummyfont
    2787 \let\cite=\indexdummyfont
    2788 \let\sc=\indexdummyfont
    2789 %Don't no-op \tt, since it isn't a user-level command
    2790 % and is used in the definitions of the active chars like <, >, |...
    2791 %\let\tt=\indexdummyfont
    2792 \let\tclose=\indexdummyfont
    2793 \let\code=\indexdummyfont
    2794 \let\url=\indexdummyfont
    2795 \let\uref=\indexdummyfont
    2796 \let\env=\indexdummyfont
    2797 \let\acronym=\indexdummyfont
    2798 \let\command=\indexdummyfont
    2799 \let\option=\indexdummyfont
    2800 \let\file=\indexdummyfont
    2801 \let\samp=\indexdummyfont
    2802 \let\kbd=\indexdummyfont
    2803 \let\key=\indexdummyfont
    2804 \let\var=\indexdummyfont
    2805 \let\TeX=\indexdummytex
    2806 \let\dots=\indexdummydots
    2807 \def\@{@}%
    2808 }
    2809 
    2810 % To define \realbackslash, we must make \ not be an escape.
    2811 % We must first make another character (@) an escape
    2812 % so we do not become unable to do a definition.
    2813 
    2814 {\catcode`\@=0 \catcode`\\=\other
    2815  @gdef@realbackslash{\}}
     3126  \def\ { }%
     3127  \def\@{@}%
     3128  % how to handle braces?
     3129  \def\_{\normalunderscore}%
     3130  %
     3131  \let\,=\asis
     3132  \let\"=\asis
     3133  \let\`=\asis
     3134  \let\'=\asis
     3135  \let\^=\asis
     3136  \let\~=\asis
     3137  \let\==\asis
     3138  \let\u=\asis
     3139  \let\v=\asis
     3140  \let\H=\asis
     3141  \let\dotaccent=\asis
     3142  \let\ringaccent=\asis
     3143  \let\tieaccent=\asis
     3144  \let\ubaraccent=\asis
     3145  \let\udotaccent=\asis
     3146  \let\dotless=\asis
     3147  %
     3148  % Other non-English letters.
     3149  \def\AA{AA}%
     3150  \def\AE{AE}%
     3151  \def\L{L}%
     3152  \def\OE{OE}%
     3153  \def\O{O}%
     3154  \def\aa{aa}%
     3155  \def\ae{ae}%
     3156  \def\l{l}%
     3157  \def\oe{oe}%
     3158  \def\o{o}%
     3159  \def\ss{ss}%
     3160  \def\exclamdown{!}%
     3161  \def\questiondown{?}%
     3162  %
     3163  % Don't no-op \tt, since it isn't a user-level command
     3164  % and is used in the definitions of the active chars like <, >, |, etc.
     3165  % Likewise with the other plain tex font commands.
     3166  %\let\tt=\asis
     3167  %
     3168  % Texinfo font commands.
     3169  \let\b=\asis
     3170  \let\i=\asis
     3171  \let\r=\asis
     3172  \let\sc=\asis
     3173  \let\t=\asis
     3174  %
     3175  \let\TeX=\indexdummytex
     3176  \let\acronym=\asis
     3177  \let\cite=\asis
     3178  \let\code=\asis
     3179  \let\command=\asis
     3180  \let\dfn=\asis
     3181  \let\dots=\indexdummydots
     3182  \let\emph=\asis
     3183  \let\env=\asis
     3184  \let\file=\asis
     3185  \let\kbd=\asis
     3186  \let\key=\asis
     3187  \let\math=\asis
     3188  \let\option=\asis
     3189  \let\samp=\asis
     3190  \let\strong=\asis
     3191  \let\uref=\asis
     3192  \let\url=\asis
     3193  \let\var=\asis
     3194  \let\w=\asis
     3195}
    28163196
    28173197\let\indexbackslash=0  %overridden during \printindex.
     
    28453225        % so it will be output as is; and it will print as backslash.
    28463226        %
    2847         \def\thirdarg{#3}%
     3227        % The main index entry text.
     3228        \toks0 = {#2}%
    28483229        %
    28493230        % If third arg is present, precede it with space in sort key.
    2850         \ifx\thirdarg\emptymacro
    2851           \let\subentry = \empty
    2852         \else
    2853           \def\subentry{ #3}%
    2854         \fi
    2855         %
    2856         % First process the index entry with all font commands turned
    2857         % off to get the string to sort by.
    2858         {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
    2859         %
    2860         % Now the real index entry with the fonts.
    2861         \toks0 = {#2}%
    2862         %
    2863         % If third (subentry) arg is present, add it to the index
    2864         % string.  And include a space.
     3231        \def\thirdarg{#3}%
    28653232        \ifx\thirdarg\emptymacro \else
     3233           % If the third (subentry) arg is present, add it to the index
     3234           % line to write.
    28663235          \toks0 = \expandafter{\the\toks0 \space #3}%
    28673236        \fi
    28683237        %
    2869         % Set up the complete index entry, with both the sort key
    2870         % and the original text, including any font commands.  We write
    2871         % three arguments to \entry to the .?? file, texindex reduces to
    2872         % two when writing the .??s sorted result.
     3238        % Process the index entry with all font commands turned off, to
     3239        % get the string to sort by.
     3240        {\indexnofonts
     3241         \edef\temp{\the\toks0}% need full expansion
     3242         \xdef\indexsorttmp{\temp}%
     3243        }%
     3244        %
     3245        % Set up the complete index entry, with both the sort key and
     3246        % the original text, including any font commands.  We write
     3247        % three arguments to \entry to the .?? file (four in the
     3248        % subentry case), texindex reduces to two when writing the .??s
     3249        % sorted result.
    28733250        \edef\temp{%
    28743251          \write\csname#1indfile\endcsname{%
     
    28963273          \ifvmode
    28973274            \skip0 = \lastskip
    2898             \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
     3275            \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
    28993276          \fi
    29003277          %
    29013278          \temp % do the write
    2902           %
    29033279          %
    29043280          \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
     
    30923468
    30933469\newskip\secondaryindent \secondaryindent=0.5cm
    3094 
    3095 \def\secondary #1#2{
    3096 {\parfillskip=0in \parskip=0in
    3097 \hangindent =1in \hangafter=1
    3098 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
     3470\def\secondary#1#2{{%
     3471  \parfillskip=0in
     3472  \parskip=0in
     3473  \hangindent=1in
     3474  \hangafter=1
     3475  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
     3476  \ifpdf
     3477    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
     3478  \else
     3479    #2
     3480  \fi
     3481  \par
    30993482}}
    31003483
     
    31563539  % Double the \vsize as well.  (We don't need a separate register here,
    31573540  % since nobody clobbers \vsize.)
    3158   \advance\vsize by -\ht\partialpage
    31593541  \vsize = 2\vsize
    31603542}
     
    31703552  \dimen@ = \vsize
    31713553  \divide\dimen@ by 2
     3554  \advance\dimen@ by -\ht\partialpage
    31723555  %
    31733556  % box0 will be the left-hand column, box2 the right.
     
    31773560  \penalty\outputpenalty
    31783561}
     3562%
     3563% Re-output the contents of the output page -- any previous material,
     3564% followed by the two boxes we just split, in box0 and box2.
    31793565\def\pagesofar{%
    3180   % Re-output the contents of the output page -- any previous material,
    3181   % followed by the two boxes we just split, in box0 and box2.
    31823566  \unvbox\partialpage
    31833567  %
     
    31863570  \hbox to\pagewidth{\box0\hfil\box2}%
    31873571}
     3572%
     3573% All done with double columns.
    31883574\def\enddoublecolumns{%
    31893575  \output = {%
     
    32103596  \pagegoal = \vsize
    32113597}
     3598%
     3599% Called at the end of the double column material.
    32123600\def\balancecolumns{%
    3213   % Called at the end of the double column material.
    32143601  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
    32153602  \dimen@ = \ht0
     
    33663753\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
    33673754\def\chapterzzz #1{%
    3368 \secno=0 \subsecno=0 \subsubsecno=0
    3369 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
    3370 \chapmacro {#1}{\the\chapno}%
    3371 \gdef\thissection{#1}%
    3372 \gdef\thischaptername{#1}%
    3373 % We don't substitute the actual chapter name into \thischapter
    3374 % because we don't want its macros evaluated now.
    3375 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
    3376 \toks0 = {#1}%
    3377 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
    3378                                   {\the\chapno}}}%
    3379 \temp
    3380 \donoderef
    3381 \global\let\section = \numberedsec
    3382 \global\let\subsection = \numberedsubsec
    3383 \global\let\subsubsection = \numberedsubsubsec
    3384 }
     3755  \secno=0 \subsecno=0 \subsubsecno=0
     3756  \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
     3757  \chapmacro {#1}{\the\chapno}%
     3758  \gdef\thissection{#1}%
     3759  \gdef\thischaptername{#1}%
     3760  % We don't substitute the actual chapter name into \thischapter
     3761  % because we don't want its macros evaluated now.
     3762  \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
     3763  \writetocentry{chap}{#1}{{\the\chapno}}
     3764  \donoderef
     3765  \global\let\section = \numberedsec
     3766  \global\let\subsection = \numberedsubsec
     3767  \global\let\subsubsection = \numberedsubsubsec
     3768}
     3769
     3770% we use \chapno to avoid indenting back
     3771\def\appendixbox#1{%
     3772  \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
     3773  \hbox to \wd0{#1\hss}}
    33853774
    33863775\outer\def\appendix{\parsearg\appendixyyy}
    33873776\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
    33883777\def\appendixzzz #1{%
    3389 \secno=0 \subsecno=0 \subsubsecno=0
    3390 \global\advance \appendixno by 1
    3391 \message{\putwordAppendix\space \appendixletter}%
    3392 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
    3393 \gdef\thissection{#1}%
    3394 \gdef\thischaptername{#1}%
    3395 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
    3396 \toks0 = {#1}%
    3397 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
    3398                        {\putwordAppendix{} \appendixletter}}}%
    3399 \temp
    3400 \appendixnoderef
    3401 \global\let\section = \appendixsec
    3402 \global\let\subsection = \appendixsubsec
    3403 \global\let\subsubsection = \appendixsubsubsec
     3778  \secno=0 \subsecno=0 \subsubsecno=0
     3779  \global\advance \appendixno by 1
     3780  \message{\putwordAppendix\space \appendixletter}%
     3781  \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
     3782  \gdef\thissection{#1}%
     3783  \gdef\thischaptername{#1}%
     3784  \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
     3785  \writetocentry{appendix}{#1}{{\appendixletter}}
     3786  \appendixnoderef
     3787  \global\let\section = \appendixsec
     3788  \global\let\subsection = \appendixsubsec
     3789  \global\let\subsubsection = \appendixsubsubsec
    34043790}
    34053791
     
    34143800\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
    34153801\def\unnumberedzzz #1{%
    3416 \secno=0 \subsecno=0 \subsubsecno=0
    3417 %
    3418 % This used to be simply \message{#1}, but TeX fully expands the
    3419 % argument to \message.  Therefore, if #1 contained @-commands, TeX
    3420 % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
    3421 % expanded @cite (which turns out to cause errors because \cite is meant
    3422 % to be executed, not expanded).
    3423 %
    3424 % Anyway, we don't want the fully-expanded definition of @cite to appear
    3425 % as a result of the \message, we just want `@cite' itself.  We use
    3426 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
    3427 % simply yielding the contents of <toks register>.  (We also do this for
    3428 % the toc entries.)
    3429 \toks0 = {#1}\message{(\the\toks0)}%
    3430 %
    3431 \unnumbchapmacro {#1}%
    3432 \gdef\thischapter{#1}\gdef\thissection{#1}%
    3433 \toks0 = {#1}%
    3434 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
    3435 \temp
    3436 \unnumbnoderef
    3437 \global\let\section = \unnumberedsec
    3438 \global\let\subsection = \unnumberedsubsec
    3439 \global\let\subsubsection = \unnumberedsubsubsec
     3802  \secno=0 \subsecno=0 \subsubsecno=0
     3803  %
     3804  % This used to be simply \message{#1}, but TeX fully expands the
     3805  % argument to \message.  Therefore, if #1 contained @-commands, TeX
     3806  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
     3807  % expanded @cite (which turns out to cause errors because \cite is meant
     3808  % to be executed, not expanded).
     3809  %
     3810  % Anyway, we don't want the fully-expanded definition of @cite to appear
     3811  % as a result of the \message, we just want `@cite' itself.  We use
     3812  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
     3813  % simply yielding the contents of <toks register>.  (We also do this for
     3814  % the toc entries.)
     3815  \toks0 = {#1}\message{(\the\toks0)}%
     3816  %
     3817  \unnumbchapmacro {#1}%
     3818  \gdef\thischapter{#1}\gdef\thissection{#1}%
     3819  \writetocentry{unnumbchap}{#1}{{\the\chapno}}
     3820  \unnumbnoderef
     3821  \global\let\section = \unnumberedsec
     3822  \global\let\subsection = \unnumberedsubsec
     3823  \global\let\subsubsection = \unnumberedsubsubsec
    34403824}
    34413825
     
    34443828\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
    34453829\def\seczzz #1{%
    3446 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
    3447 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
    3448 \toks0 = {#1}%
    3449 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
    3450                                   {\the\chapno}{\the\secno}}}%
    3451 \temp
    3452 \donoderef
    3453 \nobreak
     3830  \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
     3831  \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
     3832  \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
     3833  \donoderef
     3834  \nobreak
    34543835}
    34553836
     
    34583839\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
    34593840\def\appendixsectionzzz #1{%
    3460 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
    3461 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
    3462 \toks0 = {#1}%
    3463 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
    3464                                   {\appendixletter}{\the\secno}}}%
    3465 \temp
    3466 \appendixnoderef
    3467 \nobreak
     3841  \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
     3842  \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
     3843  \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
     3844  \appendixnoderef
     3845  \nobreak
    34683846}
    34693847
     
    34713849\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
    34723850\def\unnumberedseczzz #1{%
    3473 \plainsecheading {#1}\gdef\thissection{#1}%
    3474 \toks0 = {#1}%
    3475 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
    3476 \temp
    3477 \unnumbnoderef
    3478 \nobreak
     3851  \plainsecheading {#1}\gdef\thissection{#1}%
     3852  \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
     3853  \unnumbnoderef
     3854  \nobreak
    34793855}
    34803856
     
    34833859\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
    34843860\def\numberedsubseczzz #1{%
    3485 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
    3486 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
    3487 \toks0 = {#1}%
    3488 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
    3489                                     {\the\chapno}{\the\secno}{\the\subsecno}}}%
    3490 \temp
    3491 \donoderef
    3492 \nobreak
     3861  \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
     3862  \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
     3863  \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
     3864  \donoderef
     3865  \nobreak
    34933866}
    34943867
     
    34963869\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
    34973870\def\appendixsubseczzz #1{%
    3498 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
    3499 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
    3500 \toks0 = {#1}%
    3501 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
    3502                                 {\appendixletter}{\the\secno}{\the\subsecno}}}%
    3503 \temp
    3504 \appendixnoderef
    3505 \nobreak
     3871  \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
     3872  \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
     3873  \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
     3874  \appendixnoderef
     3875  \nobreak
    35063876}
    35073877
     
    35093879\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
    35103880\def\unnumberedsubseczzz #1{%
    3511 \plainsubsecheading {#1}\gdef\thissection{#1}%
    3512 \toks0 = {#1}%
    3513 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
    3514                                     {\the\toks0}}}%
    3515 \temp
    3516 \unnumbnoderef
    3517 \nobreak
     3881  \plainsubsecheading {#1}\gdef\thissection{#1}%
     3882  \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
     3883  \unnumbnoderef
     3884  \nobreak
    35183885}
    35193886
     
    35223889\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
    35233890\def\numberedsubsubseczzz #1{%
    3524 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
    3525 \subsubsecheading {#1}
    3526   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
    3527 \toks0 = {#1}%
    3528 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
    3529   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
    3530 \temp
    3531 \donoderef
    3532 \nobreak
     3891  \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
     3892  \subsubsecheading {#1}
     3893    {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
     3894  \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
     3895  \donoderef
     3896  \nobreak
    35333897}
    35343898
     
    35363900\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
    35373901\def\appendixsubsubseczzz #1{%
    3538 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
    3539 \subsubsecheading {#1}
    3540   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
    3541 \toks0 = {#1}%
    3542 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
    3543   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
    3544 \temp
    3545 \appendixnoderef
    3546 \nobreak
     3902  \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
     3903  \subsubsecheading {#1}
     3904    {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
     3905  \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
     3906  \appendixnoderef
     3907  \nobreak
    35473908}
    35483909
     
    35503911\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
    35513912\def\unnumberedsubsubseczzz #1{%
    3552 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
    3553 \toks0 = {#1}%
    3554 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
    3555                                     {\the\toks0}}}%
    3556 \temp
    3557 \unnumbnoderef
    3558 \nobreak
     3913  \plainsubsubsecheading {#1}\gdef\thissection{#1}%
     3914  \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
     3915  \unnumbnoderef
     3916  \nobreak
    35593917}
    35603918
     
    35973955\def\majorheading{\parsearg\majorheadingzzz}
    35983956\def\majorheadingzzz #1{%
    3599 {\advance\chapheadingskip by 10pt \chapbreak }%
    3600 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
    3601                   \parindent=0pt\raggedright
    3602                   \rm #1\hfill}}\bigskip \par\penalty 200}
     3957  {\advance\chapheadingskip by 10pt \chapbreak }%
     3958  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
     3959                    \parindent=0pt\raggedright
     3960                    \rm #1\hfill}}\bigskip \par\penalty 200}
    36033961
    36043962\def\chapheading{\parsearg\chapheadingzzz}
    36053963\def\chapheadingzzz #1{\chapbreak %
    3606 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
    3607                   \parindent=0pt\raggedright
    3608                   \rm #1\hfill}}\bigskip \par\penalty 200}
     3964  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
     3965                    \parindent=0pt\raggedright
     3966                    \rm #1\hfill}}\bigskip \par\penalty 200}
    36093967
    36103968% @heading, @subheading, @subsubheading.
     
    37524110          \unhbox0 #3}%
    37534111  }%
    3754   \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
     4112  % Add extra space after the heading -- either a line space or a
     4113  % paragraph space, whichever is more.  (Some people like to set
     4114  % \parskip to large values for some reason.)  Don't allow stretch, though.
     4115  \nobreak
     4116  \ifdim\parskip>\normalbaselineskip
     4117    \kern\parskip
     4118  \else
     4119    \kern\normalbaselineskip
     4120  \fi
     4121  \nobreak
    37554122}
    37564123
     
    37644131% argument, which will end up as the last argument to the \...entry macro.
    37654132%
    3766 % We open the .toc file here instead of at @setfilename or any other
    3767 % given time so that @contents can be put in the document anywhere.
     4133% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
     4134% We open the .toc file for writing here instead of at @setfilename (or
     4135% any other fixed time) so that @contents can be anywhere in the document.
    37684136%
    37694137\newif\iftocfileopened
    3770 \def\writetocentry#1{%
     4138\def\writetocentry#1#2#3{%
    37714139  \iftocfileopened\else
    37724140    \immediate\openout\tocfile = \jobname.toc
    37734141    \global\tocfileopenedtrue
    37744142  \fi
    3775   \iflinks \write\tocfile{#1{\folio}}\fi
     4143  %
     4144  \iflinks
     4145    \toks0 = {#2}%
     4146    \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
     4147    \temp
     4148  \fi
     4149  %
     4150  % Tell \shipout to create a page destination if we're doing pdf, which
     4151  % will be the target of the links in the table of contents.  We can't
     4152  % just do it on every page because the title pages are numbered 1 and
     4153  % 2 (the page numbers aren't printed), and so are the first two pages
     4154  % of the document.  Thus, we'd have two destinations named `1', and
     4155  % two named `2'.
     4156  \ifpdf \pdfmakepagedesttrue \fi
    37764157}
    37774158
     
    38044185      %
    38054186      % Roman numerals for page numbers.
    3806       \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
     4187      \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
    38074188}
    38084189
     
    38214202   \endgroup
    38224203   \lastnegativepageno = \pageno
    3823    \pageno = \savepageno
     4204   \global\pageno = \savepageno
    38244205}
    38254206
     
    38294210      %
    38304211      \let\chapentry = \shortchapentry
     4212      \let\appendixentry = \shortappendixentry
    38314213      \let\unnumbchapentry = \shortunnumberedentry
    38324214      % We want a true roman here for the page numbers.
    38334215      \secfonts
    3834       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
     4216      \let\rm=\shortcontrm \let\bf=\shortcontbf
     4217      \let\sl=\shortcontsl \let\tt=\shortconttt
    38354218      \rm
    38364219      \hyphenpenalty = 10000
    38374220      \advance\baselineskip by 1pt % Open it up a little.
    38384221      \def\secentry ##1##2##3##4{}
    3839       \def\unnumbsecentry ##1##2{}
    38404222      \def\subsecentry ##1##2##3##4##5{}
    3841       \def\unnumbsubsecentry ##1##2{}
    38424223      \def\subsubsecentry ##1##2##3##4##5##6{}
    3843       \def\unnumbsubsubsecentry ##1##2{}
     4224      \let\unnumbsecentry = \secentry
     4225      \let\unnumbsubsecentry = \subsecentry
     4226      \let\unnumbsubsubsecentry = \subsubsecentry
    38444227      \openin 1 \jobname.toc
    38454228      \ifeof 1 \else
     
    38514234   \endgroup
    38524235   \lastnegativepageno = \pageno
    3853    \pageno = \savepageno
     4236   \global\pageno = \savepageno
    38544237}
    38554238\let\shortcontents = \summarycontents
     
    38644247% The arguments in between are the chapter number, section number, ...
    38654248
    3866 % Chapter-level things, for both the long and short contents.
     4249% Chapters, in the main contents.
    38674250\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
    3868 
    3869 % See comments in \dochapentry re vbox and related settings
     4251%
     4252% Chapters, in the short toc.
     4253% See comments in \dochapentry re vbox and related settings.
    38704254\def\shortchapentry#1#2#3{%
    38714255  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
    38724256}
    38734257
     4258% Appendices, in the main contents.
     4259\def\appendixentry#1#2#3{%
     4260  \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}}
     4261%
     4262% Appendices, in the short toc.
     4263\let\shortappendixentry = \shortchapentry
     4264
    38744265% Typeset the label for a chapter or appendix for the short contents.
    3875 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
     4266% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
    38764267% We could simplify the code here by writing out an \appendixentry
    38774268% command in the toc file for appendices, instead of using \chapentry
     
    38814272%
    38824273\def\shortchaplabel#1{%
    3883   % Compute width of word "Appendix", may change with language.
    3884   \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
    3885   \shortappendixwidth = \wd0
    3886   %
    3887   % We typeset #1 in a box of constant width, regardless of the text of
    3888   % #1, so the chapter titles will come out aligned.
    3889   \setbox0 = \hbox{#1}%
    3890   \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
    3891   %
    3892   % This space should be plenty, since a single number is .5em, and the
     4274  % This space should be enough, since a single number is .5em, and the
    38934275  % widest letter (M) is 1em, at least in the Computer Modern fonts.
     4276  % But use \hss just in case.
    38944277  % (This space doesn't include the extra space that gets added after
    38954278  % the label; that gets put in by \shortchapentry above.)
    3896   \advance\dimen0 by 1.1em
    3897   \hbox to \dimen0{#1\hfil}%
    3898 }
    3899 
    3900 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
    3901 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
     4279  \dimen0 = 1em
     4280  \hbox to \dimen0{#1\hss}%
     4281}
     4282
     4283% Unnumbered chapters.
     4284\def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}}
     4285\def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}}
    39024286
    39034287% Sections.
    39044288\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
    3905 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
     4289\def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}}
    39064290
    39074291% Subsections.
    39084292\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
    3909 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
     4293\def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}}
    39104294
    39114295% And subsubsections.
    39124296\def\subsubsecentry#1#2#3#4#5#6{%
    39134297  \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
    3914 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
     4298\def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}}
    39154299
    39164300% This parameter controls the indentation of the various levels.
     
    39534337  \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
    39544338  % Do not use \turnoffactive in these arguments.  Since the toc is
    3955   % typeset in cmr, so characters such as _ would come out wrong; we
     4339  % typeset in cmr, characters such as _ would come out wrong; we
    39564340  % have to do the usual translation tricks.
    39574341  \entry{#1}{#2}%
     
    39734357% @foo ... @end foo.
    39744358
     4359% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
     4360%
    39754361% Since these characters are used in examples, it should be an even number of
    39764362% \tt widths. Each \tt character is 1en, so two makes it 1em.
    3977 % Furthermore, these definitions must come after we define our fonts.
    3978 \newbox\dblarrowbox    \newbox\longdblarrowbox
    3979 \newbox\pushcharbox    \newbox\bullbox
    3980 \newbox\equivbox       \newbox\errorbox
    3981 
    3982 %{\tentt
    3983 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
    3984 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
    3985 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
    3986 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
    3987 % Adapted from the manmac format (p.420 of TeXbook)
    3988 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
    3989 %                                      depth .1ex\hfil}
    3990 %}
    3991 
    3992 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
     4363%
    39934364\def\point{$\star$}
    39944365\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
     
    39974368\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
    39984369
     4370% The @error{} command.
    39994371% Adapted from the TeXbook's \boxit.
     4372%
     4373\newbox\errorbox
     4374%
    40004375{\tentt \global\dimen0 = 3em}% Width of the box.
    40014376\dimen2 = .55pt % Thickness of rules
    40024377% The text. (`r' is open on the right, `e' somewhat less so on the left.)
    40034378\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
    4004 
     4379%
    40054380\global\setbox\errorbox=\hbox to \dimen0{\hfil
    40064381   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
     
    40134388      \hrule height\dimen2}
    40144389    \hfil}
    4015 
    4016 % The @error{} command.
     4390%
    40174391\def\error{\leavevmode\lower.7ex\copy\errorbox}
    40184392
     
    40244398  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
    40254399  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
    4026   \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
     4400  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
    40274401  \catcode `\%=14
    4028   \catcode 43=12 % plus
    4029   \catcode`\"=12
    4030   \catcode`\==12
    4031   \catcode`\|=12
    4032   \catcode`\<=12
    4033   \catcode`\>=12
     4402  \catcode `\+=\other
     4403  \catcode `\"=\other
     4404  \catcode `\==\other
     4405  \catcode `\|=\other
     4406  \catcode `\<=\other
     4407  \catcode `\>=\other
    40344408  \escapechar=`\\
    40354409  %
     
    40544428\let\Etex=\endgroup}
    40554429
    4056 % Define @lisp ... @endlisp.
     4430% Define @lisp ... @end lisp.
    40574431% @lisp does a \begingroup so it can rebind things,
    4058 % including the definition of @endlisp (which normally is erroneous).
     4432% including the definition of @end lisp (which normally is erroneous).
    40594433
    40604434% Amount to narrow the margins by for @lisp.
     
    40854459% to help in doing that, since in @example-like environments \parskip
    40864460% is reset to zero; thus the \afterenvbreak inserts no space -- but the
    4087 % start of the next paragraph will insert \parskip
    4088 %
    4089 \def\aboveenvbreak{{\advance\envskipamount by \parskip
    4090 \endgraf \ifdim\lastskip<\envskipamount
    4091 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
     4461% start of the next paragraph will insert \parskip.
     4462%
     4463\def\aboveenvbreak{{%
     4464  % =10000 instead of <10000 because of a special case in \itemzzz, q.v.
     4465  \ifnum \lastpenalty=10000 \else
     4466    \advance\envskipamount by \parskip
     4467    \endgraf
     4468    \ifdim\lastskip<\envskipamount
     4469      \removelastskip
     4470      % it's not a good place to break if the last penalty was \nobreak
     4471      % or better ...
     4472      \ifnum\lastpenalty>10000 \else \penalty-50 \fi
     4473      \vskip\envskipamount
     4474    \fi
     4475  \fi
     4476}}
    40924477
    40934478\let\afterenvbreak = \aboveenvbreak
     
    41174502\newskip\lskip\newskip\rskip
    41184503
    4119 \long\def\cartouche{%
     4504\def\cartouche{%
     4505\par  % can't be in the midst of a paragraph.
    41204506\begingroup
    41214507        \lskip=\leftskip \rskip=\rightskip
     
    41644550  \hfuzz = 12pt % Don't be fussy
    41654551  \sepspaces % Make spaces be word-separators rather than space tokens.
    4166   \singlespace
    41674552  \let\par = \lisppar % don't ignore blank lines
    41684553  \obeylines % each line of input is a line of output
     
    42034588\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
    42044589
    4205 % @small... is usually equivalent to the non-small (@smallbook
    4206 % redefines).  We must call \example (or whatever) last in the
    4207 % definition, since it reads the return following the @example (or
    4208 % whatever) command.
    4209 %
    4210 % This actually allows (for example) @end display inside an
    4211 % @smalldisplay.  Too bad, but makeinfo will catch the error anyway.
    4212 %
    4213 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
    4214 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
    4215 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
    4216 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
    4217 
    4218 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
     4590% @smallexample and @smalllisp: use smaller fonts.
    42194591% Originally contributed by Pavel@xerox.
    4220 \def\smalllispx{\begingroup
     4592\def\smalllisp{\begingroup
    42214593  \def\Esmalllisp{\nonfillfinish\endgroup}%
    42224594  \def\Esmallexample{\nonfillfinish\endgroup}%
    4223   \smallfonts
     4595  \smallexamplefonts
    42244596  \lisp
    42254597}
     4598\let\smallexample = \smalllisp
     4599
    42264600
    42274601% @display: same as @lisp except keep current font.
     
    42324606  \gobble
    42334607}
    4234 
    4235 % @smalldisplay (when @smallbook): @display plus smaller fonts.
    4236 %
    4237 \def\smalldisplayx{\begingroup
     4608%
     4609% @smalldisplay: @display plus smaller fonts.
     4610%
     4611\def\smalldisplay{\begingroup
    42384612  \def\Esmalldisplay{\nonfillfinish\endgroup}%
    4239   \smallfonts \rm
     4613  \smallexamplefonts \rm
    42404614  \display
    42414615}
     
    42494623  \gobble
    42504624}
    4251 
    4252 % @smallformat (when @smallbook): @format plus smaller fonts.
    4253 %
    4254 \def\smallformatx{\begingroup
     4625%
     4626% @smallformat: @format plus smaller fonts.
     4627%
     4628\def\smallformat{\begingroup
    42554629  \def\Esmallformat{\nonfillfinish\endgroup}%
    4256   \smallfonts \rm
     4630  \smallexamplefonts \rm
    42574631  \format
    42584632}
     
    42724646}
    42734647
     4648
    42744649% @quotation does normal linebreaking (hence we can't use \nonfillstart)
    42754650% and narrows the margins.
     
    42784653  \begingroup\inENV %This group ends at the end of the @quotation body
    42794654  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
    4280   \singlespace
    42814655  \parindent=0pt
    42824656  % We have retained a nonzero parskip for the environment, since we're
     
    42944668
    42954669
     4670% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
     4671% If we want to allow any <char> as delimiter,
     4672% we need the curly braces so that makeinfo sees the @verb command, eg:
     4673% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
     4674%
     4675% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
     4676%
     4677% [Knuth] p.344; only we need to do the other characters Texinfo sets
     4678% active too.  Otherwise, they get lost as the first character on a
     4679% verbatim line.
     4680\def\dospecials{%
     4681  \do\ \do\\\do\{\do\}\do\$\do\&%
     4682  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
     4683  \do\<\do\>\do\|\do\@\do+\do\"%
     4684}
     4685%
     4686% [Knuth] p. 380
     4687\def\uncatcodespecials{%
     4688  \def\do##1{\catcode`##1=12}\dospecials}
     4689%
     4690% [Knuth] pp. 380,381,391
     4691% Disable Spanish ligatures ?` and !` of \tt font
     4692\begingroup
     4693  \catcode`\`=\active\gdef`{\relax\lq}
     4694\endgroup
     4695%
     4696% Setup for the @verb command.
     4697%
     4698% Eight spaces for a tab
     4699\begingroup
     4700  \catcode`\^^I=\active
     4701  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
     4702\endgroup
     4703%
     4704\def\setupverb{%
     4705  \tt  % easiest (and conventionally used) font for verbatim
     4706  \def\par{\leavevmode\endgraf}%
     4707  \catcode`\`=\active
     4708  \tabeightspaces
     4709  % Respect line breaks,
     4710  % print special symbols as themselves, and
     4711  % make each space count
     4712  % must do in this order:
     4713  \obeylines \uncatcodespecials \sepspaces
     4714}
     4715
     4716% Setup for the @verbatim environment
     4717%
     4718% Real tab expansion
     4719\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
     4720%
     4721\def\starttabbox{\setbox0=\hbox\bgroup}
     4722\begingroup
     4723  \catcode`\^^I=\active
     4724  \gdef\tabexpand{%
     4725    \catcode`\^^I=\active
     4726    \def^^I{\leavevmode\egroup
     4727      \dimen0=\wd0 % the width so far, or since the previous tab
     4728      \divide\dimen0 by\tabw
     4729      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
     4730      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
     4731      \wd0=\dimen0 \box0 \starttabbox
     4732    }%
     4733  }
     4734\endgroup
     4735\def\setupverbatim{%
     4736  % Easiest (and conventionally used) font for verbatim
     4737  \tt
     4738  \def\par{\leavevmode\egroup\box0\endgraf}%
     4739  \catcode`\`=\active
     4740  \tabexpand
     4741  % Respect line breaks,
     4742  % print special symbols as themselves, and
     4743  % make each space count
     4744  % must do in this order:
     4745  \obeylines \uncatcodespecials \sepspaces
     4746  \everypar{\starttabbox}%
     4747}
     4748
     4749% Do the @verb magic: verbatim text is quoted by unique
     4750% delimiter characters.  Before first delimiter expect a
     4751% right brace, after last delimiter expect closing brace:
     4752%
     4753%    \def\doverb'{'<char>#1<char>'}'{#1}
     4754%
     4755% [Knuth] p. 382; only eat outer {}
     4756\begingroup
     4757  \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
     4758  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
     4759\endgroup
     4760%
     4761\def\verb{\begingroup\setupverb\doverb}
     4762%
     4763%
     4764% Do the @verbatim magic: define the macro \doverbatim so that
     4765% the (first) argument ends when '@end verbatim' is reached, ie:
     4766%
     4767%     \def\doverbatim#1@end verbatim{#1}
     4768%
     4769% For Texinfo it's a lot easier than for LaTeX,
     4770% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
     4771% we need not redefine '\', '{' and '}'.
     4772%
     4773% Inspired by LaTeX's verbatim command set [latex.ltx]
     4774%% Include LaTeX hack for completeness -- never know
     4775%% \begingroup
     4776%% \catcode`|=0 \catcode`[=1
     4777%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
     4778%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
     4779%% #1|endgroup|def|Everbatim[]|end[verbatim]]
     4780%% |endgroup
     4781%
     4782\begingroup
     4783  \catcode`\ =\active
     4784  \obeylines %
     4785  % ignore everything up to the first ^^M, that's the newline at the end
     4786  % of the @verbatim input line itself.  Otherwise we get an extra blank
     4787  % line in the output.
     4788  \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
     4789\endgroup
     4790%
     4791\def\verbatim{%
     4792  \def\Everbatim{\nonfillfinish\endgroup}%
     4793  \begingroup
     4794    \nonfillstart
     4795    \advance\leftskip by -\defbodyindent
     4796    \begingroup\setupverbatim\doverbatim
     4797}
     4798
     4799% @verbatiminclude FILE - insert text of file in verbatim environment.
     4800%
     4801% Allow normal characters that we make active in the argument (a file name).
     4802\def\verbatiminclude{%
     4803  \begingroup
     4804    \catcode`\\=\other
     4805    \catcode`~=\other
     4806    \catcode`^=\other
     4807    \catcode`_=\other
     4808    \catcode`|=\other
     4809    \catcode`<=\other
     4810    \catcode`>=\other
     4811    \catcode`+=\other
     4812    \parsearg\doverbatiminclude
     4813}
     4814\def\setupverbatiminclude{%
     4815  \begingroup
     4816    \nonfillstart
     4817    \advance\leftskip by -\defbodyindent
     4818    \begingroup\setupverbatim
     4819}
     4820%
     4821\def\doverbatiminclude#1{%
     4822     % Restore active chars for included file.
     4823  \endgroup
     4824  \begingroup
     4825    \let\value=\expandablevalue
     4826    \def\thisfile{#1}%
     4827    \expandafter\expandafter\setupverbatiminclude\input\thisfile
     4828  \endgroup
     4829  \nonfillfinish
     4830  \endgroup
     4831}
     4832
     4833% @copying ... @end copying.
     4834% Save the text away for @insertcopying later.  Many commands won't be
     4835% allowed in this context, but that's ok.
     4836%
     4837% We save the uninterpreted tokens, rather than creating a box.
     4838% Saving the text in a box would be much easier, but then all the
     4839% typesetting commands (@smallbook, font changes, etc.) have to be done
     4840% beforehand -- and a) we want @copying to be done first in the source
     4841% file; b) letting users define the frontmatter in as flexible order as
     4842% possible is very desirable.
     4843%
     4844\def\copying{\begingroup
     4845  % Define a command to swallow text until we reach `@end copying'.
     4846  % \ is the escape char in this texinfo.tex file, so it is the
     4847  % delimiter for the command; @ will be the escape char when we read
     4848  % it, but that doesn't matter.
     4849  \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
     4850  %
     4851  % We must preserve ^^M's in the input file; see \insertcopying below.
     4852  \catcode`\^^M = \active
     4853  \docopying
     4854}
     4855
     4856% What we do to finish off the copying text.
     4857%
     4858\def\enddocopying{\endgroup\ignorespaces}
     4859
     4860% @insertcopying.  Here we must play games with ^^M's.  On the one hand,
     4861% we need them to delimit commands such as `@end quotation', so they
     4862% must be active.  On the other hand, we certainly don't want every
     4863% end-of-line to be a \par, as would happen with the normal active
     4864% definition of ^^M.  On the third hand, two ^^M's in a row should still
     4865% generate a \par.
     4866%
     4867% Our approach is to make ^^M insert a space and a penalty1 normally;
     4868% then it can also check if \lastpenalty=1.  If it does, then manually
     4869% do \par.
     4870%
     4871% This messes up the normal definitions of @c[omment], so we redefine
     4872% it.  Similarly for @ignore.  (These commands are used in the gcc
     4873% manual for man page generation.)
     4874%
     4875% Seems pretty fragile, most line-oriented commands will presumably
     4876% fail, but for the limited use of getting the copying text (which
     4877% should be quite simple) inserted, we can hope it's ok.
     4878%
     4879{\catcode`\^^M=\active %
     4880\gdef\insertcopying{\begingroup %
     4881  \parindent = 0pt  % looks wrong on title page
     4882  \def^^M{%
     4883    \ifnum \lastpenalty=1 %
     4884      \par %
     4885    \else %
     4886      \space \penalty 1 %
     4887    \fi %
     4888  }%
     4889  %
     4890  % Fix @c[omment] for catcode 13 ^^M's.
     4891  \def\c##1^^M{\ignorespaces}%
     4892  \let\comment = \c %
     4893  %
     4894  % Don't bother jumping through all the hoops that \doignore does, it
     4895  % would be very hard since the catcodes are already set.
     4896  \long\def\ignore##1\end ignore{\ignorespaces}%
     4897  %
     4898  \copyingtext %
     4899\endgroup}%
     4900}
     4901
    42964902\message{defuns,}
    42974903% @defun etc.
    42984904
    42994905% Allow user to change definition object font (\df) internally
    4300 \def\setdeffont #1 {\csname DEF#1\endcsname}
     4906\def\setdeffont#1 {\csname DEF#1\endcsname}
    43014907
    43024908\newskip\defbodyindent \defbodyindent=.4in
    43034909\newskip\defargsindent \defargsindent=50pt
    4304 \newskip\deftypemargin \deftypemargin=12pt
    43054910\newskip\deflastargmargin \deflastargmargin=18pt
    43064911
    43074912\newcount\parencount
    4308 % define \functionparens, which makes ( and ) and & do special things.
    4309 % \functionparens affects the group it is contained in.
     4913
     4914% We want ()&[] to print specially on the defun line.
     4915%
    43104916\def\activeparens{%
    4311 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
    4312 \catcode`\[=\active \catcode`\]=\active}
     4917  \catcode`\(=\active \catcode`\)=\active
     4918  \catcode`\&=\active
     4919  \catcode`\[=\active \catcode`\]=\active
     4920}
    43134921
    43144922% Make control sequences which act like normal parenthesis chars.
     
    43574965% Active &'s sneak into the index arguments, so make sure it's defined.
    43584966{
    4359   \catcode`& = 13
     4967  \catcode`& = \active
    43604968  \global\let& = \ampnr
    43614969}
    43624970
    4363 % First, defname, which formats the header line itself.
    4364 % #1 should be the function name.
    4365 % #2 should be the type of definition, such as "Function".
    4366 
    4367 \def\defname #1#2{%
    4368 % Get the values of \leftskip and \rightskip as they were
    4369 % outside the @def...
    4370 \dimen2=\leftskip
    4371 \advance\dimen2 by -\defbodyindent
    4372 \noindent
    4373 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
    4374 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
    4375 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
    4376 \parshape 2 0in \dimen0 \defargsindent \dimen1
    4377 % Now output arg 2 ("Function" or some such)
    4378 % ending at \deftypemargin from the right margin,
    4379 % but stuck inside a box of width 0 so it does not interfere with linebreaking
    4380 {% Adjust \hsize to exclude the ambient margins,
    4381 % so that \rightline will obey them.
    4382 \advance \hsize by -\dimen2
    4383 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
    4384 % Make all lines underfull and no complaints:
    4385 \tolerance=10000 \hbadness=10000
    4386 \advance\leftskip by -\defbodyindent
    4387 \exdentamount=\defbodyindent
    4388 {\df #1}\enskip        % Generate function name
    4389 }
    4390 
    4391 % Actually process the body of a definition
    4392 % #1 should be the terminating control sequence, such as \Edefun.
    4393 % #2 should be the "another name" control sequence, such as \defunx.
    4394 % #3 should be the control sequence that actually processes the header,
    4395 %    such as \defunheader.
    4396 
    4397 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
    4398 \medbreak %
    4399 % Define the end token that this defining construct specifies
    4400 % so that it will exit this group.
    4401 \def#1{\endgraf\endgroup\medbreak}%
    4402 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
    4403 \parindent=0in
    4404 \advance\leftskip by \defbodyindent
    4405 \exdentamount=\defbodyindent
    4406 \begingroup %
    4407 \catcode 61=\active % 61 is `='
    4408 \obeylines\activeparens\spacesplit#3}
    4409 
     4971% \defname, which formats the name of the @def (not the args).
     4972% #1 is the function name.
     4973% #2 is the type of definition, such as "Function".
     4974%
     4975\def\defname#1#2{%
     4976  % How we'll output the type name.  Putting it in brackets helps
     4977  % distinguish it from the body text that may end up on the next line
     4978  % just below it.
     4979  \ifempty{#2}%
     4980    \def\defnametype{}%
     4981  \else
     4982    \def\defnametype{[\rm #2]}%
     4983  \fi
     4984  %
     4985  % Get the values of \leftskip and \rightskip as they were outside the @def...
     4986  \dimen2=\leftskip
     4987  \advance\dimen2 by -\defbodyindent
     4988  %
     4989  % Figure out values for the paragraph shape.
     4990  \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
     4991  \dimen0=\hsize \advance \dimen0 by -\wd0  % compute size for first line
     4992  \dimen1=\hsize \advance \dimen1 by -\defargsindent  % size for continuations
     4993  \parshape 2 0in \dimen0 \defargsindent \dimen1
     4994  %
     4995  % Output arg 2 ("Function" or some such) but stuck inside a box of
     4996  % width 0 so it does not interfere with linebreaking.
     4997  \noindent
     4998  %
     4999  {% Adjust \hsize to exclude the ambient margins,
     5000   % so that \rightline will obey them.
     5001   \advance \hsize by -\dimen2
     5002   \dimen3 = 0pt  % was -1.25pc
     5003   \rlap{\rightline{\defnametype\kern\dimen3}}%
     5004  }%
     5005  %
     5006  % Allow all lines to be underfull without complaint:
     5007  \tolerance=10000 \hbadness=10000
     5008  \advance\leftskip by -\defbodyindent
     5009  \exdentamount=\defbodyindent
     5010  {\df #1}\enskip        % output function name
     5011  % \defunargs will be called next to output the arguments, if any.
     5012}
     5013
     5014% Common pieces to start any @def...
    44105015% #1 is the \E... control sequence to end the definition (which we define).
    4411 % #2 is the \...x control sequence for consecutive fns (which we define).
    4412 % #3 is the control sequence to call to resume processing.
    4413 % #4, delimited by the space, is the class name.
    4414 %
    4415 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
    4416 \medbreak %
    4417 % Define the end token that this defining construct specifies
    4418 % so that it will exit this group.
    4419 \def#1{\endgraf\endgroup\medbreak}%
    4420 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
    4421 \parindent=0in
    4422 \advance\leftskip by \defbodyindent
    4423 \exdentamount=\defbodyindent
    4424 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
    4425 
    4426 % Used for @deftypemethod and @deftypeivar.
    4427 % #1 is the \E... control sequence to end the definition (which we define).
    4428 % #2 is the \...x control sequence for consecutive fns (which we define).
    4429 % #3 is the control sequence to call to resume processing.
    4430 % #4, delimited by a space, is the class name.
    4431 % #5 is the method's return type.
    4432 %
    4433 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
     5016% #2 is the \...x control sequence (which our caller defines).
     5017% #3 is the control sequence to process the header, such as \defunheader.
     5018%
     5019\def\parsebodycommon#1#2#3{%
     5020  \begingroup\inENV
     5021  % If there are two @def commands in a row, we'll have a \nobreak,
     5022  % which is there to keep the function description together with its
     5023  % header.  But if there's nothing but headers, we want to allow a
     5024  % break after all.  Check for penalty 10002 (inserted by
     5025  % \defargscommonending) instead of 10000, since the sectioning
     5026  % commands insert a \penalty10000, and we don't want to allow a break
     5027  % between a section heading and a defun.
     5028  \ifnum\lastpenalty=10002 \penalty0 \fi
    44345029  \medbreak
     5030  %
     5031  % Define the \E... end token that this defining construct specifies
     5032  % so that it will exit this group.
    44355033  \def#1{\endgraf\endgroup\medbreak}%
    4436   \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
     5034  %
    44375035  \parindent=0in
    44385036  \advance\leftskip by \defbodyindent
    44395037  \exdentamount=\defbodyindent
    4440   \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
     5038}
     5039
     5040% Common part of the \...x definitions.
     5041%
     5042\def\defxbodycommon{%
     5043  % As with \parsebodycommon above, allow line break if we have multiple
     5044  % x headers in a row.  It's not a great place, though.
     5045  \ifnum\lastpenalty=10000 \penalty1000 \fi
     5046  %
     5047  \begingroup\obeylines
     5048}
     5049
     5050% Process body of @defun, @deffn, @defmac, etc.
     5051%
     5052\def\defparsebody#1#2#3{%
     5053  \parsebodycommon{#1}{#2}{#3}%
     5054  \def#2{\defxbodycommon \activeparens \spacesplit#3}%
     5055  \catcode\equalChar=\active
     5056  \begingroup\obeylines\activeparens
     5057  \spacesplit#3%
     5058}
     5059
     5060% #1, #2, #3 are the common arguments (see \parsebodycommon above).
     5061% #4, delimited by the space, is the class name.
     5062%
     5063\def\defmethparsebody#1#2#3#4 {%
     5064  \parsebodycommon{#1}{#2}{#3}%
     5065  \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
     5066  \begingroup\obeylines\activeparens
     5067  % The \empty here prevents misinterpretation of a construct such as
     5068  %   @deffn {whatever} {Enharmonic comma}
     5069  % See comments at \deftpparsebody, although in our case we don't have
     5070  % to remove the \empty afterwards, since it is empty.
     5071  \spacesplit{#3{#4}}\empty
     5072}
     5073
     5074% Used for @deftypemethod and @deftypeivar.
     5075% #1, #2, #3 are the common arguments (see \defparsebody).
     5076% #4, delimited by a space, is the class name.
     5077% #5 is the method's return type.
     5078%
     5079\def\deftypemethparsebody#1#2#3#4 #5 {%
     5080  \parsebodycommon{#1}{#2}{#3}%
     5081  \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
     5082  \begingroup\obeylines\activeparens
     5083  \spacesplit{#3{#4}{#5}}%
     5084}
    44415085
    44425086% Used for @deftypeop.  The change from \deftypemethparsebody is an
     
    44475091% the \E... definition to assign the category name to.
    44485092%
    4449 \def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
    4450   \medbreak
    4451   \def#1{\endgraf\endgroup\medbreak}%
    4452   \def#2##1 ##2 ##3 {%
    4453     \def#4{##1}%
    4454     \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
    4455   \parindent=0in
    4456   \advance\leftskip by \defbodyindent
    4457   \exdentamount=\defbodyindent
    4458   \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
    4459 
    4460 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
    4461 \medbreak %
    4462 % Define the end token that this defining construct specifies
    4463 % so that it will exit this group.
    4464 \def#1{\endgraf\endgroup\medbreak}%
    4465 \def#2##1 ##2 {\def#4{##1}%
    4466 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
    4467 \parindent=0in
    4468 \advance\leftskip by \defbodyindent
    4469 \exdentamount=\defbodyindent
    4470 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
     5093\def\deftypeopparsebody#1#2#3#4#5 #6 {%
     5094  \parsebodycommon{#1}{#2}{#3}%
     5095  \def#2##1 ##2 ##3 {\def#4{##1}%
     5096    \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
     5097  \begingroup\obeylines\activeparens
     5098  \spacesplit{#3{#5}{#6}}%
     5099}
     5100
     5101% For @defop.
     5102\def\defopparsebody #1#2#3#4#5 {%
     5103  \parsebodycommon{#1}{#2}{#3}%
     5104  \def#2##1 ##2 {\def#4{##1}%
     5105    \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
     5106  \begingroup\obeylines\activeparens
     5107  \spacesplit{#3{#5}}%
     5108}
    44715109
    44725110% These parsing functions are similar to the preceding ones
    44735111% except that they do not make parens into active characters.
    44745112% These are used for "variables" since they have no arguments.
    4475 
    4476 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
    4477 \medbreak %
    4478 % Define the end token that this defining construct specifies
    4479 % so that it will exit this group.
    4480 \def#1{\endgraf\endgroup\medbreak}%
    4481 \def#2{\begingroup\obeylines\spacesplit#3}%
    4482 \parindent=0in
    4483 \advance\leftskip by \defbodyindent
    4484 \exdentamount=\defbodyindent
    4485 \begingroup %
    4486 \catcode 61=\active %
    4487 \obeylines\spacesplit#3}
    4488 
    4489 % This is used for \def{tp,vr}parsebody.  It could probably be used for
    4490 % some of the others, too, with some judicious conditionals.
    4491 %
    4492 \def\parsebodycommon#1#2#3{%
    4493   \begingroup\inENV %
    4494   \medbreak %
    4495   % Define the end token that this defining construct specifies
    4496   % so that it will exit this group.
    4497   \def#1{\endgraf\endgroup\medbreak}%
    4498   \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
    4499   \parindent=0in
    4500   \advance\leftskip by \defbodyindent
    4501   \exdentamount=\defbodyindent
     5113%
     5114\def\defvarparsebody #1#2#3{%
     5115  \parsebodycommon{#1}{#2}{#3}%
     5116  \def#2{\defxbodycommon \spacesplit#3}%
     5117  \catcode\equalChar=\active
    45025118  \begingroup\obeylines
     5119  \spacesplit#3%
     5120}
     5121
     5122% @defopvar.
     5123\def\defopvarparsebody #1#2#3#4#5 {%
     5124  \parsebodycommon{#1}{#2}{#3}%
     5125  \def#2##1 ##2 {\def#4{##1}%
     5126    \defxbodycommon \spacesplit{#3{##2}}}%
     5127  \begingroup\obeylines
     5128  \spacesplit{#3{#5}}%
    45035129}
    45045130
    45055131\def\defvrparsebody#1#2#3#4 {%
    45065132  \parsebodycommon{#1}{#2}{#3}%
     5133  \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
     5134  \begingroup\obeylines
    45075135  \spacesplit{#3{#4}}%
    45085136}
     
    45195147\def\deftpparsebody #1#2#3#4 {%
    45205148  \parsebodycommon{#1}{#2}{#3}%
     5149  \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
     5150  \begingroup\obeylines
    45215151  \spacesplit{\parsetpheaderline{#3{#4}}}\empty
    45225152}
     
    45355165}%
    45365166
    4537 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
    4538 \medbreak %
    4539 % Define the end token that this defining construct specifies
    4540 % so that it will exit this group.
    4541 \def#1{\endgraf\endgroup\medbreak}%
    4542 \def#2##1 ##2 {\def#4{##1}%
    4543 \begingroup\obeylines\spacesplit{#3{##2}}}%
    4544 \parindent=0in
    4545 \advance\leftskip by \defbodyindent
    4546 \exdentamount=\defbodyindent
    4547 \begingroup\obeylines\spacesplit{#3{#5}}}
    4548 
    4549 % Split up #2 at the first space token.
     5167% Split up #2 (the rest of the input line) at the first space token.
    45505168% call #1 with two arguments:
    45515169%  the first is all of #2 before the space token,
     
    45535171% If #2 contains no space token, all of it is passed as the first arg
    45545172% and the second is passed as empty.
    4555 
    4556 {\obeylines
    4557 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
    4558 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
    4559 \ifx\relax #3%
    4560 #1{#2}{}\else #1{#2}{#3#4}\fi}}
    4561 
    4562 % So much for the things common to all kinds of definitions.
     5173%
     5174{\obeylines %
     5175 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
     5176 \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
     5177   \ifx\relax #3%
     5178     #1{#2}{}%
     5179   \else %
     5180     #1{#2}{#3#4}%
     5181   \fi}%
     5182}
    45635183
    45645184% Define @defun.
    45655185
    4566 % First, define the processing that is wanted for arguments of \defun
    4567 % Use this to expand the args and terminate the paragraph they make up
    4568 
     5186% This is called to end the arguments processing for all the @def... commands.
     5187%
     5188\def\defargscommonending{%
     5189  \interlinepenalty = 10000
     5190  \advance\rightskip by 0pt plus 1fil
     5191  \endgraf
     5192  \nobreak\vskip -\parskip
     5193  \penalty 10002  % signal to \parsebodycommon.
     5194}
     5195
     5196% This expands the args and terminates the paragraph they comprise.
     5197%
    45695198\def\defunargs#1{\functionparens \sl
    45705199% Expand, preventing hyphenation at `-' chars.
     
    45755204{\tensl\hyphenchar\font=45}%
    45765205\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
    4577 \interlinepenalty=10000
    4578 \advance\rightskip by 0pt plus 1fil
    4579 \endgraf\nobreak\vskip -\parskip\nobreak
     5206  \defargscommonending
    45805207}
    45815208
     
    45865213\boldbraxnoamp
    45875214\tclose{#1}% avoid \code because of side effects on active chars
    4588 \interlinepenalty=10000
    4589 \advance\rightskip by 0pt plus 1fil
    4590 \endgraf\nobreak\vskip -\parskip\nobreak
     5215  \defargscommonending
    45915216}
    45925217
     
    45995224\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
    46005225\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
    4601 \catcode 61=\other % Turn off change made in \defparsebody
     5226\catcode\equalChar=\other % Turn off change made in \defparsebody
    46025227}
    46035228
     
    46095234\begingroup\defname {#1}{\putwordDeffunc}%
    46105235\defunargs {#2}\endgroup %
    4611 \catcode 61=\other % Turn off change made in \defparsebody
     5236\catcode\equalChar=\other % Turn off change made in \defparsebody
    46125237}
    46135238
     
    46215246\def\deftypefunheaderx #1#2 #3\relax{%
    46225247\doind {fn}{\code{#2}}% Make entry in function index
    4623 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
     5248\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
    46245249\deftypefunargs {#3}\endgroup %
    4625 \catcode 61=\other % Turn off change made in \defparsebody
     5250\catcode\equalChar=\other % Turn off change made in \defparsebody
    46265251}
    46275252
     
    46305255\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
    46315256
    4632 % \defheaderxcond#1\relax$$$
     5257% \defheaderxcond#1\relax$.$
    46335258% puts #1 in @code, followed by a space, but does nothing if #1 is null.
    4634 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
     5259\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
    46355260
    46365261% #1 is the classification.  #2 is the data type.  #3 is the name and args.
     
    46425267\normalparens % notably, turn off `&' magic, which prevents
    46435268%               at least some C++ text from working
    4644 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
     5269\defname {\defheaderxcond#2\relax$.$#3}{#1}%
    46455270\deftypefunargs {#4}\endgroup %
    4646 \catcode 61=\other % Turn off change made in \defparsebody
     5271\catcode\equalChar=\other % Turn off change made in \defparsebody
    46475272}
    46485273
     
    46545279\begingroup\defname {#1}{\putwordDefmac}%
    46555280\defunargs {#2}\endgroup %
    4656 \catcode 61=\other % Turn off change made in \defparsebody
     5281\catcode\equalChar=\other % Turn off change made in \defparsebody
    46575282}
    46585283
     
    46645289\begingroup\defname {#1}{\putwordDefspec}%
    46655290\defunargs {#2}\endgroup %
    4666 \catcode 61=\other % Turn off change made in \defparsebody
     5291\catcode\equalChar=\other % Turn off change made in \defparsebody
    46675292}
    46685293
     
    46735298%
    46745299\def\defopheader#1#2#3{%
    4675 \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
    4676 \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
    4677 \defunargs {#3}\endgroup %
     5300  \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
     5301  \begingroup
     5302    \defname{#2}{\defoptype\ \putwordon\ #1}%
     5303    \defunargs{#3}%
     5304  \endgroup
    46785305}
    46795306
     
    46885315  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
    46895316  \begingroup
    4690     \defname{\defheaderxcond#2\relax$$$#3}
     5317    \defname{\defheaderxcond#2\relax$.$#3}
    46915318            {\deftypeopcategory\ \putwordon\ \code{#1}}%
    46925319    \deftypefunargs{#4}%
     
    47035330  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
    47045331  \begingroup
    4705     \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
     5332    \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
    47065333    \deftypefunargs{#4}%
    47075334  \endgroup
     
    47175344  \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
    47185345  \begingroup
    4719     \defname{\defheaderxcond#2\relax$$$#3}
     5346    \defname{\defheaderxcond#2\relax$.$#3}
    47205347            {\putwordInstanceVariableof\ \code{#1}}%
    47215348    \defvarargs{#3}%
     
    47425369
    47435370\def\defcvarheader #1#2#3{%
    4744 \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
    4745 \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
    4746 \defvarargs {#3}\endgroup %
     5371  \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
     5372  \begingroup
     5373    \defname{#2}{\defcvtype\ \putwordof\ #1}%
     5374    \defvarargs{#3}%
     5375  \endgroup
    47475376}
    47485377
     
    47525381%
    47535382\def\defivarheader#1#2#3{%
    4754   \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
     5383  \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
    47555384  \begingroup
    47565385    \defname{#2}{\putwordInstanceVariableof\ #1}%
     
    47645393% This must expand the args and terminate the paragraph they make up
    47655394\def\defvarargs #1{\normalparens #1%
    4766 \interlinepenalty=10000
    4767 \endgraf\nobreak\vskip -\parskip\nobreak}
     5395  \defargscommonending
     5396}
    47685397
    47695398% @defvr Counter foo-count
     
    48005429\def\deftypevarheader #1#2{%
    48015430\dovarind#2 \relax% Make entry in variables index
    4802 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
    4803 \interlinepenalty=10000
    4804 \endgraf\nobreak\vskip -\parskip\nobreak
     5431\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
     5432  \defargscommonending
    48055433\endgroup}
    48065434\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
     
    48115439
    48125440\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
    4813 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
    4814 \interlinepenalty=10000
    4815 \endgraf\nobreak\vskip -\parskip\nobreak
     5441\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
     5442  \defargscommonending
    48165443\endgroup}
    48175444
     
    48625489   \begingroup \newlinechar`\^^M
    48635490   % Undo catcode changes of \startcontents and \doprintindex
    4864    \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
     5491   \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
    48655492   % Append \endinput to make sure that TeX does not see the ending newline.
    48665493   \toks0={#1\endinput}%
     
    48765503\begingroup \newlinechar`\^^M
    48775504% Undo catcode changes of \startcontents and \doprintindex
    4878 \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
     5505\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
    48795506\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
    48805507\fi
     
    49065533
    49075534% Trim a single trailing ^^M off a string.
    4908 {\catcode`\^^M=12\catcode`\Q=3%
     5535{\catcode`\^^M=\other \catcode`\Q=3%
    49095536\gdef\eatcr #1{\eatcra #1Q^^MQ}%
    49105537\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
     
    49215548
    49225549\def\macrobodyctxt{%
    4923   \catcode`\~=12
    4924   \catcode`\^=12
    4925   \catcode`\_=12
    4926   \catcode`\|=12
    4927   \catcode`\<=12
    4928   \catcode`\>=12
    4929   \catcode`\+=12
    4930   \catcode`\{=12
    4931   \catcode`\}=12
    4932   \catcode`\@=12
    4933   \catcode`\^^M=12
     5550  \catcode`\~=\other
     5551  \catcode`\^=\other
     5552  \catcode`\_=\other
     5553  \catcode`\|=\other
     5554  \catcode`\<=\other
     5555  \catcode`\>=\other
     5556  \catcode`\+=\other
     5557  \catcode`\{=\other
     5558  \catcode`\}=\other
     5559  \catcode`\@=\other
     5560  \catcode`\^^M=\other
    49345561  \usembodybackslash}
    49355562
    49365563\def\macroargctxt{%
    4937   \catcode`\~=12
    4938   \catcode`\^=12
    4939   \catcode`\_=12
    4940   \catcode`\|=12
    4941   \catcode`\<=12
    4942   \catcode`\>=12
    4943   \catcode`\+=12
    4944   \catcode`\@=12
    4945   \catcode`\\=12}
     5564  \catcode`\~=\other
     5565  \catcode`\^=\other
     5566  \catcode`\_=\other
     5567  \catcode`\|=\other
     5568  \catcode`\<=\other
     5569  \catcode`\>=\other
     5570  \catcode`\+=\other
     5571  \catcode`\@=\other
     5572  \catcode`\\=\other}
    49465573
    49475574% \mbodybackslash is the definition of \ in @macro bodies.
     
    49715598  \else
    49725599     \expandafter\ifx\csname \the\macname\endcsname \relax
    4973      \else \errmessage{The name \the\macname\space is reserved}\fi
     5600     \else \errmessage{Macro name \the\macname\space already defined}\fi
    49745601     \global\cslet{macsave.\the\macname}{\the\macname}%
    49755602     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
     
    49845611  \fi}
    49855612
    4986 \def\unmacro{\parsearg\unmacroxxx}
    4987 \def\unmacroxxx#1{%
     5613\def\unmacro{\parsearg\dounmacro}
     5614\def\dounmacro#1{%
    49885615  \if1\csname ismacro.#1\endcsname
    49895616    \global\cslet{#1}{macsave.#1}%
    49905617    \global\expandafter\let \csname ismacro.#1\endcsname=0%
    4991     % Remove the macro name from \macrolist
     5618    % Remove the macro name from \macrolist:
    49925619    \begingroup
    4993       \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
    4994       \def\do##1{%
    4995         \def\tempb{##1}%
    4996         \ifx\tempa\tempb
    4997           % remove this
    4998         \else
    4999           \toks0 = \expandafter{\newmacrolist\do}%
    5000           \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
    5001         \fi}%
    5002       \def\newmacrolist{}%
    5003       % Execute macro list to define \newmacrolist
    5004       \macrolist
    5005       \global\let\macrolist\newmacrolist
     5620      \expandafter\let\csname#1\endcsname \relax
     5621      \let\do\unmacrodo
     5622      \xdef\macrolist{\macrolist}%
    50065623    \endgroup
    50075624  \else
    50085625    \errmessage{Macro #1 not defined}%
     5626  \fi
     5627}
     5628
     5629% Called by \do from \dounmacro on each macro.  The idea is to omit any
     5630% macro definitions that have been changed to \relax.
     5631%
     5632\def\unmacrodo#1{%
     5633  \ifx#1\relax
     5634    % remove this
     5635  \else
     5636    \noexpand\do \noexpand #1%
    50095637  \fi
    50105638}
     
    51925820\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
    51935821
    5194 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
    5195 % NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  We have
    5196 % to set \indexdummies so commands such as @code in a section title
    5197 % aren't expanded.  It would be nicer not to expand the titles in the
    5198 % first place, but there's so many layers that that is hard to do.
    5199 %
     5822% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
     5823% anchor), namely NAME-title (the corresponding @chapter/etc. name),
     5824% NAME-pg (the page number), and NAME-snt (section number and type).
     5825% Called from \foonoderef.
     5826%
     5827% We have to set \indexdummies so commands such as @code in a section
     5828% title aren't expanded.  It would be nicer not to expand the titles in
     5829% the first place, but there's so many layers that that is hard to do.
     5830%
     5831% Likewise, use \turnoffactive so that punctuation chars such as underscore
     5832% and backslash work in node names.
     5833%
    52005834\def\setref#1#2{{%
    5201   \indexdummies
     5835  \atdummies
    52025836  \pdfmkdest{#1}%
     5837  %
     5838  \turnoffactive
    52035839  \dosetq{#1-title}{Ytitle}%
    52045840  \dosetq{#1-pg}{Ypagenumber}%
     
    52525888    \leavevmode
    52535889    \getfilename{#4}%
    5254     \ifnum\filenamelength>0
    5255       \startlink attr{/Border [0 0 0]}%
    5256         goto file{\the\filename.pdf} name{#1@}%
    5257     \else
    5258       \startlink attr{/Border [0 0 0]}%
    5259         goto name{#1@}%
    5260     \fi
     5890    {\turnoffactive \otherbackslash
     5891     \ifnum\filenamelength>0
     5892       \startlink attr{/Border [0 0 0]}%
     5893         goto file{\the\filename.pdf} name{#1}%
     5894     \else
     5895       \startlink attr{/Border [0 0 0]}%
     5896         goto name{#1}%
     5897     \fi
     5898    }%
    52615899    \linkcolor
    52625900  \fi
     
    52705908    % printing. So we \turnoffactive for the \refx-snt, back on for the
    52715909    % printing, back off for the \refx-pg.
    5272     {\normalturnoffactive
     5910    {\turnoffactive \otherbackslash
    52735911     % Only output a following space if the -snt ref is nonempty; for
    52745912     % @unnumbered and @anchor, it won't be.
     
    52795917    [\printednodename],\space
    52805918    % page 3
    5281     \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
     5919    \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
    52825920  \fi
    52835921  \endlink
    52845922\endgroup}
    52855923
    5286 % \dosetq is the interface for calls from other macros
    5287 
    5288 % Use \normalturnoffactive so that punctuation chars such as underscore
    5289 % and backslash work in node names.  (\turnoffactive doesn't do \.)
     5924% \dosetq is called from \setref to do the actual \write (\iflinks).
     5925%
    52905926\def\dosetq#1#2{%
    52915927  {\let\folio=0%
    5292    \normalturnoffactive
    52935928   \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
    5294    \iflinks
    5295      \next
    5296    \fi
     5929   \iflinks \next \fi
    52975930  }%
    52985931}
    52995932
    5300 % \internalsetq {foo}{page} expands into
    5301 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
    5302 % When the aux file is read, ' is the escape character
    5303 
    5304 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
    5305 
    5306 % Things to be expanded by \internalsetq
    5307 
     5933% \internalsetq{foo}{page} expands into
     5934%   CHARACTERS @xrdef{foo}{...expansion of \page...}
     5935\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
     5936
     5937% Things to be expanded by \internalsetq.
     5938%
    53085939\def\Ypagenumber{\folio}
    5309 
    53105940\def\Ytitle{\thissection}
    5311 
    53125941\def\Ynothing{}
    5313 
    53145942\def\Ysectionnumberandtype{%
    5315 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
    5316 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
    5317 \else \ifnum \subsubsecno=0 %
    5318 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
    5319 \else %
    5320 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
    5321 \fi \fi \fi }
     5943  \ifnum\secno=0
     5944    \putwordChapter@tie \the\chapno
     5945  \else \ifnum\subsecno=0
     5946    \putwordSection@tie \the\chapno.\the\secno
     5947  \else \ifnum\subsubsecno=0
     5948    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
     5949  \else
     5950    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
     5951  \fi\fi\fi
     5952}
    53225953
    53235954\def\Yappendixletterandtype{%
    5324 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
    5325 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
    5326 \else \ifnum \subsubsecno=0 %
    5327 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
    5328 \else %
    5329 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
    5330 \fi \fi \fi }
    5331 
    5332 \gdef\xreftie{'tie}
     5955  \ifnum\secno=0
     5956     \putwordAppendix@tie @char\the\appendixno{}%
     5957  \else \ifnum\subsecno=0
     5958     \putwordSection@tie @char\the\appendixno.\the\secno
     5959  \else \ifnum\subsubsecno=0
     5960    \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
     5961  \else
     5962    \putwordSection@tie
     5963      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
     5964  \fi\fi\fi
     5965}
    53335966
    53345967% Use TeX 3.0's \inputlineno to get the line number, for better error
     
    53365969%
    53375970\ifx\inputlineno\thisisundefined
    5338   \let\linenumber = \empty % Non-3.0.
     5971  \let\linenumber = \empty % Pre-3.0.
    53395972\else
    53405973  \def\linenumber{\the\inputlineno:\space}
     
    53435976% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
    53445977% If its value is nonempty, SUFFIX is output afterward.
    5345 
     5978%
    53465979\def\refx#1#2{%
    5347   \expandafter\ifx\csname X#1\endcsname\relax
     5980  {%
     5981    \indexnofonts
     5982    \otherbackslash
     5983    \expandafter\global\expandafter\let\expandafter\thisrefX
     5984      \csname X#1\endcsname
     5985  }%
     5986  \ifx\thisrefX\relax
    53485987    % If not defined, say something at least.
    53495988    \angleleft un\-de\-fined\angleright
     
    53605999  \else
    53616000    % It's defined, so just use it.
    5362     \csname X#1\endcsname
     6001    \thisrefX
    53636002  \fi
    53646003  #2% Output the suffix in any case.
     
    53676006% This is the macro invoked by entries in the aux file.
    53686007%
    5369 \def\xrdef#1{\begingroup
    5370   % Reenable \ as an escape while reading the second argument.
    5371   \catcode`\\ = 0
    5372   \afterassignment\endgroup
    5373   \expandafter\gdef\csname X#1\endcsname
    5374 }
     6008\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
    53756009
    53766010% Read the last existing aux file, if any.  No error if none exists.
     
    54036037  \catcode`\^^^=\other
    54046038  \catcode`\^^_=\other
    5405   \catcode`\@=\other
    5406   \catcode`\^=\other
    5407   % It was suggested to define this as 7, which would allow ^^e4 etc.
     6039  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
    54086040  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
    54096041  % supported in the main text, it doesn't seem desirable.  Furthermore,
     
    54186050  % and then to call \auxhat in \setq.
    54196051  %
     6052  \catcode`\^=\other
     6053  %
     6054  % Special characters.  Should be turned off anyway, but...
    54206055  \catcode`\~=\other
    54216056  \catcode`\[=\other
     
    54296064  \catcode`\#=\other
    54306065  \catcode`\&=\other
     6066  \catcode`\%=\other
    54316067  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
     6068  %
    54326069  % Make the characters 128-255 be printing characters
    54336070  {%
     
    54396076    }%
    54406077  }%
    5441   % The aux file uses ' as the escape (for now).
     6078  %
    54426079  % Turn off \ as an escape so we do not lose on
    54436080  % entries which were dumped with control sequences in their names.
    5444   % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
     6081  % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
    54456082  % Reference to such entries still does not work the way one would wish,
    54466083  % but at least they do not bomb out when the aux file is read in.
     6084  \catcode`\\=\other
     6085  %
     6086  % @ is our escape character in .aux files.
    54476087  \catcode`\{=1
    54486088  \catcode`\}=2
    5449   \catcode`\%=\other
    5450   \catcode`\'=0
    5451   \catcode`\\=\other
     6089  \catcode`\@=0
    54526090  %
    54536091  \openin 1 \jobname.aux
     
    54946132  \unskip
    54956133  \thisfootno\@sf
    5496   \footnotezzz
     6134  \dofootnote
    54976135}%
    54986136
     
    55046142% the footnote is read.  --karl, 16nov96.
    55056143%
    5506 \long\gdef\footnotezzz{\insert\footins\bgroup
     6144% The start of the footnote looks usually like this:
     6145\gdef\startfootins{\insert\footins\bgroup}
     6146%
     6147% ... but this macro is redefined inside @multitable.
     6148%
     6149\gdef\dofootnote{%
     6150  \startfootins
    55076151  % We want to typeset this text as a normal paragraph, even if the
    55086152  % footnote reference occurs in (for example) a display environment.
    55096153  % So reset some parameters.
     6154  \hsize=\pagewidth
    55106155  \interlinepenalty\interfootnotelinepenalty
    55116156  \splittopskip\ht\strutbox % top baseline for broken footnotes
     
    55206165  \smallfonts \rm
    55216166  %
    5522   % Hang the footnote text off the number.
    5523   \hang
     6167  % Because we use hanging indentation in footnotes, a @noindent appears
     6168  % to exdent this text, so make it be a no-op.  makeinfo does not use
     6169  % hanging indentation so @noindent can still be needed within footnote
     6170  % text after an @example or the like (not that this is good style).
     6171  \let\noindent = \relax
     6172  %
     6173  % Hang the footnote text off the number.  Use \everypar in case the
     6174  % footnote extends for more than one paragraph.
     6175  \everypar = {\hang}%
    55246176  \textindent{\thisfootno}%
    55256177  %
     
    55306182  \futurelet\next\fo@t
    55316183}
    5532 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
    5533   \else\let\next\f@t\fi \next}
    5534 \def\f@@t{\bgroup\aftergroup\@foot\let\next}
    5535 \def\f@t#1{#1\@foot}
    5536 \def\@foot{\strut\par\egroup}
    5537 
    55386184}%end \catcode `\@=11
    5539 
    5540 % Set the baselineskip to #1, and the lineskip and strut size
    5541 % correspondingly.  There is no deep meaning behind these magic numbers
    5542 % used as factors; they just match (closely enough) what Knuth defined.
    5543 %
    5544 \def\lineskipfactor{.08333}
    5545 \def\strutheightpercent{.70833}
    5546 \def\strutdepthpercent {.29167}
    5547 %
    5548 \def\setleading#1{%
    5549   \normalbaselineskip = #1\relax
    5550   \normallineskip = \lineskipfactor\normalbaselineskip
    5551   \normalbaselines
    5552   \setbox\strutbox =\hbox{%
    5553     \vrule width0pt height\strutheightpercent\baselineskip
    5554                     depth \strutdepthpercent \baselineskip
    5555   }%
    5556 }
    55576185
    55586186% @| inserts a changebar to the left of the current line.  It should
     
    56006228\ifeof 1 \else
    56016229  \closein 1
    5602   % Do not bother showing banner with post-v2.7 epsf.tex (available in
    5603   % doc/epsf.tex until it shows up on ctan).
     6230  % Do not bother showing banner with epsf.tex v2.7k (available in
     6231  % doc/epsf.tex and on ctan).
    56046232  \def\epsfannounce{\toks0 = }%
    56056233  \input epsf.tex
     
    56206248    \fi
    56216249  \else
    5622     \imagexxx #1,,,\finish
     6250    \imagexxx #1,,,,,\finish
    56236251  \fi
    56246252}
     
    56276255% #1 is (mandatory) image filename; we tack on .eps extension.
    56286256% #2 is (optional) width, #3 is (optional) height.
    5629 % #4 is just the usual extra ignored arg for parsing this stuff.
    5630 \def\imagexxx#1,#2,#3,#4\finish{%
     6257% #4 is (ignored optional) html alt text.
     6258% #5 is (ignored optional) extension.
     6259% #6 is just the usual extra ignored arg for parsing this stuff.
     6260\newif\ifimagevmode
     6261\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
     6262  \catcode`\^^M = 5     % in case we're inside an example
     6263  \normalturnoffactive  % allow _ et al. in names
     6264  % If the image is by itself, center it.
     6265  \ifvmode
     6266    \imagevmodetrue
     6267    \nobreak\bigskip
     6268    % Usually we'll have text after the image which will insert
     6269    % \parskip glue, so insert it here too to equalize the space
     6270    % above and below.
     6271    \nobreak\vskip\parskip
     6272    \nobreak
     6273    \line\bgroup\hss
     6274  \fi
     6275  %
     6276  % Output the image.
    56316277  \ifpdf
    5632     \centerline{\dopdfimage{#1}{#2}{#3}}%
     6278    \dopdfimage{#1}{#2}{#3}%
    56336279  \else
    56346280    % \epsfbox itself resets \epsf?size at each figure.
    56356281    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
    56366282    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
    5637     \begingroup
    5638       \catcode`\^^M = 5 % in case we're inside an example
    5639       % If the image is by itself, center it.
    5640       \ifvmode
    5641         \nobreak\bigskip
    5642         % Usually we'll have text after the image which will insert
    5643         % \parskip glue, so insert it here too to equalize the space
    5644         % above and below.
    5645         \nobreak\vskip\parskip
    5646         \nobreak
    5647         \centerline{\epsfbox{#1.eps}}%
    5648         \bigbreak
    5649       \else
    5650         % In the middle of a paragraph, no extra space.
    5651         \epsfbox{#1.eps}%
    5652       \fi
    5653     \endgroup
     6283    \epsfbox{#1.eps}%
    56546284  \fi
    5655 }
     6285  %
     6286  \ifimagevmode \hss \egroup \bigbreak \fi  % space after the image
     6287\endgroup}
    56566288
    56576289
     
    57226354
    57236355% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
    5724 % 4) hoffset; 5) binding offset; 6) topskip.  Then whoever calls us can
    5725 % set \parskip and call \setleading for \baselineskip.
    5726 %
    5727 \def\internalpagesizes#1#2#3#4#5#6{%
     6356% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
     6357% physical page width.
     6358%
     6359% We also call \setleading{\textleading}, so the caller should define
     6360% \textleading.  The caller should also set \parskip.
     6361%
     6362\def\internalpagesizes#1#2#3#4#5#6#7#8{%
    57286363  \voffset = #3\relax
    57296364  \topskip = #6\relax
     
    57446379  \bindingoffset = #5\relax
    57456380  %
     6381  \ifpdf
     6382    \pdfpageheight #7\relax
     6383    \pdfpagewidth #8\relax
     6384  \fi
     6385  %
     6386  \setleading{\textleading}
     6387  %
    57466388  \parindent = \defaultparindent
    57476389  \setemergencystretch
     
    57516393\def\letterpaper{{\globaldefs = 1
    57526394  \parskip = 3pt plus 2pt minus 1pt
    5753   \setleading{13.2pt}%
     6395  \textleading = 13.2pt
    57546396  %
    57556397  % If page is nothing but text, make it come out even.
    5756   \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
     6398  \internalpagesizes{46\baselineskip}{6in}%
     6399                    {\voffset}{.25in}%
     6400                    {\bindingoffset}{36pt}%
     6401                    {11in}{8.5in}%
    57576402}}
    57586403
     
    57606405\def\smallbook{{\globaldefs = 1
    57616406  \parskip = 2pt plus 1pt
    5762   \setleading{12pt}%
    5763   %
    5764   \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
     6407  \textleading = 12pt
     6408  %
     6409  \internalpagesizes{7.5in}{5in}%
     6410                    {\voffset}{.25in}%
     6411                    {\bindingoffset}{16pt}%
     6412                    {9.25in}{7in}%
    57656413  %
    57666414  \lispnarrowing = 0.3in
     
    57686416  \hfuzz = 1pt
    57696417  \contentsrightmargin = 0pt
    5770   \deftypemargin = 0pt
    57716418  \defbodyindent = .5cm
    5772   %
    5773   \let\smalldisplay = \smalldisplayx
    5774   \let\smallexample = \smalllispx
    5775   \let\smallformat = \smallformatx
    5776   \let\smalllisp = \smalllispx
    57776419}}
    57786420
    57796421% Use @afourpaper to print on European A4 paper.
    57806422\def\afourpaper{{\globaldefs = 1
    5781   \setleading{12pt}%
    57826423  \parskip = 3pt plus 2pt minus 1pt
    5783   %
    5784   \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
     6424  \textleading = 13.2pt
     6425  %
     6426  % Double-side printing via postscript on Laserjet 4050
     6427  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
     6428  % To change the settings for a different printer or situation, adjust
     6429  % \normaloffset until the front-side and back-side texts align.  Then
     6430  % do the same for \bindingoffset.  You can set these for testing in
     6431  % your texinfo source file like this:
     6432  % @tex
     6433  % \global\normaloffset = -6mm
     6434  % \global\bindingoffset = 10mm
     6435  % @end tex
     6436  \internalpagesizes{51\baselineskip}{160mm}
     6437                    {\voffset}{\hoffset}%
     6438                    {\bindingoffset}{44pt}%
     6439                    {297mm}{210mm}%
    57856440  %
    57866441  \tolerance = 700
    57876442  \hfuzz = 1pt
     6443  \contentsrightmargin = 0pt
     6444  \defbodyindent = 5mm
    57886445}}
    57896446
    5790 % A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
    5791 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
     6447% Use @afivepaper to print on European A5 paper.
     6448% From romildo@urano.iceb.ufop.br, 2 July 2000.
     6449% He also recommends making @example and @lisp be small.
     6450\def\afivepaper{{\globaldefs = 1
     6451  \parskip = 2pt plus 1pt minus 0.1pt
     6452  \textleading = 12.5pt
     6453  %
     6454  \internalpagesizes{160mm}{120mm}%
     6455                    {\voffset}{\hoffset}%
     6456                    {\bindingoffset}{8pt}%
     6457                    {210mm}{148mm}%
     6458  %
     6459  \lispnarrowing = 0.2in
     6460  \tolerance = 800
     6461  \hfuzz = 1.2pt
     6462  \contentsrightmargin = 0pt
     6463  \defbodyindent = 2mm
     6464  \tableindent = 12mm
     6465}}
     6466
     6467% A specific text layout, 24x15cm overall, intended for A4 paper. 
    57926468\def\afourlatex{{\globaldefs = 1
    5793   \setleading{13.6pt}%
    5794   %
    57956469  \afourpaper
    5796   \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
    5797   %
     6470  \internalpagesizes{237mm}{150mm}%
     6471                    {\voffset}{4.6mm}%
     6472                    {\bindingoffset}{7mm}%
     6473                    {297mm}{210mm}%
     6474  %
     6475  % Must explicitly reset to 0 because we call \afourpaper.
    57986476  \globaldefs = 0
    57996477}}
    58006478
    5801 % Use @afourwide to print on European A4 paper in wide format.
    5802 \def\afourwide{%
     6479% Use @afourwide to print on A4 paper in landscape format.
     6480\def\afourwide{{\globaldefs = 1
    58036481  \afourpaper
    5804   \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
    5805   %
     6482  \internalpagesizes{241mm}{165mm}%
     6483                    {\voffset}{-2.95mm}%
     6484                    {\bindingoffset}{7mm}%
     6485                    {297mm}{210mm}%
    58066486  \globaldefs = 0
    5807 }
     6487}}
    58086488
    58096489% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
     
    58186498  %
    58196499  \parskip = 3pt plus 2pt minus 1pt
    5820   \setleading{13.2pt}%
    5821   %
    5822   \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
     6500  \setleading{\textleading}%
     6501  %
     6502  \dimen0 = #1
     6503  \advance\dimen0 by \voffset
     6504  %
     6505  \dimen2 = \hsize
     6506  \advance\dimen2 by \normaloffset
     6507  %
     6508  \internalpagesizes{#1}{\hsize}%
     6509                    {\voffset}{\normaloffset}%
     6510                    {\bindingoffset}{44pt}%
     6511                    {\dimen0}{\dimen2}%
    58236512}}
    58246513
     
    58486537\def\normalgreater{>}
    58496538\def\normalplus{+}
    5850 \def\normaldollar{$}
     6539\def\normaldollar{$}%$ font-lock fix
    58516540
    58526541% This macro is used to make a character print one way in ttfont
     
    58846573\def_{\ifusingtt\normalunderscore\_}
    58856574% Subroutine for the previous macro.
    5886 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
     6575\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
    58876576
    58886577\catcode`\|=\active
     
    58976586\def+{{\tt \char 43}}
    58986587\catcode`\$=\active
    5899 \def${\ifusingit{{\sl\$}}\normaldollar}
    5900 %\catcode 27=\active
    5901 %\def^^[{$\diamondsuit$}
     6588\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
    59026589
    59036590% Set up an active definition for =, but don't enable it most of the time.
     
    59166603\catcode`\@=0
    59176604
    5918 % \rawbackslashxx output one backslash character in current font
     6605% \rawbackslashxx outputs one backslash character in current font,
     6606% as in \char`\\.
    59196607\global\chardef\rawbackslashxx=`\\
    5920 %{\catcode`\\=\other
    5921 %@gdef@rawbackslashxx{\}}
    5922 
    5923 % \rawbackslash redefines \ as input to do \rawbackslashxx.
     6608
     6609% \rawbackslash defines an active \ to do \rawbackslashxx.
     6610% \otherbackslash defines an active \ to be a literal `\' character with
     6611% catcode other.
    59246612{\catcode`\\=\active
    5925 @gdef@rawbackslash{@let\=@rawbackslashxx }}
     6613 @gdef@rawbackslash{@let\=@rawbackslashxx}
     6614 @gdef@otherbackslash{@let\=@realbackslash}
     6615}
     6616
     6617% \realbackslash is an actual character `\' with catcode other.
     6618{\catcode`\\=\other @gdef@realbackslash{\}}
    59266619
    59276620% \normalbackslash outputs one backslash in fixed width font.
    59286621\def\normalbackslash{{\tt\rawbackslashxx}}
    59296622
    5930 % \catcode 17=0   % Define control-q
    59316623\catcode`\\=\active
    59326624
    59336625% Used sometimes to turn off (effectively) the active characters
    59346626% even after parsing them.
    5935 @def@turnoffactive{@let"=@normaldoublequote
    5936 @let\=@realbackslash
    5937 @let~=@normaltilde
    5938 @let^=@normalcaret
    5939 @let_=@normalunderscore
    5940 @let|=@normalverticalbar
    5941 @let<=@normalless
    5942 @let>=@normalgreater
    5943 @let+=@normalplus
    5944 @let$=@normaldollar}
    5945 
    5946 @def@normalturnoffactive{@let"=@normaldoublequote
    5947 @let\=@normalbackslash
    5948 @let~=@normaltilde
    5949 @let^=@normalcaret
    5950 @let_=@normalunderscore
    5951 @let|=@normalverticalbar
    5952 @let<=@normalless
    5953 @let>=@normalgreater
    5954 @let+=@normalplus
    5955 @let$=@normaldollar}
     6627@def@turnoffactive{%
     6628  @let"=@normaldoublequote
     6629  @let\=@realbackslash
     6630  @let~=@normaltilde
     6631  @let^=@normalcaret
     6632  @let_=@normalunderscore
     6633  @let|=@normalverticalbar
     6634  @let<=@normalless
     6635  @let>=@normalgreater
     6636  @let+=@normalplus
     6637  @let$=@normaldollar %$ font-lock fix
     6638}
     6639
     6640% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
     6641% the literal character `\'.  (Thus, \ is not expandable when this is in
     6642% effect.)
     6643%
     6644@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
    59566645
    59576646% Make _ and + \other characters, temporarily.
Note: See TracChangeset for help on using the changeset viewer.