Home | History | Annotate | Line # | Download | only in doc
texinfo.tex revision 1.1
      1  1.1  mrg % texinfo.tex -- TeX macros to handle Texinfo files.
      2  1.1  mrg % 
      3  1.1  mrg % Load plain if necessary, i.e., if running under initex.
      4  1.1  mrg \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
      5  1.1  mrg %
      6  1.1  mrg \def\texinfoversion{2012-03-11.15}
      7  1.1  mrg %
      8  1.1  mrg % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
      9  1.1  mrg % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
     10  1.1  mrg % 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
     11  1.1  mrg %
     12  1.1  mrg % This texinfo.tex file is free software: you can redistribute it and/or
     13  1.1  mrg % modify it under the terms of the GNU General Public License as
     14  1.1  mrg % published by the Free Software Foundation, either version 3 of the
     15  1.1  mrg % License, or (at your option) any later version.
     16  1.1  mrg %
     17  1.1  mrg % This texinfo.tex file is distributed in the hope that it will be
     18  1.1  mrg % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
     19  1.1  mrg % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     20  1.1  mrg % General Public License for more details.
     21  1.1  mrg %
     22  1.1  mrg % You should have received a copy of the GNU General Public License
     23  1.1  mrg % along with this program.  If not, see <http://www.gnu.org/licenses/>.
     24  1.1  mrg %
     25  1.1  mrg % As a special exception, when this file is read by TeX when processing
     26  1.1  mrg % a Texinfo source document, you may use the result without
     27  1.1  mrg % restriction.  (This has been our intent since Texinfo was invented.)
     28  1.1  mrg %
     29  1.1  mrg % Please try the latest version of texinfo.tex before submitting bug
     30  1.1  mrg % reports; you can get the latest version from:
     31  1.1  mrg %   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
     32  1.1  mrg %   ftp://tug.org/tex/texinfo.tex
     33  1.1  mrg %     (and all CTAN mirrors, see http://www.ctan.org).
     34  1.1  mrg % The texinfo.tex in any given distribution could well be out
     35  1.1  mrg % of date, so if that's what you're using, please check.
     36  1.1  mrg %
     37  1.1  mrg % Send bug reports to bug-texinfo (a] gnu.org.  Please include including a
     38  1.1  mrg % complete document in each bug report with which we can reproduce the
     39  1.1  mrg % problem.  Patches are, of course, greatly appreciated.
     40  1.1  mrg %
     41  1.1  mrg % To process a Texinfo manual with TeX, it's most reliable to use the
     42  1.1  mrg % texi2dvi shell script that comes with the distribution.  For a simple
     43  1.1  mrg % manual foo.texi, however, you can get away with this:
     44  1.1  mrg %   tex foo.texi
     45  1.1  mrg %   texindex foo.??
     46  1.1  mrg %   tex foo.texi
     47  1.1  mrg %   tex foo.texi
     48  1.1  mrg %   dvips foo.dvi -o  # or whatever; this makes foo.ps.
     49  1.1  mrg % The extra TeX runs get the cross-reference information correct.
     50  1.1  mrg % Sometimes one run after texindex suffices, and sometimes you need more
     51  1.1  mrg % than two; texi2dvi does it as many times as necessary.
     52  1.1  mrg %
     53  1.1  mrg % It is possible to adapt texinfo.tex for other languages, to some
     54  1.1  mrg % extent.  You can get the existing language-specific files from the
     55  1.1  mrg % full Texinfo distribution.
     56  1.1  mrg %
     57  1.1  mrg % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
     58  1.1  mrg 
     59  1.1  mrg 
     60  1.1  mrg \message{Loading texinfo [version \texinfoversion]:}
     61  1.1  mrg 
     62  1.1  mrg % If in a .fmt file, print the version number
     63  1.1  mrg % and turn on active characters that we couldn't do earlier because
     64  1.1  mrg % they might have appeared in the input file name.
     65  1.1  mrg \everyjob{\message{[Texinfo version \texinfoversion]}%
     66  1.1  mrg   \catcode`+=\active \catcode`\_=\active}
     67  1.1  mrg 
     68  1.1  mrg \chardef\other=12
     69  1.1  mrg 
     70  1.1  mrg % We never want plain's \outer definition of \+ in Texinfo.
     71  1.1  mrg % For @tex, we can use \tabalign.
     72  1.1  mrg \let\+ = \relax
     73  1.1  mrg 
     74  1.1  mrg % Save some plain tex macros whose names we will redefine.
     75  1.1  mrg \let\ptexb=\b
     76  1.1  mrg \let\ptexbullet=\bullet
     77  1.1  mrg \let\ptexc=\c
     78  1.1  mrg \let\ptexcomma=\,
     79  1.1  mrg \let\ptexdot=\.
     80  1.1  mrg \let\ptexdots=\dots
     81  1.1  mrg \let\ptexend=\end
     82  1.1  mrg \let\ptexequiv=\equiv
     83  1.1  mrg \let\ptexexclam=\!
     84  1.1  mrg \let\ptexfootnote=\footnote
     85  1.1  mrg \let\ptexgtr=>
     86  1.1  mrg \let\ptexhat=^
     87  1.1  mrg \let\ptexi=\i
     88  1.1  mrg \let\ptexindent=\indent
     89  1.1  mrg \let\ptexinsert=\insert
     90  1.1  mrg \let\ptexlbrace=\{
     91  1.1  mrg \let\ptexless=<
     92  1.1  mrg \let\ptexnewwrite\newwrite
     93  1.1  mrg \let\ptexnoindent=\noindent
     94  1.1  mrg \let\ptexplus=+
     95  1.1  mrg \let\ptexraggedright=\raggedright
     96  1.1  mrg \let\ptexrbrace=\}
     97  1.1  mrg \let\ptexslash=\/
     98  1.1  mrg \let\ptexstar=\*
     99  1.1  mrg \let\ptext=\t
    100  1.1  mrg \let\ptextop=\top
    101  1.1  mrg {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
    102  1.1  mrg 
    103  1.1  mrg % If this character appears in an error message or help string, it
    104  1.1  mrg % starts a new line in the output.
    105  1.1  mrg \newlinechar = `^^J
    106  1.1  mrg 
    107  1.1  mrg % Use TeX 3.0's \inputlineno to get the line number, for better error
    108  1.1  mrg % messages, but if we're using an old version of TeX, don't do anything.
    109  1.1  mrg %
    110  1.1  mrg \ifx\inputlineno\thisisundefined
    111  1.1  mrg   \let\linenumber = \empty % Pre-3.0.
    112  1.1  mrg \else
    113  1.1  mrg   \def\linenumber{l.\the\inputlineno:\space}
    114  1.1  mrg \fi
    115  1.1  mrg 
    116  1.1  mrg % Set up fixed words for English if not already set.
    117  1.1  mrg \ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
    118  1.1  mrg \ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
    119  1.1  mrg \ifx\putworderror\undefined     \gdef\putworderror{error}\fi
    120  1.1  mrg \ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
    121  1.1  mrg \ifx\putwordin\undefined        \gdef\putwordin{in}\fi
    122  1.1  mrg \ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
    123  1.1  mrg \ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
    124  1.1  mrg \ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
    125  1.1  mrg \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
    126  1.1  mrg \ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
    127  1.1  mrg \ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
    128  1.1  mrg \ifx\putwordof\undefined        \gdef\putwordof{of}\fi
    129  1.1  mrg \ifx\putwordon\undefined        \gdef\putwordon{on}\fi
    130  1.1  mrg \ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
    131  1.1  mrg \ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
    132  1.1  mrg \ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
    133  1.1  mrg \ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
    134  1.1  mrg \ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
    135  1.1  mrg \ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
    136  1.1  mrg \ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
    137  1.1  mrg %
    138  1.1  mrg \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
    139  1.1  mrg \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
    140  1.1  mrg \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
    141  1.1  mrg \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
    142  1.1  mrg \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
    143  1.1  mrg \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
    144  1.1  mrg \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
    145  1.1  mrg \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
    146  1.1  mrg \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
    147  1.1  mrg \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
    148  1.1  mrg \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
    149  1.1  mrg \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
    150  1.1  mrg %
    151  1.1  mrg \ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
    152  1.1  mrg \ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
    153  1.1  mrg \ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
    154  1.1  mrg \ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
    155  1.1  mrg \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
    156  1.1  mrg 
    157  1.1  mrg % Since the category of space is not known, we have to be careful.
    158  1.1  mrg \chardef\spacecat = 10
    159  1.1  mrg \def\spaceisspace{\catcode`\ =\spacecat}
    160  1.1  mrg 
    161  1.1  mrg % sometimes characters are active, so we need control sequences.
    162  1.1  mrg \chardef\ampChar   = `\&
    163  1.1  mrg \chardef\colonChar = `\:
    164  1.1  mrg \chardef\commaChar = `\,
    165  1.1  mrg \chardef\dashChar  = `\-
    166  1.1  mrg \chardef\dotChar   = `\.
    167  1.1  mrg \chardef\exclamChar= `\!
    168  1.1  mrg \chardef\hashChar  = `\#
    169  1.1  mrg \chardef\lquoteChar= `\`
    170  1.1  mrg \chardef\questChar = `\?
    171  1.1  mrg \chardef\rquoteChar= `\'
    172  1.1  mrg \chardef\semiChar  = `\;
    173  1.1  mrg \chardef\slashChar = `\/
    174  1.1  mrg \chardef\underChar = `\_
    175  1.1  mrg 
    176  1.1  mrg % Ignore a token.
    177  1.1  mrg %
    178  1.1  mrg \def\gobble#1{}
    179  1.1  mrg 
    180  1.1  mrg % The following is used inside several \edef's.
    181  1.1  mrg \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
    182  1.1  mrg 
    183  1.1  mrg % Hyphenation fixes.
    184  1.1  mrg \hyphenation{
    185  1.1  mrg   Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
    186  1.1  mrg   ap-pen-dix bit-map bit-maps
    187  1.1  mrg   data-base data-bases eshell fall-ing half-way long-est man-u-script
    188  1.1  mrg   man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
    189  1.1  mrg   par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
    190  1.1  mrg   spell-ing spell-ings
    191  1.1  mrg   stand-alone strong-est time-stamp time-stamps which-ever white-space
    192  1.1  mrg   wide-spread wrap-around
    193  1.1  mrg }
    194  1.1  mrg 
    195  1.1  mrg % Margin to add to right of even pages, to left of odd pages.
    196  1.1  mrg \newdimen\bindingoffset
    197  1.1  mrg \newdimen\normaloffset
    198  1.1  mrg \newdimen\pagewidth \newdimen\pageheight
    199  1.1  mrg 
    200  1.1  mrg % For a final copy, take out the rectangles
    201  1.1  mrg % that mark overfull boxes (in case you have decided
    202  1.1  mrg % that the text looks ok even though it passes the margin).
    203  1.1  mrg %
    204  1.1  mrg \def\finalout{\overfullrule=0pt }
    205  1.1  mrg 
    206  1.1  mrg % Sometimes it is convenient to have everything in the transcript file
    207  1.1  mrg % and nothing on the terminal.  We don't just call \tracingall here,
    208  1.1  mrg % since that produces some useless output on the terminal.  We also make
    209  1.1  mrg % some effort to order the tracing commands to reduce output in the log
    210  1.1  mrg % file; cf. trace.sty in LaTeX.
    211  1.1  mrg %
    212  1.1  mrg \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
    213  1.1  mrg \def\loggingall{%
    214  1.1  mrg   \tracingstats2
    215  1.1  mrg   \tracingpages1
    216  1.1  mrg   \tracinglostchars2  % 2 gives us more in etex
    217  1.1  mrg   \tracingparagraphs1
    218  1.1  mrg   \tracingoutput1
    219  1.1  mrg   \tracingmacros2
    220  1.1  mrg   \tracingrestores1
    221  1.1  mrg   \showboxbreadth\maxdimen \showboxdepth\maxdimen
    222  1.1  mrg   \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
    223  1.1  mrg     \tracingscantokens1
    224  1.1  mrg     \tracingifs1
    225  1.1  mrg     \tracinggroups1
    226  1.1  mrg     \tracingnesting2
    227  1.1  mrg     \tracingassigns1
    228  1.1  mrg   \fi
    229  1.1  mrg   \tracingcommands3  % 3 gives us more in etex
    230  1.1  mrg   \errorcontextlines16
    231  1.1  mrg }%
    232  1.1  mrg 
    233  1.1  mrg % @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
    234  1.1  mrg % aren't perfect, it's not the end of the world, being an error message,
    235  1.1  mrg % after all.
    236  1.1  mrg % 
    237  1.1  mrg \def\errormsg{\begingroup \indexnofonts \doerrormsg}
    238  1.1  mrg \def\doerrormsg#1{\errmessage{#1}}
    239  1.1  mrg 
    240  1.1  mrg % add check for \lastpenalty to plain's definitions.  If the last thing
    241  1.1  mrg % we did was a \nobreak, we don't want to insert more space.
    242  1.1  mrg %
    243  1.1  mrg \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
    244  1.1  mrg   \removelastskip\penalty-50\smallskip\fi\fi}
    245  1.1  mrg \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
    246  1.1  mrg   \removelastskip\penalty-100\medskip\fi\fi}
    247  1.1  mrg \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
    248  1.1  mrg   \removelastskip\penalty-200\bigskip\fi\fi}
    249  1.1  mrg 
    250  1.1  mrg % Do @cropmarks to get crop marks.
    251  1.1  mrg %
    252  1.1  mrg \newif\ifcropmarks
    253  1.1  mrg \let\cropmarks = \cropmarkstrue
    254  1.1  mrg %
    255  1.1  mrg % Dimensions to add cropmarks at corners.
    256  1.1  mrg % Added by P. A. MacKay, 12 Nov. 1986
    257  1.1  mrg %
    258  1.1  mrg \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
    259  1.1  mrg \newdimen\cornerlong  \cornerlong=1pc
    260  1.1  mrg \newdimen\cornerthick \cornerthick=.3pt
    261  1.1  mrg \newdimen\topandbottommargin \topandbottommargin=.75in
    262  1.1  mrg 
    263  1.1  mrg % Output a mark which sets \thischapter, \thissection and \thiscolor.
    264  1.1  mrg % We dump everything together because we only have one kind of mark.
    265  1.1  mrg % This works because we only use \botmark / \topmark, not \firstmark.
    266  1.1  mrg %
    267  1.1  mrg % A mark contains a subexpression of the \ifcase ... \fi construct.
    268  1.1  mrg % \get*marks macros below extract the needed part using \ifcase.
    269  1.1  mrg %
    270  1.1  mrg % Another complication is to let the user choose whether \thischapter
    271  1.1  mrg % (\thissection) refers to the chapter (section) in effect at the top
    272  1.1  mrg % of a page, or that at the bottom of a page.  The solution is
    273  1.1  mrg % described on page 260 of The TeXbook.  It involves outputting two
    274  1.1  mrg % marks for the sectioning macros, one before the section break, and
    275  1.1  mrg % one after.  I won't pretend I can describe this better than DEK...
    276  1.1  mrg \def\domark{%
    277  1.1  mrg   \toks0=\expandafter{\lastchapterdefs}%
    278  1.1  mrg   \toks2=\expandafter{\lastsectiondefs}%
    279  1.1  mrg   \toks4=\expandafter{\prevchapterdefs}%
    280  1.1  mrg   \toks6=\expandafter{\prevsectiondefs}%
    281  1.1  mrg   \toks8=\expandafter{\lastcolordefs}%
    282  1.1  mrg   \mark{%
    283  1.1  mrg                    \the\toks0 \the\toks2
    284  1.1  mrg       \noexpand\or \the\toks4 \the\toks6
    285  1.1  mrg     \noexpand\else \the\toks8
    286  1.1  mrg   }%
    287  1.1  mrg }
    288  1.1  mrg % \topmark doesn't work for the very first chapter (after the title
    289  1.1  mrg % page or the contents), so we use \firstmark there -- this gets us
    290  1.1  mrg % the mark with the chapter defs, unless the user sneaks in, e.g.,
    291  1.1  mrg % @setcolor (or @url, or @link, etc.) between @contents and the very
    292  1.1  mrg % first @chapter.
    293  1.1  mrg \def\gettopheadingmarks{%
    294  1.1  mrg   \ifcase0\topmark\fi
    295  1.1  mrg   \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
    296  1.1  mrg }
    297  1.1  mrg \def\getbottomheadingmarks{\ifcase1\botmark\fi}
    298  1.1  mrg \def\getcolormarks{\ifcase2\topmark\fi}
    299  1.1  mrg 
    300  1.1  mrg % Avoid "undefined control sequence" errors.
    301  1.1  mrg \def\lastchapterdefs{}
    302  1.1  mrg \def\lastsectiondefs{}
    303  1.1  mrg \def\prevchapterdefs{}
    304  1.1  mrg \def\prevsectiondefs{}
    305  1.1  mrg \def\lastcolordefs{}
    306  1.1  mrg 
    307  1.1  mrg % Main output routine.
    308  1.1  mrg \chardef\PAGE = 255
    309  1.1  mrg \output = {\onepageout{\pagecontents\PAGE}}
    310  1.1  mrg 
    311  1.1  mrg \newbox\headlinebox
    312  1.1  mrg \newbox\footlinebox
    313  1.1  mrg 
    314  1.1  mrg % \onepageout takes a vbox as an argument.  Note that \pagecontents
    315  1.1  mrg % does insertions, but you have to call it yourself.
    316  1.1  mrg \def\onepageout#1{%
    317  1.1  mrg   \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
    318  1.1  mrg   %
    319  1.1  mrg   \ifodd\pageno  \advance\hoffset by \bindingoffset
    320  1.1  mrg   \else \advance\hoffset by -\bindingoffset\fi
    321  1.1  mrg   %
    322  1.1  mrg   % Do this outside of the \shipout so @code etc. will be expanded in
    323  1.1  mrg   % the headline as they should be, not taken literally (outputting ''code).
    324  1.1  mrg   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
    325  1.1  mrg   \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
    326  1.1  mrg   \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
    327  1.1  mrg   \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
    328  1.1  mrg   %
    329  1.1  mrg   {%
    330  1.1  mrg     % Have to do this stuff outside the \shipout because we want it to
    331  1.1  mrg     % take effect in \write's, yet the group defined by the \vbox ends
    332  1.1  mrg     % before the \shipout runs.
    333  1.1  mrg     %
    334  1.1  mrg     \indexdummies         % don't expand commands in the output.
    335  1.1  mrg     \normalturnoffactive  % \ in index entries must not stay \, e.g., if
    336  1.1  mrg                % the page break happens to be in the middle of an example.
    337  1.1  mrg                % We don't want .vr (or whatever) entries like this:
    338  1.1  mrg                % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
    339  1.1  mrg                % "\acronym" won't work when it's read back in;
    340  1.1  mrg                % it needs to be
    341  1.1  mrg                % {\code {{\tt \backslashcurfont }acronym}
    342  1.1  mrg     \shipout\vbox{%
    343  1.1  mrg       % Do this early so pdf references go to the beginning of the page.
    344  1.1  mrg       \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
    345  1.1  mrg       %
    346  1.1  mrg       \ifcropmarks \vbox to \outervsize\bgroup
    347  1.1  mrg         \hsize = \outerhsize
    348  1.1  mrg         \vskip-\topandbottommargin
    349  1.1  mrg         \vtop to0pt{%
    350  1.1  mrg           \line{\ewtop\hfil\ewtop}%
    351  1.1  mrg           \nointerlineskip
    352  1.1  mrg           \line{%
    353  1.1  mrg             \vbox{\moveleft\cornerthick\nstop}%
    354  1.1  mrg             \hfill
    355  1.1  mrg             \vbox{\moveright\cornerthick\nstop}%
    356  1.1  mrg           }%
    357  1.1  mrg           \vss}%
    358  1.1  mrg         \vskip\topandbottommargin
    359  1.1  mrg         \line\bgroup
    360  1.1  mrg           \hfil % center the page within the outer (page) hsize.
    361  1.1  mrg           \ifodd\pageno\hskip\bindingoffset\fi
    362  1.1  mrg           \vbox\bgroup
    363  1.1  mrg       \fi
    364  1.1  mrg       %
    365  1.1  mrg       \unvbox\headlinebox
    366  1.1  mrg       \pagebody{#1}%
    367  1.1  mrg       \ifdim\ht\footlinebox > 0pt
    368  1.1  mrg         % Only leave this space if the footline is nonempty.
    369  1.1  mrg         % (We lessened \vsize for it in \oddfootingyyy.)
    370  1.1  mrg         % The \baselineskip=24pt in plain's \makefootline has no effect.
    371  1.1  mrg         \vskip 24pt
    372  1.1  mrg         \unvbox\footlinebox
    373  1.1  mrg       \fi
    374  1.1  mrg       %
    375  1.1  mrg       \ifcropmarks
    376  1.1  mrg           \egroup % end of \vbox\bgroup
    377  1.1  mrg         \hfil\egroup % end of (centering) \line\bgroup
    378  1.1  mrg         \vskip\topandbottommargin plus1fill minus1fill
    379  1.1  mrg         \boxmaxdepth = \cornerthick
    380  1.1  mrg         \vbox to0pt{\vss
    381  1.1  mrg           \line{%
    382  1.1  mrg             \vbox{\moveleft\cornerthick\nsbot}%
    383  1.1  mrg             \hfill
    384  1.1  mrg             \vbox{\moveright\cornerthick\nsbot}%
    385  1.1  mrg           }%
    386  1.1  mrg           \nointerlineskip
    387  1.1  mrg           \line{\ewbot\hfil\ewbot}%
    388  1.1  mrg         }%
    389  1.1  mrg       \egroup % \vbox from first cropmarks clause
    390  1.1  mrg       \fi
    391  1.1  mrg     }% end of \shipout\vbox
    392  1.1  mrg   }% end of group with \indexdummies
    393  1.1  mrg   \advancepageno
    394  1.1  mrg   \ifnum\outputpenalty>-20000 \else\dosupereject\fi
    395  1.1  mrg }
    396  1.1  mrg 
    397  1.1  mrg \newinsert\margin \dimen\margin=\maxdimen
    398  1.1  mrg 
    399  1.1  mrg \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
    400  1.1  mrg {\catcode`\@ =11
    401  1.1  mrg \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
    402  1.1  mrg % marginal hacks, juha (a] viisa.uucp (Juha Takala)
    403  1.1  mrg \ifvoid\margin\else % marginal info is present
    404  1.1  mrg   \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
    405  1.1  mrg \dimen@=\dp#1\relax \unvbox#1\relax
    406  1.1  mrg \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
    407  1.1  mrg \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
    408  1.1  mrg }
    409  1.1  mrg 
    410  1.1  mrg % Here are the rules for the cropmarks.  Note that they are
    411  1.1  mrg % offset so that the space between them is truly \outerhsize or \outervsize
    412  1.1  mrg % (P. A. MacKay, 12 November, 1986)
    413  1.1  mrg %
    414  1.1  mrg \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
    415  1.1  mrg \def\nstop{\vbox
    416  1.1  mrg   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
    417  1.1  mrg \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
    418  1.1  mrg \def\nsbot{\vbox
    419  1.1  mrg   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
    420  1.1  mrg 
    421  1.1  mrg % Parse an argument, then pass it to #1.  The argument is the rest of
    422  1.1  mrg % the input line (except we remove a trailing comment).  #1 should be a
    423  1.1  mrg % macro which expects an ordinary undelimited TeX argument.
    424  1.1  mrg %
    425  1.1  mrg \def\parsearg{\parseargusing{}}
    426  1.1  mrg \def\parseargusing#1#2{%
    427  1.1  mrg   \def\argtorun{#2}%
    428  1.1  mrg   \begingroup
    429  1.1  mrg     \obeylines
    430  1.1  mrg     \spaceisspace
    431  1.1  mrg     #1%
    432  1.1  mrg     \parseargline\empty% Insert the \empty token, see \finishparsearg below.
    433  1.1  mrg }
    434  1.1  mrg 
    435  1.1  mrg {\obeylines %
    436  1.1  mrg   \gdef\parseargline#1^^M{%
    437  1.1  mrg     \endgroup % End of the group started in \parsearg.
    438  1.1  mrg     \argremovecomment #1\comment\ArgTerm%
    439  1.1  mrg   }%
    440  1.1  mrg }
    441  1.1  mrg 
    442  1.1  mrg % First remove any @comment, then any @c comment.
    443  1.1  mrg \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
    444  1.1  mrg \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
    445  1.1  mrg 
    446  1.1  mrg % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
    447  1.1  mrg %
    448  1.1  mrg % \argremovec might leave us with trailing space, e.g.,
    449  1.1  mrg %    @end itemize  @c foo
    450  1.1  mrg % This space token undergoes the same procedure and is eventually removed
    451  1.1  mrg % by \finishparsearg.
    452  1.1  mrg %
    453  1.1  mrg \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
    454  1.1  mrg \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
    455  1.1  mrg \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
    456  1.1  mrg   \def\temp{#3}%
    457  1.1  mrg   \ifx\temp\empty
    458  1.1  mrg     % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
    459  1.1  mrg     \let\temp\finishparsearg
    460  1.1  mrg   \else
    461  1.1  mrg     \let\temp\argcheckspaces
    462  1.1  mrg   \fi
    463  1.1  mrg   % Put the space token in:
    464  1.1  mrg   \temp#1 #3\ArgTerm
    465  1.1  mrg }
    466  1.1  mrg 
    467  1.1  mrg % If a _delimited_ argument is enclosed in braces, they get stripped; so
    468  1.1  mrg % to get _exactly_ the rest of the line, we had to prevent such situation.
    469  1.1  mrg % We prepended an \empty token at the very beginning and we expand it now,
    470  1.1  mrg % just before passing the control to \argtorun.
    471  1.1  mrg % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
    472  1.1  mrg % either the null string, or it ends with \^^M---thus there is no danger
    473  1.1  mrg % that a pair of braces would be stripped.
    474  1.1  mrg %
    475  1.1  mrg % But first, we have to remove the trailing space token.
    476  1.1  mrg %
    477  1.1  mrg \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
    478  1.1  mrg 
    479  1.1  mrg % \parseargdef\foo{...}
    480  1.1  mrg %	is roughly equivalent to
    481  1.1  mrg % \def\foo{\parsearg\Xfoo}
    482  1.1  mrg % \def\Xfoo#1{...}
    483  1.1  mrg %
    484  1.1  mrg % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
    485  1.1  mrg % favourite TeX trick.  --kasal, 16nov03
    486  1.1  mrg 
    487  1.1  mrg \def\parseargdef#1{%
    488  1.1  mrg   \expandafter \doparseargdef \csname\string#1\endcsname #1%
    489  1.1  mrg }
    490  1.1  mrg \def\doparseargdef#1#2{%
    491  1.1  mrg   \def#2{\parsearg#1}%
    492  1.1  mrg   \def#1##1%
    493  1.1  mrg }
    494  1.1  mrg 
    495  1.1  mrg % Several utility definitions with active space:
    496  1.1  mrg {
    497  1.1  mrg   \obeyspaces
    498  1.1  mrg   \gdef\obeyedspace{ }
    499  1.1  mrg 
    500  1.1  mrg   % Make each space character in the input produce a normal interword
    501  1.1  mrg   % space in the output.  Don't allow a line break at this space, as this
    502  1.1  mrg   % is used only in environments like @example, where each line of input
    503  1.1  mrg   % should produce a line of output anyway.
    504  1.1  mrg   %
    505  1.1  mrg   \gdef\sepspaces{\obeyspaces\let =\tie}
    506  1.1  mrg 
    507  1.1  mrg   % If an index command is used in an @example environment, any spaces
    508  1.1  mrg   % therein should become regular spaces in the raw index file, not the
    509  1.1  mrg   % expansion of \tie (\leavevmode \penalty \@M \ ).
    510  1.1  mrg   \gdef\unsepspaces{\let =\space}
    511  1.1  mrg }
    512  1.1  mrg 
    513  1.1  mrg 
    514  1.1  mrg \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
    515  1.1  mrg 
    516  1.1  mrg % Define the framework for environments in texinfo.tex.  It's used like this:
    517  1.1  mrg %
    518  1.1  mrg %   \envdef\foo{...}
    519  1.1  mrg %   \def\Efoo{...}
    520  1.1  mrg %
    521  1.1  mrg % It's the responsibility of \envdef to insert \begingroup before the
    522  1.1  mrg % actual body; @end closes the group after calling \Efoo.  \envdef also
    523  1.1  mrg % defines \thisenv, so the current environment is known; @end checks
    524  1.1  mrg % whether the environment name matches.  The \checkenv macro can also be
    525  1.1  mrg % used to check whether the current environment is the one expected.
    526  1.1  mrg %
    527  1.1  mrg % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
    528  1.1  mrg % are not treated as environments; they don't open a group.  (The
    529  1.1  mrg % implementation of @end takes care not to call \endgroup in this
    530  1.1  mrg % special case.)
    531  1.1  mrg 
    532  1.1  mrg 
    533  1.1  mrg % At run-time, environments start with this:
    534  1.1  mrg \def\startenvironment#1{\begingroup\def\thisenv{#1}}
    535  1.1  mrg % initialize
    536  1.1  mrg \let\thisenv\empty
    537  1.1  mrg 
    538  1.1  mrg % ... but they get defined via ``\envdef\foo{...}'':
    539  1.1  mrg \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
    540  1.1  mrg \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
    541  1.1  mrg 
    542  1.1  mrg % Check whether we're in the right environment:
    543  1.1  mrg \def\checkenv#1{%
    544  1.1  mrg   \def\temp{#1}%
    545  1.1  mrg   \ifx\thisenv\temp
    546  1.1  mrg   \else
    547  1.1  mrg     \badenverr
    548  1.1  mrg   \fi
    549  1.1  mrg }
    550  1.1  mrg 
    551  1.1  mrg % Environment mismatch, #1 expected:
    552  1.1  mrg \def\badenverr{%
    553  1.1  mrg   \errhelp = \EMsimple
    554  1.1  mrg   \errmessage{This command can appear only \inenvironment\temp,
    555  1.1  mrg     not \inenvironment\thisenv}%
    556  1.1  mrg }
    557  1.1  mrg \def\inenvironment#1{%
    558  1.1  mrg   \ifx#1\empty
    559  1.1  mrg     outside of any environment%
    560  1.1  mrg   \else
    561  1.1  mrg     in environment \expandafter\string#1%
    562  1.1  mrg   \fi
    563  1.1  mrg }
    564  1.1  mrg 
    565  1.1  mrg % @end foo executes the definition of \Efoo.
    566  1.1  mrg % But first, it executes a specialized version of \checkenv
    567  1.1  mrg %
    568  1.1  mrg \parseargdef\end{%
    569  1.1  mrg   \if 1\csname iscond.#1\endcsname
    570  1.1  mrg   \else
    571  1.1  mrg     % The general wording of \badenverr may not be ideal.
    572  1.1  mrg     \expandafter\checkenv\csname#1\endcsname
    573  1.1  mrg     \csname E#1\endcsname
    574  1.1  mrg     \endgroup
    575  1.1  mrg   \fi
    576  1.1  mrg }
    577  1.1  mrg 
    578  1.1  mrg \newhelp\EMsimple{Press RETURN to continue.}
    579  1.1  mrg 
    580  1.1  mrg 
    581  1.1  mrg % Be sure we're in horizontal mode when doing a tie, since we make space
    582  1.1  mrg % equivalent to this in @example-like environments. Otherwise, a space
    583  1.1  mrg % at the beginning of a line will start with \penalty -- and
    584  1.1  mrg % since \penalty is valid in vertical mode, we'd end up putting the
    585  1.1  mrg % penalty on the vertical list instead of in the new paragraph.
    586  1.1  mrg {\catcode`@ = 11
    587  1.1  mrg  % Avoid using \@M directly, because that causes trouble
    588  1.1  mrg  % if the definition is written into an index file.
    589  1.1  mrg  \global\let\tiepenalty = \@M
    590  1.1  mrg  \gdef\tie{\leavevmode\penalty\tiepenalty\ }
    591  1.1  mrg }
    592  1.1  mrg 
    593  1.1  mrg % @: forces normal size whitespace following.
    594  1.1  mrg \def\:{\spacefactor=1000 }
    595  1.1  mrg 
    596  1.1  mrg % @* forces a line break.
    597  1.1  mrg \def\*{\hfil\break\hbox{}\ignorespaces}
    598  1.1  mrg 
    599  1.1  mrg % @/ allows a line break.
    600  1.1  mrg \let\/=\allowbreak
    601  1.1  mrg 
    602  1.1  mrg % @. is an end-of-sentence period.
    603  1.1  mrg \def\.{.\spacefactor=\endofsentencespacefactor\space}
    604  1.1  mrg 
    605  1.1  mrg % @! is an end-of-sentence bang.
    606  1.1  mrg \def\!{!\spacefactor=\endofsentencespacefactor\space}
    607  1.1  mrg 
    608  1.1  mrg % @? is an end-of-sentence query.
    609  1.1  mrg \def\?{?\spacefactor=\endofsentencespacefactor\space}
    610  1.1  mrg 
    611  1.1  mrg % @frenchspacing on|off  says whether to put extra space after punctuation.
    612  1.1  mrg %
    613  1.1  mrg \def\onword{on}
    614  1.1  mrg \def\offword{off}
    615  1.1  mrg %
    616  1.1  mrg \parseargdef\frenchspacing{%
    617  1.1  mrg   \def\temp{#1}%
    618  1.1  mrg   \ifx\temp\onword \plainfrenchspacing
    619  1.1  mrg   \else\ifx\temp\offword \plainnonfrenchspacing
    620  1.1  mrg   \else
    621  1.1  mrg     \errhelp = \EMsimple
    622  1.1  mrg     \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
    623  1.1  mrg   \fi\fi
    624  1.1  mrg }
    625  1.1  mrg 
    626  1.1  mrg % @w prevents a word break.  Without the \leavevmode, @w at the
    627  1.1  mrg % beginning of a paragraph, when TeX is still in vertical mode, would
    628  1.1  mrg % produce a whole line of output instead of starting the paragraph.
    629  1.1  mrg \def\w#1{\leavevmode\hbox{#1}}
    630  1.1  mrg 
    631  1.1  mrg % @group ... @end group forces ... to be all on one page, by enclosing
    632  1.1  mrg % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
    633  1.1  mrg % to keep its height that of a normal line.  According to the rules for
    634  1.1  mrg % \topskip (p.114 of the TeXbook), the glue inserted is
    635  1.1  mrg % max (\topskip - \ht (first item), 0).  If that height is large,
    636  1.1  mrg % therefore, no glue is inserted, and the space between the headline and
    637  1.1  mrg % the text is small, which looks bad.
    638  1.1  mrg %
    639  1.1  mrg % Another complication is that the group might be very large.  This can
    640  1.1  mrg % cause the glue on the previous page to be unduly stretched, because it
    641  1.1  mrg % does not have much material.  In this case, it's better to add an
    642  1.1  mrg % explicit \vfill so that the extra space is at the bottom.  The
    643  1.1  mrg % threshold for doing this is if the group is more than \vfilllimit
    644  1.1  mrg % percent of a page (\vfilllimit can be changed inside of @tex).
    645  1.1  mrg %
    646  1.1  mrg \newbox\groupbox
    647  1.1  mrg \def\vfilllimit{0.7}
    648  1.1  mrg %
    649  1.1  mrg \envdef\group{%
    650  1.1  mrg   \ifnum\catcode`\^^M=\active \else
    651  1.1  mrg     \errhelp = \groupinvalidhelp
    652  1.1  mrg     \errmessage{@group invalid in context where filling is enabled}%
    653  1.1  mrg   \fi
    654  1.1  mrg   \startsavinginserts
    655  1.1  mrg   %
    656  1.1  mrg   \setbox\groupbox = \vtop\bgroup
    657  1.1  mrg     % Do @comment since we are called inside an environment such as
    658  1.1  mrg     % @example, where each end-of-line in the input causes an
    659  1.1  mrg     % end-of-line in the output.  We don't want the end-of-line after
    660  1.1  mrg     % the `@group' to put extra space in the output.  Since @group
    661  1.1  mrg     % should appear on a line by itself (according to the Texinfo
    662  1.1  mrg     % manual), we don't worry about eating any user text.
    663  1.1  mrg     \comment
    664  1.1  mrg }
    665  1.1  mrg %
    666  1.1  mrg % The \vtop produces a box with normal height and large depth; thus, TeX puts
    667  1.1  mrg % \baselineskip glue before it, and (when the next line of text is done)
    668  1.1  mrg % \lineskip glue after it.  Thus, space below is not quite equal to space
    669  1.1  mrg % above.  But it's pretty close.
    670  1.1  mrg \def\Egroup{%
    671  1.1  mrg     % To get correct interline space between the last line of the group
    672  1.1  mrg     % and the first line afterwards, we have to propagate \prevdepth.
    673  1.1  mrg     \endgraf % Not \par, as it may have been set to \lisppar.
    674  1.1  mrg     \global\dimen1 = \prevdepth
    675  1.1  mrg   \egroup           % End the \vtop.
    676  1.1  mrg   % \dimen0 is the vertical size of the group's box.
    677  1.1  mrg   \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
    678  1.1  mrg   % \dimen2 is how much space is left on the page (more or less).
    679  1.1  mrg   \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
    680  1.1  mrg   % if the group doesn't fit on the current page, and it's a big big
    681  1.1  mrg   % group, force a page break.
    682  1.1  mrg   \ifdim \dimen0 > \dimen2
    683  1.1  mrg     \ifdim \pagetotal < \vfilllimit\pageheight
    684  1.1  mrg       \page
    685  1.1  mrg     \fi
    686  1.1  mrg   \fi
    687  1.1  mrg   \box\groupbox
    688  1.1  mrg   \prevdepth = \dimen1
    689  1.1  mrg   \checkinserts
    690  1.1  mrg }
    691  1.1  mrg %
    692  1.1  mrg % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
    693  1.1  mrg % message, so this ends up printing `@group can only ...'.
    694  1.1  mrg %
    695  1.1  mrg \newhelp\groupinvalidhelp{%
    696  1.1  mrg group can only be used in environments such as @example,^^J%
    697  1.1  mrg where each line of input produces a line of output.}
    698  1.1  mrg 
    699  1.1  mrg % @need space-in-mils
    700  1.1  mrg % forces a page break if there is not space-in-mils remaining.
    701  1.1  mrg 
    702  1.1  mrg \newdimen\mil  \mil=0.001in
    703  1.1  mrg 
    704  1.1  mrg \parseargdef\need{%
    705  1.1  mrg   % Ensure vertical mode, so we don't make a big box in the middle of a
    706  1.1  mrg   % paragraph.
    707  1.1  mrg   \par
    708  1.1  mrg   %
    709  1.1  mrg   % If the @need value is less than one line space, it's useless.
    710  1.1  mrg   \dimen0 = #1\mil
    711  1.1  mrg   \dimen2 = \ht\strutbox
    712  1.1  mrg   \advance\dimen2 by \dp\strutbox
    713  1.1  mrg   \ifdim\dimen0 > \dimen2
    714  1.1  mrg     %
    715  1.1  mrg     % Do a \strut just to make the height of this box be normal, so the
    716  1.1  mrg     % normal leading is inserted relative to the preceding line.
    717  1.1  mrg     % And a page break here is fine.
    718  1.1  mrg     \vtop to #1\mil{\strut\vfil}%
    719  1.1  mrg     %
    720  1.1  mrg     % TeX does not even consider page breaks if a penalty added to the
    721  1.1  mrg     % main vertical list is 10000 or more.  But in order to see if the
    722  1.1  mrg     % empty box we just added fits on the page, we must make it consider
    723  1.1  mrg     % page breaks.  On the other hand, we don't want to actually break the
    724  1.1  mrg     % page after the empty box.  So we use a penalty of 9999.
    725  1.1  mrg     %
    726  1.1  mrg     % There is an extremely small chance that TeX will actually break the
    727  1.1  mrg     % page at this \penalty, if there are no other feasible breakpoints in
    728  1.1  mrg     % sight.  (If the user is using lots of big @group commands, which
    729  1.1  mrg     % almost-but-not-quite fill up a page, TeX will have a hard time doing
    730  1.1  mrg     % good page breaking, for example.)  However, I could not construct an
    731  1.1  mrg     % example where a page broke at this \penalty; if it happens in a real
    732  1.1  mrg     % document, then we can reconsider our strategy.
    733  1.1  mrg     \penalty9999
    734  1.1  mrg     %
    735  1.1  mrg     % Back up by the size of the box, whether we did a page break or not.
    736  1.1  mrg     \kern -#1\mil
    737  1.1  mrg     %
    738  1.1  mrg     % Do not allow a page break right after this kern.
    739  1.1  mrg     \nobreak
    740  1.1  mrg   \fi
    741  1.1  mrg }
    742  1.1  mrg 
    743  1.1  mrg % @br   forces paragraph break (and is undocumented).
    744  1.1  mrg 
    745  1.1  mrg \let\br = \par
    746  1.1  mrg 
    747  1.1  mrg % @page forces the start of a new page.
    748  1.1  mrg %
    749  1.1  mrg \def\page{\par\vfill\supereject}
    750  1.1  mrg 
    751  1.1  mrg % @exdent text....
    752  1.1  mrg % outputs text on separate line in roman font, starting at standard page margin
    753  1.1  mrg 
    754  1.1  mrg % This records the amount of indent in the innermost environment.
    755  1.1  mrg % That's how much \exdent should take out.
    756  1.1  mrg \newskip\exdentamount
    757  1.1  mrg 
    758  1.1  mrg % This defn is used inside fill environments such as @defun.
    759  1.1  mrg \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
    760  1.1  mrg 
    761  1.1  mrg % This defn is used inside nofill environments such as @example.
    762  1.1  mrg \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
    763  1.1  mrg   \leftline{\hskip\leftskip{\rm#1}}}}
    764  1.1  mrg 
    765  1.1  mrg % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
    766  1.1  mrg % paragraph.  For more general purposes, use the \margin insertion
    767  1.1  mrg % class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
    768  1.1  mrg %
    769  1.1  mrg \newskip\inmarginspacing \inmarginspacing=1cm
    770  1.1  mrg \def\strutdepth{\dp\strutbox}
    771  1.1  mrg %
    772  1.1  mrg \def\doinmargin#1#2{\strut\vadjust{%
    773  1.1  mrg   \nobreak
    774  1.1  mrg   \kern-\strutdepth
    775  1.1  mrg   \vtop to \strutdepth{%
    776  1.1  mrg     \baselineskip=\strutdepth
    777  1.1  mrg     \vss
    778  1.1  mrg     % if you have multiple lines of stuff to put here, you'll need to
    779  1.1  mrg     % make the vbox yourself of the appropriate size.
    780  1.1  mrg     \ifx#1l%
    781  1.1  mrg       \llap{\ignorespaces #2\hskip\inmarginspacing}%
    782  1.1  mrg     \else
    783  1.1  mrg       \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
    784  1.1  mrg     \fi
    785  1.1  mrg     \null
    786  1.1  mrg   }%
    787  1.1  mrg }}
    788  1.1  mrg \def\inleftmargin{\doinmargin l}
    789  1.1  mrg \def\inrightmargin{\doinmargin r}
    790  1.1  mrg %
    791  1.1  mrg % @inmargin{TEXT [, RIGHT-TEXT]}
    792  1.1  mrg % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
    793  1.1  mrg % else use TEXT for both).
    794  1.1  mrg %
    795  1.1  mrg \def\inmargin#1{\parseinmargin #1,,\finish}
    796  1.1  mrg \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
    797  1.1  mrg   \setbox0 = \hbox{\ignorespaces #2}%
    798  1.1  mrg   \ifdim\wd0 > 0pt
    799  1.1  mrg     \def\lefttext{#1}%  have both texts
    800  1.1  mrg     \def\righttext{#2}%
    801  1.1  mrg   \else
    802  1.1  mrg     \def\lefttext{#1}%  have only one text
    803  1.1  mrg     \def\righttext{#1}%
    804  1.1  mrg   \fi
    805  1.1  mrg   %
    806  1.1  mrg   \ifodd\pageno
    807  1.1  mrg     \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
    808  1.1  mrg   \else
    809  1.1  mrg     \def\temp{\inleftmargin\lefttext}%
    810  1.1  mrg   \fi
    811  1.1  mrg   \temp
    812  1.1  mrg }
    813  1.1  mrg 
    814  1.1  mrg % @| inserts a changebar to the left of the current line.  It should
    815  1.1  mrg % surround any changed text.  This approach does *not* work if the
    816  1.1  mrg % change spans more than two lines of output.  To handle that, we would
    817  1.1  mrg % have adopt a much more difficult approach (putting marks into the main
    818  1.1  mrg % vertical list for the beginning and end of each change).  This command
    819  1.1  mrg % is not documented, not supported, and doesn't work.
    820  1.1  mrg %
    821  1.1  mrg \def\|{%
    822  1.1  mrg   % \vadjust can only be used in horizontal mode.
    823  1.1  mrg   \leavevmode
    824  1.1  mrg   %
    825  1.1  mrg   % Append this vertical mode material after the current line in the output.
    826  1.1  mrg   \vadjust{%
    827  1.1  mrg     % We want to insert a rule with the height and depth of the current
    828  1.1  mrg     % leading; that is exactly what \strutbox is supposed to record.
    829  1.1  mrg     \vskip-\baselineskip
    830  1.1  mrg     %
    831  1.1  mrg     % \vadjust-items are inserted at the left edge of the type.  So
    832  1.1  mrg     % the \llap here moves out into the left-hand margin.
    833  1.1  mrg     \llap{%
    834  1.1  mrg       %
    835  1.1  mrg       % For a thicker or thinner bar, change the `1pt'.
    836  1.1  mrg       \vrule height\baselineskip width1pt
    837  1.1  mrg       %
    838  1.1  mrg       % This is the space between the bar and the text.
    839  1.1  mrg       \hskip 12pt
    840  1.1  mrg     }%
    841  1.1  mrg   }%
    842  1.1  mrg }
    843  1.1  mrg 
    844  1.1  mrg % @include FILE -- \input text of FILE.
    845  1.1  mrg %
    846  1.1  mrg \def\include{\parseargusing\filenamecatcodes\includezzz}
    847  1.1  mrg \def\includezzz#1{%
    848  1.1  mrg   \pushthisfilestack
    849  1.1  mrg   \def\thisfile{#1}%
    850  1.1  mrg   {%
    851  1.1  mrg     \makevalueexpandable  % we want to expand any @value in FILE.
    852  1.1  mrg     \turnoffactive        % and allow special characters in the expansion
    853  1.1  mrg     \indexnofonts         % Allow `@@' and other weird things in file names.
    854  1.1  mrg     \wlog{texinfo.tex: doing @include of #1^^J}%
    855  1.1  mrg     \edef\temp{\noexpand\input #1 }%
    856  1.1  mrg     %
    857  1.1  mrg     % This trickery is to read FILE outside of a group, in case it makes
    858  1.1  mrg     % definitions, etc.
    859  1.1  mrg     \expandafter
    860  1.1  mrg   }\temp
    861  1.1  mrg   \popthisfilestack
    862  1.1  mrg }
    863  1.1  mrg \def\filenamecatcodes{%
    864  1.1  mrg   \catcode`\\=\other
    865  1.1  mrg   \catcode`~=\other
    866  1.1  mrg   \catcode`^=\other
    867  1.1  mrg   \catcode`_=\other
    868  1.1  mrg   \catcode`|=\other
    869  1.1  mrg   \catcode`<=\other
    870  1.1  mrg   \catcode`>=\other
    871  1.1  mrg   \catcode`+=\other
    872  1.1  mrg   \catcode`-=\other
    873  1.1  mrg   \catcode`\`=\other
    874  1.1  mrg   \catcode`\'=\other
    875  1.1  mrg }
    876  1.1  mrg 
    877  1.1  mrg \def\pushthisfilestack{%
    878  1.1  mrg   \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
    879  1.1  mrg }
    880  1.1  mrg \def\pushthisfilestackX{%
    881  1.1  mrg   \expandafter\pushthisfilestackY\thisfile\StackTerm
    882  1.1  mrg }
    883  1.1  mrg \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
    884  1.1  mrg   \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
    885  1.1  mrg }
    886  1.1  mrg 
    887  1.1  mrg \def\popthisfilestack{\errthisfilestackempty}
    888  1.1  mrg \def\errthisfilestackempty{\errmessage{Internal error:
    889  1.1  mrg   the stack of filenames is empty.}}
    890  1.1  mrg %
    891  1.1  mrg \def\thisfile{}
    892  1.1  mrg 
    893  1.1  mrg % @center line
    894  1.1  mrg % outputs that line, centered.
    895  1.1  mrg %
    896  1.1  mrg \parseargdef\center{%
    897  1.1  mrg   \ifhmode
    898  1.1  mrg     \let\centersub\centerH
    899  1.1  mrg   \else
    900  1.1  mrg     \let\centersub\centerV
    901  1.1  mrg   \fi
    902  1.1  mrg   \centersub{\hfil \ignorespaces#1\unskip \hfil}%
    903  1.1  mrg   \let\centersub\relax % don't let the definition persist, just in case
    904  1.1  mrg }
    905  1.1  mrg \def\centerH#1{{%
    906  1.1  mrg   \hfil\break
    907  1.1  mrg   \advance\hsize by -\leftskip
    908  1.1  mrg   \advance\hsize by -\rightskip
    909  1.1  mrg   \line{#1}%
    910  1.1  mrg   \break
    911  1.1  mrg }}
    912  1.1  mrg %
    913  1.1  mrg \newcount\centerpenalty
    914  1.1  mrg \def\centerV#1{%
    915  1.1  mrg   % The idea here is the same as in \startdefun, \cartouche, etc.: if
    916  1.1  mrg   % @center is the first thing after a section heading, we need to wipe
    917  1.1  mrg   % out the negative parskip inserted by \sectionheading, but still
    918  1.1  mrg   % prevent a page break here.
    919  1.1  mrg   \centerpenalty = \lastpenalty
    920  1.1  mrg   \ifnum\centerpenalty>10000 \vskip\parskip \fi
    921  1.1  mrg   \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
    922  1.1  mrg   \line{\kern\leftskip #1\kern\rightskip}%
    923  1.1  mrg }
    924  1.1  mrg 
    925  1.1  mrg % @sp n   outputs n lines of vertical space
    926  1.1  mrg %
    927  1.1  mrg \parseargdef\sp{\vskip #1\baselineskip}
    928  1.1  mrg 
    929  1.1  mrg % @comment ...line which is ignored...
    930  1.1  mrg % @c is the same as @comment
    931  1.1  mrg % @ignore ... @end ignore  is another way to write a comment
    932  1.1  mrg %
    933  1.1  mrg \def\comment{\begingroup \catcode`\^^M=\other%
    934  1.1  mrg \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
    935  1.1  mrg \commentxxx}
    936  1.1  mrg {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
    937  1.1  mrg %
    938  1.1  mrg \let\c=\comment
    939  1.1  mrg 
    940  1.1  mrg % @paragraphindent NCHARS
    941  1.1  mrg % We'll use ems for NCHARS, close enough.
    942  1.1  mrg % NCHARS can also be the word `asis' or `none'.
    943  1.1  mrg % We cannot feasibly implement @paragraphindent asis, though.
    944  1.1  mrg %
    945  1.1  mrg \def\asisword{asis} % no translation, these are keywords
    946  1.1  mrg \def\noneword{none}
    947  1.1  mrg %
    948  1.1  mrg \parseargdef\paragraphindent{%
    949  1.1  mrg   \def\temp{#1}%
    950  1.1  mrg   \ifx\temp\asisword
    951  1.1  mrg   \else
    952  1.1  mrg     \ifx\temp\noneword
    953  1.1  mrg       \defaultparindent = 0pt
    954  1.1  mrg     \else
    955  1.1  mrg       \defaultparindent = #1em
    956  1.1  mrg     \fi
    957  1.1  mrg   \fi
    958  1.1  mrg   \parindent = \defaultparindent
    959  1.1  mrg }
    960  1.1  mrg 
    961  1.1  mrg % @exampleindent NCHARS
    962  1.1  mrg % We'll use ems for NCHARS like @paragraphindent.
    963  1.1  mrg % It seems @exampleindent asis isn't necessary, but
    964  1.1  mrg % I preserve it to make it similar to @paragraphindent.
    965  1.1  mrg \parseargdef\exampleindent{%
    966  1.1  mrg   \def\temp{#1}%
    967  1.1  mrg   \ifx\temp\asisword
    968  1.1  mrg   \else
    969  1.1  mrg     \ifx\temp\noneword
    970  1.1  mrg       \lispnarrowing = 0pt
    971  1.1  mrg     \else
    972  1.1  mrg       \lispnarrowing = #1em
    973  1.1  mrg     \fi
    974  1.1  mrg   \fi
    975  1.1  mrg }
    976  1.1  mrg 
    977  1.1  mrg % @firstparagraphindent WORD
    978  1.1  mrg % If WORD is `none', then suppress indentation of the first paragraph
    979  1.1  mrg % after a section heading.  If WORD is `insert', then do indent at such
    980  1.1  mrg % paragraphs.
    981  1.1  mrg %
    982  1.1  mrg % The paragraph indentation is suppressed or not by calling
    983  1.1  mrg % \suppressfirstparagraphindent, which the sectioning commands do.
    984  1.1  mrg % We switch the definition of this back and forth according to WORD.
    985  1.1  mrg % By default, we suppress indentation.
    986  1.1  mrg %
    987  1.1  mrg \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
    988  1.1  mrg \def\insertword{insert}
    989  1.1  mrg %
    990  1.1  mrg \parseargdef\firstparagraphindent{%
    991  1.1  mrg   \def\temp{#1}%
    992  1.1  mrg   \ifx\temp\noneword
    993  1.1  mrg     \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
    994  1.1  mrg   \else\ifx\temp\insertword
    995  1.1  mrg     \let\suppressfirstparagraphindent = \relax
    996  1.1  mrg   \else
    997  1.1  mrg     \errhelp = \EMsimple
    998  1.1  mrg     \errmessage{Unknown @firstparagraphindent option `\temp'}%
    999  1.1  mrg   \fi\fi
   1000  1.1  mrg }
   1001  1.1  mrg 
   1002  1.1  mrg % Here is how we actually suppress indentation.  Redefine \everypar to
   1003  1.1  mrg % \kern backwards by \parindent, and then reset itself to empty.
   1004  1.1  mrg %
   1005  1.1  mrg % We also make \indent itself not actually do anything until the next
   1006  1.1  mrg % paragraph.
   1007  1.1  mrg %
   1008  1.1  mrg \gdef\dosuppressfirstparagraphindent{%
   1009  1.1  mrg   \gdef\indent{%
   1010  1.1  mrg     \restorefirstparagraphindent
   1011  1.1  mrg     \indent
   1012  1.1  mrg   }%
   1013  1.1  mrg   \gdef\noindent{%
   1014  1.1  mrg     \restorefirstparagraphindent
   1015  1.1  mrg     \noindent
   1016  1.1  mrg   }%
   1017  1.1  mrg   \global\everypar = {%
   1018  1.1  mrg     \kern -\parindent
   1019  1.1  mrg     \restorefirstparagraphindent
   1020  1.1  mrg   }%
   1021  1.1  mrg }
   1022  1.1  mrg 
   1023  1.1  mrg \gdef\restorefirstparagraphindent{%
   1024  1.1  mrg   \global \let \indent = \ptexindent
   1025  1.1  mrg   \global \let \noindent = \ptexnoindent
   1026  1.1  mrg   \global \everypar = {}%
   1027  1.1  mrg }
   1028  1.1  mrg 
   1029  1.1  mrg 
   1030  1.1  mrg % @refill is a no-op.
   1031  1.1  mrg \let\refill=\relax
   1032  1.1  mrg 
   1033  1.1  mrg % If working on a large document in chapters, it is convenient to
   1034  1.1  mrg % be able to disable indexing, cross-referencing, and contents, for test runs.
   1035  1.1  mrg % This is done with @novalidate (before @setfilename).
   1036  1.1  mrg %
   1037  1.1  mrg \newif\iflinks \linkstrue % by default we want the aux files.
   1038  1.1  mrg \let\novalidate = \linksfalse
   1039  1.1  mrg 
   1040  1.1  mrg % @setfilename is done at the beginning of every texinfo file.
   1041  1.1  mrg % So open here the files we need to have open while reading the input.
   1042  1.1  mrg % This makes it possible to make a .fmt file for texinfo.
   1043  1.1  mrg \def\setfilename{%
   1044  1.1  mrg    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
   1045  1.1  mrg    \iflinks
   1046  1.1  mrg      \tryauxfile
   1047  1.1  mrg      % Open the new aux file.  TeX will close it automatically at exit.
   1048  1.1  mrg      \immediate\openout\auxfile=\jobname.aux
   1049  1.1  mrg    \fi % \openindices needs to do some work in any case.
   1050  1.1  mrg    \openindices
   1051  1.1  mrg    \let\setfilename=\comment % Ignore extra @setfilename cmds.
   1052  1.1  mrg    %
   1053  1.1  mrg    % If texinfo.cnf is present on the system, read it.
   1054  1.1  mrg    % Useful for site-wide @afourpaper, etc.
   1055  1.1  mrg    \openin 1 texinfo.cnf
   1056  1.1  mrg    \ifeof 1 \else \input texinfo.cnf \fi
   1057  1.1  mrg    \closein 1
   1058  1.1  mrg    %
   1059  1.1  mrg    \comment % Ignore the actual filename.
   1060  1.1  mrg }
   1061  1.1  mrg 
   1062  1.1  mrg % Called from \setfilename.
   1063  1.1  mrg %
   1064  1.1  mrg \def\openindices{%
   1065  1.1  mrg   \newindex{cp}%
   1066  1.1  mrg   \newcodeindex{fn}%
   1067  1.1  mrg   \newcodeindex{vr}%
   1068  1.1  mrg   \newcodeindex{tp}%
   1069  1.1  mrg   \newcodeindex{ky}%
   1070  1.1  mrg   \newcodeindex{pg}%
   1071  1.1  mrg }
   1072  1.1  mrg 
   1073  1.1  mrg % @bye.
   1074  1.1  mrg \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
   1075  1.1  mrg 
   1076  1.1  mrg 
   1077  1.1  mrg \message{pdf,}
   1078  1.1  mrg % adobe `portable' document format
   1079  1.1  mrg \newcount\tempnum
   1080  1.1  mrg \newcount\lnkcount
   1081  1.1  mrg \newtoks\filename
   1082  1.1  mrg \newcount\filenamelength
   1083  1.1  mrg \newcount\pgn
   1084  1.1  mrg \newtoks\toksA
   1085  1.1  mrg \newtoks\toksB
   1086  1.1  mrg \newtoks\toksC
   1087  1.1  mrg \newtoks\toksD
   1088  1.1  mrg \newbox\boxA
   1089  1.1  mrg \newcount\countA
   1090  1.1  mrg \newif\ifpdf
   1091  1.1  mrg \newif\ifpdfmakepagedest
   1092  1.1  mrg 
   1093  1.1  mrg % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
   1094  1.1  mrg % can be set).  So we test for \relax and 0 as well as being undefined.
   1095  1.1  mrg \ifx\pdfoutput\thisisundefined
   1096  1.1  mrg \else
   1097  1.1  mrg   \ifx\pdfoutput\relax
   1098  1.1  mrg   \else
   1099  1.1  mrg     \ifcase\pdfoutput
   1100  1.1  mrg     \else
   1101  1.1  mrg       \pdftrue
   1102  1.1  mrg     \fi
   1103  1.1  mrg   \fi
   1104  1.1  mrg \fi
   1105  1.1  mrg 
   1106  1.1  mrg % PDF uses PostScript string constants for the names of xref targets,
   1107  1.1  mrg % for display in the outlines, and in other places.  Thus, we have to
   1108  1.1  mrg % double any backslashes.  Otherwise, a name like "\node" will be
   1109  1.1  mrg % interpreted as a newline (\n), followed by o, d, e.  Not good.
   1110  1.1  mrg % 
   1111  1.1  mrg % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
   1112  1.1  mrg % related messages.  The final outcome is that it is up to the TeX user
   1113  1.1  mrg % to double the backslashes and otherwise make the string valid, so
   1114  1.1  mrg % that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
   1115  1.1  mrg % do this reliably, so we use it.
   1116  1.1  mrg 
   1117  1.1  mrg % #1 is a control sequence in which to do the replacements,
   1118  1.1  mrg % which we \xdef.
   1119  1.1  mrg \def\txiescapepdf#1{%
   1120  1.1  mrg   \ifx\pdfescapestring\relax
   1121  1.1  mrg     % No primitive available; should we give a warning or log?
   1122  1.1  mrg     % Many times it won't matter.
   1123  1.1  mrg   \else
   1124  1.1  mrg     % The expandable \pdfescapestring primitive escapes parentheses,
   1125  1.1  mrg     % backslashes, and other special chars.
   1126  1.1  mrg     \xdef#1{\pdfescapestring{#1}}%
   1127  1.1  mrg   \fi
   1128  1.1  mrg }
   1129  1.1  mrg 
   1130  1.1  mrg \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
   1131  1.1  mrg with PDF output, and none of those formats could be found.  (.eps cannot
   1132  1.1  mrg be supported due to the design of the PDF format; use regular TeX (DVI
   1133  1.1  mrg output) for that.)}
   1134  1.1  mrg 
   1135  1.1  mrg \ifpdf
   1136  1.1  mrg   %
   1137  1.1  mrg   % Color manipulation macros based on pdfcolor.tex,
   1138  1.1  mrg   % except using rgb instead of cmyk; the latter is said to render as a
   1139  1.1  mrg   % very dark gray on-screen and a very dark halftone in print, instead
   1140  1.1  mrg   % of actual black.
   1141  1.1  mrg   \def\rgbDarkRed{0.50 0.09 0.12}
   1142  1.1  mrg   \def\rgbBlack{0 0 0}
   1143  1.1  mrg   %
   1144  1.1  mrg   % k sets the color for filling (usual text, etc.);
   1145  1.1  mrg   % K sets the color for stroking (thin rules, e.g., normal _'s).
   1146  1.1  mrg   \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
   1147  1.1  mrg   %
   1148  1.1  mrg   % Set color, and create a mark which defines \thiscolor accordingly,
   1149  1.1  mrg   % so that \makeheadline knows which color to restore.
   1150  1.1  mrg   \def\setcolor#1{%
   1151  1.1  mrg     \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
   1152  1.1  mrg     \domark
   1153  1.1  mrg     \pdfsetcolor{#1}%
   1154  1.1  mrg   }
   1155  1.1  mrg   %
   1156  1.1  mrg   \def\maincolor{\rgbBlack}
   1157  1.1  mrg   \pdfsetcolor{\maincolor}
   1158  1.1  mrg   \edef\thiscolor{\maincolor}
   1159  1.1  mrg   \def\lastcolordefs{}
   1160  1.1  mrg   %
   1161  1.1  mrg   \def\makefootline{%
   1162  1.1  mrg     \baselineskip24pt
   1163  1.1  mrg     \line{\pdfsetcolor{\maincolor}\the\footline}%
   1164  1.1  mrg   }
   1165  1.1  mrg   %
   1166  1.1  mrg   \def\makeheadline{%
   1167  1.1  mrg     \vbox to 0pt{%
   1168  1.1  mrg       \vskip-22.5pt
   1169  1.1  mrg       \line{%
   1170  1.1  mrg         \vbox to8.5pt{}%
   1171  1.1  mrg         % Extract \thiscolor definition from the marks.
   1172  1.1  mrg         \getcolormarks
   1173  1.1  mrg         % Typeset the headline with \maincolor, then restore the color.
   1174  1.1  mrg         \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
   1175  1.1  mrg       }%
   1176  1.1  mrg       \vss
   1177  1.1  mrg     }%
   1178  1.1  mrg     \nointerlineskip
   1179  1.1  mrg   }
   1180  1.1  mrg   %
   1181  1.1  mrg   %
   1182  1.1  mrg   \pdfcatalog{/PageMode /UseOutlines}
   1183  1.1  mrg   %
   1184  1.1  mrg   % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
   1185  1.1  mrg   \def\dopdfimage#1#2#3{%
   1186  1.1  mrg     \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
   1187  1.1  mrg     \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
   1188  1.1  mrg     %
   1189  1.1  mrg     % pdftex (and the PDF format) support .pdf, .png, .jpg (among
   1190  1.1  mrg     % others).  Let's try in that order, PDF first since if
   1191  1.1  mrg     % someone has a scalable image, presumably better to use that than a
   1192  1.1  mrg     % bitmap.
   1193  1.1  mrg     \let\pdfimgext=\empty
   1194  1.1  mrg     \begingroup
   1195  1.1  mrg       \openin 1 #1.pdf \ifeof 1
   1196  1.1  mrg         \openin 1 #1.PDF \ifeof 1
   1197  1.1  mrg           \openin 1 #1.png \ifeof 1
   1198  1.1  mrg             \openin 1 #1.jpg \ifeof 1
   1199  1.1  mrg               \openin 1 #1.jpeg \ifeof 1
   1200  1.1  mrg                 \openin 1 #1.JPG \ifeof 1
   1201  1.1  mrg                   \errhelp = \nopdfimagehelp
   1202  1.1  mrg                   \errmessage{Could not find image file #1 for pdf}%
   1203  1.1  mrg                 \else \gdef\pdfimgext{JPG}%
   1204  1.1  mrg                 \fi
   1205  1.1  mrg               \else \gdef\pdfimgext{jpeg}%
   1206  1.1  mrg               \fi
   1207  1.1  mrg             \else \gdef\pdfimgext{jpg}%
   1208  1.1  mrg             \fi
   1209  1.1  mrg           \else \gdef\pdfimgext{png}%
   1210  1.1  mrg           \fi
   1211  1.1  mrg         \else \gdef\pdfimgext{PDF}%
   1212  1.1  mrg         \fi
   1213  1.1  mrg       \else \gdef\pdfimgext{pdf}%
   1214  1.1  mrg       \fi
   1215  1.1  mrg       \closein 1
   1216  1.1  mrg     \endgroup
   1217  1.1  mrg     %
   1218  1.1  mrg     % without \immediate, ancient pdftex seg faults when the same image is
   1219  1.1  mrg     % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
   1220  1.1  mrg     \ifnum\pdftexversion < 14
   1221  1.1  mrg       \immediate\pdfimage
   1222  1.1  mrg     \else
   1223  1.1  mrg       \immediate\pdfximage
   1224  1.1  mrg     \fi
   1225  1.1  mrg       \ifdim \wd0 >0pt width \pdfimagewidth \fi
   1226  1.1  mrg       \ifdim \wd2 >0pt height \pdfimageheight \fi
   1227  1.1  mrg       \ifnum\pdftexversion<13
   1228  1.1  mrg          #1.\pdfimgext
   1229  1.1  mrg        \else
   1230  1.1  mrg          {#1.\pdfimgext}%
   1231  1.1  mrg        \fi
   1232  1.1  mrg     \ifnum\pdftexversion < 14 \else
   1233  1.1  mrg       \pdfrefximage \pdflastximage
   1234  1.1  mrg     \fi}
   1235  1.1  mrg   %
   1236  1.1  mrg   \def\pdfmkdest#1{{%
   1237  1.1  mrg     % We have to set dummies so commands such as @code, and characters
   1238  1.1  mrg     % such as \, aren't expanded when present in a section title.
   1239  1.1  mrg     \indexnofonts
   1240  1.1  mrg     \turnoffactive
   1241  1.1  mrg     \makevalueexpandable
   1242  1.1  mrg     \def\pdfdestname{#1}%
   1243  1.1  mrg     \txiescapepdf\pdfdestname
   1244  1.1  mrg     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
   1245  1.1  mrg   }}
   1246  1.1  mrg   %
   1247  1.1  mrg   % used to mark target names; must be expandable.
   1248  1.1  mrg   \def\pdfmkpgn#1{#1}
   1249  1.1  mrg   %
   1250  1.1  mrg   % by default, use a color that is dark enough to print on paper as
   1251  1.1  mrg   % nearly black, but still distinguishable for online viewing.
   1252  1.1  mrg   \def\urlcolor{\rgbDarkRed}
   1253  1.1  mrg   \def\linkcolor{\rgbDarkRed}
   1254  1.1  mrg   \def\endlink{\setcolor{\maincolor}\pdfendlink}
   1255  1.1  mrg   %
   1256  1.1  mrg   % Adding outlines to PDF; macros for calculating structure of outlines
   1257  1.1  mrg   % come from Petr Olsak
   1258  1.1  mrg   \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
   1259  1.1  mrg     \else \csname#1\endcsname \fi}
   1260  1.1  mrg   \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
   1261  1.1  mrg     \advance\tempnum by 1
   1262  1.1  mrg     \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
   1263  1.1  mrg   %
   1264  1.1  mrg   % #1 is the section text, which is what will be displayed in the
   1265  1.1  mrg   % outline by the pdf viewer.  #2 is the pdf expression for the number
   1266  1.1  mrg   % of subentries (or empty, for subsubsections).  #3 is the node text,
   1267  1.1  mrg   % which might be empty if this toc entry had no corresponding node.
   1268  1.1  mrg   % #4 is the page number
   1269  1.1  mrg   %
   1270  1.1  mrg   \def\dopdfoutline#1#2#3#4{%
   1271  1.1  mrg     % Generate a link to the node text if that exists; else, use the
   1272  1.1  mrg     % page number.  We could generate a destination for the section
   1273  1.1  mrg     % text in the case where a section has no node, but it doesn't
   1274  1.1  mrg     % seem worth the trouble, since most documents are normally structured.
   1275  1.1  mrg     \edef\pdfoutlinedest{#3}%
   1276  1.1  mrg     \ifx\pdfoutlinedest\empty
   1277  1.1  mrg       \def\pdfoutlinedest{#4}%
   1278  1.1  mrg     \else
   1279  1.1  mrg       \txiescapepdf\pdfoutlinedest
   1280  1.1  mrg     \fi
   1281  1.1  mrg     %
   1282  1.1  mrg     % Also escape PDF chars in the display string.
   1283  1.1  mrg     \edef\pdfoutlinetext{#1}%
   1284  1.1  mrg     \txiescapepdf\pdfoutlinetext
   1285  1.1  mrg     %
   1286  1.1  mrg     \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
   1287  1.1  mrg   }
   1288  1.1  mrg   %
   1289  1.1  mrg   \def\pdfmakeoutlines{%
   1290  1.1  mrg     \begingroup
   1291  1.1  mrg       % Read toc silently, to get counts of subentries for \pdfoutline.
   1292  1.1  mrg       \def\partentry##1##2##3##4{}% ignore parts in the outlines
   1293  1.1  mrg       \def\numchapentry##1##2##3##4{%
   1294  1.1  mrg 	\def\thischapnum{##2}%
   1295  1.1  mrg 	\def\thissecnum{0}%
   1296  1.1  mrg 	\def\thissubsecnum{0}%
   1297  1.1  mrg       }%
   1298  1.1  mrg       \def\numsecentry##1##2##3##4{%
   1299  1.1  mrg 	\advancenumber{chap\thischapnum}%
   1300  1.1  mrg 	\def\thissecnum{##2}%
   1301  1.1  mrg 	\def\thissubsecnum{0}%
   1302  1.1  mrg       }%
   1303  1.1  mrg       \def\numsubsecentry##1##2##3##4{%
   1304  1.1  mrg 	\advancenumber{sec\thissecnum}%
   1305  1.1  mrg 	\def\thissubsecnum{##2}%
   1306  1.1  mrg       }%
   1307  1.1  mrg       \def\numsubsubsecentry##1##2##3##4{%
   1308  1.1  mrg 	\advancenumber{subsec\thissubsecnum}%
   1309  1.1  mrg       }%
   1310  1.1  mrg       \def\thischapnum{0}%
   1311  1.1  mrg       \def\thissecnum{0}%
   1312  1.1  mrg       \def\thissubsecnum{0}%
   1313  1.1  mrg       %
   1314  1.1  mrg       % use \def rather than \let here because we redefine \chapentry et
   1315  1.1  mrg       % al. a second time, below.
   1316  1.1  mrg       \def\appentry{\numchapentry}%
   1317  1.1  mrg       \def\appsecentry{\numsecentry}%
   1318  1.1  mrg       \def\appsubsecentry{\numsubsecentry}%
   1319  1.1  mrg       \def\appsubsubsecentry{\numsubsubsecentry}%
   1320  1.1  mrg       \def\unnchapentry{\numchapentry}%
   1321  1.1  mrg       \def\unnsecentry{\numsecentry}%
   1322  1.1  mrg       \def\unnsubsecentry{\numsubsecentry}%
   1323  1.1  mrg       \def\unnsubsubsecentry{\numsubsubsecentry}%
   1324  1.1  mrg       \readdatafile{toc}%
   1325  1.1  mrg       %
   1326  1.1  mrg       % Read toc second time, this time actually producing the outlines.
   1327  1.1  mrg       % The `-' means take the \expnumber as the absolute number of
   1328  1.1  mrg       % subentries, which we calculated on our first read of the .toc above.
   1329  1.1  mrg       %
   1330  1.1  mrg       % We use the node names as the destinations.
   1331  1.1  mrg       \def\numchapentry##1##2##3##4{%
   1332  1.1  mrg         \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
   1333  1.1  mrg       \def\numsecentry##1##2##3##4{%
   1334  1.1  mrg         \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
   1335  1.1  mrg       \def\numsubsecentry##1##2##3##4{%
   1336  1.1  mrg         \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
   1337  1.1  mrg       \def\numsubsubsecentry##1##2##3##4{% count is always zero
   1338  1.1  mrg         \dopdfoutline{##1}{}{##3}{##4}}%
   1339  1.1  mrg       %
   1340  1.1  mrg       % PDF outlines are displayed using system fonts, instead of
   1341  1.1  mrg       % document fonts.  Therefore we cannot use special characters,
   1342  1.1  mrg       % since the encoding is unknown.  For example, the eogonek from
   1343  1.1  mrg       % Latin 2 (0xea) gets translated to a | character.  Info from
   1344  1.1  mrg       % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
   1345  1.1  mrg       %
   1346  1.1  mrg       % TODO this right, we have to translate 8-bit characters to
   1347  1.1  mrg       % their "best" equivalent, based on the @documentencoding.  Too
   1348  1.1  mrg       % much work for too little return.  Just use the ASCII equivalents
   1349  1.1  mrg       % we use for the index sort strings.
   1350  1.1  mrg       % 
   1351  1.1  mrg       \indexnofonts
   1352  1.1  mrg       \setupdatafile
   1353  1.1  mrg       % We can have normal brace characters in the PDF outlines, unlike
   1354  1.1  mrg       % Texinfo index files.  So set that up.
   1355  1.1  mrg       \def\{{\lbracecharliteral}%
   1356  1.1  mrg       \def\}{\rbracecharliteral}%
   1357  1.1  mrg       \catcode`\\=\active \otherbackslash
   1358  1.1  mrg       \input \tocreadfilename
   1359  1.1  mrg     \endgroup
   1360  1.1  mrg   }
   1361  1.1  mrg   {\catcode`[=1 \catcode`]=2
   1362  1.1  mrg    \catcode`{=\other \catcode`}=\other
   1363  1.1  mrg    \gdef\lbracecharliteral[{]%
   1364  1.1  mrg    \gdef\rbracecharliteral[}]%
   1365  1.1  mrg   ]
   1366  1.1  mrg   %
   1367  1.1  mrg   \def\skipspaces#1{\def\PP{#1}\def\D{|}%
   1368  1.1  mrg     \ifx\PP\D\let\nextsp\relax
   1369  1.1  mrg     \else\let\nextsp\skipspaces
   1370  1.1  mrg       \ifx\p\space\else\addtokens{\filename}{\PP}%
   1371  1.1  mrg         \advance\filenamelength by 1
   1372  1.1  mrg       \fi
   1373  1.1  mrg     \fi
   1374  1.1  mrg     \nextsp}
   1375  1.1  mrg   \def\getfilename#1{%
   1376  1.1  mrg     \filenamelength=0
   1377  1.1  mrg     % If we don't expand the argument now, \skipspaces will get
   1378  1.1  mrg     % snagged on things like "@value{foo}".
   1379  1.1  mrg     \edef\temp{#1}%
   1380  1.1  mrg     \expandafter\skipspaces\temp|\relax
   1381  1.1  mrg   }
   1382  1.1  mrg   \ifnum\pdftexversion < 14
   1383  1.1  mrg     \let \startlink \pdfannotlink
   1384  1.1  mrg   \else
   1385  1.1  mrg     \let \startlink \pdfstartlink
   1386  1.1  mrg   \fi
   1387  1.1  mrg   % make a live url in pdf output.
   1388  1.1  mrg   \def\pdfurl#1{%
   1389  1.1  mrg     \begingroup
   1390  1.1  mrg       % it seems we really need yet another set of dummies; have not
   1391  1.1  mrg       % tried to figure out what each command should do in the context
   1392  1.1  mrg       % of @url.  for now, just make @/ a no-op, that's the only one
   1393  1.1  mrg       % people have actually reported a problem with.
   1394  1.1  mrg       %
   1395  1.1  mrg       \normalturnoffactive
   1396  1.1  mrg       \def\@{@}%
   1397  1.1  mrg       \let\/=\empty
   1398  1.1  mrg       \makevalueexpandable
   1399  1.1  mrg       % do we want to go so far as to use \indexnofonts instead of just
   1400  1.1  mrg       % special-casing \var here?
   1401  1.1  mrg       \def\var##1{##1}%
   1402  1.1  mrg       %
   1403  1.1  mrg       \leavevmode\setcolor{\urlcolor}%
   1404  1.1  mrg       \startlink attr{/Border [0 0 0]}%
   1405  1.1  mrg         user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
   1406  1.1  mrg     \endgroup}
   1407  1.1  mrg   \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
   1408  1.1  mrg   \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
   1409  1.1  mrg   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
   1410  1.1  mrg   \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
   1411  1.1  mrg   \def\maketoks{%
   1412  1.1  mrg     \expandafter\poptoks\the\toksA|ENDTOKS|\relax
   1413  1.1  mrg     \ifx\first0\adn0
   1414  1.1  mrg     \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
   1415  1.1  mrg     \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
   1416  1.1  mrg     \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
   1417  1.1  mrg     \else
   1418  1.1  mrg       \ifnum0=\countA\else\makelink\fi
   1419  1.1  mrg       \ifx\first.\let\next=\done\else
   1420  1.1  mrg         \let\next=\maketoks
   1421  1.1  mrg         \addtokens{\toksB}{\the\toksD}
   1422  1.1  mrg         \ifx\first,\addtokens{\toksB}{\space}\fi
   1423  1.1  mrg       \fi
   1424  1.1  mrg     \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
   1425  1.1  mrg     \next}
   1426  1.1  mrg   \def\makelink{\addtokens{\toksB}%
   1427  1.1  mrg     {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
   1428  1.1  mrg   \def\pdflink#1{%
   1429  1.1  mrg     \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
   1430  1.1  mrg     \setcolor{\linkcolor}#1\endlink}
   1431  1.1  mrg   \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
   1432  1.1  mrg \else
   1433  1.1  mrg   % non-pdf mode
   1434  1.1  mrg   \let\pdfmkdest = \gobble
   1435  1.1  mrg   \let\pdfurl = \gobble
   1436  1.1  mrg   \let\endlink = \relax
   1437  1.1  mrg   \let\setcolor = \gobble
   1438  1.1  mrg   \let\pdfsetcolor = \gobble
   1439  1.1  mrg   \let\pdfmakeoutlines = \relax
   1440  1.1  mrg \fi  % \ifx\pdfoutput
   1441  1.1  mrg 
   1442  1.1  mrg 
   1443  1.1  mrg \message{fonts,}
   1444  1.1  mrg 
   1445  1.1  mrg % Change the current font style to #1, remembering it in \curfontstyle.
   1446  1.1  mrg % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
   1447  1.1  mrg % italics, not bold italics.
   1448  1.1  mrg %
   1449  1.1  mrg \def\setfontstyle#1{%
   1450  1.1  mrg   \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
   1451  1.1  mrg   \csname ten#1\endcsname  % change the current font
   1452  1.1  mrg }
   1453  1.1  mrg 
   1454  1.1  mrg % Select #1 fonts with the current style.
   1455  1.1  mrg %
   1456  1.1  mrg \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
   1457  1.1  mrg 
   1458  1.1  mrg \def\rm{\fam=0 \setfontstyle{rm}}
   1459  1.1  mrg \def\it{\fam=\itfam \setfontstyle{it}}
   1460  1.1  mrg \def\sl{\fam=\slfam \setfontstyle{sl}}
   1461  1.1  mrg \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
   1462  1.1  mrg \def\tt{\fam=\ttfam \setfontstyle{tt}}
   1463  1.1  mrg 
   1464  1.1  mrg % Unfortunately, we have to override this for titles and the like, since
   1465  1.1  mrg % in those cases "rm" is bold.  Sigh.
   1466  1.1  mrg \def\rmisbold{\rm\def\curfontstyle{bf}}
   1467  1.1  mrg 
   1468  1.1  mrg % Texinfo sort of supports the sans serif font style, which plain TeX does not.
   1469  1.1  mrg % So we set up a \sf.
   1470  1.1  mrg \newfam\sffam
   1471  1.1  mrg \def\sf{\fam=\sffam \setfontstyle{sf}}
   1472  1.1  mrg \let\li = \sf % Sometimes we call it \li, not \sf.
   1473  1.1  mrg 
   1474  1.1  mrg % We don't need math for this font style.
   1475  1.1  mrg \def\ttsl{\setfontstyle{ttsl}}
   1476  1.1  mrg 
   1477  1.1  mrg 
   1478  1.1  mrg % Default leading.
   1479  1.1  mrg \newdimen\textleading  \textleading = 13.2pt
   1480  1.1  mrg 
   1481  1.1  mrg % Set the baselineskip to #1, and the lineskip and strut size
   1482  1.1  mrg % correspondingly.  There is no deep meaning behind these magic numbers
   1483  1.1  mrg % used as factors; they just match (closely enough) what Knuth defined.
   1484  1.1  mrg %
   1485  1.1  mrg \def\lineskipfactor{.08333}
   1486  1.1  mrg \def\strutheightpercent{.70833}
   1487  1.1  mrg \def\strutdepthpercent {.29167}
   1488  1.1  mrg %
   1489  1.1  mrg % can get a sort of poor man's double spacing by redefining this.
   1490  1.1  mrg \def\baselinefactor{1}
   1491  1.1  mrg %
   1492  1.1  mrg \def\setleading#1{%
   1493  1.1  mrg   \dimen0 = #1\relax
   1494  1.1  mrg   \normalbaselineskip = \baselinefactor\dimen0
   1495  1.1  mrg   \normallineskip = \lineskipfactor\normalbaselineskip
   1496  1.1  mrg   \normalbaselines
   1497  1.1  mrg   \setbox\strutbox =\hbox{%
   1498  1.1  mrg     \vrule width0pt height\strutheightpercent\baselineskip
   1499  1.1  mrg                     depth \strutdepthpercent \baselineskip
   1500  1.1  mrg   }%
   1501  1.1  mrg }
   1502  1.1  mrg 
   1503  1.1  mrg % PDF CMaps.  See also LaTeX's t1.cmap.
   1504  1.1  mrg %
   1505  1.1  mrg % do nothing with this by default.
   1506  1.1  mrg \expandafter\let\csname cmapOT1\endcsname\gobble
   1507  1.1  mrg \expandafter\let\csname cmapOT1IT\endcsname\gobble
   1508  1.1  mrg \expandafter\let\csname cmapOT1TT\endcsname\gobble
   1509  1.1  mrg 
   1510  1.1  mrg % if we are producing pdf, and we have \pdffontattr, then define cmaps.
   1511  1.1  mrg % (\pdffontattr was introduced many years ago, but people still run
   1512  1.1  mrg % older pdftex's; it's easy to conditionalize, so we do.)
   1513  1.1  mrg \ifpdf \ifx\pdffontattr\thisisundefined \else
   1514  1.1  mrg   \begingroup
   1515  1.1  mrg     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
   1516  1.1  mrg     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
   1517  1.1  mrg %%DocumentNeededResources: ProcSet (CIDInit)
   1518  1.1  mrg %%IncludeResource: ProcSet (CIDInit)
   1519  1.1  mrg %%BeginResource: CMap (TeX-OT1-0)
   1520  1.1  mrg %%Title: (TeX-OT1-0 TeX OT1 0)
   1521  1.1  mrg %%Version: 1.000
   1522  1.1  mrg %%EndComments
   1523  1.1  mrg /CIDInit /ProcSet findresource begin
   1524  1.1  mrg 12 dict begin
   1525  1.1  mrg begincmap
   1526  1.1  mrg /CIDSystemInfo
   1527  1.1  mrg << /Registry (TeX)
   1528  1.1  mrg /Ordering (OT1)
   1529  1.1  mrg /Supplement 0
   1530  1.1  mrg >> def
   1531  1.1  mrg /CMapName /TeX-OT1-0 def
   1532  1.1  mrg /CMapType 2 def
   1533  1.1  mrg 1 begincodespacerange
   1534  1.1  mrg <00> <7F>
   1535  1.1  mrg endcodespacerange
   1536  1.1  mrg 8 beginbfrange
   1537  1.1  mrg <00> <01> <0393>
   1538  1.1  mrg <09> <0A> <03A8>
   1539  1.1  mrg <23> <26> <0023>
   1540  1.1  mrg <28> <3B> <0028>
   1541  1.1  mrg <3F> <5B> <003F>
   1542  1.1  mrg <5D> <5E> <005D>
   1543  1.1  mrg <61> <7A> <0061>
   1544  1.1  mrg <7B> <7C> <2013>
   1545  1.1  mrg endbfrange
   1546  1.1  mrg 40 beginbfchar
   1547  1.1  mrg <02> <0398>
   1548  1.1  mrg <03> <039B>
   1549  1.1  mrg <04> <039E>
   1550  1.1  mrg <05> <03A0>
   1551  1.1  mrg <06> <03A3>
   1552  1.1  mrg <07> <03D2>
   1553  1.1  mrg <08> <03A6>
   1554  1.1  mrg <0B> <00660066>
   1555  1.1  mrg <0C> <00660069>
   1556  1.1  mrg <0D> <0066006C>
   1557  1.1  mrg <0E> <006600660069>
   1558  1.1  mrg <0F> <00660066006C>
   1559  1.1  mrg <10> <0131>
   1560  1.1  mrg <11> <0237>
   1561  1.1  mrg <12> <0060>
   1562  1.1  mrg <13> <00B4>
   1563  1.1  mrg <14> <02C7>
   1564  1.1  mrg <15> <02D8>
   1565  1.1  mrg <16> <00AF>
   1566  1.1  mrg <17> <02DA>
   1567  1.1  mrg <18> <00B8>
   1568  1.1  mrg <19> <00DF>
   1569  1.1  mrg <1A> <00E6>
   1570  1.1  mrg <1B> <0153>
   1571  1.1  mrg <1C> <00F8>
   1572  1.1  mrg <1D> <00C6>
   1573  1.1  mrg <1E> <0152>
   1574  1.1  mrg <1F> <00D8>
   1575  1.1  mrg <21> <0021>
   1576  1.1  mrg <22> <201D>
   1577  1.1  mrg <27> <2019>
   1578  1.1  mrg <3C> <00A1>
   1579  1.1  mrg <3D> <003D>
   1580  1.1  mrg <3E> <00BF>
   1581  1.1  mrg <5C> <201C>
   1582  1.1  mrg <5F> <02D9>
   1583  1.1  mrg <60> <2018>
   1584  1.1  mrg <7D> <02DD>
   1585  1.1  mrg <7E> <007E>
   1586  1.1  mrg <7F> <00A8>
   1587  1.1  mrg endbfchar
   1588  1.1  mrg endcmap
   1589  1.1  mrg CMapName currentdict /CMap defineresource pop
   1590  1.1  mrg end
   1591  1.1  mrg end
   1592  1.1  mrg %%EndResource
   1593  1.1  mrg %%EOF
   1594  1.1  mrg     }\endgroup
   1595  1.1  mrg   \expandafter\edef\csname cmapOT1\endcsname#1{%
   1596  1.1  mrg     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
   1597  1.1  mrg   }%
   1598  1.1  mrg %
   1599  1.1  mrg % \cmapOT1IT
   1600  1.1  mrg   \begingroup
   1601  1.1  mrg     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
   1602  1.1  mrg     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
   1603  1.1  mrg %%DocumentNeededResources: ProcSet (CIDInit)
   1604  1.1  mrg %%IncludeResource: ProcSet (CIDInit)
   1605  1.1  mrg %%BeginResource: CMap (TeX-OT1IT-0)
   1606  1.1  mrg %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
   1607  1.1  mrg %%Version: 1.000
   1608  1.1  mrg %%EndComments
   1609  1.1  mrg /CIDInit /ProcSet findresource begin
   1610  1.1  mrg 12 dict begin
   1611  1.1  mrg begincmap
   1612  1.1  mrg /CIDSystemInfo
   1613  1.1  mrg << /Registry (TeX)
   1614  1.1  mrg /Ordering (OT1IT)
   1615  1.1  mrg /Supplement 0
   1616  1.1  mrg >> def
   1617  1.1  mrg /CMapName /TeX-OT1IT-0 def
   1618  1.1  mrg /CMapType 2 def
   1619  1.1  mrg 1 begincodespacerange
   1620  1.1  mrg <00> <7F>
   1621  1.1  mrg endcodespacerange
   1622  1.1  mrg 8 beginbfrange
   1623  1.1  mrg <00> <01> <0393>
   1624  1.1  mrg <09> <0A> <03A8>
   1625  1.1  mrg <25> <26> <0025>
   1626  1.1  mrg <28> <3B> <0028>
   1627  1.1  mrg <3F> <5B> <003F>
   1628  1.1  mrg <5D> <5E> <005D>
   1629  1.1  mrg <61> <7A> <0061>
   1630  1.1  mrg <7B> <7C> <2013>
   1631  1.1  mrg endbfrange
   1632  1.1  mrg 42 beginbfchar
   1633  1.1  mrg <02> <0398>
   1634  1.1  mrg <03> <039B>
   1635  1.1  mrg <04> <039E>
   1636  1.1  mrg <05> <03A0>
   1637  1.1  mrg <06> <03A3>
   1638  1.1  mrg <07> <03D2>
   1639  1.1  mrg <08> <03A6>
   1640  1.1  mrg <0B> <00660066>
   1641  1.1  mrg <0C> <00660069>
   1642  1.1  mrg <0D> <0066006C>
   1643  1.1  mrg <0E> <006600660069>
   1644  1.1  mrg <0F> <00660066006C>
   1645  1.1  mrg <10> <0131>
   1646  1.1  mrg <11> <0237>
   1647  1.1  mrg <12> <0060>
   1648  1.1  mrg <13> <00B4>
   1649  1.1  mrg <14> <02C7>
   1650  1.1  mrg <15> <02D8>
   1651  1.1  mrg <16> <00AF>
   1652  1.1  mrg <17> <02DA>
   1653  1.1  mrg <18> <00B8>
   1654  1.1  mrg <19> <00DF>
   1655  1.1  mrg <1A> <00E6>
   1656  1.1  mrg <1B> <0153>
   1657  1.1  mrg <1C> <00F8>
   1658  1.1  mrg <1D> <00C6>
   1659  1.1  mrg <1E> <0152>
   1660  1.1  mrg <1F> <00D8>
   1661  1.1  mrg <21> <0021>
   1662  1.1  mrg <22> <201D>
   1663  1.1  mrg <23> <0023>
   1664  1.1  mrg <24> <00A3>
   1665  1.1  mrg <27> <2019>
   1666  1.1  mrg <3C> <00A1>
   1667  1.1  mrg <3D> <003D>
   1668  1.1  mrg <3E> <00BF>
   1669  1.1  mrg <5C> <201C>
   1670  1.1  mrg <5F> <02D9>
   1671  1.1  mrg <60> <2018>
   1672  1.1  mrg <7D> <02DD>
   1673  1.1  mrg <7E> <007E>
   1674  1.1  mrg <7F> <00A8>
   1675  1.1  mrg endbfchar
   1676  1.1  mrg endcmap
   1677  1.1  mrg CMapName currentdict /CMap defineresource pop
   1678  1.1  mrg end
   1679  1.1  mrg end
   1680  1.1  mrg %%EndResource
   1681  1.1  mrg %%EOF
   1682  1.1  mrg     }\endgroup
   1683  1.1  mrg   \expandafter\edef\csname cmapOT1IT\endcsname#1{%
   1684  1.1  mrg     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
   1685  1.1  mrg   }%
   1686  1.1  mrg %
   1687  1.1  mrg % \cmapOT1TT
   1688  1.1  mrg   \begingroup
   1689  1.1  mrg     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
   1690  1.1  mrg     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
   1691  1.1  mrg %%DocumentNeededResources: ProcSet (CIDInit)
   1692  1.1  mrg %%IncludeResource: ProcSet (CIDInit)
   1693  1.1  mrg %%BeginResource: CMap (TeX-OT1TT-0)
   1694  1.1  mrg %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
   1695  1.1  mrg %%Version: 1.000
   1696  1.1  mrg %%EndComments
   1697  1.1  mrg /CIDInit /ProcSet findresource begin
   1698  1.1  mrg 12 dict begin
   1699  1.1  mrg begincmap
   1700  1.1  mrg /CIDSystemInfo
   1701  1.1  mrg << /Registry (TeX)
   1702  1.1  mrg /Ordering (OT1TT)
   1703  1.1  mrg /Supplement 0
   1704  1.1  mrg >> def
   1705  1.1  mrg /CMapName /TeX-OT1TT-0 def
   1706  1.1  mrg /CMapType 2 def
   1707  1.1  mrg 1 begincodespacerange
   1708  1.1  mrg <00> <7F>
   1709  1.1  mrg endcodespacerange
   1710  1.1  mrg 5 beginbfrange
   1711  1.1  mrg <00> <01> <0393>
   1712  1.1  mrg <09> <0A> <03A8>
   1713  1.1  mrg <21> <26> <0021>
   1714  1.1  mrg <28> <5F> <0028>
   1715  1.1  mrg <61> <7E> <0061>
   1716  1.1  mrg endbfrange
   1717  1.1  mrg 32 beginbfchar
   1718  1.1  mrg <02> <0398>
   1719  1.1  mrg <03> <039B>
   1720  1.1  mrg <04> <039E>
   1721  1.1  mrg <05> <03A0>
   1722  1.1  mrg <06> <03A3>
   1723  1.1  mrg <07> <03D2>
   1724  1.1  mrg <08> <03A6>
   1725  1.1  mrg <0B> <2191>
   1726  1.1  mrg <0C> <2193>
   1727  1.1  mrg <0D> <0027>
   1728  1.1  mrg <0E> <00A1>
   1729  1.1  mrg <0F> <00BF>
   1730  1.1  mrg <10> <0131>
   1731  1.1  mrg <11> <0237>
   1732  1.1  mrg <12> <0060>
   1733  1.1  mrg <13> <00B4>
   1734  1.1  mrg <14> <02C7>
   1735  1.1  mrg <15> <02D8>
   1736  1.1  mrg <16> <00AF>
   1737  1.1  mrg <17> <02DA>
   1738  1.1  mrg <18> <00B8>
   1739  1.1  mrg <19> <00DF>
   1740  1.1  mrg <1A> <00E6>
   1741  1.1  mrg <1B> <0153>
   1742  1.1  mrg <1C> <00F8>
   1743  1.1  mrg <1D> <00C6>
   1744  1.1  mrg <1E> <0152>
   1745  1.1  mrg <1F> <00D8>
   1746  1.1  mrg <20> <2423>
   1747  1.1  mrg <27> <2019>
   1748  1.1  mrg <60> <2018>
   1749  1.1  mrg <7F> <00A8>
   1750  1.1  mrg endbfchar
   1751  1.1  mrg endcmap
   1752  1.1  mrg CMapName currentdict /CMap defineresource pop
   1753  1.1  mrg end
   1754  1.1  mrg end
   1755  1.1  mrg %%EndResource
   1756  1.1  mrg %%EOF
   1757  1.1  mrg     }\endgroup
   1758  1.1  mrg   \expandafter\edef\csname cmapOT1TT\endcsname#1{%
   1759  1.1  mrg     \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
   1760  1.1  mrg   }%
   1761  1.1  mrg \fi\fi
   1762  1.1  mrg 
   1763  1.1  mrg 
   1764  1.1  mrg % Set the font macro #1 to the font named #2, adding on the
   1765  1.1  mrg % specified font prefix (normally `cm').
   1766  1.1  mrg % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
   1767  1.1  mrg % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
   1768  1.1  mrg % empty to omit).
   1769  1.1  mrg \def\setfont#1#2#3#4#5{%
   1770  1.1  mrg   \font#1=\fontprefix#2#3 scaled #4
   1771  1.1  mrg   \csname cmap#5\endcsname#1%
   1772  1.1  mrg }
   1773  1.1  mrg % This is what gets called when #5 of \setfont is empty.
   1774  1.1  mrg \let\cmap\gobble
   1775  1.1  mrg % emacs-page end of cmaps
   1776  1.1  mrg 
   1777  1.1  mrg % Use cm as the default font prefix.
   1778  1.1  mrg % To specify the font prefix, you must define \fontprefix
   1779  1.1  mrg % before you read in texinfo.tex.
   1780  1.1  mrg \ifx\fontprefix\thisisundefined
   1781  1.1  mrg \def\fontprefix{cm}
   1782  1.1  mrg \fi
   1783  1.1  mrg % Support font families that don't use the same naming scheme as CM.
   1784  1.1  mrg \def\rmshape{r}
   1785  1.1  mrg \def\rmbshape{bx}               %where the normal face is bold
   1786  1.1  mrg \def\bfshape{b}
   1787  1.1  mrg \def\bxshape{bx}
   1788  1.1  mrg \def\ttshape{tt}
   1789  1.1  mrg \def\ttbshape{tt}
   1790  1.1  mrg \def\ttslshape{sltt}
   1791  1.1  mrg \def\itshape{ti}
   1792  1.1  mrg \def\itbshape{bxti}
   1793  1.1  mrg \def\slshape{sl}
   1794  1.1  mrg \def\slbshape{bxsl}
   1795  1.1  mrg \def\sfshape{ss}
   1796  1.1  mrg \def\sfbshape{ss}
   1797  1.1  mrg \def\scshape{csc}
   1798  1.1  mrg \def\scbshape{csc}
   1799  1.1  mrg 
   1800  1.1  mrg % Definitions for a main text size of 11pt.  This is the default in
   1801  1.1  mrg % Texinfo.
   1802  1.1  mrg %
   1803  1.1  mrg \def\definetextfontsizexi{%
   1804  1.1  mrg % Text fonts (11.2pt, magstep1).
   1805  1.1  mrg \def\textnominalsize{11pt}
   1806  1.1  mrg \edef\mainmagstep{\magstephalf}
   1807  1.1  mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
   1808  1.1  mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
   1809  1.1  mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
   1810  1.1  mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
   1811  1.1  mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
   1812  1.1  mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
   1813  1.1  mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
   1814  1.1  mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
   1815  1.1  mrg \font\texti=cmmi10 scaled \mainmagstep
   1816  1.1  mrg \font\textsy=cmsy10 scaled \mainmagstep
   1817  1.1  mrg \def\textecsize{1095}
   1818  1.1  mrg 
   1819  1.1  mrg % A few fonts for @defun names and args.
   1820  1.1  mrg \setfont\defbf\bfshape{10}{\magstep1}{OT1}
   1821  1.1  mrg \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
   1822  1.1  mrg \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
   1823  1.1  mrg \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
   1824  1.1  mrg 
   1825  1.1  mrg % Fonts for indices, footnotes, small examples (9pt).
   1826  1.1  mrg \def\smallnominalsize{9pt}
   1827  1.1  mrg \setfont\smallrm\rmshape{9}{1000}{OT1}
   1828  1.1  mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT}
   1829  1.1  mrg \setfont\smallbf\bfshape{10}{900}{OT1}
   1830  1.1  mrg \setfont\smallit\itshape{9}{1000}{OT1IT}
   1831  1.1  mrg \setfont\smallsl\slshape{9}{1000}{OT1}
   1832  1.1  mrg \setfont\smallsf\sfshape{9}{1000}{OT1}
   1833  1.1  mrg \setfont\smallsc\scshape{10}{900}{OT1}
   1834  1.1  mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
   1835  1.1  mrg \font\smalli=cmmi9
   1836  1.1  mrg \font\smallsy=cmsy9
   1837  1.1  mrg \def\smallecsize{0900}
   1838  1.1  mrg 
   1839  1.1  mrg % Fonts for small examples (8pt).
   1840  1.1  mrg \def\smallernominalsize{8pt}
   1841  1.1  mrg \setfont\smallerrm\rmshape{8}{1000}{OT1}
   1842  1.1  mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT}
   1843  1.1  mrg \setfont\smallerbf\bfshape{10}{800}{OT1}
   1844  1.1  mrg \setfont\smallerit\itshape{8}{1000}{OT1IT}
   1845  1.1  mrg \setfont\smallersl\slshape{8}{1000}{OT1}
   1846  1.1  mrg \setfont\smallersf\sfshape{8}{1000}{OT1}
   1847  1.1  mrg \setfont\smallersc\scshape{10}{800}{OT1}
   1848  1.1  mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
   1849  1.1  mrg \font\smalleri=cmmi8
   1850  1.1  mrg \font\smallersy=cmsy8
   1851  1.1  mrg \def\smallerecsize{0800}
   1852  1.1  mrg 
   1853  1.1  mrg % Fonts for title page (20.4pt):
   1854  1.1  mrg \def\titlenominalsize{20pt}
   1855  1.1  mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
   1856  1.1  mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
   1857  1.1  mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
   1858  1.1  mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
   1859  1.1  mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
   1860  1.1  mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
   1861  1.1  mrg \let\titlebf=\titlerm
   1862  1.1  mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
   1863  1.1  mrg \font\titlei=cmmi12 scaled \magstep3
   1864  1.1  mrg \font\titlesy=cmsy10 scaled \magstep4
   1865  1.1  mrg \def\titleecsize{2074}
   1866  1.1  mrg 
   1867  1.1  mrg % Chapter (and unnumbered) fonts (17.28pt).
   1868  1.1  mrg \def\chapnominalsize{17pt}
   1869  1.1  mrg \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
   1870  1.1  mrg \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
   1871  1.1  mrg \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
   1872  1.1  mrg \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
   1873  1.1  mrg \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
   1874  1.1  mrg \setfont\chapsf\sfbshape{17}{1000}{OT1}
   1875  1.1  mrg \let\chapbf=\chaprm
   1876  1.1  mrg \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
   1877  1.1  mrg \font\chapi=cmmi12 scaled \magstep2
   1878  1.1  mrg \font\chapsy=cmsy10 scaled \magstep3
   1879  1.1  mrg \def\chapecsize{1728}
   1880  1.1  mrg 
   1881  1.1  mrg % Section fonts (14.4pt).
   1882  1.1  mrg \def\secnominalsize{14pt}
   1883  1.1  mrg \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
   1884  1.1  mrg \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
   1885  1.1  mrg \setfont\secsl\slbshape{10}{\magstep2}{OT1}
   1886  1.1  mrg \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
   1887  1.1  mrg \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
   1888  1.1  mrg \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
   1889  1.1  mrg \let\secbf\secrm
   1890  1.1  mrg \setfont\secsc\scbshape{10}{\magstep2}{OT1}
   1891  1.1  mrg \font\seci=cmmi12 scaled \magstep1
   1892  1.1  mrg \font\secsy=cmsy10 scaled \magstep2
   1893  1.1  mrg \def\sececsize{1440}
   1894  1.1  mrg 
   1895  1.1  mrg % Subsection fonts (13.15pt).
   1896  1.1  mrg \def\ssecnominalsize{13pt}
   1897  1.1  mrg \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
   1898  1.1  mrg \setfont\ssecit\itbshape{10}{1315}{OT1IT}
   1899  1.1  mrg \setfont\ssecsl\slbshape{10}{1315}{OT1}
   1900  1.1  mrg \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
   1901  1.1  mrg \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
   1902  1.1  mrg \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
   1903  1.1  mrg \let\ssecbf\ssecrm
   1904  1.1  mrg \setfont\ssecsc\scbshape{10}{1315}{OT1}
   1905  1.1  mrg \font\sseci=cmmi12 scaled \magstephalf
   1906  1.1  mrg \font\ssecsy=cmsy10 scaled 1315
   1907  1.1  mrg \def\ssececsize{1200}
   1908  1.1  mrg 
   1909  1.1  mrg % Reduced fonts for @acro in text (10pt).
   1910  1.1  mrg \def\reducednominalsize{10pt}
   1911  1.1  mrg \setfont\reducedrm\rmshape{10}{1000}{OT1}
   1912  1.1  mrg \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
   1913  1.1  mrg \setfont\reducedbf\bfshape{10}{1000}{OT1}
   1914  1.1  mrg \setfont\reducedit\itshape{10}{1000}{OT1IT}
   1915  1.1  mrg \setfont\reducedsl\slshape{10}{1000}{OT1}
   1916  1.1  mrg \setfont\reducedsf\sfshape{10}{1000}{OT1}
   1917  1.1  mrg \setfont\reducedsc\scshape{10}{1000}{OT1}
   1918  1.1  mrg \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
   1919  1.1  mrg \font\reducedi=cmmi10
   1920  1.1  mrg \font\reducedsy=cmsy10
   1921  1.1  mrg \def\reducedecsize{1000}
   1922  1.1  mrg 
   1923  1.1  mrg \textleading = 13.2pt % line spacing for 11pt CM
   1924  1.1  mrg \textfonts            % reset the current fonts
   1925  1.1  mrg \rm
   1926  1.1  mrg } % end of 11pt text font size definitions
   1927  1.1  mrg 
   1928  1.1  mrg 
   1929  1.1  mrg % Definitions to make the main text be 10pt Computer Modern, with
   1930  1.1  mrg % section, chapter, etc., sizes following suit.  This is for the GNU
   1931  1.1  mrg % Press printing of the Emacs 22 manual.  Maybe other manuals in the
   1932  1.1  mrg % future.  Used with @smallbook, which sets the leading to 12pt.
   1933  1.1  mrg %
   1934  1.1  mrg \def\definetextfontsizex{%
   1935  1.1  mrg % Text fonts (10pt).
   1936  1.1  mrg \def\textnominalsize{10pt}
   1937  1.1  mrg \edef\mainmagstep{1000}
   1938  1.1  mrg \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
   1939  1.1  mrg \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
   1940  1.1  mrg \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
   1941  1.1  mrg \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
   1942  1.1  mrg \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
   1943  1.1  mrg \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
   1944  1.1  mrg \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
   1945  1.1  mrg \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
   1946  1.1  mrg \font\texti=cmmi10 scaled \mainmagstep
   1947  1.1  mrg \font\textsy=cmsy10 scaled \mainmagstep
   1948  1.1  mrg \def\textecsize{1000}
   1949  1.1  mrg 
   1950  1.1  mrg % A few fonts for @defun names and args.
   1951  1.1  mrg \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
   1952  1.1  mrg \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
   1953  1.1  mrg \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
   1954  1.1  mrg \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
   1955  1.1  mrg 
   1956  1.1  mrg % Fonts for indices, footnotes, small examples (9pt).
   1957  1.1  mrg \def\smallnominalsize{9pt}
   1958  1.1  mrg \setfont\smallrm\rmshape{9}{1000}{OT1}
   1959  1.1  mrg \setfont\smalltt\ttshape{9}{1000}{OT1TT}
   1960  1.1  mrg \setfont\smallbf\bfshape{10}{900}{OT1}
   1961  1.1  mrg \setfont\smallit\itshape{9}{1000}{OT1IT}
   1962  1.1  mrg \setfont\smallsl\slshape{9}{1000}{OT1}
   1963  1.1  mrg \setfont\smallsf\sfshape{9}{1000}{OT1}
   1964  1.1  mrg \setfont\smallsc\scshape{10}{900}{OT1}
   1965  1.1  mrg \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
   1966  1.1  mrg \font\smalli=cmmi9
   1967  1.1  mrg \font\smallsy=cmsy9
   1968  1.1  mrg \def\smallecsize{0900}
   1969  1.1  mrg 
   1970  1.1  mrg % Fonts for small examples (8pt).
   1971  1.1  mrg \def\smallernominalsize{8pt}
   1972  1.1  mrg \setfont\smallerrm\rmshape{8}{1000}{OT1}
   1973  1.1  mrg \setfont\smallertt\ttshape{8}{1000}{OT1TT}
   1974  1.1  mrg \setfont\smallerbf\bfshape{10}{800}{OT1}
   1975  1.1  mrg \setfont\smallerit\itshape{8}{1000}{OT1IT}
   1976  1.1  mrg \setfont\smallersl\slshape{8}{1000}{OT1}
   1977  1.1  mrg \setfont\smallersf\sfshape{8}{1000}{OT1}
   1978  1.1  mrg \setfont\smallersc\scshape{10}{800}{OT1}
   1979  1.1  mrg \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
   1980  1.1  mrg \font\smalleri=cmmi8
   1981  1.1  mrg \font\smallersy=cmsy8
   1982  1.1  mrg \def\smallerecsize{0800}
   1983  1.1  mrg 
   1984  1.1  mrg % Fonts for title page (20.4pt):
   1985  1.1  mrg \def\titlenominalsize{20pt}
   1986  1.1  mrg \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
   1987  1.1  mrg \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
   1988  1.1  mrg \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
   1989  1.1  mrg \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
   1990  1.1  mrg \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
   1991  1.1  mrg \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
   1992  1.1  mrg \let\titlebf=\titlerm
   1993  1.1  mrg \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
   1994  1.1  mrg \font\titlei=cmmi12 scaled \magstep3
   1995  1.1  mrg \font\titlesy=cmsy10 scaled \magstep4
   1996  1.1  mrg \def\titleecsize{2074}
   1997  1.1  mrg 
   1998  1.1  mrg % Chapter fonts (14.4pt).
   1999  1.1  mrg \def\chapnominalsize{14pt}
   2000  1.1  mrg \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
   2001  1.1  mrg \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
   2002  1.1  mrg \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
   2003  1.1  mrg \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
   2004  1.1  mrg \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
   2005  1.1  mrg \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
   2006  1.1  mrg \let\chapbf\chaprm
   2007  1.1  mrg \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
   2008  1.1  mrg \font\chapi=cmmi12 scaled \magstep1
   2009  1.1  mrg \font\chapsy=cmsy10 scaled \magstep2
   2010  1.1  mrg \def\chapecsize{1440}
   2011  1.1  mrg 
   2012  1.1  mrg % Section fonts (12pt).
   2013  1.1  mrg \def\secnominalsize{12pt}
   2014  1.1  mrg \setfont\secrm\rmbshape{12}{1000}{OT1}
   2015  1.1  mrg \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
   2016  1.1  mrg \setfont\secsl\slbshape{10}{\magstep1}{OT1}
   2017  1.1  mrg \setfont\sectt\ttbshape{12}{1000}{OT1TT}
   2018  1.1  mrg \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
   2019  1.1  mrg \setfont\secsf\sfbshape{12}{1000}{OT1}
   2020  1.1  mrg \let\secbf\secrm
   2021  1.1  mrg \setfont\secsc\scbshape{10}{\magstep1}{OT1}
   2022  1.1  mrg \font\seci=cmmi12
   2023  1.1  mrg \font\secsy=cmsy10 scaled \magstep1
   2024  1.1  mrg \def\sececsize{1200}
   2025  1.1  mrg 
   2026  1.1  mrg % Subsection fonts (10pt).
   2027  1.1  mrg \def\ssecnominalsize{10pt}
   2028  1.1  mrg \setfont\ssecrm\rmbshape{10}{1000}{OT1}
   2029  1.1  mrg \setfont\ssecit\itbshape{10}{1000}{OT1IT}
   2030  1.1  mrg \setfont\ssecsl\slbshape{10}{1000}{OT1}
   2031  1.1  mrg \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
   2032  1.1  mrg \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
   2033  1.1  mrg \setfont\ssecsf\sfbshape{10}{1000}{OT1}
   2034  1.1  mrg \let\ssecbf\ssecrm
   2035  1.1  mrg \setfont\ssecsc\scbshape{10}{1000}{OT1}
   2036  1.1  mrg \font\sseci=cmmi10
   2037  1.1  mrg \font\ssecsy=cmsy10
   2038  1.1  mrg \def\ssececsize{1000}
   2039  1.1  mrg 
   2040  1.1  mrg % Reduced fonts for @acro in text (9pt).
   2041  1.1  mrg \def\reducednominalsize{9pt}
   2042  1.1  mrg \setfont\reducedrm\rmshape{9}{1000}{OT1}
   2043  1.1  mrg \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
   2044  1.1  mrg \setfont\reducedbf\bfshape{10}{900}{OT1}
   2045  1.1  mrg \setfont\reducedit\itshape{9}{1000}{OT1IT}
   2046  1.1  mrg \setfont\reducedsl\slshape{9}{1000}{OT1}
   2047  1.1  mrg \setfont\reducedsf\sfshape{9}{1000}{OT1}
   2048  1.1  mrg \setfont\reducedsc\scshape{10}{900}{OT1}
   2049  1.1  mrg \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
   2050  1.1  mrg \font\reducedi=cmmi9
   2051  1.1  mrg \font\reducedsy=cmsy9
   2052  1.1  mrg \def\reducedecsize{0900}
   2053  1.1  mrg 
   2054  1.1  mrg \divide\parskip by 2  % reduce space between paragraphs
   2055  1.1  mrg \textleading = 12pt   % line spacing for 10pt CM
   2056  1.1  mrg \textfonts            % reset the current fonts
   2057  1.1  mrg \rm
   2058  1.1  mrg } % end of 10pt text font size definitions
   2059  1.1  mrg 
   2060  1.1  mrg 
   2061  1.1  mrg % We provide the user-level command
   2062  1.1  mrg %   @fonttextsize 10
   2063  1.1  mrg % (or 11) to redefine the text font size.  pt is assumed.
   2064  1.1  mrg %
   2065  1.1  mrg \def\xiword{11}
   2066  1.1  mrg \def\xword{10}
   2067  1.1  mrg \def\xwordpt{10pt}
   2068  1.1  mrg %
   2069  1.1  mrg \parseargdef\fonttextsize{%
   2070  1.1  mrg   \def\textsizearg{#1}%
   2071  1.1  mrg   %\wlog{doing @fonttextsize \textsizearg}%
   2072  1.1  mrg   %
   2073  1.1  mrg   % Set \globaldefs so that documents can use this inside @tex, since
   2074  1.1  mrg   % makeinfo 4.8 does not support it, but we need it nonetheless.
   2075  1.1  mrg   %
   2076  1.1  mrg  \begingroup \globaldefs=1
   2077  1.1  mrg   \ifx\textsizearg\xword \definetextfontsizex
   2078  1.1  mrg   \else \ifx\textsizearg\xiword \definetextfontsizexi
   2079  1.1  mrg   \else
   2080  1.1  mrg     \errhelp=\EMsimple
   2081  1.1  mrg     \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
   2082  1.1  mrg   \fi\fi
   2083  1.1  mrg  \endgroup
   2084  1.1  mrg }
   2085  1.1  mrg 
   2086  1.1  mrg 
   2087  1.1  mrg % In order for the font changes to affect most math symbols and letters,
   2088  1.1  mrg % we have to define the \textfont of the standard families.  Since
   2089  1.1  mrg % texinfo doesn't allow for producing subscripts and superscripts except
   2090  1.1  mrg % in the main text, we don't bother to reset \scriptfont and
   2091  1.1  mrg % \scriptscriptfont (which would also require loading a lot more fonts).
   2092  1.1  mrg %
   2093  1.1  mrg \def\resetmathfonts{%
   2094  1.1  mrg   \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
   2095  1.1  mrg   \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
   2096  1.1  mrg   \textfont\ttfam=\tentt \textfont\sffam=\tensf
   2097  1.1  mrg }
   2098  1.1  mrg 
   2099  1.1  mrg % The font-changing commands redefine the meanings of \tenSTYLE, instead
   2100  1.1  mrg % of just \STYLE.  We do this because \STYLE needs to also set the
   2101  1.1  mrg % current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
   2102  1.1  mrg % \tenSTYLE to set the current font.
   2103  1.1  mrg %
   2104  1.1  mrg % Each font-changing command also sets the names \lsize (one size lower)
   2105  1.1  mrg % and \lllsize (three sizes lower).  These relative commands are used in
   2106  1.1  mrg % the LaTeX logo and acronyms.
   2107  1.1  mrg %
   2108  1.1  mrg % This all needs generalizing, badly.
   2109  1.1  mrg %
   2110  1.1  mrg \def\textfonts{%
   2111  1.1  mrg   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
   2112  1.1  mrg   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
   2113  1.1  mrg   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
   2114  1.1  mrg   \let\tenttsl=\textttsl
   2115  1.1  mrg   \def\curfontsize{text}%
   2116  1.1  mrg   \def\lsize{reduced}\def\lllsize{smaller}%
   2117  1.1  mrg   \resetmathfonts \setleading{\textleading}}
   2118  1.1  mrg \def\titlefonts{%
   2119  1.1  mrg   \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
   2120  1.1  mrg   \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
   2121  1.1  mrg   \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
   2122  1.1  mrg   \let\tenttsl=\titlettsl
   2123  1.1  mrg   \def\curfontsize{title}%
   2124  1.1  mrg   \def\lsize{chap}\def\lllsize{subsec}%
   2125  1.1  mrg   \resetmathfonts \setleading{27pt}}
   2126  1.1  mrg \def\titlefont#1{{\titlefonts\rmisbold #1}}
   2127  1.1  mrg \def\chapfonts{%
   2128  1.1  mrg   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
   2129  1.1  mrg   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
   2130  1.1  mrg   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
   2131  1.1  mrg   \let\tenttsl=\chapttsl
   2132  1.1  mrg   \def\curfontsize{chap}%
   2133  1.1  mrg   \def\lsize{sec}\def\lllsize{text}%
   2134  1.1  mrg   \resetmathfonts \setleading{19pt}}
   2135  1.1  mrg \def\secfonts{%
   2136  1.1  mrg   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
   2137  1.1  mrg   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
   2138  1.1  mrg   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
   2139  1.1  mrg   \let\tenttsl=\secttsl
   2140  1.1  mrg   \def\curfontsize{sec}%
   2141  1.1  mrg   \def\lsize{subsec}\def\lllsize{reduced}%
   2142  1.1  mrg   \resetmathfonts \setleading{16pt}}
   2143  1.1  mrg \def\subsecfonts{%
   2144  1.1  mrg   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
   2145  1.1  mrg   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
   2146  1.1  mrg   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
   2147  1.1  mrg   \let\tenttsl=\ssecttsl
   2148  1.1  mrg   \def\curfontsize{ssec}%
   2149  1.1  mrg   \def\lsize{text}\def\lllsize{small}%
   2150  1.1  mrg   \resetmathfonts \setleading{15pt}}
   2151  1.1  mrg \let\subsubsecfonts = \subsecfonts
   2152  1.1  mrg \def\reducedfonts{%
   2153  1.1  mrg   \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
   2154  1.1  mrg   \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
   2155  1.1  mrg   \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
   2156  1.1  mrg   \let\tenttsl=\reducedttsl
   2157  1.1  mrg   \def\curfontsize{reduced}%
   2158  1.1  mrg   \def\lsize{small}\def\lllsize{smaller}%
   2159  1.1  mrg   \resetmathfonts \setleading{10.5pt}}
   2160  1.1  mrg \def\smallfonts{%
   2161  1.1  mrg   \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
   2162  1.1  mrg   \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
   2163  1.1  mrg   \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
   2164  1.1  mrg   \let\tenttsl=\smallttsl
   2165  1.1  mrg   \def\curfontsize{small}%
   2166  1.1  mrg   \def\lsize{smaller}\def\lllsize{smaller}%
   2167  1.1  mrg   \resetmathfonts \setleading{10.5pt}}
   2168  1.1  mrg \def\smallerfonts{%
   2169  1.1  mrg   \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
   2170  1.1  mrg   \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
   2171  1.1  mrg   \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
   2172  1.1  mrg   \let\tenttsl=\smallerttsl
   2173  1.1  mrg   \def\curfontsize{smaller}%
   2174  1.1  mrg   \def\lsize{smaller}\def\lllsize{smaller}%
   2175  1.1  mrg   \resetmathfonts \setleading{9.5pt}}
   2176  1.1  mrg 
   2177  1.1  mrg % Fonts for short table of contents.
   2178  1.1  mrg \setfont\shortcontrm\rmshape{12}{1000}{OT1}
   2179  1.1  mrg \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
   2180  1.1  mrg \setfont\shortcontsl\slshape{12}{1000}{OT1}
   2181  1.1  mrg \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
   2182  1.1  mrg 
   2183  1.1  mrg % Define these just so they can be easily changed for other fonts.
   2184  1.1  mrg \def\angleleft{$\langle$}
   2185  1.1  mrg \def\angleright{$\rangle$}
   2186  1.1  mrg 
   2187  1.1  mrg % Set the fonts to use with the @small... environments.
   2188  1.1  mrg \let\smallexamplefonts = \smallfonts
   2189  1.1  mrg 
   2190  1.1  mrg % About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
   2191  1.1  mrg % can fit this many characters:
   2192  1.1  mrg %   8.5x11=86   smallbook=72  a4=90  a5=69
   2193  1.1  mrg % If we use \scriptfonts (8pt), then we can fit this many characters:
   2194  1.1  mrg %   8.5x11=90+  smallbook=80  a4=90+  a5=77
   2195  1.1  mrg % For me, subjectively, the few extra characters that fit aren't worth
   2196  1.1  mrg % the additional smallness of 8pt.  So I'm making the default 9pt.
   2197  1.1  mrg %
   2198  1.1  mrg % By the way, for comparison, here's what fits with @example (10pt):
   2199  1.1  mrg %   8.5x11=71  smallbook=60  a4=75  a5=58
   2200  1.1  mrg % --karl, 24jan03.
   2201  1.1  mrg 
   2202  1.1  mrg % Set up the default fonts, so we can use them for creating boxes.
   2203  1.1  mrg %
   2204  1.1  mrg \definetextfontsizexi
   2205  1.1  mrg 
   2206  1.1  mrg 
   2207  1.1  mrg \message{markup,}
   2208  1.1  mrg 
   2209  1.1  mrg % Check if we are currently using a typewriter font.  Since all the
   2210  1.1  mrg % Computer Modern typewriter fonts have zero interword stretch (and
   2211  1.1  mrg % shrink), and it is reasonable to expect all typewriter fonts to have
   2212  1.1  mrg % this property, we can check that font parameter.
   2213  1.1  mrg %
   2214  1.1  mrg \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
   2215  1.1  mrg 
   2216  1.1  mrg % Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
   2217  1.1  mrg % define and register \INITMACRO to be called on markup style changes.
   2218  1.1  mrg % \INITMACRO can check \currentmarkupstyle for the innermost
   2219  1.1  mrg % style and the set of \ifmarkupSTYLE switches for all styles
   2220  1.1  mrg % currently in effect.
   2221  1.1  mrg \newif\ifmarkupvar
   2222  1.1  mrg \newif\ifmarkupsamp
   2223  1.1  mrg \newif\ifmarkupkey
   2224  1.1  mrg %\newif\ifmarkupfile % @file == @samp.
   2225  1.1  mrg %\newif\ifmarkupoption % @option == @samp.
   2226  1.1  mrg \newif\ifmarkupcode
   2227  1.1  mrg \newif\ifmarkupkbd
   2228  1.1  mrg %\newif\ifmarkupenv % @env == @code.
   2229  1.1  mrg %\newif\ifmarkupcommand % @command == @code.
   2230  1.1  mrg \newif\ifmarkuptex % @tex (and part of @math, for now).
   2231  1.1  mrg \newif\ifmarkupexample
   2232  1.1  mrg \newif\ifmarkupverb
   2233  1.1  mrg \newif\ifmarkupverbatim
   2234  1.1  mrg 
   2235  1.1  mrg \let\currentmarkupstyle\empty
   2236  1.1  mrg 
   2237  1.1  mrg \def\setupmarkupstyle#1{%
   2238  1.1  mrg   \csname markup#1true\endcsname
   2239  1.1  mrg   \def\currentmarkupstyle{#1}%
   2240  1.1  mrg   \markupstylesetup
   2241  1.1  mrg }
   2242  1.1  mrg 
   2243  1.1  mrg \let\markupstylesetup\empty
   2244  1.1  mrg 
   2245  1.1  mrg \def\defmarkupstylesetup#1{%
   2246  1.1  mrg   \expandafter\def\expandafter\markupstylesetup
   2247  1.1  mrg     \expandafter{\markupstylesetup #1}%
   2248  1.1  mrg   \def#1%
   2249  1.1  mrg }
   2250  1.1  mrg 
   2251  1.1  mrg % Markup style setup for left and right quotes.
   2252  1.1  mrg \defmarkupstylesetup\markupsetuplq{%
   2253  1.1  mrg   \expandafter\let\expandafter \temp
   2254  1.1  mrg     \csname markupsetuplq\currentmarkupstyle\endcsname
   2255  1.1  mrg   \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
   2256  1.1  mrg }
   2257  1.1  mrg 
   2258  1.1  mrg \defmarkupstylesetup\markupsetuprq{%
   2259  1.1  mrg   \expandafter\let\expandafter \temp
   2260  1.1  mrg     \csname markupsetuprq\currentmarkupstyle\endcsname
   2261  1.1  mrg   \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
   2262  1.1  mrg }
   2263  1.1  mrg 
   2264  1.1  mrg {
   2265  1.1  mrg \catcode`\'=\active
   2266  1.1  mrg \catcode`\`=\active
   2267  1.1  mrg 
   2268  1.1  mrg \gdef\markupsetuplqdefault{\let`\lq}
   2269  1.1  mrg \gdef\markupsetuprqdefault{\let'\rq}
   2270  1.1  mrg 
   2271  1.1  mrg \gdef\markupsetcodequoteleft{\let`\codequoteleft}
   2272  1.1  mrg \gdef\markupsetcodequoteright{\let'\codequoteright}
   2273  1.1  mrg 
   2274  1.1  mrg \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
   2275  1.1  mrg }
   2276  1.1  mrg 
   2277  1.1  mrg \let\markupsetuplqcode \markupsetcodequoteleft
   2278  1.1  mrg \let\markupsetuprqcode \markupsetcodequoteright
   2279  1.1  mrg %
   2280  1.1  mrg \let\markupsetuplqexample \markupsetcodequoteleft
   2281  1.1  mrg \let\markupsetuprqexample \markupsetcodequoteright
   2282  1.1  mrg %
   2283  1.1  mrg \let\markupsetuplqsamp \markupsetcodequoteleft
   2284  1.1  mrg \let\markupsetuprqsamp \markupsetcodequoteright
   2285  1.1  mrg %
   2286  1.1  mrg \let\markupsetuplqverb \markupsetcodequoteleft
   2287  1.1  mrg \let\markupsetuprqverb \markupsetcodequoteright
   2288  1.1  mrg %
   2289  1.1  mrg \let\markupsetuplqverbatim \markupsetcodequoteleft
   2290  1.1  mrg \let\markupsetuprqverbatim \markupsetcodequoteright
   2291  1.1  mrg 
   2292  1.1  mrg \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
   2293  1.1  mrg 
   2294  1.1  mrg % Allow an option to not use regular directed right quote/apostrophe
   2295  1.1  mrg % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
   2296  1.1  mrg % The undirected quote is ugly, so don't make it the default, but it
   2297  1.1  mrg % works for pasting with more pdf viewers (at least evince), the
   2298  1.1  mrg % lilypond developers report.  xpdf does work with the regular 0x27.
   2299  1.1  mrg %
   2300  1.1  mrg \def\codequoteright{%
   2301  1.1  mrg   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
   2302  1.1  mrg     \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
   2303  1.1  mrg       '%
   2304  1.1  mrg     \else \char'15 \fi
   2305  1.1  mrg   \else \char'15 \fi
   2306  1.1  mrg }
   2307  1.1  mrg %
   2308  1.1  mrg % and a similar option for the left quote char vs. a grave accent.
   2309  1.1  mrg % Modern fonts display ASCII 0x60 as a grave accent, so some people like
   2310  1.1  mrg % the code environments to do likewise.
   2311  1.1  mrg %
   2312  1.1  mrg \def\codequoteleft{%
   2313  1.1  mrg   \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
   2314  1.1  mrg     \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
   2315  1.1  mrg       % [Knuth] pp. 380,381,391
   2316  1.1  mrg       % \relax disables Spanish ligatures ?` and !` of \tt font.
   2317  1.1  mrg       \relax`%
   2318  1.1  mrg     \else \char'22 \fi
   2319  1.1  mrg   \else \char'22 \fi
   2320  1.1  mrg }
   2321  1.1  mrg 
   2322  1.1  mrg % Commands to set the quote options.
   2323  1.1  mrg % 
   2324  1.1  mrg \parseargdef\codequoteundirected{%
   2325  1.1  mrg   \def\temp{#1}%
   2326  1.1  mrg   \ifx\temp\onword
   2327  1.1  mrg     \expandafter\let\csname SETtxicodequoteundirected\endcsname
   2328  1.1  mrg       = t%
   2329  1.1  mrg   \else\ifx\temp\offword
   2330  1.1  mrg     \expandafter\let\csname SETtxicodequoteundirected\endcsname
   2331  1.1  mrg       = \relax
   2332  1.1  mrg   \else
   2333  1.1  mrg     \errhelp = \EMsimple
   2334  1.1  mrg     \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
   2335  1.1  mrg   \fi\fi
   2336  1.1  mrg }
   2337  1.1  mrg %
   2338  1.1  mrg \parseargdef\codequotebacktick{%
   2339  1.1  mrg   \def\temp{#1}%
   2340  1.1  mrg   \ifx\temp\onword
   2341  1.1  mrg     \expandafter\let\csname SETtxicodequotebacktick\endcsname
   2342  1.1  mrg       = t%
   2343  1.1  mrg   \else\ifx\temp\offword
   2344  1.1  mrg     \expandafter\let\csname SETtxicodequotebacktick\endcsname
   2345  1.1  mrg       = \relax
   2346  1.1  mrg   \else
   2347  1.1  mrg     \errhelp = \EMsimple
   2348  1.1  mrg     \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
   2349  1.1  mrg   \fi\fi
   2350  1.1  mrg }
   2351  1.1  mrg 
   2352  1.1  mrg % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
   2353  1.1  mrg \def\noligaturesquoteleft{\relax\lq}
   2354  1.1  mrg 
   2355  1.1  mrg % Count depth in font-changes, for error checks
   2356  1.1  mrg \newcount\fontdepth \fontdepth=0
   2357  1.1  mrg 
   2358  1.1  mrg % Font commands.
   2359  1.1  mrg 
   2360  1.1  mrg % #1 is the font command (\sl or \it), #2 is the text to slant.
   2361  1.1  mrg % If we are in a monospaced environment, however, 1) always use \ttsl,
   2362  1.1  mrg % and 2) do not add an italic correction.
   2363  1.1  mrg \def\dosmartslant#1#2{%
   2364  1.1  mrg   \ifusingtt 
   2365  1.1  mrg     {{\ttsl #2}\let\next=\relax}%
   2366  1.1  mrg     {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
   2367  1.1  mrg   \next
   2368  1.1  mrg }
   2369  1.1  mrg \def\smartslanted{\dosmartslant\sl}
   2370  1.1  mrg \def\smartitalic{\dosmartslant\it}
   2371  1.1  mrg 
   2372  1.1  mrg % Output an italic correction unless \next (presumed to be the following
   2373  1.1  mrg % character) is such as not to need one.
   2374  1.1  mrg \def\smartitaliccorrection{%
   2375  1.1  mrg   \ifx\next,%
   2376  1.1  mrg   \else\ifx\next-%
   2377  1.1  mrg   \else\ifx\next.%
   2378  1.1  mrg   \else\ptexslash
   2379  1.1  mrg   \fi\fi\fi
   2380  1.1  mrg   \aftersmartic
   2381  1.1  mrg }
   2382  1.1  mrg 
   2383  1.1  mrg % like \smartslanted except unconditionally uses \ttsl, and no ic.
   2384  1.1  mrg % @var is set to this for defun arguments.
   2385  1.1  mrg \def\ttslanted#1{{\ttsl #1}}
   2386  1.1  mrg 
   2387  1.1  mrg % @cite is like \smartslanted except unconditionally use \sl.  We never want
   2388  1.1  mrg % ttsl for book titles, do we?
   2389  1.1  mrg \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
   2390  1.1  mrg 
   2391  1.1  mrg \def\aftersmartic{}
   2392  1.1  mrg \def\var#1{%
   2393  1.1  mrg   \let\saveaftersmartic = \aftersmartic
   2394  1.1  mrg   \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
   2395  1.1  mrg   \smartslanted{#1}%
   2396  1.1  mrg }
   2397  1.1  mrg 
   2398  1.1  mrg \let\i=\smartitalic
   2399  1.1  mrg \let\slanted=\smartslanted
   2400  1.1  mrg \let\dfn=\smartslanted
   2401  1.1  mrg \let\emph=\smartitalic
   2402  1.1  mrg 
   2403  1.1  mrg % Explicit font changes: @r, @sc, undocumented @ii.
   2404  1.1  mrg \def\r#1{{\rm #1}}              % roman font
   2405  1.1  mrg \def\sc#1{{\smallcaps#1}}       % smallcaps font
   2406  1.1  mrg \def\ii#1{{\it #1}}             % italic font
   2407  1.1  mrg 
   2408  1.1  mrg % @b, explicit bold.  Also @strong.
   2409  1.1  mrg \def\b#1{{\bf #1}}
   2410  1.1  mrg \let\strong=\b
   2411  1.1  mrg 
   2412  1.1  mrg % @sansserif, explicit sans.
   2413  1.1  mrg \def\sansserif#1{{\sf #1}}
   2414  1.1  mrg 
   2415  1.1  mrg % We can't just use \exhyphenpenalty, because that only has effect at
   2416  1.1  mrg % the end of a paragraph.  Restore normal hyphenation at the end of the
   2417  1.1  mrg % group within which \nohyphenation is presumably called.
   2418  1.1  mrg %
   2419  1.1  mrg \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
   2420  1.1  mrg \def\restorehyphenation{\hyphenchar\font = `- }
   2421  1.1  mrg 
   2422  1.1  mrg % Set sfcode to normal for the chars that usually have another value.
   2423  1.1  mrg % Can't use plain's \frenchspacing because it uses the `\x notation, and
   2424  1.1  mrg % sometimes \x has an active definition that messes things up.
   2425  1.1  mrg %
   2426  1.1  mrg \catcode`@=11
   2427  1.1  mrg   \def\plainfrenchspacing{%
   2428  1.1  mrg     \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
   2429  1.1  mrg     \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
   2430  1.1  mrg     \def\endofsentencespacefactor{1000}% for @. and friends
   2431  1.1  mrg   }
   2432  1.1  mrg   \def\plainnonfrenchspacing{%
   2433  1.1  mrg     \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
   2434  1.1  mrg     \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
   2435  1.1  mrg     \def\endofsentencespacefactor{3000}% for @. and friends
   2436  1.1  mrg   }
   2437  1.1  mrg \catcode`@=\other
   2438  1.1  mrg \def\endofsentencespacefactor{3000}% default
   2439  1.1  mrg 
   2440  1.1  mrg % @t, explicit typewriter.
   2441  1.1  mrg \def\t#1{%
   2442  1.1  mrg   {\tt \rawbackslash \plainfrenchspacing #1}%
   2443  1.1  mrg   \null
   2444  1.1  mrg }
   2445  1.1  mrg 
   2446  1.1  mrg % @samp.
   2447  1.1  mrg \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
   2448  1.1  mrg 
   2449  1.1  mrg % definition of @key that produces a lozenge.  Doesn't adjust to text size.
   2450  1.1  mrg %\setfont\keyrm\rmshape{8}{1000}{OT1}
   2451  1.1  mrg %\font\keysy=cmsy9
   2452  1.1  mrg %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
   2453  1.1  mrg %  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
   2454  1.1  mrg %    \vbox{\hrule\kern-0.4pt
   2455  1.1  mrg %     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
   2456  1.1  mrg %    \kern-0.4pt\hrule}%
   2457  1.1  mrg %  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
   2458  1.1  mrg 
   2459  1.1  mrg % definition of @key with no lozenge.  If the current font is already
   2460  1.1  mrg % monospace, don't change it; that way, we respect @kbdinputstyle.  But
   2461  1.1  mrg % if it isn't monospace, then use \tt.
   2462  1.1  mrg %
   2463  1.1  mrg \def\key#1{{\setupmarkupstyle{key}%
   2464  1.1  mrg   \nohyphenation
   2465  1.1  mrg   \ifmonospace\else\tt\fi
   2466  1.1  mrg   #1}\null}
   2467  1.1  mrg 
   2468  1.1  mrg % ctrl is no longer a Texinfo command.
   2469  1.1  mrg \def\ctrl #1{{\tt \rawbackslash \hat}#1}
   2470  1.1  mrg 
   2471  1.1  mrg % @file, @option are the same as @samp.
   2472  1.1  mrg \let\file=\samp
   2473  1.1  mrg \let\option=\samp
   2474  1.1  mrg 
   2475  1.1  mrg % @code is a modification of @t,
   2476  1.1  mrg % which makes spaces the same size as normal in the surrounding text.
   2477  1.1  mrg \def\tclose#1{%
   2478  1.1  mrg   {%
   2479  1.1  mrg     % Change normal interword space to be same as for the current font.
   2480  1.1  mrg     \spaceskip = \fontdimen2\font
   2481  1.1  mrg     %
   2482  1.1  mrg     % Switch to typewriter.
   2483  1.1  mrg     \tt
   2484  1.1  mrg     %
   2485  1.1  mrg     % But `\ ' produces the large typewriter interword space.
   2486  1.1  mrg     \def\ {{\spaceskip = 0pt{} }}%
   2487  1.1  mrg     %
   2488  1.1  mrg     % Turn off hyphenation.
   2489  1.1  mrg     \nohyphenation
   2490  1.1  mrg     %
   2491  1.1  mrg     \rawbackslash
   2492  1.1  mrg     \plainfrenchspacing
   2493  1.1  mrg     #1%
   2494  1.1  mrg   }%
   2495  1.1  mrg   \null % reset spacefactor to 1000
   2496  1.1  mrg }
   2497  1.1  mrg 
   2498  1.1  mrg % We *must* turn on hyphenation at `-' and `_' in @code.
   2499  1.1  mrg % Otherwise, it is too hard to avoid overfull hboxes
   2500  1.1  mrg % in the Emacs manual, the Library manual, etc.
   2501  1.1  mrg 
   2502  1.1  mrg % Unfortunately, TeX uses one parameter (\hyphenchar) to control
   2503  1.1  mrg % both hyphenation at - and hyphenation within words.
   2504  1.1  mrg % We must therefore turn them both off (\tclose does that)
   2505  1.1  mrg % and arrange explicitly to hyphenate at a dash.
   2506  1.1  mrg %  -- rms.
   2507  1.1  mrg {
   2508  1.1  mrg   \catcode`\-=\active \catcode`\_=\active
   2509  1.1  mrg   \catcode`\'=\active \catcode`\`=\active
   2510  1.1  mrg   \global\let'=\rq \global\let`=\lq  % default definitions
   2511  1.1  mrg   %
   2512  1.1  mrg   \global\def\code{\begingroup
   2513  1.1  mrg     \setupmarkupstyle{code}%
   2514  1.1  mrg     % The following should really be moved into \setupmarkupstyle handlers.
   2515  1.1  mrg     \catcode\dashChar=\active  \catcode\underChar=\active
   2516  1.1  mrg     \ifallowcodebreaks
   2517  1.1  mrg      \let-\codedash
   2518  1.1  mrg      \let_\codeunder
   2519  1.1  mrg     \else
   2520  1.1  mrg      \let-\realdash
   2521  1.1  mrg      \let_\realunder
   2522  1.1  mrg     \fi
   2523  1.1  mrg     \codex
   2524  1.1  mrg   }
   2525  1.1  mrg }
   2526  1.1  mrg 
   2527  1.1  mrg \def\codex #1{\tclose{#1}\endgroup}
   2528  1.1  mrg 
   2529  1.1  mrg \def\realdash{-}
   2530  1.1  mrg \def\codedash{-\discretionary{}{}{}}
   2531  1.1  mrg \def\codeunder{%
   2532  1.1  mrg   % this is all so @math{@code{var_name}+1} can work.  In math mode, _
   2533  1.1  mrg   % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
   2534  1.1  mrg   % will therefore expand the active definition of _, which is us
   2535  1.1  mrg   % (inside @code that is), therefore an endless loop.
   2536  1.1  mrg   \ifusingtt{\ifmmode
   2537  1.1  mrg                \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
   2538  1.1  mrg              \else\normalunderscore \fi
   2539  1.1  mrg              \discretionary{}{}{}}%
   2540  1.1  mrg             {\_}%
   2541  1.1  mrg }
   2542  1.1  mrg 
   2543  1.1  mrg % An additional complication: the above will allow breaks after, e.g.,
   2544  1.1  mrg % each of the four underscores in __typeof__.  This is undesirable in
   2545  1.1  mrg % some manuals, especially if they don't have long identifiers in
   2546  1.1  mrg % general.  @allowcodebreaks provides a way to control this.
   2547  1.1  mrg %
   2548  1.1  mrg \newif\ifallowcodebreaks  \allowcodebreakstrue
   2549  1.1  mrg 
   2550  1.1  mrg \def\keywordtrue{true}
   2551  1.1  mrg \def\keywordfalse{false}
   2552  1.1  mrg 
   2553  1.1  mrg \parseargdef\allowcodebreaks{%
   2554  1.1  mrg   \def\txiarg{#1}%
   2555  1.1  mrg   \ifx\txiarg\keywordtrue
   2556  1.1  mrg     \allowcodebreakstrue
   2557  1.1  mrg   \else\ifx\txiarg\keywordfalse
   2558  1.1  mrg     \allowcodebreaksfalse
   2559  1.1  mrg   \else
   2560  1.1  mrg     \errhelp = \EMsimple
   2561  1.1  mrg     \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
   2562  1.1  mrg   \fi\fi
   2563  1.1  mrg }
   2564  1.1  mrg 
   2565  1.1  mrg % @uref (abbreviation for `urlref') takes an optional (comma-separated)
   2566  1.1  mrg % second argument specifying the text to display and an optional third
   2567  1.1  mrg % arg as text to display instead of (rather than in addition to) the url
   2568  1.1  mrg % itself.  First (mandatory) arg is the url.
   2569  1.1  mrg % (This \urefnobreak definition isn't used now, leaving it for a while
   2570  1.1  mrg % for comparison.)
   2571  1.1  mrg \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
   2572  1.1  mrg \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
   2573  1.1  mrg   \unsepspaces
   2574  1.1  mrg   \pdfurl{#1}%
   2575  1.1  mrg   \setbox0 = \hbox{\ignorespaces #3}%
   2576  1.1  mrg   \ifdim\wd0 > 0pt
   2577  1.1  mrg     \unhbox0 % third arg given, show only that
   2578  1.1  mrg   \else
   2579  1.1  mrg     \setbox0 = \hbox{\ignorespaces #2}%
   2580  1.1  mrg     \ifdim\wd0 > 0pt
   2581  1.1  mrg       \ifpdf
   2582  1.1  mrg         \unhbox0             % PDF: 2nd arg given, show only it
   2583  1.1  mrg       \else
   2584  1.1  mrg         \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
   2585  1.1  mrg       \fi
   2586  1.1  mrg     \else
   2587  1.1  mrg       \code{#1}% only url given, so show it
   2588  1.1  mrg     \fi
   2589  1.1  mrg   \fi
   2590  1.1  mrg   \endlink
   2591  1.1  mrg \endgroup}
   2592  1.1  mrg 
   2593  1.1  mrg % This \urefbreak definition is the active one.
   2594  1.1  mrg \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
   2595  1.1  mrg \let\uref=\urefbreak
   2596  1.1  mrg \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
   2597  1.1  mrg \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
   2598  1.1  mrg   \unsepspaces
   2599  1.1  mrg   \pdfurl{#1}%
   2600  1.1  mrg   \setbox0 = \hbox{\ignorespaces #3}%
   2601  1.1  mrg   \ifdim\wd0 > 0pt
   2602  1.1  mrg     \unhbox0 % third arg given, show only that
   2603  1.1  mrg   \else
   2604  1.1  mrg     \setbox0 = \hbox{\ignorespaces #2}%
   2605  1.1  mrg     \ifdim\wd0 > 0pt
   2606  1.1  mrg       \ifpdf
   2607  1.1  mrg         \unhbox0             % PDF: 2nd arg given, show only it
   2608  1.1  mrg       \else
   2609  1.1  mrg         \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
   2610  1.1  mrg       \fi
   2611  1.1  mrg     \else
   2612  1.1  mrg       \urefcode{#1}% only url given, so show it
   2613  1.1  mrg     \fi
   2614  1.1  mrg   \fi
   2615  1.1  mrg   \endlink
   2616  1.1  mrg \endgroup}
   2617  1.1  mrg 
   2618  1.1  mrg % Allow line breaks around only a few characters (only).
   2619  1.1  mrg \def\urefcatcodes{%
   2620  1.1  mrg   \catcode\ampChar=\active   \catcode\dotChar=\active
   2621  1.1  mrg   \catcode\hashChar=\active  \catcode\questChar=\active
   2622  1.1  mrg   \catcode\slashChar=\active
   2623  1.1  mrg }
   2624  1.1  mrg {
   2625  1.1  mrg   \urefcatcodes
   2626  1.1  mrg   %
   2627  1.1  mrg   \global\def\urefcode{\begingroup
   2628  1.1  mrg     \setupmarkupstyle{code}%
   2629  1.1  mrg     \urefcatcodes
   2630  1.1  mrg     \let&\urefcodeamp
   2631  1.1  mrg     \let.\urefcodedot
   2632  1.1  mrg     \let#\urefcodehash
   2633  1.1  mrg     \let?\urefcodequest
   2634  1.1  mrg     \let/\urefcodeslash
   2635  1.1  mrg     \codex
   2636  1.1  mrg   }
   2637  1.1  mrg   %
   2638  1.1  mrg   % By default, they are just regular characters.
   2639  1.1  mrg   \global\def&{\normalamp}
   2640  1.1  mrg   \global\def.{\normaldot}
   2641  1.1  mrg   \global\def#{\normalhash}
   2642  1.1  mrg   \global\def?{\normalquest}
   2643  1.1  mrg   \global\def/{\normalslash}
   2644  1.1  mrg }
   2645  1.1  mrg 
   2646  1.1  mrg % we put a little stretch before and after the breakable chars, to help
   2647  1.1  mrg % line breaking of long url's.  The unequal skips make look better in
   2648  1.1  mrg % cmtt at least, especially for dots.
   2649  1.1  mrg \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
   2650  1.1  mrg \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
   2651  1.1  mrg %
   2652  1.1  mrg \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
   2653  1.1  mrg \def\urefcodedot{\urefprestretch .\urefpoststretch}
   2654  1.1  mrg \def\urefcodehash{\urefprestretch \#\urefpoststretch}
   2655  1.1  mrg \def\urefcodequest{\urefprestretch ?\urefpoststretch}
   2656  1.1  mrg \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
   2657  1.1  mrg {
   2658  1.1  mrg   \catcode`\/=\active
   2659  1.1  mrg   \global\def\urefcodeslashfinish{%
   2660  1.1  mrg     \urefprestretch \slashChar
   2661  1.1  mrg     % Allow line break only after the final / in a sequence of
   2662  1.1  mrg     % slashes, to avoid line break between the slashes in http://.
   2663  1.1  mrg     \ifx\next/\else \urefpoststretch \fi
   2664  1.1  mrg   }
   2665  1.1  mrg }
   2666  1.1  mrg 
   2667  1.1  mrg % One more complication: by default we'll break after the special
   2668  1.1  mrg % characters, but some people like to break before the special chars, so
   2669  1.1  mrg % allow that.  Also allow no breaking at all, for manual control.
   2670  1.1  mrg % 
   2671  1.1  mrg \parseargdef\urefbreakstyle{%
   2672  1.1  mrg   \def\txiarg{#1}%
   2673  1.1  mrg   \ifx\txiarg\wordnone
   2674  1.1  mrg     \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
   2675  1.1  mrg   \else\ifx\txiarg\wordbefore
   2676  1.1  mrg     \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
   2677  1.1  mrg   \else\ifx\txiarg\wordafter
   2678  1.1  mrg     \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
   2679  1.1  mrg   \else
   2680  1.1  mrg     \errhelp = \EMsimple
   2681  1.1  mrg     \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
   2682  1.1  mrg   \fi\fi\fi
   2683  1.1  mrg }
   2684  1.1  mrg \def\wordafter{after}
   2685  1.1  mrg \def\wordbefore{before}
   2686  1.1  mrg \def\wordnone{none}
   2687  1.1  mrg 
   2688  1.1  mrg \urefbreakstyle after
   2689  1.1  mrg 
   2690  1.1  mrg % @url synonym for @uref, since that's how everyone uses it.
   2691  1.1  mrg %
   2692  1.1  mrg \let\url=\uref
   2693  1.1  mrg 
   2694  1.1  mrg % rms does not like angle brackets --karl, 17may97.
   2695  1.1  mrg % So now @email is just like @uref, unless we are pdf.
   2696  1.1  mrg %
   2697  1.1  mrg %\def\email#1{\angleleft{\tt #1}\angleright}
   2698  1.1  mrg \ifpdf
   2699  1.1  mrg   \def\email#1{\doemail#1,,\finish}
   2700  1.1  mrg   \def\doemail#1,#2,#3\finish{\begingroup
   2701  1.1  mrg     \unsepspaces
   2702  1.1  mrg     \pdfurl{mailto:#1}%
   2703  1.1  mrg     \setbox0 = \hbox{\ignorespaces #2}%
   2704  1.1  mrg     \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
   2705  1.1  mrg     \endlink
   2706  1.1  mrg   \endgroup}
   2707  1.1  mrg \else
   2708  1.1  mrg   \let\email=\uref
   2709  1.1  mrg \fi
   2710  1.1  mrg 
   2711  1.1  mrg % @kbd is like @code, except that if the argument is just one @key command,
   2712  1.1  mrg % then @kbd has no effect.
   2713  1.1  mrg \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
   2714  1.1  mrg 
   2715  1.1  mrg % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
   2716  1.1  mrg %   `example' (@kbd uses ttsl only inside of @example and friends),
   2717  1.1  mrg %   or `code' (@kbd uses normal tty font always).
   2718  1.1  mrg \parseargdef\kbdinputstyle{%
   2719  1.1  mrg   \def\txiarg{#1}%
   2720  1.1  mrg   \ifx\txiarg\worddistinct
   2721  1.1  mrg     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
   2722  1.1  mrg   \else\ifx\txiarg\wordexample
   2723  1.1  mrg     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
   2724  1.1  mrg   \else\ifx\txiarg\wordcode
   2725  1.1  mrg     \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
   2726  1.1  mrg   \else
   2727  1.1  mrg     \errhelp = \EMsimple
   2728  1.1  mrg     \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
   2729  1.1  mrg   \fi\fi\fi
   2730  1.1  mrg }
   2731  1.1  mrg \def\worddistinct{distinct}
   2732  1.1  mrg \def\wordexample{example}
   2733  1.1  mrg \def\wordcode{code}
   2734  1.1  mrg 
   2735  1.1  mrg % Default is `distinct'.
   2736  1.1  mrg \kbdinputstyle distinct
   2737  1.1  mrg 
   2738  1.1  mrg \def\xkey{\key}
   2739  1.1  mrg \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
   2740  1.1  mrg \ifx\one\xkey\ifx\threex\three \key{#2}%
   2741  1.1  mrg \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
   2742  1.1  mrg \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
   2743  1.1  mrg 
   2744  1.1  mrg % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
   2745  1.1  mrg \let\indicateurl=\code
   2746  1.1  mrg \let\env=\code
   2747  1.1  mrg \let\command=\code
   2748  1.1  mrg 
   2749  1.1  mrg % @clicksequence{File @click{} Open ...}
   2750  1.1  mrg \def\clicksequence#1{\begingroup #1\endgroup}
   2751  1.1  mrg 
   2752  1.1  mrg % @clickstyle @arrow   (by default)
   2753  1.1  mrg \parseargdef\clickstyle{\def\click{#1}}
   2754  1.1  mrg \def\click{\arrow}
   2755  1.1  mrg 
   2756  1.1  mrg % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
   2757  1.1  mrg % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
   2758  1.1  mrg %
   2759  1.1  mrg \def\dmn#1{\thinspace #1}
   2760  1.1  mrg 
   2761  1.1  mrg % @l was never documented to mean ``switch to the Lisp font'',
   2762  1.1  mrg % and it is not used as such in any manual I can find.  We need it for
   2763  1.1  mrg % Polish suppressed-l.  --karl, 22sep96.
   2764  1.1  mrg %\def\l#1{{\li #1}\null}
   2765  1.1  mrg 
   2766  1.1  mrg % @acronym for "FBI", "NATO", and the like.
   2767  1.1  mrg % We print this one point size smaller, since it's intended for
   2768  1.1  mrg % all-uppercase.
   2769  1.1  mrg %
   2770  1.1  mrg \def\acronym#1{\doacronym #1,,\finish}
   2771  1.1  mrg \def\doacronym#1,#2,#3\finish{%
   2772  1.1  mrg   {\selectfonts\lsize #1}%
   2773  1.1  mrg   \def\temp{#2}%
   2774  1.1  mrg   \ifx\temp\empty \else
   2775  1.1  mrg     \space ({\unsepspaces \ignorespaces \temp \unskip})%
   2776  1.1  mrg   \fi
   2777  1.1  mrg   \null % reset \spacefactor=1000
   2778  1.1  mrg }
   2779  1.1  mrg 
   2780  1.1  mrg % @abbr for "Comput. J." and the like.
   2781  1.1  mrg % No font change, but don't do end-of-sentence spacing.
   2782  1.1  mrg %
   2783  1.1  mrg \def\abbr#1{\doabbr #1,,\finish}
   2784  1.1  mrg \def\doabbr#1,#2,#3\finish{%
   2785  1.1  mrg   {\plainfrenchspacing #1}%
   2786  1.1  mrg   \def\temp{#2}%
   2787  1.1  mrg   \ifx\temp\empty \else
   2788  1.1  mrg     \space ({\unsepspaces \ignorespaces \temp \unskip})%
   2789  1.1  mrg   \fi
   2790  1.1  mrg   \null % reset \spacefactor=1000
   2791  1.1  mrg }
   2792  1.1  mrg 
   2793  1.1  mrg % @asis just yields its argument.  Used with @table, for example.
   2794  1.1  mrg %
   2795  1.1  mrg \def\asis#1{#1}
   2796  1.1  mrg 
   2797  1.1  mrg % @math outputs its argument in math mode.
   2798  1.1  mrg %
   2799  1.1  mrg % One complication: _ usually means subscripts, but it could also mean
   2800  1.1  mrg % an actual _ character, as in @math{@var{some_variable} + 1}.  So make
   2801  1.1  mrg % _ active, and distinguish by seeing if the current family is \slfam,
   2802  1.1  mrg % which is what @var uses.
   2803  1.1  mrg {
   2804  1.1  mrg   \catcode`\_ = \active
   2805  1.1  mrg   \gdef\mathunderscore{%
   2806  1.1  mrg     \catcode`\_=\active
   2807  1.1  mrg     \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
   2808  1.1  mrg   }
   2809  1.1  mrg }
   2810  1.1  mrg % Another complication: we want \\ (and @\) to output a math (or tt) \.
   2811  1.1  mrg % FYI, plain.tex uses \\ as a temporary control sequence (for no
   2812  1.1  mrg % particular reason), but this is not advertised and we don't care.
   2813  1.1  mrg %
   2814  1.1  mrg % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
   2815  1.1  mrg \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
   2816  1.1  mrg %
   2817  1.1  mrg \def\math{%
   2818  1.1  mrg   \tex
   2819  1.1  mrg   \mathunderscore
   2820  1.1  mrg   \let\\ = \mathbackslash
   2821  1.1  mrg   \mathactive
   2822  1.1  mrg   % make the texinfo accent commands work in math mode
   2823  1.1  mrg   \let\"=\ddot
   2824  1.1  mrg   \let\'=\acute
   2825  1.1  mrg   \let\==\bar
   2826  1.1  mrg   \let\^=\hat
   2827  1.1  mrg   \let\`=\grave
   2828  1.1  mrg   \let\u=\breve
   2829  1.1  mrg   \let\v=\check
   2830  1.1  mrg   \let\~=\tilde
   2831  1.1  mrg   \let\dotaccent=\dot
   2832  1.1  mrg   $\finishmath
   2833  1.1  mrg }
   2834  1.1  mrg \def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
   2835  1.1  mrg 
   2836  1.1  mrg % Some active characters (such as <) are spaced differently in math.
   2837  1.1  mrg % We have to reset their definitions in case the @math was an argument
   2838  1.1  mrg % to a command which sets the catcodes (such as @item or @section).
   2839  1.1  mrg %
   2840  1.1  mrg {
   2841  1.1  mrg   \catcode`^ = \active
   2842  1.1  mrg   \catcode`< = \active
   2843  1.1  mrg   \catcode`> = \active
   2844  1.1  mrg   \catcode`+ = \active
   2845  1.1  mrg   \catcode`' = \active
   2846  1.1  mrg   \gdef\mathactive{%
   2847  1.1  mrg     \let^ = \ptexhat
   2848  1.1  mrg     \let< = \ptexless
   2849  1.1  mrg     \let> = \ptexgtr
   2850  1.1  mrg     \let+ = \ptexplus
   2851  1.1  mrg     \let' = \ptexquoteright
   2852  1.1  mrg   }
   2853  1.1  mrg }
   2854  1.1  mrg 
   2855  1.1  mrg % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
   2856  1.1  mrg % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
   2857  1.1  mrg % except specified as a normal braced arg, so no newlines to worry about.
   2858  1.1  mrg % 
   2859  1.1  mrg \def\outfmtnametex{tex}
   2860  1.1  mrg %
   2861  1.1  mrg \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
   2862  1.1  mrg \long\def\doinlinefmt#1,#2,\finish{%
   2863  1.1  mrg   \def\inlinefmtname{#1}%
   2864  1.1  mrg   \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
   2865  1.1  mrg }
   2866  1.1  mrg % For raw, must switch into @tex before parsing the argument, to avoid
   2867  1.1  mrg % setting catcodes prematurely.  Doing it this way means that, for
   2868  1.1  mrg % example, @inlineraw{html, foo{bar} gets a parse error instead of being
   2869  1.1  mrg % ignored.  But this isn't important because if people want a literal
   2870  1.1  mrg % *right* brace they would have to use a command anyway, so they may as
   2871  1.1  mrg % well use a command to get a left brace too.  We could re-use the
   2872  1.1  mrg % delimiter character idea from \verb, but it seems like overkill.
   2873  1.1  mrg % 
   2874  1.1  mrg \long\def\inlineraw{\tex \doinlineraw}
   2875  1.1  mrg \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
   2876  1.1  mrg \def\doinlinerawtwo#1,#2,\finish{%
   2877  1.1  mrg   \def\inlinerawname{#1}%
   2878  1.1  mrg   \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
   2879  1.1  mrg   \endgroup % close group opened by \tex.
   2880  1.1  mrg }
   2881  1.1  mrg 
   2882  1.1  mrg 
   2883  1.1  mrg \message{glyphs,}
   2884  1.1  mrg % and logos.
   2885  1.1  mrg 
   2886  1.1  mrg % @@ prints an @, as does @atchar{}.
   2887  1.1  mrg \def\@{\char64 }
   2888  1.1  mrg \let\atchar=\@
   2889  1.1  mrg 
   2890  1.1  mrg % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
   2891  1.1  mrg % Unless we're in typewriter, use \ecfont because the CM text fonts do
   2892  1.1  mrg % not have braces, and we don't want to switch into math.
   2893  1.1  mrg \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
   2894  1.1  mrg \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
   2895  1.1  mrg \let\{=\mylbrace \let\lbracechar=\{
   2896  1.1  mrg \let\}=\myrbrace \let\rbracechar=\}
   2897  1.1  mrg \begingroup
   2898  1.1  mrg   % Definitions to produce \{ and \} commands for indices,
   2899  1.1  mrg   % and @{ and @} for the aux/toc files.
   2900  1.1  mrg   \catcode`\{ = \other \catcode`\} = \other
   2901  1.1  mrg   \catcode`\[ = 1 \catcode`\] = 2
   2902  1.1  mrg   \catcode`\! = 0 \catcode`\\ = \other
   2903  1.1  mrg   !gdef!lbracecmd[\{]%
   2904  1.1  mrg   !gdef!rbracecmd[\}]%
   2905  1.1  mrg   !gdef!lbraceatcmd[@{]%
   2906  1.1  mrg   !gdef!rbraceatcmd[@}]%
   2907  1.1  mrg !endgroup
   2908  1.1  mrg 
   2909  1.1  mrg % @comma{} to avoid , parsing problems.
   2910  1.1  mrg \let\comma = ,
   2911  1.1  mrg 
   2912  1.1  mrg % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
   2913  1.1  mrg % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
   2914  1.1  mrg \let\, = \ptexc
   2915  1.1  mrg \let\dotaccent = \ptexdot
   2916  1.1  mrg \def\ringaccent#1{{\accent23 #1}}
   2917  1.1  mrg \let\tieaccent = \ptext
   2918  1.1  mrg \let\ubaraccent = \ptexb
   2919  1.1  mrg \let\udotaccent = \d
   2920  1.1  mrg 
   2921  1.1  mrg % Other special characters: @questiondown @exclamdown @ordf @ordm
   2922  1.1  mrg % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
   2923  1.1  mrg \def\questiondown{?`}
   2924  1.1  mrg \def\exclamdown{!`}
   2925  1.1  mrg \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
   2926  1.1  mrg \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
   2927  1.1  mrg 
   2928  1.1  mrg % Dotless i and dotless j, used for accents.
   2929  1.1  mrg \def\imacro{i}
   2930  1.1  mrg \def\jmacro{j}
   2931  1.1  mrg \def\dotless#1{%
   2932  1.1  mrg   \def\temp{#1}%
   2933  1.1  mrg   \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
   2934  1.1  mrg   \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
   2935  1.1  mrg   \else \errmessage{@dotless can be used only with i or j}%
   2936  1.1  mrg   \fi\fi
   2937  1.1  mrg }
   2938  1.1  mrg 
   2939  1.1  mrg % The \TeX{} logo, as in plain, but resetting the spacing so that a
   2940  1.1  mrg % period following counts as ending a sentence.  (Idea found in latex.)
   2941  1.1  mrg %
   2942  1.1  mrg \edef\TeX{\TeX \spacefactor=1000 }
   2943  1.1  mrg 
   2944  1.1  mrg % @LaTeX{} logo.  Not quite the same results as the definition in
   2945  1.1  mrg % latex.ltx, since we use a different font for the raised A; it's most
   2946  1.1  mrg % convenient for us to use an explicitly smaller font, rather than using
   2947  1.1  mrg % the \scriptstyle font (since we don't reset \scriptstyle and
   2948  1.1  mrg % \scriptscriptstyle).
   2949  1.1  mrg %
   2950  1.1  mrg \def\LaTeX{%
   2951  1.1  mrg   L\kern-.36em
   2952  1.1  mrg   {\setbox0=\hbox{T}%
   2953  1.1  mrg    \vbox to \ht0{\hbox{%
   2954  1.1  mrg      \ifx\textnominalsize\xwordpt
   2955  1.1  mrg        % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
   2956  1.1  mrg        % Revert to plain's \scriptsize, which is 7pt.
   2957  1.1  mrg        \count255=\the\fam $\fam\count255 \scriptstyle A$%
   2958  1.1  mrg      \else
   2959  1.1  mrg        % For 11pt, we can use our lllsize.
   2960  1.1  mrg        \selectfonts\lllsize A%
   2961  1.1  mrg      \fi
   2962  1.1  mrg      }%
   2963  1.1  mrg      \vss
   2964  1.1  mrg   }}%
   2965  1.1  mrg   \kern-.15em
   2966  1.1  mrg   \TeX
   2967  1.1  mrg }
   2968  1.1  mrg 
   2969  1.1  mrg % Some math mode symbols.
   2970  1.1  mrg \def\bullet{$\ptexbullet$}
   2971  1.1  mrg \def\geq{\ifmmode \ge\else $\ge$\fi}
   2972  1.1  mrg \def\leq{\ifmmode \le\else $\le$\fi}
   2973  1.1  mrg \def\minus{\ifmmode -\else $-$\fi}
   2974  1.1  mrg 
   2975  1.1  mrg % @dots{} outputs an ellipsis using the current font.
   2976  1.1  mrg % We do .5em per period so that it has the same spacing in the cm
   2977  1.1  mrg % typewriter fonts as three actual period characters; on the other hand,
   2978  1.1  mrg % in other typewriter fonts three periods are wider than 1.5em.  So do
   2979  1.1  mrg % whichever is larger.
   2980  1.1  mrg %
   2981  1.1  mrg \def\dots{%
   2982  1.1  mrg   \leavevmode
   2983  1.1  mrg   \setbox0=\hbox{...}% get width of three periods
   2984  1.1  mrg   \ifdim\wd0 > 1.5em
   2985  1.1  mrg     \dimen0 = \wd0
   2986  1.1  mrg   \else
   2987  1.1  mrg     \dimen0 = 1.5em
   2988  1.1  mrg   \fi
   2989  1.1  mrg   \hbox to \dimen0{%
   2990  1.1  mrg     \hskip 0pt plus.25fil
   2991  1.1  mrg     .\hskip 0pt plus1fil
   2992  1.1  mrg     .\hskip 0pt plus1fil
   2993  1.1  mrg     .\hskip 0pt plus.5fil
   2994  1.1  mrg   }%
   2995  1.1  mrg }
   2996  1.1  mrg 
   2997  1.1  mrg % @enddots{} is an end-of-sentence ellipsis.
   2998  1.1  mrg %
   2999  1.1  mrg \def\enddots{%
   3000  1.1  mrg   \dots
   3001  1.1  mrg   \spacefactor=\endofsentencespacefactor
   3002  1.1  mrg }
   3003  1.1  mrg 
   3004  1.1  mrg % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
   3005  1.1  mrg %
   3006  1.1  mrg % Since these characters are used in examples, they should be an even number of
   3007  1.1  mrg % \tt widths. Each \tt character is 1en, so two makes it 1em.
   3008  1.1  mrg %
   3009  1.1  mrg \def\point{$\star$}
   3010  1.1  mrg \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
   3011  1.1  mrg \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
   3012  1.1  mrg \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
   3013  1.1  mrg \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
   3014  1.1  mrg \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
   3015  1.1  mrg 
   3016  1.1  mrg % The @error{} command.
   3017  1.1  mrg % Adapted from the TeXbook's \boxit.
   3018  1.1  mrg %
   3019  1.1  mrg \newbox\errorbox
   3020  1.1  mrg %
   3021  1.1  mrg {\tentt \global\dimen0 = 3em}% Width of the box.
   3022  1.1  mrg \dimen2 = .55pt % Thickness of rules
   3023  1.1  mrg % The text. (`r' is open on the right, `e' somewhat less so on the left.)
   3024  1.1  mrg \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
   3025  1.1  mrg %
   3026  1.1  mrg \setbox\errorbox=\hbox to \dimen0{\hfil
   3027  1.1  mrg    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
   3028  1.1  mrg    \advance\hsize by -2\dimen2 % Rules.
   3029  1.1  mrg    \vbox{%
   3030  1.1  mrg       \hrule height\dimen2
   3031  1.1  mrg       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
   3032  1.1  mrg          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
   3033  1.1  mrg          \kern3pt\vrule width\dimen2}% Space to right.
   3034  1.1  mrg       \hrule height\dimen2}
   3035  1.1  mrg     \hfil}
   3036  1.1  mrg %
   3037  1.1  mrg \def\error{\leavevmode\lower.7ex\copy\errorbox}
   3038  1.1  mrg 
   3039  1.1  mrg % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
   3040  1.1  mrg %
   3041  1.1  mrg \def\pounds{{\it\$}}
   3042  1.1  mrg 
   3043  1.1  mrg % @euro{} comes from a separate font, depending on the current style.
   3044  1.1  mrg % We use the free feym* fonts from the eurosym package by Henrik
   3045  1.1  mrg % Theiling, which support regular, slanted, bold and bold slanted (and
   3046  1.1  mrg % "outlined" (blackboard board, sort of) versions, which we don't need).
   3047  1.1  mrg % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
   3048  1.1  mrg %
   3049  1.1  mrg % Although only regular is the truly official Euro symbol, we ignore
   3050  1.1  mrg % that.  The Euro is designed to be slightly taller than the regular
   3051  1.1  mrg % font height.
   3052  1.1  mrg %
   3053  1.1  mrg % feymr - regular
   3054  1.1  mrg % feymo - slanted
   3055  1.1  mrg % feybr - bold
   3056  1.1  mrg % feybo - bold slanted
   3057  1.1  mrg %
   3058  1.1  mrg % There is no good (free) typewriter version, to my knowledge.
   3059  1.1  mrg % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
   3060  1.1  mrg % Hmm.
   3061  1.1  mrg %
   3062  1.1  mrg % Also doesn't work in math.  Do we need to do math with euro symbols?
   3063  1.1  mrg % Hope not.
   3064  1.1  mrg %
   3065  1.1  mrg %
   3066  1.1  mrg \def\euro{{\eurofont e}}
   3067  1.1  mrg \def\eurofont{%
   3068  1.1  mrg   % We set the font at each command, rather than predefining it in
   3069  1.1  mrg   % \textfonts and the other font-switching commands, so that
   3070  1.1  mrg   % installations which never need the symbol don't have to have the
   3071  1.1  mrg   % font installed.
   3072  1.1  mrg   %
   3073  1.1  mrg   % There is only one designed size (nominal 10pt), so we always scale
   3074  1.1  mrg   % that to the current nominal size.
   3075  1.1  mrg   %
   3076  1.1  mrg   % By the way, simply using "at 1em" works for cmr10 and the like, but
   3077  1.1  mrg   % does not work for cmbx10 and other extended/shrunken fonts.
   3078  1.1  mrg   %
   3079  1.1  mrg   \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
   3080  1.1  mrg   %
   3081  1.1  mrg   \ifx\curfontstyle\bfstylename
   3082  1.1  mrg     % bold:
   3083  1.1  mrg     \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
   3084  1.1  mrg   \else
   3085  1.1  mrg     % regular:
   3086  1.1  mrg     \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
   3087  1.1  mrg   \fi
   3088  1.1  mrg   \thiseurofont
   3089  1.1  mrg }
   3090  1.1  mrg 
   3091  1.1  mrg % Glyphs from the EC fonts.  We don't use \let for the aliases, because
   3092  1.1  mrg % sometimes we redefine the original macro, and the alias should reflect
   3093  1.1  mrg % the redefinition.
   3094  1.1  mrg %
   3095  1.1  mrg % Use LaTeX names for the Icelandic letters.
   3096  1.1  mrg \def\DH{{\ecfont \char"D0}} % Eth
   3097  1.1  mrg \def\dh{{\ecfont \char"F0}} % eth
   3098  1.1  mrg \def\TH{{\ecfont \char"DE}} % Thorn
   3099  1.1  mrg \def\th{{\ecfont \char"FE}} % thorn
   3100  1.1  mrg %
   3101  1.1  mrg \def\guillemetleft{{\ecfont \char"13}}
   3102  1.1  mrg \def\guillemotleft{\guillemetleft}
   3103  1.1  mrg \def\guillemetright{{\ecfont \char"14}}
   3104  1.1  mrg \def\guillemotright{\guillemetright}
   3105  1.1  mrg \def\guilsinglleft{{\ecfont \char"0E}}
   3106  1.1  mrg \def\guilsinglright{{\ecfont \char"0F}}
   3107  1.1  mrg \def\quotedblbase{{\ecfont \char"12}}
   3108  1.1  mrg \def\quotesinglbase{{\ecfont \char"0D}}
   3109  1.1  mrg %
   3110  1.1  mrg % This positioning is not perfect (see the ogonek LaTeX package), but
   3111  1.1  mrg % we have the precomposed glyphs for the most common cases.  We put the
   3112  1.1  mrg % tests to use those glyphs in the single \ogonek macro so we have fewer
   3113  1.1  mrg % dummy definitions to worry about for index entries, etc.
   3114  1.1  mrg %
   3115  1.1  mrg % ogonek is also used with other letters in Lithuanian (IOU), but using
   3116  1.1  mrg % the precomposed glyphs for those is not so easy since they aren't in
   3117  1.1  mrg % the same EC font.
   3118  1.1  mrg \def\ogonek#1{{%
   3119  1.1  mrg   \def\temp{#1}%
   3120  1.1  mrg   \ifx\temp\macrocharA\Aogonek
   3121  1.1  mrg   \else\ifx\temp\macrochara\aogonek
   3122  1.1  mrg   \else\ifx\temp\macrocharE\Eogonek
   3123  1.1  mrg   \else\ifx\temp\macrochare\eogonek
   3124  1.1  mrg   \else
   3125  1.1  mrg     \ecfont \setbox0=\hbox{#1}%
   3126  1.1  mrg     \ifdim\ht0=1ex\accent"0C #1%
   3127  1.1  mrg     \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
   3128  1.1  mrg     \fi
   3129  1.1  mrg   \fi\fi\fi\fi
   3130  1.1  mrg   }%
   3131  1.1  mrg }
   3132  1.1  mrg \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
   3133  1.1  mrg \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
   3134  1.1  mrg \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
   3135  1.1  mrg \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
   3136  1.1  mrg %
   3137  1.1  mrg % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
   3138  1.1  mrg \def\ecfont{%
   3139  1.1  mrg   % We can't distinguish serif/sans and italic/slanted, but this
   3140  1.1  mrg   % is used for crude hacks anyway (like adding French and German
   3141  1.1  mrg   % quotes to documents typeset with CM, where we lose kerning), so
   3142  1.1  mrg   % hopefully nobody will notice/care.
   3143  1.1  mrg   \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
   3144  1.1  mrg   \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
   3145  1.1  mrg   \ifx\curfontstyle\bfstylename
   3146  1.1  mrg     % bold:
   3147  1.1  mrg     \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
   3148  1.1  mrg   \else
   3149  1.1  mrg     % regular:
   3150  1.1  mrg     \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
   3151  1.1  mrg   \fi
   3152  1.1  mrg   \thisecfont
   3153  1.1  mrg }
   3154  1.1  mrg 
   3155  1.1  mrg % @registeredsymbol - R in a circle.  The font for the R should really
   3156  1.1  mrg % be smaller yet, but lllsize is the best we can do for now.
   3157  1.1  mrg % Adapted from the plain.tex definition of \copyright.
   3158  1.1  mrg %
   3159  1.1  mrg \def\registeredsymbol{%
   3160  1.1  mrg   $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
   3161  1.1  mrg                \hfil\crcr\Orb}}%
   3162  1.1  mrg     }$%
   3163  1.1  mrg }
   3164  1.1  mrg 
   3165  1.1  mrg % @textdegree - the normal degrees sign.
   3166  1.1  mrg %
   3167  1.1  mrg \def\textdegree{$^\circ$}
   3168  1.1  mrg 
   3169  1.1  mrg % Laurent Siebenmann reports \Orb undefined with:
   3170  1.1  mrg %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
   3171  1.1  mrg % so we'll define it if necessary.
   3172  1.1  mrg %
   3173  1.1  mrg \ifx\Orb\thisisundefined
   3174  1.1  mrg \def\Orb{\mathhexbox20D}
   3175  1.1  mrg \fi
   3176  1.1  mrg 
   3177  1.1  mrg % Quotes.
   3178  1.1  mrg \chardef\quotedblleft="5C
   3179  1.1  mrg \chardef\quotedblright=`\"
   3180  1.1  mrg \chardef\quoteleft=`\`
   3181  1.1  mrg \chardef\quoteright=`\'
   3182  1.1  mrg 
   3183  1.1  mrg 
   3184  1.1  mrg \message{page headings,}
   3185  1.1  mrg 
   3186  1.1  mrg \newskip\titlepagetopglue \titlepagetopglue = 1.5in
   3187  1.1  mrg \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
   3188  1.1  mrg 
   3189  1.1  mrg % First the title page.  Must do @settitle before @titlepage.
   3190  1.1  mrg \newif\ifseenauthor
   3191  1.1  mrg \newif\iffinishedtitlepage
   3192  1.1  mrg 
   3193  1.1  mrg % Do an implicit @contents or @shortcontents after @end titlepage if the
   3194  1.1  mrg % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
   3195  1.1  mrg %
   3196  1.1  mrg \newif\ifsetcontentsaftertitlepage
   3197  1.1  mrg  \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
   3198  1.1  mrg \newif\ifsetshortcontentsaftertitlepage
   3199  1.1  mrg  \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
   3200  1.1  mrg 
   3201  1.1  mrg \parseargdef\shorttitlepage{%
   3202  1.1  mrg   \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
   3203  1.1  mrg   \endgroup\page\hbox{}\page}
   3204  1.1  mrg 
   3205  1.1  mrg \envdef\titlepage{%
   3206  1.1  mrg   % Open one extra group, as we want to close it in the middle of \Etitlepage.
   3207  1.1  mrg   \begingroup
   3208  1.1  mrg     \parindent=0pt \textfonts
   3209  1.1  mrg     % Leave some space at the very top of the page.
   3210  1.1  mrg     \vglue\titlepagetopglue
   3211  1.1  mrg     % No rule at page bottom unless we print one at the top with @title.
   3212  1.1  mrg     \finishedtitlepagetrue
   3213  1.1  mrg     %
   3214  1.1  mrg     % Most title ``pages'' are actually two pages long, with space
   3215  1.1  mrg     % at the top of the second.  We don't want the ragged left on the second.
   3216  1.1  mrg     \let\oldpage = \page
   3217  1.1  mrg     \def\page{%
   3218  1.1  mrg       \iffinishedtitlepage\else
   3219  1.1  mrg 	 \finishtitlepage
   3220  1.1  mrg       \fi
   3221  1.1  mrg       \let\page = \oldpage
   3222  1.1  mrg       \page
   3223  1.1  mrg       \null
   3224  1.1  mrg     }%
   3225  1.1  mrg }
   3226  1.1  mrg 
   3227  1.1  mrg \def\Etitlepage{%
   3228  1.1  mrg     \iffinishedtitlepage\else
   3229  1.1  mrg 	\finishtitlepage
   3230  1.1  mrg     \fi
   3231  1.1  mrg     % It is important to do the page break before ending the group,
   3232  1.1  mrg     % because the headline and footline are only empty inside the group.
   3233  1.1  mrg     % If we use the new definition of \page, we always get a blank page
   3234  1.1  mrg     % after the title page, which we certainly don't want.
   3235  1.1  mrg     \oldpage
   3236  1.1  mrg   \endgroup
   3237  1.1  mrg   %
   3238  1.1  mrg   % Need this before the \...aftertitlepage checks so that if they are
   3239  1.1  mrg   % in effect the toc pages will come out with page numbers.
   3240  1.1  mrg   \HEADINGSon
   3241  1.1  mrg   %
   3242  1.1  mrg   % If they want short, they certainly want long too.
   3243  1.1  mrg   \ifsetshortcontentsaftertitlepage
   3244  1.1  mrg     \shortcontents
   3245  1.1  mrg     \contents
   3246  1.1  mrg     \global\let\shortcontents = \relax
   3247  1.1  mrg     \global\let\contents = \relax
   3248  1.1  mrg   \fi
   3249  1.1  mrg   %
   3250  1.1  mrg   \ifsetcontentsaftertitlepage
   3251  1.1  mrg     \contents
   3252  1.1  mrg     \global\let\contents = \relax
   3253  1.1  mrg     \global\let\shortcontents = \relax
   3254  1.1  mrg   \fi
   3255  1.1  mrg }
   3256  1.1  mrg 
   3257  1.1  mrg \def\finishtitlepage{%
   3258  1.1  mrg   \vskip4pt \hrule height 2pt width \hsize
   3259  1.1  mrg   \vskip\titlepagebottomglue
   3260  1.1  mrg   \finishedtitlepagetrue
   3261  1.1  mrg }
   3262  1.1  mrg 
   3263  1.1  mrg % Macros to be used within @titlepage:
   3264  1.1  mrg 
   3265  1.1  mrg \let\subtitlerm=\tenrm
   3266  1.1  mrg \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
   3267  1.1  mrg 
   3268  1.1  mrg \parseargdef\title{%
   3269  1.1  mrg   \checkenv\titlepage
   3270  1.1  mrg   \leftline{\titlefonts\rmisbold #1}
   3271  1.1  mrg   % print a rule at the page bottom also.
   3272  1.1  mrg   \finishedtitlepagefalse
   3273  1.1  mrg   \vskip4pt \hrule height 4pt width \hsize \vskip4pt
   3274  1.1  mrg }
   3275  1.1  mrg 
   3276  1.1  mrg \parseargdef\subtitle{%
   3277  1.1  mrg   \checkenv\titlepage
   3278  1.1  mrg   {\subtitlefont \rightline{#1}}%
   3279  1.1  mrg }
   3280  1.1  mrg 
   3281  1.1  mrg % @author should come last, but may come many times.
   3282  1.1  mrg % It can also be used inside @quotation.
   3283  1.1  mrg %
   3284  1.1  mrg \parseargdef\author{%
   3285  1.1  mrg   \def\temp{\quotation}%
   3286  1.1  mrg   \ifx\thisenv\temp
   3287  1.1  mrg     \def\quotationauthor{#1}% printed in \Equotation.
   3288  1.1  mrg   \else
   3289  1.1  mrg     \checkenv\titlepage
   3290  1.1  mrg     \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
   3291  1.1  mrg     {\secfonts\rmisbold \leftline{#1}}%
   3292  1.1  mrg   \fi
   3293  1.1  mrg }
   3294  1.1  mrg 
   3295  1.1  mrg 
   3296  1.1  mrg % Set up page headings and footings.
   3297  1.1  mrg 
   3298  1.1  mrg \let\thispage=\folio
   3299  1.1  mrg 
   3300  1.1  mrg \newtoks\evenheadline    % headline on even pages
   3301  1.1  mrg \newtoks\oddheadline     % headline on odd pages
   3302  1.1  mrg \newtoks\evenfootline    % footline on even pages
   3303  1.1  mrg \newtoks\oddfootline     % footline on odd pages
   3304  1.1  mrg 
   3305  1.1  mrg % Now make TeX use those variables
   3306  1.1  mrg \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
   3307  1.1  mrg                             \else \the\evenheadline \fi}}
   3308  1.1  mrg \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
   3309  1.1  mrg                             \else \the\evenfootline \fi}\HEADINGShook}
   3310  1.1  mrg \let\HEADINGShook=\relax
   3311  1.1  mrg 
   3312  1.1  mrg % Commands to set those variables.
   3313  1.1  mrg % For example, this is what  @headings on  does
   3314  1.1  mrg % @evenheading @thistitle|@thispage|@thischapter
   3315  1.1  mrg % @oddheading @thischapter|@thispage|@thistitle
   3316  1.1  mrg % @evenfooting @thisfile||
   3317  1.1  mrg % @oddfooting ||@thisfile
   3318  1.1  mrg 
   3319  1.1  mrg 
   3320  1.1  mrg \def\evenheading{\parsearg\evenheadingxxx}
   3321  1.1  mrg \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
   3322  1.1  mrg \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
   3323  1.1  mrg \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
   3324  1.1  mrg 
   3325  1.1  mrg \def\oddheading{\parsearg\oddheadingxxx}
   3326  1.1  mrg \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
   3327  1.1  mrg \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
   3328  1.1  mrg \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
   3329  1.1  mrg 
   3330  1.1  mrg \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
   3331  1.1  mrg 
   3332  1.1  mrg \def\evenfooting{\parsearg\evenfootingxxx}
   3333  1.1  mrg \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
   3334  1.1  mrg \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
   3335  1.1  mrg \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
   3336  1.1  mrg 
   3337  1.1  mrg \def\oddfooting{\parsearg\oddfootingxxx}
   3338  1.1  mrg \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
   3339  1.1  mrg \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
   3340  1.1  mrg   \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
   3341  1.1  mrg   %
   3342  1.1  mrg   % Leave some space for the footline.  Hopefully ok to assume
   3343  1.1  mrg   % @evenfooting will not be used by itself.
   3344  1.1  mrg   \global\advance\pageheight by -12pt
   3345  1.1  mrg   \global\advance\vsize by -12pt
   3346  1.1  mrg }
   3347  1.1  mrg 
   3348  1.1  mrg \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
   3349  1.1  mrg 
   3350  1.1  mrg % @evenheadingmarks top     \thischapter <- chapter at the top of a page
   3351  1.1  mrg % @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
   3352  1.1  mrg %
   3353  1.1  mrg % The same set of arguments for:
   3354  1.1  mrg %
   3355  1.1  mrg % @oddheadingmarks
   3356  1.1  mrg % @evenfootingmarks
   3357  1.1  mrg % @oddfootingmarks
   3358  1.1  mrg % @everyheadingmarks
   3359  1.1  mrg % @everyfootingmarks
   3360  1.1  mrg 
   3361  1.1  mrg \def\evenheadingmarks{\headingmarks{even}{heading}}
   3362  1.1  mrg \def\oddheadingmarks{\headingmarks{odd}{heading}}
   3363  1.1  mrg \def\evenfootingmarks{\headingmarks{even}{footing}}
   3364  1.1  mrg \def\oddfootingmarks{\headingmarks{odd}{footing}}
   3365  1.1  mrg \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
   3366  1.1  mrg                           \headingmarks{odd}{heading}{#1} }
   3367  1.1  mrg \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
   3368  1.1  mrg                           \headingmarks{odd}{footing}{#1} }
   3369  1.1  mrg % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
   3370  1.1  mrg \def\headingmarks#1#2#3 {%
   3371  1.1  mrg   \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
   3372  1.1  mrg   \global\expandafter\let\csname get#1#2marks\endcsname \temp
   3373  1.1  mrg }
   3374  1.1  mrg 
   3375  1.1  mrg \everyheadingmarks bottom
   3376  1.1  mrg \everyfootingmarks bottom
   3377  1.1  mrg 
   3378  1.1  mrg % @headings double      turns headings on for double-sided printing.
   3379  1.1  mrg % @headings single      turns headings on for single-sided printing.
   3380  1.1  mrg % @headings off         turns them off.
   3381  1.1  mrg % @headings on          same as @headings double, retained for compatibility.
   3382  1.1  mrg % @headings after       turns on double-sided headings after this page.
   3383  1.1  mrg % @headings doubleafter turns on double-sided headings after this page.
   3384  1.1  mrg % @headings singleafter turns on single-sided headings after this page.
   3385  1.1  mrg % By default, they are off at the start of a document,
   3386  1.1  mrg % and turned `on' after @end titlepage.
   3387  1.1  mrg 
   3388  1.1  mrg \def\headings #1 {\csname HEADINGS#1\endcsname}
   3389  1.1  mrg 
   3390  1.1  mrg \def\headingsoff{% non-global headings elimination
   3391  1.1  mrg   \evenheadline={\hfil}\evenfootline={\hfil}%
   3392  1.1  mrg    \oddheadline={\hfil}\oddfootline={\hfil}%
   3393  1.1  mrg }
   3394  1.1  mrg 
   3395  1.1  mrg \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
   3396  1.1  mrg \HEADINGSoff  % it's the default
   3397  1.1  mrg 
   3398  1.1  mrg % When we turn headings on, set the page number to 1.
   3399  1.1  mrg % For double-sided printing, put current file name in lower left corner,
   3400  1.1  mrg % chapter name on inside top of right hand pages, document
   3401  1.1  mrg % title on inside top of left hand pages, and page numbers on outside top
   3402  1.1  mrg % edge of all pages.
   3403  1.1  mrg \def\HEADINGSdouble{%
   3404  1.1  mrg \global\pageno=1
   3405  1.1  mrg \global\evenfootline={\hfil}
   3406  1.1  mrg \global\oddfootline={\hfil}
   3407  1.1  mrg \global\evenheadline={\line{\folio\hfil\thistitle}}
   3408  1.1  mrg \global\oddheadline={\line{\thischapter\hfil\folio}}
   3409  1.1  mrg \global\let\contentsalignmacro = \chapoddpage
   3410  1.1  mrg }
   3411  1.1  mrg \let\contentsalignmacro = \chappager
   3412  1.1  mrg 
   3413  1.1  mrg % For single-sided printing, chapter title goes across top left of page,
   3414  1.1  mrg % page number on top right.
   3415  1.1  mrg \def\HEADINGSsingle{%
   3416  1.1  mrg \global\pageno=1
   3417  1.1  mrg \global\evenfootline={\hfil}
   3418  1.1  mrg \global\oddfootline={\hfil}
   3419  1.1  mrg \global\evenheadline={\line{\thischapter\hfil\folio}}
   3420  1.1  mrg \global\oddheadline={\line{\thischapter\hfil\folio}}
   3421  1.1  mrg \global\let\contentsalignmacro = \chappager
   3422  1.1  mrg }
   3423  1.1  mrg \def\HEADINGSon{\HEADINGSdouble}
   3424  1.1  mrg 
   3425  1.1  mrg \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
   3426  1.1  mrg \let\HEADINGSdoubleafter=\HEADINGSafter
   3427  1.1  mrg \def\HEADINGSdoublex{%
   3428  1.1  mrg \global\evenfootline={\hfil}
   3429  1.1  mrg \global\oddfootline={\hfil}
   3430  1.1  mrg \global\evenheadline={\line{\folio\hfil\thistitle}}
   3431  1.1  mrg \global\oddheadline={\line{\thischapter\hfil\folio}}
   3432  1.1  mrg \global\let\contentsalignmacro = \chapoddpage
   3433  1.1  mrg }
   3434  1.1  mrg 
   3435  1.1  mrg \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
   3436  1.1  mrg \def\HEADINGSsinglex{%
   3437  1.1  mrg \global\evenfootline={\hfil}
   3438  1.1  mrg \global\oddfootline={\hfil}
   3439  1.1  mrg \global\evenheadline={\line{\thischapter\hfil\folio}}
   3440  1.1  mrg \global\oddheadline={\line{\thischapter\hfil\folio}}
   3441  1.1  mrg \global\let\contentsalignmacro = \chappager
   3442  1.1  mrg }
   3443  1.1  mrg 
   3444  1.1  mrg % Subroutines used in generating headings
   3445  1.1  mrg % This produces Day Month Year style of output.
   3446  1.1  mrg % Only define if not already defined, in case a txi-??.tex file has set
   3447  1.1  mrg % up a different format (e.g., txi-cs.tex does this).
   3448  1.1  mrg \ifx\today\thisisundefined
   3449  1.1  mrg \def\today{%
   3450  1.1  mrg   \number\day\space
   3451  1.1  mrg   \ifcase\month
   3452  1.1  mrg   \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
   3453  1.1  mrg   \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
   3454  1.1  mrg   \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
   3455  1.1  mrg   \fi
   3456  1.1  mrg   \space\number\year}
   3457  1.1  mrg \fi
   3458  1.1  mrg 
   3459  1.1  mrg % @settitle line...  specifies the title of the document, for headings.
   3460  1.1  mrg % It generates no output of its own.
   3461  1.1  mrg \def\thistitle{\putwordNoTitle}
   3462  1.1  mrg \def\settitle{\parsearg{\gdef\thistitle}}
   3463  1.1  mrg 
   3464  1.1  mrg 
   3465  1.1  mrg \message{tables,}
   3466  1.1  mrg % Tables -- @table, @ftable, @vtable, @item(x).
   3467  1.1  mrg 
   3468  1.1  mrg % default indentation of table text
   3469  1.1  mrg \newdimen\tableindent \tableindent=.8in
   3470  1.1  mrg % default indentation of @itemize and @enumerate text
   3471  1.1  mrg \newdimen\itemindent  \itemindent=.3in
   3472  1.1  mrg % margin between end of table item and start of table text.
   3473  1.1  mrg \newdimen\itemmargin  \itemmargin=.1in
   3474  1.1  mrg 
   3475  1.1  mrg % used internally for \itemindent minus \itemmargin
   3476  1.1  mrg \newdimen\itemmax
   3477  1.1  mrg 
   3478  1.1  mrg % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
   3479  1.1  mrg % these defs.
   3480  1.1  mrg % They also define \itemindex
   3481  1.1  mrg % to index the item name in whatever manner is desired (perhaps none).
   3482  1.1  mrg 
   3483  1.1  mrg \newif\ifitemxneedsnegativevskip
   3484  1.1  mrg 
   3485  1.1  mrg \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
   3486  1.1  mrg 
   3487  1.1  mrg \def\internalBitem{\smallbreak \parsearg\itemzzz}
   3488  1.1  mrg \def\internalBitemx{\itemxpar \parsearg\itemzzz}
   3489  1.1  mrg 
   3490  1.1  mrg \def\itemzzz #1{\begingroup %
   3491  1.1  mrg   \advance\hsize by -\rightskip
   3492  1.1  mrg   \advance\hsize by -\tableindent
   3493  1.1  mrg   \setbox0=\hbox{\itemindicate{#1}}%
   3494  1.1  mrg   \itemindex{#1}%
   3495  1.1  mrg   \nobreak % This prevents a break before @itemx.
   3496  1.1  mrg   %
   3497  1.1  mrg   % If the item text does not fit in the space we have, put it on a line
   3498  1.1  mrg   % by itself, and do not allow a page break either before or after that
   3499  1.1  mrg   % line.  We do not start a paragraph here because then if the next
   3500  1.1  mrg   % command is, e.g., @kindex, the whatsit would get put into the
   3501  1.1  mrg   % horizontal list on a line by itself, resulting in extra blank space.
   3502  1.1  mrg   \ifdim \wd0>\itemmax
   3503  1.1  mrg     %
   3504  1.1  mrg     % Make this a paragraph so we get the \parskip glue and wrapping,
   3505  1.1  mrg     % but leave it ragged-right.
   3506  1.1  mrg     \begingroup
   3507  1.1  mrg       \advance\leftskip by-\tableindent
   3508  1.1  mrg       \advance\hsize by\tableindent
   3509  1.1  mrg       \advance\rightskip by0pt plus1fil\relax
   3510  1.1  mrg       \leavevmode\unhbox0\par
   3511  1.1  mrg     \endgroup
   3512  1.1  mrg     %
   3513  1.1  mrg     % We're going to be starting a paragraph, but we don't want the
   3514  1.1  mrg     % \parskip glue -- logically it's part of the @item we just started.
   3515  1.1  mrg     \nobreak \vskip-\parskip
   3516  1.1  mrg     %
   3517  1.1  mrg     % Stop a page break at the \parskip glue coming up.  However, if
   3518  1.1  mrg     % what follows is an environment such as @example, there will be no
   3519  1.1  mrg     % \parskip glue; then the negative vskip we just inserted would
   3520  1.1  mrg     % cause the example and the item to crash together.  So we use this
   3521  1.1  mrg     % bizarre value of 10001 as a signal to \aboveenvbreak to insert
   3522  1.1  mrg     % \parskip glue after all.  Section titles are handled this way also.
   3523  1.1  mrg     %
   3524  1.1  mrg     \penalty 10001
   3525  1.1  mrg     \endgroup
   3526  1.1  mrg     \itemxneedsnegativevskipfalse
   3527  1.1  mrg   \else
   3528  1.1  mrg     % The item text fits into the space.  Start a paragraph, so that the
   3529  1.1  mrg     % following text (if any) will end up on the same line.
   3530  1.1  mrg     \noindent
   3531  1.1  mrg     % Do this with kerns and \unhbox so that if there is a footnote in
   3532  1.1  mrg     % the item text, it can migrate to the main vertical list and
   3533  1.1  mrg     % eventually be printed.
   3534  1.1  mrg     \nobreak\kern-\tableindent
   3535  1.1  mrg     \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
   3536  1.1  mrg     \unhbox0
   3537  1.1  mrg     \nobreak\kern\dimen0
   3538  1.1  mrg     \endgroup
   3539  1.1  mrg     \itemxneedsnegativevskiptrue
   3540  1.1  mrg   \fi
   3541  1.1  mrg }
   3542  1.1  mrg 
   3543  1.1  mrg \def\item{\errmessage{@item while not in a list environment}}
   3544  1.1  mrg \def\itemx{\errmessage{@itemx while not in a list environment}}
   3545  1.1  mrg 
   3546  1.1  mrg % @table, @ftable, @vtable.
   3547  1.1  mrg \envdef\table{%
   3548  1.1  mrg   \let\itemindex\gobble
   3549  1.1  mrg   \tablecheck{table}%
   3550  1.1  mrg }
   3551  1.1  mrg \envdef\ftable{%
   3552  1.1  mrg   \def\itemindex ##1{\doind {fn}{\code{##1}}}%
   3553  1.1  mrg   \tablecheck{ftable}%
   3554  1.1  mrg }
   3555  1.1  mrg \envdef\vtable{%
   3556  1.1  mrg   \def\itemindex ##1{\doind {vr}{\code{##1}}}%
   3557  1.1  mrg   \tablecheck{vtable}%
   3558  1.1  mrg }
   3559  1.1  mrg \def\tablecheck#1{%
   3560  1.1  mrg   \ifnum \the\catcode`\^^M=\active
   3561  1.1  mrg     \endgroup
   3562  1.1  mrg     \errmessage{This command won't work in this context; perhaps the problem is
   3563  1.1  mrg       that we are \inenvironment\thisenv}%
   3564  1.1  mrg     \def\next{\doignore{#1}}%
   3565  1.1  mrg   \else
   3566  1.1  mrg     \let\next\tablex
   3567  1.1  mrg   \fi
   3568  1.1  mrg   \next
   3569  1.1  mrg }
   3570  1.1  mrg \def\tablex#1{%
   3571  1.1  mrg   \def\itemindicate{#1}%
   3572  1.1  mrg   \parsearg\tabley
   3573  1.1  mrg }
   3574  1.1  mrg \def\tabley#1{%
   3575  1.1  mrg   {%
   3576  1.1  mrg     \makevalueexpandable
   3577  1.1  mrg     \edef\temp{\noexpand\tablez #1\space\space\space}%
   3578  1.1  mrg     \expandafter
   3579  1.1  mrg   }\temp \endtablez
   3580  1.1  mrg }
   3581  1.1  mrg \def\tablez #1 #2 #3 #4\endtablez{%
   3582  1.1  mrg   \aboveenvbreak
   3583  1.1  mrg   \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
   3584  1.1  mrg   \ifnum 0#2>0 \tableindent=#2\mil \fi
   3585  1.1  mrg   \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
   3586  1.1  mrg   \itemmax=\tableindent
   3587  1.1  mrg   \advance \itemmax by -\itemmargin
   3588  1.1  mrg   \advance \leftskip by \tableindent
   3589  1.1  mrg   \exdentamount=\tableindent
   3590  1.1  mrg   \parindent = 0pt
   3591  1.1  mrg   \parskip = \smallskipamount
   3592  1.1  mrg   \ifdim \parskip=0pt \parskip=2pt \fi
   3593  1.1  mrg   \let\item = \internalBitem
   3594  1.1  mrg   \let\itemx = \internalBitemx
   3595  1.1  mrg }
   3596  1.1  mrg \def\Etable{\endgraf\afterenvbreak}
   3597  1.1  mrg \let\Eftable\Etable
   3598  1.1  mrg \let\Evtable\Etable
   3599  1.1  mrg \let\Eitemize\Etable
   3600  1.1  mrg \let\Eenumerate\Etable
   3601  1.1  mrg 
   3602  1.1  mrg % This is the counter used by @enumerate, which is really @itemize
   3603  1.1  mrg 
   3604  1.1  mrg \newcount \itemno
   3605  1.1  mrg 
   3606  1.1  mrg \envdef\itemize{\parsearg\doitemize}
   3607  1.1  mrg 
   3608  1.1  mrg \def\doitemize#1{%
   3609  1.1  mrg   \aboveenvbreak
   3610  1.1  mrg   \itemmax=\itemindent
   3611  1.1  mrg   \advance\itemmax by -\itemmargin
   3612  1.1  mrg   \advance\leftskip by \itemindent
   3613  1.1  mrg   \exdentamount=\itemindent
   3614  1.1  mrg   \parindent=0pt
   3615  1.1  mrg   \parskip=\smallskipamount
   3616  1.1  mrg   \ifdim\parskip=0pt \parskip=2pt \fi
   3617  1.1  mrg   %
   3618  1.1  mrg   % Try typesetting the item mark that if the document erroneously says
   3619  1.1  mrg   % something like @itemize @samp (intending @table), there's an error
   3620  1.1  mrg   % right away at the @itemize.  It's not the best error message in the
   3621  1.1  mrg   % world, but it's better than leaving it to the @item.  This means if
   3622  1.1  mrg   % the user wants an empty mark, they have to say @w{} not just @w.
   3623  1.1  mrg   \def\itemcontents{#1}%
   3624  1.1  mrg   \setbox0 = \hbox{\itemcontents}%
   3625  1.1  mrg   %
   3626  1.1  mrg   % @itemize with no arg is equivalent to @itemize @bullet.
   3627  1.1  mrg   \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
   3628  1.1  mrg   %
   3629  1.1  mrg   \let\item=\itemizeitem
   3630  1.1  mrg }
   3631  1.1  mrg 
   3632  1.1  mrg % Definition of @item while inside @itemize and @enumerate.
   3633  1.1  mrg %
   3634  1.1  mrg \def\itemizeitem{%
   3635  1.1  mrg   \advance\itemno by 1  % for enumerations
   3636  1.1  mrg   {\let\par=\endgraf \smallbreak}% reasonable place to break
   3637  1.1  mrg   {%
   3638  1.1  mrg    % If the document has an @itemize directly after a section title, a
   3639  1.1  mrg    % \nobreak will be last on the list, and \sectionheading will have
   3640  1.1  mrg    % done a \vskip-\parskip.  In that case, we don't want to zero
   3641  1.1  mrg    % parskip, or the item text will crash with the heading.  On the
   3642  1.1  mrg    % other hand, when there is normal text preceding the item (as there
   3643  1.1  mrg    % usually is), we do want to zero parskip, or there would be too much
   3644  1.1  mrg    % space.  In that case, we won't have a \nobreak before.  At least
   3645  1.1  mrg    % that's the theory.
   3646  1.1  mrg    \ifnum\lastpenalty<10000 \parskip=0in \fi
   3647  1.1  mrg    \noindent
   3648  1.1  mrg    \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
   3649  1.1  mrg    %
   3650  1.1  mrg    \vadjust{\penalty 1200}}% not good to break after first line of item.
   3651  1.1  mrg   \flushcr
   3652  1.1  mrg }
   3653  1.1  mrg 
   3654  1.1  mrg % \splitoff TOKENS\endmark defines \first to be the first token in
   3655  1.1  mrg % TOKENS, and \rest to be the remainder.
   3656  1.1  mrg %
   3657  1.1  mrg \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
   3658  1.1  mrg 
   3659  1.1  mrg % Allow an optional argument of an uppercase letter, lowercase letter,
   3660  1.1  mrg % or number, to specify the first label in the enumerated list.  No
   3661  1.1  mrg % argument is the same as `1'.
   3662  1.1  mrg %
   3663  1.1  mrg \envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
   3664  1.1  mrg \def\enumeratey #1 #2\endenumeratey{%
   3665  1.1  mrg   % If we were given no argument, pretend we were given `1'.
   3666  1.1  mrg   \def\thearg{#1}%
   3667  1.1  mrg   \ifx\thearg\empty \def\thearg{1}\fi
   3668  1.1  mrg   %
   3669  1.1  mrg   % Detect if the argument is a single token.  If so, it might be a
   3670  1.1  mrg   % letter.  Otherwise, the only valid thing it can be is a number.
   3671  1.1  mrg   % (We will always have one token, because of the test we just made.
   3672  1.1  mrg   % This is a good thing, since \splitoff doesn't work given nothing at
   3673  1.1  mrg   % all -- the first parameter is undelimited.)
   3674  1.1  mrg   \expandafter\splitoff\thearg\endmark
   3675  1.1  mrg   \ifx\rest\empty
   3676  1.1  mrg     % Only one token in the argument.  It could still be anything.
   3677  1.1  mrg     % A ``lowercase letter'' is one whose \lccode is nonzero.
   3678  1.1  mrg     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
   3679  1.1  mrg     %   not equal to itself.
   3680  1.1  mrg     % Otherwise, we assume it's a number.
   3681  1.1  mrg     %
   3682  1.1  mrg     % We need the \relax at the end of the \ifnum lines to stop TeX from
   3683  1.1  mrg     % continuing to look for a <number>.
   3684  1.1  mrg     %
   3685  1.1  mrg     \ifnum\lccode\expandafter`\thearg=0\relax
   3686  1.1  mrg       \numericenumerate % a number (we hope)
   3687  1.1  mrg     \else
   3688  1.1  mrg       % It's a letter.
   3689  1.1  mrg       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
   3690  1.1  mrg         \lowercaseenumerate % lowercase letter
   3691  1.1  mrg       \else
   3692  1.1  mrg         \uppercaseenumerate % uppercase letter
   3693  1.1  mrg       \fi
   3694  1.1  mrg     \fi
   3695  1.1  mrg   \else
   3696  1.1  mrg     % Multiple tokens in the argument.  We hope it's a number.
   3697  1.1  mrg     \numericenumerate
   3698  1.1  mrg   \fi
   3699  1.1  mrg }
   3700  1.1  mrg 
   3701  1.1  mrg % An @enumerate whose labels are integers.  The starting integer is
   3702  1.1  mrg % given in \thearg.
   3703  1.1  mrg %
   3704  1.1  mrg \def\numericenumerate{%
   3705  1.1  mrg   \itemno = \thearg
   3706  1.1  mrg   \startenumeration{\the\itemno}%
   3707  1.1  mrg }
   3708  1.1  mrg 
   3709  1.1  mrg % The starting (lowercase) letter is in \thearg.
   3710  1.1  mrg \def\lowercaseenumerate{%
   3711  1.1  mrg   \itemno = \expandafter`\thearg
   3712  1.1  mrg   \startenumeration{%
   3713  1.1  mrg     % Be sure we're not beyond the end of the alphabet.
   3714  1.1  mrg     \ifnum\itemno=0
   3715  1.1  mrg       \errmessage{No more lowercase letters in @enumerate; get a bigger
   3716  1.1  mrg                   alphabet}%
   3717  1.1  mrg     \fi
   3718  1.1  mrg     \char\lccode\itemno
   3719  1.1  mrg   }%
   3720  1.1  mrg }
   3721  1.1  mrg 
   3722  1.1  mrg % The starting (uppercase) letter is in \thearg.
   3723  1.1  mrg \def\uppercaseenumerate{%
   3724  1.1  mrg   \itemno = \expandafter`\thearg
   3725  1.1  mrg   \startenumeration{%
   3726  1.1  mrg     % Be sure we're not beyond the end of the alphabet.
   3727  1.1  mrg     \ifnum\itemno=0
   3728  1.1  mrg       \errmessage{No more uppercase letters in @enumerate; get a bigger
   3729  1.1  mrg                   alphabet}
   3730  1.1  mrg     \fi
   3731  1.1  mrg     \char\uccode\itemno
   3732  1.1  mrg   }%
   3733  1.1  mrg }
   3734  1.1  mrg 
   3735  1.1  mrg % Call \doitemize, adding a period to the first argument and supplying the
   3736  1.1  mrg % common last two arguments.  Also subtract one from the initial value in
   3737  1.1  mrg % \itemno, since @item increments \itemno.
   3738  1.1  mrg %
   3739  1.1  mrg \def\startenumeration#1{%
   3740  1.1  mrg   \advance\itemno by -1
   3741  1.1  mrg   \doitemize{#1.}\flushcr
   3742  1.1  mrg }
   3743  1.1  mrg 
   3744  1.1  mrg % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
   3745  1.1  mrg % to @enumerate.
   3746  1.1  mrg %
   3747  1.1  mrg \def\alphaenumerate{\enumerate{a}}
   3748  1.1  mrg \def\capsenumerate{\enumerate{A}}
   3749  1.1  mrg \def\Ealphaenumerate{\Eenumerate}
   3750  1.1  mrg \def\Ecapsenumerate{\Eenumerate}
   3751  1.1  mrg 
   3752  1.1  mrg 
   3753  1.1  mrg % @multitable macros
   3754  1.1  mrg % Amy Hendrickson, 8/18/94, 3/6/96
   3755  1.1  mrg %
   3756  1.1  mrg % @multitable ... @end multitable will make as many columns as desired.
   3757  1.1  mrg % Contents of each column will wrap at width given in preamble.  Width
   3758  1.1  mrg % can be specified either with sample text given in a template line,
   3759  1.1  mrg % or in percent of \hsize, the current width of text on page.
   3760  1.1  mrg 
   3761  1.1  mrg % Table can continue over pages but will only break between lines.
   3762  1.1  mrg 
   3763  1.1  mrg % To make preamble:
   3764  1.1  mrg %
   3765  1.1  mrg % Either define widths of columns in terms of percent of \hsize:
   3766  1.1  mrg %   @multitable @columnfractions .25 .3 .45
   3767  1.1  mrg %   @item ...
   3768  1.1  mrg %
   3769  1.1  mrg %   Numbers following @columnfractions are the percent of the total
   3770  1.1  mrg %   current hsize to be used for each column. You may use as many
   3771  1.1  mrg %   columns as desired.
   3772  1.1  mrg 
   3773  1.1  mrg 
   3774  1.1  mrg % Or use a template:
   3775  1.1  mrg %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
   3776  1.1  mrg %   @item ...
   3777  1.1  mrg %   using the widest term desired in each column.
   3778  1.1  mrg 
   3779  1.1  mrg % Each new table line starts with @item, each subsequent new column
   3780  1.1  mrg % starts with @tab. Empty columns may be produced by supplying @tab's
   3781  1.1  mrg % with nothing between them for as many times as empty columns are needed,
   3782  1.1  mrg % ie, @tab@tab@tab will produce two empty columns.
   3783  1.1  mrg 
   3784  1.1  mrg % @item, @tab do not need to be on their own lines, but it will not hurt
   3785  1.1  mrg % if they are.
   3786  1.1  mrg 
   3787  1.1  mrg % Sample multitable:
   3788  1.1  mrg 
   3789  1.1  mrg %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
   3790  1.1  mrg %   @item first col stuff @tab second col stuff @tab third col
   3791  1.1  mrg %   @item
   3792  1.1  mrg %   first col stuff
   3793  1.1  mrg %   @tab
   3794  1.1  mrg %   second col stuff
   3795  1.1  mrg %   @tab
   3796  1.1  mrg %   third col
   3797  1.1  mrg %   @item first col stuff @tab second col stuff
   3798  1.1  mrg %   @tab Many paragraphs of text may be used in any column.
   3799  1.1  mrg %
   3800  1.1  mrg %         They will wrap at the width determined by the template.
   3801  1.1  mrg %   @item@tab@tab This will be in third column.
   3802  1.1  mrg %   @end multitable
   3803  1.1  mrg 
   3804  1.1  mrg % Default dimensions may be reset by user.
   3805  1.1  mrg % @multitableparskip is vertical space between paragraphs in table.
   3806  1.1  mrg % @multitableparindent is paragraph indent in table.
   3807  1.1  mrg % @multitablecolmargin is horizontal space to be left between columns.
   3808  1.1  mrg % @multitablelinespace is space to leave between table items, baseline
   3809  1.1  mrg %                                                            to baseline.
   3810  1.1  mrg %   0pt means it depends on current normal line spacing.
   3811  1.1  mrg %
   3812  1.1  mrg \newskip\multitableparskip
   3813  1.1  mrg \newskip\multitableparindent
   3814  1.1  mrg \newdimen\multitablecolspace
   3815  1.1  mrg \newskip\multitablelinespace
   3816  1.1  mrg \multitableparskip=0pt
   3817  1.1  mrg \multitableparindent=6pt
   3818  1.1  mrg \multitablecolspace=12pt
   3819  1.1  mrg \multitablelinespace=0pt
   3820  1.1  mrg 
   3821  1.1  mrg % Macros used to set up halign preamble:
   3822  1.1  mrg %
   3823  1.1  mrg \let\endsetuptable\relax
   3824  1.1  mrg \def\xendsetuptable{\endsetuptable}
   3825  1.1  mrg \let\columnfractions\relax
   3826  1.1  mrg \def\xcolumnfractions{\columnfractions}
   3827  1.1  mrg \newif\ifsetpercent
   3828  1.1  mrg 
   3829  1.1  mrg % #1 is the @columnfraction, usually a decimal number like .5, but might
   3830  1.1  mrg % be just 1.  We just use it, whatever it is.
   3831  1.1  mrg %
   3832  1.1  mrg \def\pickupwholefraction#1 {%
   3833  1.1  mrg   \global\advance\colcount by 1
   3834  1.1  mrg   \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
   3835  1.1  mrg   \setuptable
   3836  1.1  mrg }
   3837  1.1  mrg 
   3838  1.1  mrg \newcount\colcount
   3839  1.1  mrg \def\setuptable#1{%
   3840  1.1  mrg   \def\firstarg{#1}%
   3841  1.1  mrg   \ifx\firstarg\xendsetuptable
   3842  1.1  mrg     \let\go = \relax
   3843  1.1  mrg   \else
   3844  1.1  mrg     \ifx\firstarg\xcolumnfractions
   3845  1.1  mrg       \global\setpercenttrue
   3846  1.1  mrg     \else
   3847  1.1  mrg       \ifsetpercent
   3848  1.1  mrg          \let\go\pickupwholefraction
   3849  1.1  mrg       \else
   3850  1.1  mrg          \global\advance\colcount by 1
   3851  1.1  mrg          \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
   3852  1.1  mrg                    % separator; typically that is always in the input, anyway.
   3853  1.1  mrg          \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
   3854  1.1  mrg       \fi
   3855  1.1  mrg     \fi
   3856  1.1  mrg     \ifx\go\pickupwholefraction
   3857  1.1  mrg       % Put the argument back for the \pickupwholefraction call, so
   3858  1.1  mrg       % we'll always have a period there to be parsed.
   3859  1.1  mrg       \def\go{\pickupwholefraction#1}%
   3860  1.1  mrg     \else
   3861  1.1  mrg       \let\go = \setuptable
   3862  1.1  mrg     \fi%
   3863  1.1  mrg   \fi
   3864  1.1  mrg   \go
   3865  1.1  mrg }
   3866  1.1  mrg 
   3867  1.1  mrg % multitable-only commands.
   3868  1.1  mrg %
   3869  1.1  mrg % @headitem starts a heading row, which we typeset in bold.
   3870  1.1  mrg % Assignments have to be global since we are inside the implicit group
   3871  1.1  mrg % of an alignment entry.  \everycr resets \everytab so we don't have to
   3872  1.1  mrg % undo it ourselves.
   3873  1.1  mrg \def\headitemfont{\b}% for people to use in the template row; not changeable
   3874  1.1  mrg \def\headitem{%
   3875  1.1  mrg   \checkenv\multitable
   3876  1.1  mrg   \crcr
   3877  1.1  mrg   \global\everytab={\bf}% can't use \headitemfont since the parsing differs
   3878  1.1  mrg   \the\everytab % for the first item
   3879  1.1  mrg }%
   3880  1.1  mrg %
   3881  1.1  mrg % A \tab used to include \hskip1sp.  But then the space in a template
   3882  1.1  mrg % line is not enough.  That is bad.  So let's go back to just `&' until
   3883  1.1  mrg % we again encounter the problem the 1sp was intended to solve.
   3884  1.1  mrg %					--karl, nathan (a] acm.org, 20apr99.
   3885  1.1  mrg \def\tab{\checkenv\multitable &\the\everytab}%
   3886  1.1  mrg 
   3887  1.1  mrg % @multitable ... @end multitable definitions:
   3888  1.1  mrg %
   3889  1.1  mrg \newtoks\everytab  % insert after every tab.
   3890  1.1  mrg %
   3891  1.1  mrg \envdef\multitable{%
   3892  1.1  mrg   \vskip\parskip
   3893  1.1  mrg   \startsavinginserts
   3894  1.1  mrg   %
   3895  1.1  mrg   % @item within a multitable starts a normal row.
   3896  1.1  mrg   % We use \def instead of \let so that if one of the multitable entries
   3897  1.1  mrg   % contains an @itemize, we don't choke on the \item (seen as \crcr aka
   3898  1.1  mrg   % \endtemplate) expanding \doitemize.
   3899  1.1  mrg   \def\item{\crcr}%
   3900  1.1  mrg   %
   3901  1.1  mrg   \tolerance=9500
   3902  1.1  mrg   \hbadness=9500
   3903  1.1  mrg   \setmultitablespacing
   3904  1.1  mrg   \parskip=\multitableparskip
   3905  1.1  mrg   \parindent=\multitableparindent
   3906  1.1  mrg   \overfullrule=0pt
   3907  1.1  mrg   \global\colcount=0
   3908  1.1  mrg   %
   3909  1.1  mrg   \everycr = {%
   3910  1.1  mrg     \noalign{%
   3911  1.1  mrg       \global\everytab={}%
   3912  1.1  mrg       \global\colcount=0 % Reset the column counter.
   3913  1.1  mrg       % Check for saved footnotes, etc.
   3914  1.1  mrg       \checkinserts
   3915  1.1  mrg       % Keeps underfull box messages off when table breaks over pages.
   3916  1.1  mrg       %\filbreak
   3917  1.1  mrg 	% Maybe so, but it also creates really weird page breaks when the
   3918  1.1  mrg 	% table breaks over pages. Wouldn't \vfil be better?  Wait until the
   3919  1.1  mrg 	% problem manifests itself, so it can be fixed for real --karl.
   3920  1.1  mrg     }%
   3921  1.1  mrg   }%
   3922  1.1  mrg   %
   3923  1.1  mrg   \parsearg\domultitable
   3924  1.1  mrg }
   3925  1.1  mrg \def\domultitable#1{%
   3926  1.1  mrg   % To parse everything between @multitable and @item:
   3927  1.1  mrg   \setuptable#1 \endsetuptable
   3928  1.1  mrg   %
   3929  1.1  mrg   % This preamble sets up a generic column definition, which will
   3930  1.1  mrg   % be used as many times as user calls for columns.
   3931  1.1  mrg   % \vtop will set a single line and will also let text wrap and
   3932  1.1  mrg   % continue for many paragraphs if desired.
   3933  1.1  mrg   \halign\bgroup &%
   3934  1.1  mrg     \global\advance\colcount by 1
   3935  1.1  mrg     \multistrut
   3936  1.1  mrg     \vtop{%
   3937  1.1  mrg       % Use the current \colcount to find the correct column width:
   3938  1.1  mrg       \hsize=\expandafter\csname col\the\colcount\endcsname
   3939  1.1  mrg       %
   3940  1.1  mrg       % In order to keep entries from bumping into each other
   3941  1.1  mrg       % we will add a \leftskip of \multitablecolspace to all columns after
   3942  1.1  mrg       % the first one.
   3943  1.1  mrg       %
   3944  1.1  mrg       % If a template has been used, we will add \multitablecolspace
   3945  1.1  mrg       % to the width of each template entry.
   3946  1.1  mrg       %
   3947  1.1  mrg       % If the user has set preamble in terms of percent of \hsize we will
   3948  1.1  mrg       % use that dimension as the width of the column, and the \leftskip
   3949  1.1  mrg       % will keep entries from bumping into each other.  Table will start at
   3950  1.1  mrg       % left margin and final column will justify at right margin.
   3951  1.1  mrg       %
   3952  1.1  mrg       % Make sure we don't inherit \rightskip from the outer environment.
   3953  1.1  mrg       \rightskip=0pt
   3954  1.1  mrg       \ifnum\colcount=1
   3955  1.1  mrg 	% The first column will be indented with the surrounding text.
   3956  1.1  mrg 	\advance\hsize by\leftskip
   3957  1.1  mrg       \else
   3958  1.1  mrg 	\ifsetpercent \else
   3959  1.1  mrg 	  % If user has not set preamble in terms of percent of \hsize
   3960  1.1  mrg 	  % we will advance \hsize by \multitablecolspace.
   3961  1.1  mrg 	  \advance\hsize by \multitablecolspace
   3962  1.1  mrg 	\fi
   3963  1.1  mrg        % In either case we will make \leftskip=\multitablecolspace:
   3964  1.1  mrg       \leftskip=\multitablecolspace
   3965  1.1  mrg       \fi
   3966  1.1  mrg       % Ignoring space at the beginning and end avoids an occasional spurious
   3967  1.1  mrg       % blank line, when TeX decides to break the line at the space before the
   3968  1.1  mrg       % box from the multistrut, so the strut ends up on a line by itself.
   3969  1.1  mrg       % For example:
   3970  1.1  mrg       % @multitable @columnfractions .11 .89
   3971  1.1  mrg       % @item @code{#}
   3972  1.1  mrg       % @tab Legal holiday which is valid in major parts of the whole country.
   3973  1.1  mrg       % Is automatically provided with highlighting sequences respectively
   3974  1.1  mrg       % marking characters.
   3975  1.1  mrg       \noindent\ignorespaces##\unskip\multistrut
   3976  1.1  mrg     }\cr
   3977  1.1  mrg }
   3978  1.1  mrg \def\Emultitable{%
   3979  1.1  mrg   \crcr
   3980  1.1  mrg   \egroup % end the \halign
   3981  1.1  mrg   \global\setpercentfalse
   3982  1.1  mrg }
   3983  1.1  mrg 
   3984  1.1  mrg \def\setmultitablespacing{%
   3985  1.1  mrg   \def\multistrut{\strut}% just use the standard line spacing
   3986  1.1  mrg   %
   3987  1.1  mrg   % Compute \multitablelinespace (if not defined by user) for use in
   3988  1.1  mrg   % \multitableparskip calculation.  We used define \multistrut based on
   3989  1.1  mrg   % this, but (ironically) that caused the spacing to be off.
   3990  1.1  mrg   % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
   3991  1.1  mrg \ifdim\multitablelinespace=0pt
   3992  1.1  mrg \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
   3993  1.1  mrg \global\advance\multitablelinespace by-\ht0
   3994  1.1  mrg \fi
   3995  1.1  mrg % Test to see if parskip is larger than space between lines of
   3996  1.1  mrg % table. If not, do nothing.
   3997  1.1  mrg %        If so, set to same dimension as multitablelinespace.
   3998  1.1  mrg \ifdim\multitableparskip>\multitablelinespace
   3999  1.1  mrg \global\multitableparskip=\multitablelinespace
   4000  1.1  mrg \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
   4001  1.1  mrg                                       % than skip between lines in the table.
   4002  1.1  mrg \fi%
   4003  1.1  mrg \ifdim\multitableparskip=0pt
   4004  1.1  mrg \global\multitableparskip=\multitablelinespace
   4005  1.1  mrg \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
   4006  1.1  mrg                                       % than skip between lines in the table.
   4007  1.1  mrg \fi}
   4008  1.1  mrg 
   4009  1.1  mrg 
   4010  1.1  mrg \message{conditionals,}
   4011  1.1  mrg 
   4012  1.1  mrg % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
   4013  1.1  mrg % @ifnotxml always succeed.  They currently do nothing; we don't
   4014  1.1  mrg % attempt to check whether the conditionals are properly nested.  But we
   4015  1.1  mrg % have to remember that they are conditionals, so that @end doesn't
   4016  1.1  mrg % attempt to close an environment group.
   4017  1.1  mrg %
   4018  1.1  mrg \def\makecond#1{%
   4019  1.1  mrg   \expandafter\let\csname #1\endcsname = \relax
   4020  1.1  mrg   \expandafter\let\csname iscond.#1\endcsname = 1
   4021  1.1  mrg }
   4022  1.1  mrg \makecond{iftex}
   4023  1.1  mrg \makecond{ifnotdocbook}
   4024  1.1  mrg \makecond{ifnothtml}
   4025  1.1  mrg \makecond{ifnotinfo}
   4026  1.1  mrg \makecond{ifnotplaintext}
   4027  1.1  mrg \makecond{ifnotxml}
   4028  1.1  mrg 
   4029  1.1  mrg % Ignore @ignore, @ifhtml, @ifinfo, and the like.
   4030  1.1  mrg %
   4031  1.1  mrg \def\direntry{\doignore{direntry}}
   4032  1.1  mrg \def\documentdescription{\doignore{documentdescription}}
   4033  1.1  mrg \def\docbook{\doignore{docbook}}
   4034  1.1  mrg \def\html{\doignore{html}}
   4035  1.1  mrg \def\ifdocbook{\doignore{ifdocbook}}
   4036  1.1  mrg \def\ifhtml{\doignore{ifhtml}}
   4037  1.1  mrg \def\ifinfo{\doignore{ifinfo}}
   4038  1.1  mrg \def\ifnottex{\doignore{ifnottex}}
   4039  1.1  mrg \def\ifplaintext{\doignore{ifplaintext}}
   4040  1.1  mrg \def\ifxml{\doignore{ifxml}}
   4041  1.1  mrg \def\ignore{\doignore{ignore}}
   4042  1.1  mrg \def\menu{\doignore{menu}}
   4043  1.1  mrg \def\xml{\doignore{xml}}
   4044  1.1  mrg 
   4045  1.1  mrg % Ignore text until a line `@end #1', keeping track of nested conditionals.
   4046  1.1  mrg %
   4047  1.1  mrg % A count to remember the depth of nesting.
   4048  1.1  mrg \newcount\doignorecount
   4049  1.1  mrg 
   4050  1.1  mrg \def\doignore#1{\begingroup
   4051  1.1  mrg   % Scan in ``verbatim'' mode:
   4052  1.1  mrg   \obeylines
   4053  1.1  mrg   \catcode`\@ = \other
   4054  1.1  mrg   \catcode`\{ = \other
   4055  1.1  mrg   \catcode`\} = \other
   4056  1.1  mrg   %
   4057  1.1  mrg   % Make sure that spaces turn into tokens that match what \doignoretext wants.
   4058  1.1  mrg   \spaceisspace
   4059  1.1  mrg   %
   4060  1.1  mrg   % Count number of #1's that we've seen.
   4061  1.1  mrg   \doignorecount = 0
   4062  1.1  mrg   %
   4063  1.1  mrg   % Swallow text until we reach the matching `@end #1'.
   4064  1.1  mrg   \dodoignore{#1}%
   4065  1.1  mrg }
   4066  1.1  mrg 
   4067  1.1  mrg { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
   4068  1.1  mrg   \obeylines %
   4069  1.1  mrg   %
   4070  1.1  mrg   \gdef\dodoignore#1{%
   4071  1.1  mrg     % #1 contains the command name as a string, e.g., `ifinfo'.
   4072  1.1  mrg     %
   4073  1.1  mrg     % Define a command to find the next `@end #1'.
   4074  1.1  mrg     \long\def\doignoretext##1^^M@end #1{%
   4075  1.1  mrg       \doignoretextyyy##1^^M@#1\_STOP_}%
   4076  1.1  mrg     %
   4077  1.1  mrg     % And this command to find another #1 command, at the beginning of a
   4078  1.1  mrg     % line.  (Otherwise, we would consider a line `@c @ifset', for
   4079  1.1  mrg     % example, to count as an @ifset for nesting.)
   4080  1.1  mrg     \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
   4081  1.1  mrg     %
   4082  1.1  mrg     % And now expand that command.
   4083  1.1  mrg     \doignoretext ^^M%
   4084  1.1  mrg   }%
   4085  1.1  mrg }
   4086  1.1  mrg 
   4087  1.1  mrg \def\doignoreyyy#1{%
   4088  1.1  mrg   \def\temp{#1}%
   4089  1.1  mrg   \ifx\temp\empty			% Nothing found.
   4090  1.1  mrg     \let\next\doignoretextzzz
   4091  1.1  mrg   \else					% Found a nested condition, ...
   4092  1.1  mrg     \advance\doignorecount by 1
   4093  1.1  mrg     \let\next\doignoretextyyy		% ..., look for another.
   4094  1.1  mrg     % If we're here, #1 ends with ^^M\ifinfo (for example).
   4095  1.1  mrg   \fi
   4096  1.1  mrg   \next #1% the token \_STOP_ is present just after this macro.
   4097  1.1  mrg }
   4098  1.1  mrg 
   4099  1.1  mrg % We have to swallow the remaining "\_STOP_".
   4100  1.1  mrg %
   4101  1.1  mrg \def\doignoretextzzz#1{%
   4102  1.1  mrg   \ifnum\doignorecount = 0	% We have just found the outermost @end.
   4103  1.1  mrg     \let\next\enddoignore
   4104  1.1  mrg   \else				% Still inside a nested condition.
   4105  1.1  mrg     \advance\doignorecount by -1
   4106  1.1  mrg     \let\next\doignoretext      % Look for the next @end.
   4107  1.1  mrg   \fi
   4108  1.1  mrg   \next
   4109  1.1  mrg }
   4110  1.1  mrg 
   4111  1.1  mrg % Finish off ignored text.
   4112  1.1  mrg { \obeylines%
   4113  1.1  mrg   % Ignore anything after the last `@end #1'; this matters in verbatim
   4114  1.1  mrg   % environments, where otherwise the newline after an ignored conditional
   4115  1.1  mrg   % would result in a blank line in the output.
   4116  1.1  mrg   \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
   4117  1.1  mrg }
   4118  1.1  mrg 
   4119  1.1  mrg 
   4120  1.1  mrg % @set VAR sets the variable VAR to an empty value.
   4121  1.1  mrg % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
   4122  1.1  mrg %
   4123  1.1  mrg % Since we want to separate VAR from REST-OF-LINE (which might be
   4124  1.1  mrg % empty), we can't just use \parsearg; we have to insert a space of our
   4125  1.1  mrg % own to delimit the rest of the line, and then take it out again if we
   4126  1.1  mrg % didn't need it.
   4127  1.1  mrg % We rely on the fact that \parsearg sets \catcode`\ =10.
   4128  1.1  mrg %
   4129  1.1  mrg \parseargdef\set{\setyyy#1 \endsetyyy}
   4130  1.1  mrg \def\setyyy#1 #2\endsetyyy{%
   4131  1.1  mrg   {%
   4132  1.1  mrg     \makevalueexpandable
   4133  1.1  mrg     \def\temp{#2}%
   4134  1.1  mrg     \edef\next{\gdef\makecsname{SET#1}}%
   4135  1.1  mrg     \ifx\temp\empty
   4136  1.1  mrg       \next{}%
   4137  1.1  mrg     \else
   4138  1.1  mrg       \setzzz#2\endsetzzz
   4139  1.1  mrg     \fi
   4140  1.1  mrg   }%
   4141  1.1  mrg }
   4142  1.1  mrg % Remove the trailing space \setxxx inserted.
   4143  1.1  mrg \def\setzzz#1 \endsetzzz{\next{#1}}
   4144  1.1  mrg 
   4145  1.1  mrg % @clear VAR clears (i.e., unsets) the variable VAR.
   4146  1.1  mrg %
   4147  1.1  mrg \parseargdef\clear{%
   4148  1.1  mrg   {%
   4149  1.1  mrg     \makevalueexpandable
   4150  1.1  mrg     \global\expandafter\let\csname SET#1\endcsname=\relax
   4151  1.1  mrg   }%
   4152  1.1  mrg }
   4153  1.1  mrg 
   4154  1.1  mrg % @value{foo} gets the text saved in variable foo.
   4155  1.1  mrg \def\value{\begingroup\makevalueexpandable\valuexxx}
   4156  1.1  mrg \def\valuexxx#1{\expandablevalue{#1}\endgroup}
   4157  1.1  mrg {
   4158  1.1  mrg   \catcode`\- = \active \catcode`\_ = \active
   4159  1.1  mrg   %
   4160  1.1  mrg   \gdef\makevalueexpandable{%
   4161  1.1  mrg     \let\value = \expandablevalue
   4162  1.1  mrg     % We don't want these characters active, ...
   4163  1.1  mrg     \catcode`\-=\other \catcode`\_=\other
   4164  1.1  mrg     % ..., but we might end up with active ones in the argument if
   4165  1.1  mrg     % we're called from @code, as @code{@value{foo-bar_}}, though.
   4166  1.1  mrg     % So \let them to their normal equivalents.
   4167  1.1  mrg     \let-\realdash \let_\normalunderscore
   4168  1.1  mrg   }
   4169  1.1  mrg }
   4170  1.1  mrg 
   4171  1.1  mrg % We have this subroutine so that we can handle at least some @value's
   4172  1.1  mrg % properly in indexes (we call \makevalueexpandable in \indexdummies).
   4173  1.1  mrg % The command has to be fully expandable (if the variable is set), since
   4174  1.1  mrg % the result winds up in the index file.  This means that if the
   4175  1.1  mrg % variable's value contains other Texinfo commands, it's almost certain
   4176  1.1  mrg % it will fail (although perhaps we could fix that with sufficient work
   4177  1.1  mrg % to do a one-level expansion on the result, instead of complete).
   4178  1.1  mrg %
   4179  1.1  mrg \def\expandablevalue#1{%
   4180  1.1  mrg   \expandafter\ifx\csname SET#1\endcsname\relax
   4181  1.1  mrg     {[No value for ``#1'']}%
   4182  1.1  mrg     \message{Variable `#1', used in @value, is not set.}%
   4183  1.1  mrg   \else
   4184  1.1  mrg     \csname SET#1\endcsname
   4185  1.1  mrg   \fi
   4186  1.1  mrg }
   4187  1.1  mrg 
   4188  1.1  mrg % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
   4189  1.1  mrg % with @set.
   4190  1.1  mrg %
   4191  1.1  mrg % To get special treatment of `@end ifset,' call \makeond and the redefine.
   4192  1.1  mrg %
   4193  1.1  mrg \makecond{ifset}
   4194  1.1  mrg \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
   4195  1.1  mrg \def\doifset#1#2{%
   4196  1.1  mrg   {%
   4197  1.1  mrg     \makevalueexpandable
   4198  1.1  mrg     \let\next=\empty
   4199  1.1  mrg     \expandafter\ifx\csname SET#2\endcsname\relax
   4200  1.1  mrg       #1% If not set, redefine \next.
   4201  1.1  mrg     \fi
   4202  1.1  mrg     \expandafter
   4203  1.1  mrg   }\next
   4204  1.1  mrg }
   4205  1.1  mrg \def\ifsetfail{\doignore{ifset}}
   4206  1.1  mrg 
   4207  1.1  mrg % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
   4208  1.1  mrg % defined with @set, or has been undefined with @clear.
   4209  1.1  mrg %
   4210  1.1  mrg % The `\else' inside the `\doifset' parameter is a trick to reuse the
   4211  1.1  mrg % above code: if the variable is not set, do nothing, if it is set,
   4212  1.1  mrg % then redefine \next to \ifclearfail.
   4213  1.1  mrg %
   4214  1.1  mrg \makecond{ifclear}
   4215  1.1  mrg \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
   4216  1.1  mrg \def\ifclearfail{\doignore{ifclear}}
   4217  1.1  mrg 
   4218  1.1  mrg % @dircategory CATEGORY  -- specify a category of the dir file
   4219  1.1  mrg % which this file should belong to.  Ignore this in TeX.
   4220  1.1  mrg \let\dircategory=\comment
   4221  1.1  mrg 
   4222  1.1  mrg % @defininfoenclose.
   4223  1.1  mrg \let\definfoenclose=\comment
   4224  1.1  mrg 
   4225  1.1  mrg 
   4226  1.1  mrg \message{indexing,}
   4227  1.1  mrg % Index generation facilities
   4228  1.1  mrg 
   4229  1.1  mrg % Define \newwrite to be identical to plain tex's \newwrite
   4230  1.1  mrg % except not \outer, so it can be used within macros and \if's.
   4231  1.1  mrg \edef\newwrite{\makecsname{ptexnewwrite}}
   4232  1.1  mrg 
   4233  1.1  mrg % \newindex {foo} defines an index named foo.
   4234  1.1  mrg % It automatically defines \fooindex such that
   4235  1.1  mrg % \fooindex ...rest of line... puts an entry in the index foo.
   4236  1.1  mrg % It also defines \fooindfile to be the number of the output channel for
   4237  1.1  mrg % the file that accumulates this index.  The file's extension is foo.
   4238  1.1  mrg % The name of an index should be no more than 2 characters long
   4239  1.1  mrg % for the sake of vms.
   4240  1.1  mrg %
   4241  1.1  mrg \def\newindex#1{%
   4242  1.1  mrg   \iflinks
   4243  1.1  mrg     \expandafter\newwrite \csname#1indfile\endcsname
   4244  1.1  mrg     \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
   4245  1.1  mrg   \fi
   4246  1.1  mrg   \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
   4247  1.1  mrg     \noexpand\doindex{#1}}
   4248  1.1  mrg }
   4249  1.1  mrg 
   4250  1.1  mrg % @defindex foo  ==  \newindex{foo}
   4251  1.1  mrg %
   4252  1.1  mrg \def\defindex{\parsearg\newindex}
   4253  1.1  mrg 
   4254  1.1  mrg % Define @defcodeindex, like @defindex except put all entries in @code.
   4255  1.1  mrg %
   4256  1.1  mrg \def\defcodeindex{\parsearg\newcodeindex}
   4257  1.1  mrg %
   4258  1.1  mrg \def\newcodeindex#1{%
   4259  1.1  mrg   \iflinks
   4260  1.1  mrg     \expandafter\newwrite \csname#1indfile\endcsname
   4261  1.1  mrg     \openout \csname#1indfile\endcsname \jobname.#1
   4262  1.1  mrg   \fi
   4263  1.1  mrg   \expandafter\xdef\csname#1index\endcsname{%
   4264  1.1  mrg     \noexpand\docodeindex{#1}}%
   4265  1.1  mrg }
   4266  1.1  mrg 
   4267  1.1  mrg 
   4268  1.1  mrg % @synindex foo bar    makes index foo feed into index bar.
   4269  1.1  mrg % Do this instead of @defindex foo if you don't want it as a separate index.
   4270  1.1  mrg %
   4271  1.1  mrg % @syncodeindex foo bar   similar, but put all entries made for index foo
   4272  1.1  mrg % inside @code.
   4273  1.1  mrg %
   4274  1.1  mrg \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
   4275  1.1  mrg \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
   4276  1.1  mrg 
   4277  1.1  mrg % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
   4278  1.1  mrg % #3 the target index (bar).
   4279  1.1  mrg \def\dosynindex#1#2#3{%
   4280  1.1  mrg   % Only do \closeout if we haven't already done it, else we'll end up
   4281  1.1  mrg   % closing the target index.
   4282  1.1  mrg   \expandafter \ifx\csname donesynindex#2\endcsname \relax
   4283  1.1  mrg     % The \closeout helps reduce unnecessary open files; the limit on the
   4284  1.1  mrg     % Acorn RISC OS is a mere 16 files.
   4285  1.1  mrg     \expandafter\closeout\csname#2indfile\endcsname
   4286  1.1  mrg     \expandafter\let\csname donesynindex#2\endcsname = 1
   4287  1.1  mrg   \fi
   4288  1.1  mrg   % redefine \fooindfile:
   4289  1.1  mrg   \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
   4290  1.1  mrg   \expandafter\let\csname#2indfile\endcsname=\temp
   4291  1.1  mrg   % redefine \fooindex:
   4292  1.1  mrg   \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
   4293  1.1  mrg }
   4294  1.1  mrg 
   4295  1.1  mrg % Define \doindex, the driver for all \fooindex macros.
   4296  1.1  mrg % Argument #1 is generated by the calling \fooindex macro,
   4297  1.1  mrg %  and it is "foo", the name of the index.
   4298  1.1  mrg 
   4299  1.1  mrg % \doindex just uses \parsearg; it calls \doind for the actual work.
   4300  1.1  mrg % This is because \doind is more useful to call from other macros.
   4301  1.1  mrg 
   4302  1.1  mrg % There is also \dosubind {index}{topic}{subtopic}
   4303  1.1  mrg % which makes an entry in a two-level index such as the operation index.
   4304  1.1  mrg 
   4305  1.1  mrg \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
   4306  1.1  mrg \def\singleindexer #1{\doind{\indexname}{#1}}
   4307  1.1  mrg 
   4308  1.1  mrg % like the previous two, but they put @code around the argument.
   4309  1.1  mrg \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
   4310  1.1  mrg \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
   4311  1.1  mrg 
   4312  1.1  mrg % Take care of Texinfo commands that can appear in an index entry.
   4313  1.1  mrg % Since there are some commands we want to expand, and others we don't,
   4314  1.1  mrg % we have to laboriously prevent expansion for those that we don't.
   4315  1.1  mrg %
   4316  1.1  mrg \def\indexdummies{%
   4317  1.1  mrg   \escapechar = `\\     % use backslash in output files.
   4318  1.1  mrg   \def\@{@}% change to @@ when we switch to @ as escape char in index files.
   4319  1.1  mrg   \def\ {\realbackslash\space }%
   4320  1.1  mrg   %
   4321  1.1  mrg   % Need these unexpandable (because we define \tt as a dummy)
   4322  1.1  mrg   % definitions when @{ or @} appear in index entry text.  Also, more
   4323  1.1  mrg   % complicated, when \tex is in effect and \{ is a \delimiter again.
   4324  1.1  mrg   % We can't use \lbracecmd and \rbracecmd because texindex assumes
   4325  1.1  mrg   % braces and backslashes are used only as delimiters.  Perhaps we
   4326  1.1  mrg   % should define @lbrace and @rbrace commands a la @comma.
   4327  1.1  mrg   \def\{{{\tt\char123}}%
   4328  1.1  mrg   \def\}{{\tt\char125}}%
   4329  1.1  mrg   %
   4330  1.1  mrg   % I don't entirely understand this, but when an index entry is
   4331  1.1  mrg   % generated from a macro call, the \endinput which \scanmacro inserts
   4332  1.1  mrg   % causes processing to be prematurely terminated.  This is,
   4333  1.1  mrg   % apparently, because \indexsorttmp is fully expanded, and \endinput
   4334  1.1  mrg   % is an expandable command.  The redefinition below makes \endinput
   4335  1.1  mrg   % disappear altogether for that purpose -- although logging shows that
   4336  1.1  mrg   % processing continues to some further point.  On the other hand, it
   4337  1.1  mrg   % seems \endinput does not hurt in the printed index arg, since that
   4338  1.1  mrg   % is still getting written without apparent harm.
   4339  1.1  mrg   %
   4340  1.1  mrg   % Sample source (mac-idx3.tex, reported by Graham Percival to
   4341  1.1  mrg   % help-texinfo, 22may06):
   4342  1.1  mrg   % @macro funindex {WORD}
   4343  1.1  mrg   % @findex xyz
   4344  1.1  mrg   % @end macro
   4345  1.1  mrg   % ...
   4346  1.1  mrg   % @funindex commtest
   4347  1.1  mrg   %
   4348  1.1  mrg   % The above is not enough to reproduce the bug, but it gives the flavor.
   4349  1.1  mrg   %
   4350  1.1  mrg   % Sample whatsit resulting:
   4351  1.1  mrg   % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
   4352  1.1  mrg   %
   4353  1.1  mrg   % So:
   4354  1.1  mrg   \let\endinput = \empty
   4355  1.1  mrg   %
   4356  1.1  mrg   % Do the redefinitions.
   4357  1.1  mrg   \commondummies
   4358  1.1  mrg }
   4359  1.1  mrg 
   4360  1.1  mrg % For the aux and toc files, @ is the escape character.  So we want to
   4361  1.1  mrg % redefine everything using @ as the escape character (instead of
   4362  1.1  mrg % \realbackslash, still used for index files).  When everything uses @,
   4363  1.1  mrg % this will be simpler.
   4364  1.1  mrg %
   4365  1.1  mrg \def\atdummies{%
   4366  1.1  mrg   \def\@{@@}%
   4367  1.1  mrg   \def\ {@ }%
   4368  1.1  mrg   \let\{ = \lbraceatcmd
   4369  1.1  mrg   \let\} = \rbraceatcmd
   4370  1.1  mrg   %
   4371  1.1  mrg   % Do the redefinitions.
   4372  1.1  mrg   \commondummies
   4373  1.1  mrg   \otherbackslash
   4374  1.1  mrg }
   4375  1.1  mrg 
   4376  1.1  mrg % Called from \indexdummies and \atdummies.
   4377  1.1  mrg %
   4378  1.1  mrg \def\commondummies{%
   4379  1.1  mrg   %
   4380  1.1  mrg   % \definedummyword defines \#1 as \string\#1\space, thus effectively
   4381  1.1  mrg   % preventing its expansion.  This is used only for control words,
   4382  1.1  mrg   % not control letters, because the \space would be incorrect for
   4383  1.1  mrg   % control characters, but is needed to separate the control word
   4384  1.1  mrg   % from whatever follows.
   4385  1.1  mrg   %
   4386  1.1  mrg   % For control letters, we have \definedummyletter, which omits the
   4387  1.1  mrg   % space.
   4388  1.1  mrg   %
   4389  1.1  mrg   % These can be used both for control words that take an argument and
   4390  1.1  mrg   % those that do not.  If it is followed by {arg} in the input, then
   4391  1.1  mrg   % that will dutifully get written to the index (or wherever).
   4392  1.1  mrg   %
   4393  1.1  mrg   \def\definedummyword  ##1{\def##1{\string##1\space}}%
   4394  1.1  mrg   \def\definedummyletter##1{\def##1{\string##1}}%
   4395  1.1  mrg   \let\definedummyaccent\definedummyletter
   4396  1.1  mrg   %
   4397  1.1  mrg   \commondummiesnofonts
   4398  1.1  mrg   %
   4399  1.1  mrg   \definedummyletter\_%
   4400  1.1  mrg   \definedummyletter\-%
   4401  1.1  mrg   %
   4402  1.1  mrg   % Non-English letters.
   4403  1.1  mrg   \definedummyword\AA
   4404  1.1  mrg   \definedummyword\AE
   4405  1.1  mrg   \definedummyword\DH
   4406  1.1  mrg   \definedummyword\L
   4407  1.1  mrg   \definedummyword\O
   4408  1.1  mrg   \definedummyword\OE
   4409  1.1  mrg   \definedummyword\TH
   4410  1.1  mrg   \definedummyword\aa
   4411  1.1  mrg   \definedummyword\ae
   4412  1.1  mrg   \definedummyword\dh
   4413  1.1  mrg   \definedummyword\exclamdown
   4414  1.1  mrg   \definedummyword\l
   4415  1.1  mrg   \definedummyword\o
   4416  1.1  mrg   \definedummyword\oe
   4417  1.1  mrg   \definedummyword\ordf
   4418  1.1  mrg   \definedummyword\ordm
   4419  1.1  mrg   \definedummyword\questiondown
   4420  1.1  mrg   \definedummyword\ss
   4421  1.1  mrg   \definedummyword\th
   4422  1.1  mrg   %
   4423  1.1  mrg   % Although these internal commands shouldn't show up, sometimes they do.
   4424  1.1  mrg   \definedummyword\bf
   4425  1.1  mrg   \definedummyword\gtr
   4426  1.1  mrg   \definedummyword\hat
   4427  1.1  mrg   \definedummyword\less
   4428  1.1  mrg   \definedummyword\sf
   4429  1.1  mrg   \definedummyword\sl
   4430  1.1  mrg   \definedummyword\tclose
   4431  1.1  mrg   \definedummyword\tt
   4432  1.1  mrg   %
   4433  1.1  mrg   \definedummyword\LaTeX
   4434  1.1  mrg   \definedummyword\TeX
   4435  1.1  mrg   %
   4436  1.1  mrg   % Assorted special characters.
   4437  1.1  mrg   \definedummyword\arrow
   4438  1.1  mrg   \definedummyword\bullet
   4439  1.1  mrg   \definedummyword\comma
   4440  1.1  mrg   \definedummyword\copyright
   4441  1.1  mrg   \definedummyword\registeredsymbol
   4442  1.1  mrg   \definedummyword\dots
   4443  1.1  mrg   \definedummyword\enddots
   4444  1.1  mrg   \definedummyword\entrybreak
   4445  1.1  mrg   \definedummyword\equiv
   4446  1.1  mrg   \definedummyword\error
   4447  1.1  mrg   \definedummyword\euro
   4448  1.1  mrg   \definedummyword\expansion
   4449  1.1  mrg   \definedummyword\geq
   4450  1.1  mrg   \definedummyword\guillemetleft
   4451  1.1  mrg   \definedummyword\guillemetright
   4452  1.1  mrg   \definedummyword\guilsinglleft
   4453  1.1  mrg   \definedummyword\guilsinglright
   4454  1.1  mrg   \definedummyword\leq
   4455  1.1  mrg   \definedummyword\minus
   4456  1.1  mrg   \definedummyword\ogonek
   4457  1.1  mrg   \definedummyword\pounds
   4458  1.1  mrg   \definedummyword\point
   4459  1.1  mrg   \definedummyword\print
   4460  1.1  mrg   \definedummyword\quotedblbase
   4461  1.1  mrg   \definedummyword\quotedblleft
   4462  1.1  mrg   \definedummyword\quotedblright
   4463  1.1  mrg   \definedummyword\quoteleft
   4464  1.1  mrg   \definedummyword\quoteright
   4465  1.1  mrg   \definedummyword\quotesinglbase
   4466  1.1  mrg   \definedummyword\result
   4467  1.1  mrg   \definedummyword\textdegree
   4468  1.1  mrg   %
   4469  1.1  mrg   % We want to disable all macros so that they are not expanded by \write.
   4470  1.1  mrg   \macrolist
   4471  1.1  mrg   %
   4472  1.1  mrg   \normalturnoffactive
   4473  1.1  mrg   %
   4474  1.1  mrg   % Handle some cases of @value -- where it does not contain any
   4475  1.1  mrg   % (non-fully-expandable) commands.
   4476  1.1  mrg   \makevalueexpandable
   4477  1.1  mrg }
   4478  1.1  mrg 
   4479  1.1  mrg % \commondummiesnofonts: common to \commondummies and \indexnofonts.
   4480  1.1  mrg %
   4481  1.1  mrg \def\commondummiesnofonts{%
   4482  1.1  mrg   % Control letters and accents.
   4483  1.1  mrg   \definedummyletter\!%
   4484  1.1  mrg   \definedummyaccent\"%
   4485  1.1  mrg   \definedummyaccent\'%
   4486  1.1  mrg   \definedummyletter\*%
   4487  1.1  mrg   \definedummyaccent\,%
   4488  1.1  mrg   \definedummyletter\.%
   4489  1.1  mrg   \definedummyletter\/%
   4490  1.1  mrg   \definedummyletter\:%
   4491  1.1  mrg   \definedummyaccent\=%
   4492  1.1  mrg   \definedummyletter\?%
   4493  1.1  mrg   \definedummyaccent\^%
   4494  1.1  mrg   \definedummyaccent\`%
   4495  1.1  mrg   \definedummyaccent\~%
   4496  1.1  mrg   \definedummyword\u
   4497  1.1  mrg   \definedummyword\v
   4498  1.1  mrg   \definedummyword\H
   4499  1.1  mrg   \definedummyword\dotaccent
   4500  1.1  mrg   \definedummyword\ogonek
   4501  1.1  mrg   \definedummyword\ringaccent
   4502  1.1  mrg   \definedummyword\tieaccent
   4503  1.1  mrg   \definedummyword\ubaraccent
   4504  1.1  mrg   \definedummyword\udotaccent
   4505  1.1  mrg   \definedummyword\dotless
   4506  1.1  mrg   %
   4507  1.1  mrg   % Texinfo font commands.
   4508  1.1  mrg   \definedummyword\b
   4509  1.1  mrg   \definedummyword\i
   4510  1.1  mrg   \definedummyword\r
   4511  1.1  mrg   \definedummyword\sansserif
   4512  1.1  mrg   \definedummyword\sc
   4513  1.1  mrg   \definedummyword\slanted
   4514  1.1  mrg   \definedummyword\t
   4515  1.1  mrg   %
   4516  1.1  mrg   % Commands that take arguments.
   4517  1.1  mrg   \definedummyword\acronym
   4518  1.1  mrg   \definedummyword\anchor
   4519  1.1  mrg   \definedummyword\cite
   4520  1.1  mrg   \definedummyword\code
   4521  1.1  mrg   \definedummyword\command
   4522  1.1  mrg   \definedummyword\dfn
   4523  1.1  mrg   \definedummyword\dmn
   4524  1.1  mrg   \definedummyword\email
   4525  1.1  mrg   \definedummyword\emph
   4526  1.1  mrg   \definedummyword\env
   4527  1.1  mrg   \definedummyword\file
   4528  1.1  mrg   \definedummyword\indicateurl
   4529  1.1  mrg   \definedummyword\kbd
   4530  1.1  mrg   \definedummyword\key
   4531  1.1  mrg   \definedummyword\math
   4532  1.1  mrg   \definedummyword\option
   4533  1.1  mrg   \definedummyword\pxref
   4534  1.1  mrg   \definedummyword\ref
   4535  1.1  mrg   \definedummyword\samp
   4536  1.1  mrg   \definedummyword\strong
   4537  1.1  mrg   \definedummyword\tie
   4538  1.1  mrg   \definedummyword\uref
   4539  1.1  mrg   \definedummyword\url
   4540  1.1  mrg   \definedummyword\var
   4541  1.1  mrg   \definedummyword\verb
   4542  1.1  mrg   \definedummyword\w
   4543  1.1  mrg   \definedummyword\xref
   4544  1.1  mrg }
   4545  1.1  mrg 
   4546  1.1  mrg % \indexnofonts is used when outputting the strings to sort the index
   4547  1.1  mrg % by, and when constructing control sequence names.  It eliminates all
   4548  1.1  mrg % control sequences and just writes whatever the best ASCII sort string
   4549  1.1  mrg % would be for a given command (usually its argument).
   4550  1.1  mrg %
   4551  1.1  mrg \def\indexnofonts{%
   4552  1.1  mrg   % Accent commands should become @asis.
   4553  1.1  mrg   \def\definedummyaccent##1{\let##1\asis}%
   4554  1.1  mrg   % We can just ignore other control letters.
   4555  1.1  mrg   \def\definedummyletter##1{\let##1\empty}%
   4556  1.1  mrg   % All control words become @asis by default; overrides below.
   4557  1.1  mrg   \let\definedummyword\definedummyaccent
   4558  1.1  mrg   %
   4559  1.1  mrg   \commondummiesnofonts
   4560  1.1  mrg   %
   4561  1.1  mrg   % Don't no-op \tt, since it isn't a user-level command
   4562  1.1  mrg   % and is used in the definitions of the active chars like <, >, |, etc.
   4563  1.1  mrg   % Likewise with the other plain tex font commands.
   4564  1.1  mrg   %\let\tt=\asis
   4565  1.1  mrg   %
   4566  1.1  mrg   \def\ { }%
   4567  1.1  mrg   \def\@{@}%
   4568  1.1  mrg   \def\_{\normalunderscore}%
   4569  1.1  mrg   \def\-{}% @- shouldn't affect sorting
   4570  1.1  mrg   %
   4571  1.1  mrg   % Unfortunately, texindex is not prepared to handle braces in the
   4572  1.1  mrg   % content at all.  So for index sorting, we map @{ and @} to strings
   4573  1.1  mrg   % starting with |, since that ASCII character is between ASCII { and }.
   4574  1.1  mrg   \def\{{|a}%
   4575  1.1  mrg   \def\}{|b}%
   4576  1.1  mrg   %
   4577  1.1  mrg   % Non-English letters.
   4578  1.1  mrg   \def\AA{AA}%
   4579  1.1  mrg   \def\AE{AE}%
   4580  1.1  mrg   \def\DH{DZZ}%
   4581  1.1  mrg   \def\L{L}%
   4582  1.1  mrg   \def\OE{OE}%
   4583  1.1  mrg   \def\O{O}%
   4584  1.1  mrg   \def\TH{ZZZ}%
   4585  1.1  mrg   \def\aa{aa}%
   4586  1.1  mrg   \def\ae{ae}%
   4587  1.1  mrg   \def\dh{dzz}%
   4588  1.1  mrg   \def\exclamdown{!}%
   4589  1.1  mrg   \def\l{l}%
   4590  1.1  mrg   \def\oe{oe}%
   4591  1.1  mrg   \def\ordf{a}%
   4592  1.1  mrg   \def\ordm{o}%
   4593  1.1  mrg   \def\o{o}%
   4594  1.1  mrg   \def\questiondown{?}%
   4595  1.1  mrg   \def\ss{ss}%
   4596  1.1  mrg   \def\th{zzz}%
   4597  1.1  mrg   %
   4598  1.1  mrg   \def\LaTeX{LaTeX}%
   4599  1.1  mrg   \def\TeX{TeX}%
   4600  1.1  mrg   %
   4601  1.1  mrg   % Assorted special characters.
   4602  1.1  mrg   % (The following {} will end up in the sort string, but that's ok.)
   4603  1.1  mrg   \def\arrow{->}%
   4604  1.1  mrg   \def\bullet{bullet}%
   4605  1.1  mrg   \def\comma{,}%
   4606  1.1  mrg   \def\copyright{copyright}%
   4607  1.1  mrg   \def\dots{...}%
   4608  1.1  mrg   \def\enddots{...}%
   4609  1.1  mrg   \def\equiv{==}%
   4610  1.1  mrg   \def\error{error}%
   4611  1.1  mrg   \def\euro{euro}%
   4612  1.1  mrg   \def\expansion{==>}%
   4613  1.1  mrg   \def\geq{>=}%
   4614  1.1  mrg   \def\guillemetleft{<<}%
   4615  1.1  mrg   \def\guillemetright{>>}%
   4616  1.1  mrg   \def\guilsinglleft{<}%
   4617  1.1  mrg   \def\guilsinglright{>}%
   4618  1.1  mrg   \def\leq{<=}%
   4619  1.1  mrg   \def\minus{-}%
   4620  1.1  mrg   \def\point{.}%
   4621  1.1  mrg   \def\pounds{pounds}%
   4622  1.1  mrg   \def\print{-|}%
   4623  1.1  mrg   \def\quotedblbase{"}%
   4624  1.1  mrg   \def\quotedblleft{"}%
   4625  1.1  mrg   \def\quotedblright{"}%
   4626  1.1  mrg   \def\quoteleft{`}%
   4627  1.1  mrg   \def\quoteright{'}%
   4628  1.1  mrg   \def\quotesinglbase{,}%
   4629  1.1  mrg   \def\registeredsymbol{R}%
   4630  1.1  mrg   \def\result{=>}%
   4631  1.1  mrg   \def\textdegree{o}%
   4632  1.1  mrg   %
   4633  1.1  mrg   \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
   4634  1.1  mrg   \else \indexlquoteignore \fi
   4635  1.1  mrg   %
   4636  1.1  mrg   % We need to get rid of all macros, leaving only the arguments (if present).
   4637  1.1  mrg   % Of course this is not nearly correct, but it is the best we can do for now.
   4638  1.1  mrg   % makeinfo does not expand macros in the argument to @deffn, which ends up
   4639  1.1  mrg   % writing an index entry, and texindex isn't prepared for an index sort entry
   4640  1.1  mrg   % that starts with \.
   4641  1.1  mrg   %
   4642  1.1  mrg   % Since macro invocations are followed by braces, we can just redefine them
   4643  1.1  mrg   % to take a single TeX argument.  The case of a macro invocation that
   4644  1.1  mrg   % goes to end-of-line is not handled.
   4645  1.1  mrg   %
   4646  1.1  mrg   \macrolist
   4647  1.1  mrg }
   4648  1.1  mrg 
   4649  1.1  mrg % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
   4650  1.1  mrg % ignore left quotes in the sort term.
   4651  1.1  mrg {\catcode`\`=\active
   4652  1.1  mrg  \gdef\indexlquoteignore{\let`=\empty}}
   4653  1.1  mrg 
   4654  1.1  mrg \let\indexbackslash=0  %overridden during \printindex.
   4655  1.1  mrg \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
   4656  1.1  mrg 
   4657  1.1  mrg % Most index entries go through here, but \dosubind is the general case.
   4658  1.1  mrg % #1 is the index name, #2 is the entry text.
   4659  1.1  mrg \def\doind#1#2{\dosubind{#1}{#2}{}}
   4660  1.1  mrg 
   4661  1.1  mrg % Workhorse for all \fooindexes.
   4662  1.1  mrg % #1 is name of index, #2 is stuff to put there, #3 is subentry --
   4663  1.1  mrg % empty if called from \doind, as we usually are (the main exception
   4664  1.1  mrg % is with most defuns, which call us directly).
   4665  1.1  mrg %
   4666  1.1  mrg \def\dosubind#1#2#3{%
   4667  1.1  mrg   \iflinks
   4668  1.1  mrg   {%
   4669  1.1  mrg     % Store the main index entry text (including the third arg).
   4670  1.1  mrg     \toks0 = {#2}%
   4671  1.1  mrg     % If third arg is present, precede it with a space.
   4672  1.1  mrg     \def\thirdarg{#3}%
   4673  1.1  mrg     \ifx\thirdarg\empty \else
   4674  1.1  mrg       \toks0 = \expandafter{\the\toks0 \space #3}%
   4675  1.1  mrg     \fi
   4676  1.1  mrg     %
   4677  1.1  mrg     \edef\writeto{\csname#1indfile\endcsname}%
   4678  1.1  mrg     %
   4679  1.1  mrg     \safewhatsit\dosubindwrite
   4680  1.1  mrg   }%
   4681  1.1  mrg   \fi
   4682  1.1  mrg }
   4683  1.1  mrg 
   4684  1.1  mrg % Write the entry in \toks0 to the index file:
   4685  1.1  mrg %
   4686  1.1  mrg \def\dosubindwrite{%
   4687  1.1  mrg   % Put the index entry in the margin if desired.
   4688  1.1  mrg   \ifx\SETmarginindex\relax\else
   4689  1.1  mrg     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
   4690  1.1  mrg   \fi
   4691  1.1  mrg   %
   4692  1.1  mrg   % Remember, we are within a group.
   4693  1.1  mrg   \indexdummies % Must do this here, since \bf, etc expand at this stage
   4694  1.1  mrg   \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
   4695  1.1  mrg       % so it will be output as is; and it will print as backslash.
   4696  1.1  mrg   %
   4697  1.1  mrg   % Process the index entry with all font commands turned off, to
   4698  1.1  mrg   % get the string to sort by.
   4699  1.1  mrg   {\indexnofonts
   4700  1.1  mrg    \edef\temp{\the\toks0}% need full expansion
   4701  1.1  mrg    \xdef\indexsorttmp{\temp}%
   4702  1.1  mrg   }%
   4703  1.1  mrg   %
   4704  1.1  mrg   % Set up the complete index entry, with both the sort key and
   4705  1.1  mrg   % the original text, including any font commands.  We write
   4706  1.1  mrg   % three arguments to \entry to the .?? file (four in the
   4707  1.1  mrg   % subentry case), texindex reduces to two when writing the .??s
   4708  1.1  mrg   % sorted result.
   4709  1.1  mrg   \edef\temp{%
   4710  1.1  mrg     \write\writeto{%
   4711  1.1  mrg       \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
   4712  1.1  mrg   }%
   4713  1.1  mrg   \temp
   4714  1.1  mrg }
   4715  1.1  mrg 
   4716  1.1  mrg % Take care of unwanted page breaks/skips around a whatsit:
   4717  1.1  mrg %
   4718  1.1  mrg % If a skip is the last thing on the list now, preserve it
   4719  1.1  mrg % by backing up by \lastskip, doing the \write, then inserting
   4720  1.1  mrg % the skip again.  Otherwise, the whatsit generated by the
   4721  1.1  mrg % \write or \pdfdest will make \lastskip zero.  The result is that
   4722  1.1  mrg % sequences like this:
   4723  1.1  mrg % @end defun
   4724  1.1  mrg % @tindex whatever
   4725  1.1  mrg % @defun ...
   4726  1.1  mrg % will have extra space inserted, because the \medbreak in the
   4727  1.1  mrg % start of the @defun won't see the skip inserted by the @end of
   4728  1.1  mrg % the previous defun.
   4729  1.1  mrg %
   4730  1.1  mrg % But don't do any of this if we're not in vertical mode.  We
   4731  1.1  mrg % don't want to do a \vskip and prematurely end a paragraph.
   4732  1.1  mrg %
   4733  1.1  mrg % Avoid page breaks due to these extra skips, too.
   4734  1.1  mrg %
   4735  1.1  mrg % But wait, there is a catch there:
   4736  1.1  mrg % We'll have to check whether \lastskip is zero skip.  \ifdim is not
   4737  1.1  mrg % sufficient for this purpose, as it ignores stretch and shrink parts
   4738  1.1  mrg % of the skip.  The only way seems to be to check the textual
   4739  1.1  mrg % representation of the skip.
   4740  1.1  mrg %
   4741  1.1  mrg % The following is almost like \def\zeroskipmacro{0.0pt} except that
   4742  1.1  mrg % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
   4743  1.1  mrg %
   4744  1.1  mrg \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
   4745  1.1  mrg %
   4746  1.1  mrg \newskip\whatsitskip
   4747  1.1  mrg \newcount\whatsitpenalty
   4748  1.1  mrg %
   4749  1.1  mrg % ..., ready, GO:
   4750  1.1  mrg %
   4751  1.1  mrg \def\safewhatsit#1{\ifhmode
   4752  1.1  mrg   #1%
   4753  1.1  mrg  \else
   4754  1.1  mrg   % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
   4755  1.1  mrg   \whatsitskip = \lastskip
   4756  1.1  mrg   \edef\lastskipmacro{\the\lastskip}%
   4757  1.1  mrg   \whatsitpenalty = \lastpenalty
   4758  1.1  mrg   %
   4759  1.1  mrg   % If \lastskip is nonzero, that means the last item was a
   4760  1.1  mrg   % skip.  And since a skip is discardable, that means this
   4761  1.1  mrg   % -\whatsitskip glue we're inserting is preceded by a
   4762  1.1  mrg   % non-discardable item, therefore it is not a potential
   4763  1.1  mrg   % breakpoint, therefore no \nobreak needed.
   4764  1.1  mrg   \ifx\lastskipmacro\zeroskipmacro
   4765  1.1  mrg   \else
   4766  1.1  mrg     \vskip-\whatsitskip
   4767  1.1  mrg   \fi
   4768  1.1  mrg   %
   4769  1.1  mrg   #1%
   4770  1.1  mrg   %
   4771  1.1  mrg   \ifx\lastskipmacro\zeroskipmacro
   4772  1.1  mrg     % If \lastskip was zero, perhaps the last item was a penalty, and
   4773  1.1  mrg     % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
   4774  1.1  mrg     % to re-insert the same penalty (values >10000 are used for various
   4775  1.1  mrg     % signals); since we just inserted a non-discardable item, any
   4776  1.1  mrg     % following glue (such as a \parskip) would be a breakpoint.  For example:
   4777  1.1  mrg     %   @deffn deffn-whatever
   4778  1.1  mrg     %   @vindex index-whatever
   4779  1.1  mrg     %   Description.
   4780  1.1  mrg     % would allow a break between the index-whatever whatsit
   4781  1.1  mrg     % and the "Description." paragraph.
   4782  1.1  mrg     \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
   4783  1.1  mrg   \else
   4784  1.1  mrg     % On the other hand, if we had a nonzero \lastskip,
   4785  1.1  mrg     % this make-up glue would be preceded by a non-discardable item
   4786  1.1  mrg     % (the whatsit from the \write), so we must insert a \nobreak.
   4787  1.1  mrg     \nobreak\vskip\whatsitskip
   4788  1.1  mrg   \fi
   4789  1.1  mrg \fi}
   4790  1.1  mrg 
   4791  1.1  mrg % The index entry written in the file actually looks like
   4792  1.1  mrg %  \entry {sortstring}{page}{topic}
   4793  1.1  mrg % or
   4794  1.1  mrg %  \entry {sortstring}{page}{topic}{subtopic}
   4795  1.1  mrg % The texindex program reads in these files and writes files
   4796  1.1  mrg % containing these kinds of lines:
   4797  1.1  mrg %  \initial {c}
   4798  1.1  mrg %     before the first topic whose initial is c
   4799  1.1  mrg %  \entry {topic}{pagelist}
   4800  1.1  mrg %     for a topic that is used without subtopics
   4801  1.1  mrg %  \primary {topic}
   4802  1.1  mrg %     for the beginning of a topic that is used with subtopics
   4803  1.1  mrg %  \secondary {subtopic}{pagelist}
   4804  1.1  mrg %     for each subtopic.
   4805  1.1  mrg 
   4806  1.1  mrg % Define the user-accessible indexing commands
   4807  1.1  mrg % @findex, @vindex, @kindex, @cindex.
   4808  1.1  mrg 
   4809  1.1  mrg \def\findex {\fnindex}
   4810  1.1  mrg \def\kindex {\kyindex}
   4811  1.1  mrg \def\cindex {\cpindex}
   4812  1.1  mrg \def\vindex {\vrindex}
   4813  1.1  mrg \def\tindex {\tpindex}
   4814  1.1  mrg \def\pindex {\pgindex}
   4815  1.1  mrg 
   4816  1.1  mrg \def\cindexsub {\begingroup\obeylines\cindexsub}
   4817  1.1  mrg {\obeylines %
   4818  1.1  mrg \gdef\cindexsub "#1" #2^^M{\endgroup %
   4819  1.1  mrg \dosubind{cp}{#2}{#1}}}
   4820  1.1  mrg 
   4821  1.1  mrg % Define the macros used in formatting output of the sorted index material.
   4822  1.1  mrg 
   4823  1.1  mrg % @printindex causes a particular index (the ??s file) to get printed.
   4824  1.1  mrg % It does not print any chapter heading (usually an @unnumbered).
   4825  1.1  mrg %
   4826  1.1  mrg \parseargdef\printindex{\begingroup
   4827  1.1  mrg   \dobreak \chapheadingskip{10000}%
   4828  1.1  mrg   %
   4829  1.1  mrg   \smallfonts \rm
   4830  1.1  mrg   \tolerance = 9500
   4831  1.1  mrg   \plainfrenchspacing
   4832  1.1  mrg   \everypar = {}% don't want the \kern\-parindent from indentation suppression.
   4833  1.1  mrg   %
   4834  1.1  mrg   % See if the index file exists and is nonempty.
   4835  1.1  mrg   % Change catcode of @ here so that if the index file contains
   4836  1.1  mrg   % \initial {@}
   4837  1.1  mrg   % as its first line, TeX doesn't complain about mismatched braces
   4838  1.1  mrg   % (because it thinks @} is a control sequence).
   4839  1.1  mrg   \catcode`\@ = 11
   4840  1.1  mrg   \openin 1 \jobname.#1s
   4841  1.1  mrg   \ifeof 1
   4842  1.1  mrg     % \enddoublecolumns gets confused if there is no text in the index,
   4843  1.1  mrg     % and it loses the chapter title and the aux file entries for the
   4844  1.1  mrg     % index.  The easiest way to prevent this problem is to make sure
   4845  1.1  mrg     % there is some text.
   4846  1.1  mrg     \putwordIndexNonexistent
   4847  1.1  mrg   \else
   4848  1.1  mrg     %
   4849  1.1  mrg     % If the index file exists but is empty, then \openin leaves \ifeof
   4850  1.1  mrg     % false.  We have to make TeX try to read something from the file, so
   4851  1.1  mrg     % it can discover if there is anything in it.
   4852  1.1  mrg     \read 1 to \temp
   4853  1.1  mrg     \ifeof 1
   4854  1.1  mrg       \putwordIndexIsEmpty
   4855  1.1  mrg     \else
   4856  1.1  mrg       % Index files are almost Texinfo source, but we use \ as the escape
   4857  1.1  mrg       % character.  It would be better to use @, but that's too big a change
   4858  1.1  mrg       % to make right now.
   4859  1.1  mrg       \def\indexbackslash{\backslashcurfont}%
   4860  1.1  mrg       \catcode`\\ = 0
   4861  1.1  mrg       \escapechar = `\\
   4862  1.1  mrg       \begindoublecolumns
   4863  1.1  mrg       \input \jobname.#1s
   4864  1.1  mrg       \enddoublecolumns
   4865  1.1  mrg     \fi
   4866  1.1  mrg   \fi
   4867  1.1  mrg   \closein 1
   4868  1.1  mrg \endgroup}
   4869  1.1  mrg 
   4870  1.1  mrg % These macros are used by the sorted index file itself.
   4871  1.1  mrg % Change them to control the appearance of the index.
   4872  1.1  mrg 
   4873  1.1  mrg \def\initial#1{{%
   4874  1.1  mrg   % Some minor font changes for the special characters.
   4875  1.1  mrg   \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
   4876  1.1  mrg   %
   4877  1.1  mrg   % Remove any glue we may have, we'll be inserting our own.
   4878  1.1  mrg   \removelastskip
   4879  1.1  mrg   %
   4880  1.1  mrg   % We like breaks before the index initials, so insert a bonus.
   4881  1.1  mrg   \nobreak
   4882  1.1  mrg   \vskip 0pt plus 3\baselineskip
   4883  1.1  mrg   \penalty 0
   4884  1.1  mrg   \vskip 0pt plus -3\baselineskip
   4885  1.1  mrg   %
   4886  1.1  mrg   % Typeset the initial.  Making this add up to a whole number of
   4887  1.1  mrg   % baselineskips increases the chance of the dots lining up from column
   4888  1.1  mrg   % to column.  It still won't often be perfect, because of the stretch
   4889  1.1  mrg   % we need before each entry, but it's better.
   4890  1.1  mrg   %
   4891  1.1  mrg   % No shrink because it confuses \balancecolumns.
   4892  1.1  mrg   \vskip 1.67\baselineskip plus .5\baselineskip
   4893  1.1  mrg   \leftline{\secbf #1}%
   4894  1.1  mrg   % Do our best not to break after the initial.
   4895  1.1  mrg   \nobreak
   4896  1.1  mrg   \vskip .33\baselineskip plus .1\baselineskip
   4897  1.1  mrg }}
   4898  1.1  mrg 
   4899  1.1  mrg % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
   4900  1.1  mrg % then page number (#2) flushed to the right margin.  It is used for index
   4901  1.1  mrg % and table of contents entries.  The paragraph is indented by \leftskip.
   4902  1.1  mrg %
   4903  1.1  mrg % A straightforward implementation would start like this:
   4904  1.1  mrg %	\def\entry#1#2{...
   4905  1.1  mrg % But this freezes the catcodes in the argument, and can cause problems to
   4906  1.1  mrg % @code, which sets - active.  This problem was fixed by a kludge---
   4907  1.1  mrg % ``-'' was active throughout whole index, but this isn't really right.
   4908  1.1  mrg % The right solution is to prevent \entry from swallowing the whole text.
   4909  1.1  mrg %                                 --kasal, 21nov03
   4910  1.1  mrg \def\entry{%
   4911  1.1  mrg   \begingroup
   4912  1.1  mrg     %
   4913  1.1  mrg     % Start a new paragraph if necessary, so our assignments below can't
   4914  1.1  mrg     % affect previous text.
   4915  1.1  mrg     \par
   4916  1.1  mrg     %
   4917  1.1  mrg     % Do not fill out the last line with white space.
   4918  1.1  mrg     \parfillskip = 0in
   4919  1.1  mrg     %
   4920  1.1  mrg     % No extra space above this paragraph.
   4921  1.1  mrg     \parskip = 0in
   4922  1.1  mrg     %
   4923  1.1  mrg     % Do not prefer a separate line ending with a hyphen to fewer lines.
   4924  1.1  mrg     \finalhyphendemerits = 0
   4925  1.1  mrg     %
   4926  1.1  mrg     % \hangindent is only relevant when the entry text and page number
   4927  1.1  mrg     % don't both fit on one line.  In that case, bob suggests starting the
   4928  1.1  mrg     % dots pretty far over on the line.  Unfortunately, a large
   4929  1.1  mrg     % indentation looks wrong when the entry text itself is broken across
   4930  1.1  mrg     % lines.  So we use a small indentation and put up with long leaders.
   4931  1.1  mrg     %
   4932  1.1  mrg     % \hangafter is reset to 1 (which is the value we want) at the start
   4933  1.1  mrg     % of each paragraph, so we need not do anything with that.
   4934  1.1  mrg     \hangindent = 2em
   4935  1.1  mrg     %
   4936  1.1  mrg     % When the entry text needs to be broken, just fill out the first line
   4937  1.1  mrg     % with blank space.
   4938  1.1  mrg     \rightskip = 0pt plus1fil
   4939  1.1  mrg     %
   4940  1.1  mrg     % A bit of stretch before each entry for the benefit of balancing
   4941  1.1  mrg     % columns.
   4942  1.1  mrg     \vskip 0pt plus1pt
   4943  1.1  mrg     %
   4944  1.1  mrg     % When reading the text of entry, convert explicit line breaks
   4945  1.1  mrg     % from @* into spaces.  The user might give these in long section
   4946  1.1  mrg     % titles, for instance.
   4947  1.1  mrg     \def\*{\unskip\space\ignorespaces}%
   4948  1.1  mrg     \def\entrybreak{\hfil\break}%
   4949  1.1  mrg     %
   4950  1.1  mrg     % Swallow the left brace of the text (first parameter):
   4951  1.1  mrg     \afterassignment\doentry
   4952  1.1  mrg     \let\temp =
   4953  1.1  mrg }
   4954  1.1  mrg \def\entrybreak{\unskip\space\ignorespaces}%
   4955  1.1  mrg \def\doentry{%
   4956  1.1  mrg     \bgroup % Instead of the swallowed brace.
   4957  1.1  mrg       \noindent
   4958  1.1  mrg       \aftergroup\finishentry
   4959  1.1  mrg       % And now comes the text of the entry.
   4960  1.1  mrg }
   4961  1.1  mrg \def\finishentry#1{%
   4962  1.1  mrg     % #1 is the page number.
   4963  1.1  mrg     %
   4964  1.1  mrg     % The following is kludged to not output a line of dots in the index if
   4965  1.1  mrg     % there are no page numbers.  The next person who breaks this will be
   4966  1.1  mrg     % cursed by a Unix daemon.
   4967  1.1  mrg     \setbox\boxA = \hbox{#1}%
   4968  1.1  mrg     \ifdim\wd\boxA = 0pt
   4969  1.1  mrg       \ %
   4970  1.1  mrg     \else
   4971  1.1  mrg       %
   4972  1.1  mrg       % If we must, put the page number on a line of its own, and fill out
   4973  1.1  mrg       % this line with blank space.  (The \hfil is overwhelmed with the
   4974  1.1  mrg       % fill leaders glue in \indexdotfill if the page number does fit.)
   4975  1.1  mrg       \hfil\penalty50
   4976  1.1  mrg       \null\nobreak\indexdotfill % Have leaders before the page number.
   4977  1.1  mrg       %
   4978  1.1  mrg       % The `\ ' here is removed by the implicit \unskip that TeX does as
   4979  1.1  mrg       % part of (the primitive) \par.  Without it, a spurious underfull
   4980  1.1  mrg       % \hbox ensues.
   4981  1.1  mrg       \ifpdf
   4982  1.1  mrg 	\pdfgettoks#1.%
   4983  1.1  mrg 	\ \the\toksA
   4984  1.1  mrg       \else
   4985  1.1  mrg 	\ #1%
   4986  1.1  mrg       \fi
   4987  1.1  mrg     \fi
   4988  1.1  mrg     \par
   4989  1.1  mrg   \endgroup
   4990  1.1  mrg }
   4991  1.1  mrg 
   4992  1.1  mrg % Like plain.tex's \dotfill, except uses up at least 1 em.
   4993  1.1  mrg \def\indexdotfill{\cleaders
   4994  1.1  mrg   \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
   4995  1.1  mrg 
   4996  1.1  mrg \def\primary #1{\line{#1\hfil}}
   4997  1.1  mrg 
   4998  1.1  mrg \newskip\secondaryindent \secondaryindent=0.5cm
   4999  1.1  mrg \def\secondary#1#2{{%
   5000  1.1  mrg   \parfillskip=0in
   5001  1.1  mrg   \parskip=0in
   5002  1.1  mrg   \hangindent=1in
   5003  1.1  mrg   \hangafter=1
   5004  1.1  mrg   \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
   5005  1.1  mrg   \ifpdf
   5006  1.1  mrg     \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
   5007  1.1  mrg   \else
   5008  1.1  mrg     #2
   5009  1.1  mrg   \fi
   5010  1.1  mrg   \par
   5011  1.1  mrg }}
   5012  1.1  mrg 
   5013  1.1  mrg % Define two-column mode, which we use to typeset indexes.
   5014  1.1  mrg % Adapted from the TeXbook, page 416, which is to say,
   5015  1.1  mrg % the manmac.tex format used to print the TeXbook itself.
   5016  1.1  mrg \catcode`\@=11
   5017  1.1  mrg 
   5018  1.1  mrg \newbox\partialpage
   5019  1.1  mrg \newdimen\doublecolumnhsize
   5020  1.1  mrg 
   5021  1.1  mrg \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
   5022  1.1  mrg   % Grab any single-column material above us.
   5023  1.1  mrg   \output = {%
   5024  1.1  mrg     %
   5025  1.1  mrg     % Here is a possibility not foreseen in manmac: if we accumulate a
   5026  1.1  mrg     % whole lot of material, we might end up calling this \output
   5027  1.1  mrg     % routine twice in a row (see the doublecol-lose test, which is
   5028  1.1  mrg     % essentially a couple of indexes with @setchapternewpage off).  In
   5029  1.1  mrg     % that case we just ship out what is in \partialpage with the normal
   5030  1.1  mrg     % output routine.  Generally, \partialpage will be empty when this
   5031  1.1  mrg     % runs and this will be a no-op.  See the indexspread.tex test case.
   5032  1.1  mrg     \ifvoid\partialpage \else
   5033  1.1  mrg       \onepageout{\pagecontents\partialpage}%
   5034  1.1  mrg     \fi
   5035  1.1  mrg     %
   5036  1.1  mrg     \global\setbox\partialpage = \vbox{%
   5037  1.1  mrg       % Unvbox the main output page.
   5038  1.1  mrg       \unvbox\PAGE
   5039  1.1  mrg       \kern-\topskip \kern\baselineskip
   5040  1.1  mrg     }%
   5041  1.1  mrg   }%
   5042  1.1  mrg   \eject % run that output routine to set \partialpage
   5043  1.1  mrg   %
   5044  1.1  mrg   % Use the double-column output routine for subsequent pages.
   5045  1.1  mrg   \output = {\doublecolumnout}%
   5046  1.1  mrg   %
   5047  1.1  mrg   % Change the page size parameters.  We could do this once outside this
   5048  1.1  mrg   % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
   5049  1.1  mrg   % format, but then we repeat the same computation.  Repeating a couple
   5050  1.1  mrg   % of assignments once per index is clearly meaningless for the
   5051  1.1  mrg   % execution time, so we may as well do it in one place.
   5052  1.1  mrg   %
   5053  1.1  mrg   % First we halve the line length, less a little for the gutter between
   5054  1.1  mrg   % the columns.  We compute the gutter based on the line length, so it
   5055  1.1  mrg   % changes automatically with the paper format.  The magic constant
   5056  1.1  mrg   % below is chosen so that the gutter has the same value (well, +-<1pt)
   5057  1.1  mrg   % as it did when we hard-coded it.
   5058  1.1  mrg   %
   5059  1.1  mrg   % We put the result in a separate register, \doublecolumhsize, so we
   5060  1.1  mrg   % can restore it in \pagesofar, after \hsize itself has (potentially)
   5061  1.1  mrg   % been clobbered.
   5062  1.1  mrg   %
   5063  1.1  mrg   \doublecolumnhsize = \hsize
   5064  1.1  mrg     \advance\doublecolumnhsize by -.04154\hsize
   5065  1.1  mrg     \divide\doublecolumnhsize by 2
   5066  1.1  mrg   \hsize = \doublecolumnhsize
   5067  1.1  mrg   %
   5068  1.1  mrg   % Double the \vsize as well.  (We don't need a separate register here,
   5069  1.1  mrg   % since nobody clobbers \vsize.)
   5070  1.1  mrg   \vsize = 2\vsize
   5071  1.1  mrg }
   5072  1.1  mrg 
   5073  1.1  mrg % The double-column output routine for all double-column pages except
   5074  1.1  mrg % the last.
   5075  1.1  mrg %
   5076  1.1  mrg \def\doublecolumnout{%
   5077  1.1  mrg   \splittopskip=\topskip \splitmaxdepth=\maxdepth
   5078  1.1  mrg   % Get the available space for the double columns -- the normal
   5079  1.1  mrg   % (undoubled) page height minus any material left over from the
   5080  1.1  mrg   % previous page.
   5081  1.1  mrg   \dimen@ = \vsize
   5082  1.1  mrg   \divide\dimen@ by 2
   5083  1.1  mrg   \advance\dimen@ by -\ht\partialpage
   5084  1.1  mrg   %
   5085  1.1  mrg   % box0 will be the left-hand column, box2 the right.
   5086  1.1  mrg   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
   5087  1.1  mrg   \onepageout\pagesofar
   5088  1.1  mrg   \unvbox255
   5089  1.1  mrg   \penalty\outputpenalty
   5090  1.1  mrg }
   5091  1.1  mrg %
   5092  1.1  mrg % Re-output the contents of the output page -- any previous material,
   5093  1.1  mrg % followed by the two boxes we just split, in box0 and box2.
   5094  1.1  mrg \def\pagesofar{%
   5095  1.1  mrg   \unvbox\partialpage
   5096  1.1  mrg   %
   5097  1.1  mrg   \hsize = \doublecolumnhsize
   5098  1.1  mrg   \wd0=\hsize \wd2=\hsize
   5099  1.1  mrg   \hbox to\pagewidth{\box0\hfil\box2}%
   5100  1.1  mrg }
   5101  1.1  mrg %
   5102  1.1  mrg % All done with double columns.
   5103  1.1  mrg \def\enddoublecolumns{%
   5104  1.1  mrg   % The following penalty ensures that the page builder is exercised
   5105  1.1  mrg   % _before_ we change the output routine.  This is necessary in the
   5106  1.1  mrg   % following situation:
   5107  1.1  mrg   %
   5108  1.1  mrg   % The last section of the index consists only of a single entry.
   5109  1.1  mrg   % Before this section, \pagetotal is less than \pagegoal, so no
   5110  1.1  mrg   % break occurs before the last section starts.  However, the last
   5111  1.1  mrg   % section, consisting of \initial and the single \entry, does not
   5112  1.1  mrg   % fit on the page and has to be broken off.  Without the following
   5113  1.1  mrg   % penalty the page builder will not be exercised until \eject
   5114  1.1  mrg   % below, and by that time we'll already have changed the output
   5115  1.1  mrg   % routine to the \balancecolumns version, so the next-to-last
   5116  1.1  mrg   % double-column page will be processed with \balancecolumns, which
   5117  1.1  mrg   % is wrong:  The two columns will go to the main vertical list, with
   5118  1.1  mrg   % the broken-off section in the recent contributions.  As soon as
   5119  1.1  mrg   % the output routine finishes, TeX starts reconsidering the page
   5120  1.1  mrg   % break.  The two columns and the broken-off section both fit on the
   5121  1.1  mrg   % page, because the two columns now take up only half of the page
   5122  1.1  mrg   % goal.  When TeX sees \eject from below which follows the final
   5123  1.1  mrg   % section, it invokes the new output routine that we've set after
   5124  1.1  mrg   % \balancecolumns below; \onepageout will try to fit the two columns
   5125  1.1  mrg   % and the final section into the vbox of \pageheight (see
   5126  1.1  mrg   % \pagebody), causing an overfull box.
   5127  1.1  mrg   %
   5128  1.1  mrg   % Note that glue won't work here, because glue does not exercise the
   5129  1.1  mrg   % page builder, unlike penalties (see The TeXbook, pp. 280-281).
   5130  1.1  mrg   \penalty0
   5131  1.1  mrg   %
   5132  1.1  mrg   \output = {%
   5133  1.1  mrg     % Split the last of the double-column material.  Leave it on the
   5134  1.1  mrg     % current page, no automatic page break.
   5135  1.1  mrg     \balancecolumns
   5136  1.1  mrg     %
   5137  1.1  mrg     % If we end up splitting too much material for the current page,
   5138  1.1  mrg     % though, there will be another page break right after this \output
   5139  1.1  mrg     % invocation ends.  Having called \balancecolumns once, we do not
   5140  1.1  mrg     % want to call it again.  Therefore, reset \output to its normal
   5141  1.1  mrg     % definition right away.  (We hope \balancecolumns will never be
   5142  1.1  mrg     % called on to balance too much material, but if it is, this makes
   5143  1.1  mrg     % the output somewhat more palatable.)
   5144  1.1  mrg     \global\output = {\onepageout{\pagecontents\PAGE}}%
   5145  1.1  mrg   }%
   5146  1.1  mrg   \eject
   5147  1.1  mrg   \endgroup % started in \begindoublecolumns
   5148  1.1  mrg   %
   5149  1.1  mrg   % \pagegoal was set to the doubled \vsize above, since we restarted
   5150  1.1  mrg   % the current page.  We're now back to normal single-column
   5151  1.1  mrg   % typesetting, so reset \pagegoal to the normal \vsize (after the
   5152  1.1  mrg   % \endgroup where \vsize got restored).
   5153  1.1  mrg   \pagegoal = \vsize
   5154  1.1  mrg }
   5155  1.1  mrg %
   5156  1.1  mrg % Called at the end of the double column material.
   5157  1.1  mrg \def\balancecolumns{%
   5158  1.1  mrg   \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
   5159  1.1  mrg   \dimen@ = \ht0
   5160  1.1  mrg   \advance\dimen@ by \topskip
   5161  1.1  mrg   \advance\dimen@ by-\baselineskip
   5162  1.1  mrg   \divide\dimen@ by 2 % target to split to
   5163  1.1  mrg   %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
   5164  1.1  mrg   \splittopskip = \topskip
   5165  1.1  mrg   % Loop until we get a decent breakpoint.
   5166  1.1  mrg   {%
   5167  1.1  mrg     \vbadness = 10000
   5168  1.1  mrg     \loop
   5169  1.1  mrg       \global\setbox3 = \copy0
   5170  1.1  mrg       \global\setbox1 = \vsplit3 to \dimen@
   5171  1.1  mrg     \ifdim\ht3>\dimen@
   5172  1.1  mrg       \global\advance\dimen@ by 1pt
   5173  1.1  mrg     \repeat
   5174  1.1  mrg   }%
   5175  1.1  mrg   %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
   5176  1.1  mrg   \setbox0=\vbox to\dimen@{\unvbox1}%
   5177  1.1  mrg   \setbox2=\vbox to\dimen@{\unvbox3}%
   5178  1.1  mrg   %
   5179  1.1  mrg   \pagesofar
   5180  1.1  mrg }
   5181  1.1  mrg \catcode`\@ = \other
   5182  1.1  mrg 
   5183  1.1  mrg 
   5184  1.1  mrg \message{sectioning,}
   5185  1.1  mrg % Chapters, sections, etc.
   5186  1.1  mrg 
   5187  1.1  mrg % Let's start with @part.
   5188  1.1  mrg \outer\parseargdef\part{\partzzz{#1}}
   5189  1.1  mrg \def\partzzz#1{%
   5190  1.1  mrg   \chapoddpage
   5191  1.1  mrg   \null
   5192  1.1  mrg   \vskip.3\vsize  % move it down on the page a bit
   5193  1.1  mrg   \begingroup
   5194  1.1  mrg     \noindent \titlefonts\rmisbold #1\par % the text
   5195  1.1  mrg     \let\lastnode=\empty      % no node to associate with
   5196  1.1  mrg     \writetocentry{part}{#1}{}% but put it in the toc
   5197  1.1  mrg     \headingsoff              % no headline or footline on the part page
   5198  1.1  mrg     \chapoddpage
   5199  1.1  mrg   \endgroup
   5200  1.1  mrg }
   5201  1.1  mrg 
   5202  1.1  mrg % \unnumberedno is an oxymoron.  But we count the unnumbered
   5203  1.1  mrg % sections so that we can refer to them unambiguously in the pdf
   5204  1.1  mrg % outlines by their "section number".  We avoid collisions with chapter
   5205  1.1  mrg % numbers by starting them at 10000.  (If a document ever has 10000
   5206  1.1  mrg % chapters, we're in trouble anyway, I'm sure.)
   5207  1.1  mrg \newcount\unnumberedno \unnumberedno = 10000
   5208  1.1  mrg \newcount\chapno
   5209  1.1  mrg \newcount\secno        \secno=0
   5210  1.1  mrg \newcount\subsecno     \subsecno=0
   5211  1.1  mrg \newcount\subsubsecno  \subsubsecno=0
   5212  1.1  mrg 
   5213  1.1  mrg % This counter is funny since it counts through charcodes of letters A, B, ...
   5214  1.1  mrg \newcount\appendixno  \appendixno = `\@
   5215  1.1  mrg %
   5216  1.1  mrg % \def\appendixletter{\char\the\appendixno}
   5217  1.1  mrg % We do the following ugly conditional instead of the above simple
   5218  1.1  mrg % construct for the sake of pdftex, which needs the actual
   5219  1.1  mrg % letter in the expansion, not just typeset.
   5220  1.1  mrg %
   5221  1.1  mrg \def\appendixletter{%
   5222  1.1  mrg   \ifnum\appendixno=`A A%
   5223  1.1  mrg   \else\ifnum\appendixno=`B B%
   5224  1.1  mrg   \else\ifnum\appendixno=`C C%
   5225  1.1  mrg   \else\ifnum\appendixno=`D D%
   5226  1.1  mrg   \else\ifnum\appendixno=`E E%
   5227  1.1  mrg   \else\ifnum\appendixno=`F F%
   5228  1.1  mrg   \else\ifnum\appendixno=`G G%
   5229  1.1  mrg   \else\ifnum\appendixno=`H H%
   5230  1.1  mrg   \else\ifnum\appendixno=`I I%
   5231  1.1  mrg   \else\ifnum\appendixno=`J J%
   5232  1.1  mrg   \else\ifnum\appendixno=`K K%
   5233  1.1  mrg   \else\ifnum\appendixno=`L L%
   5234  1.1  mrg   \else\ifnum\appendixno=`M M%
   5235  1.1  mrg   \else\ifnum\appendixno=`N N%
   5236  1.1  mrg   \else\ifnum\appendixno=`O O%
   5237  1.1  mrg   \else\ifnum\appendixno=`P P%
   5238  1.1  mrg   \else\ifnum\appendixno=`Q Q%
   5239  1.1  mrg   \else\ifnum\appendixno=`R R%
   5240  1.1  mrg   \else\ifnum\appendixno=`S S%
   5241  1.1  mrg   \else\ifnum\appendixno=`T T%
   5242  1.1  mrg   \else\ifnum\appendixno=`U U%
   5243  1.1  mrg   \else\ifnum\appendixno=`V V%
   5244  1.1  mrg   \else\ifnum\appendixno=`W W%
   5245  1.1  mrg   \else\ifnum\appendixno=`X X%
   5246  1.1  mrg   \else\ifnum\appendixno=`Y Y%
   5247  1.1  mrg   \else\ifnum\appendixno=`Z Z%
   5248  1.1  mrg   % The \the is necessary, despite appearances, because \appendixletter is
   5249  1.1  mrg   % expanded while writing the .toc file.  \char\appendixno is not
   5250  1.1  mrg   % expandable, thus it is written literally, thus all appendixes come out
   5251  1.1  mrg   % with the same letter (or @) in the toc without it.
   5252  1.1  mrg   \else\char\the\appendixno
   5253  1.1  mrg   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
   5254  1.1  mrg   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
   5255  1.1  mrg 
   5256  1.1  mrg % Each @chapter defines these (using marks) as the number+name, number
   5257  1.1  mrg % and name of the chapter.  Page headings and footings can use
   5258  1.1  mrg % these.  @section does likewise.
   5259  1.1  mrg \def\thischapter{}
   5260  1.1  mrg \def\thischapternum{}
   5261  1.1  mrg \def\thischaptername{}
   5262  1.1  mrg \def\thissection{}
   5263  1.1  mrg \def\thissectionnum{}
   5264  1.1  mrg \def\thissectionname{}
   5265  1.1  mrg 
   5266  1.1  mrg \newcount\absseclevel % used to calculate proper heading level
   5267  1.1  mrg \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
   5268  1.1  mrg 
   5269  1.1  mrg % @raisesections: treat @section as chapter, @subsection as section, etc.
   5270  1.1  mrg \def\raisesections{\global\advance\secbase by -1}
   5271  1.1  mrg \let\up=\raisesections % original BFox name
   5272  1.1  mrg 
   5273  1.1  mrg % @lowersections: treat @chapter as section, @section as subsection, etc.
   5274  1.1  mrg \def\lowersections{\global\advance\secbase by 1}
   5275  1.1  mrg \let\down=\lowersections % original BFox name
   5276  1.1  mrg 
   5277  1.1  mrg % we only have subsub.
   5278  1.1  mrg \chardef\maxseclevel = 3
   5279  1.1  mrg %
   5280  1.1  mrg % A numbered section within an unnumbered changes to unnumbered too.
   5281  1.1  mrg % To achieve this, remember the "biggest" unnum. sec. we are currently in:
   5282  1.1  mrg \chardef\unnlevel = \maxseclevel
   5283  1.1  mrg %
   5284  1.1  mrg % Trace whether the current chapter is an appendix or not:
   5285  1.1  mrg % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
   5286  1.1  mrg \def\chapheadtype{N}
   5287  1.1  mrg 
   5288  1.1  mrg % Choose a heading macro
   5289  1.1  mrg % #1 is heading type
   5290  1.1  mrg % #2 is heading level
   5291  1.1  mrg % #3 is text for heading
   5292  1.1  mrg \def\genhead#1#2#3{%
   5293  1.1  mrg   % Compute the abs. sec. level:
   5294  1.1  mrg   \absseclevel=#2
   5295  1.1  mrg   \advance\absseclevel by \secbase
   5296  1.1  mrg   % Make sure \absseclevel doesn't fall outside the range:
   5297  1.1  mrg   \ifnum \absseclevel < 0
   5298  1.1  mrg     \absseclevel = 0
   5299  1.1  mrg   \else
   5300  1.1  mrg     \ifnum \absseclevel > 3
   5301  1.1  mrg       \absseclevel = 3
   5302  1.1  mrg     \fi
   5303  1.1  mrg   \fi
   5304  1.1  mrg   % The heading type:
   5305  1.1  mrg   \def\headtype{#1}%
   5306  1.1  mrg   \if \headtype U%
   5307  1.1  mrg     \ifnum \absseclevel < \unnlevel
   5308  1.1  mrg       \chardef\unnlevel = \absseclevel
   5309  1.1  mrg     \fi
   5310  1.1  mrg   \else
   5311  1.1  mrg     % Check for appendix sections:
   5312  1.1  mrg     \ifnum \absseclevel = 0
   5313  1.1  mrg       \edef\chapheadtype{\headtype}%
   5314  1.1  mrg     \else
   5315  1.1  mrg       \if \headtype A\if \chapheadtype N%
   5316  1.1  mrg 	\errmessage{@appendix... within a non-appendix chapter}%
   5317  1.1  mrg       \fi\fi
   5318  1.1  mrg     \fi
   5319  1.1  mrg     % Check for numbered within unnumbered:
   5320  1.1  mrg     \ifnum \absseclevel > \unnlevel
   5321  1.1  mrg       \def\headtype{U}%
   5322  1.1  mrg     \else
   5323  1.1  mrg       \chardef\unnlevel = 3
   5324  1.1  mrg     \fi
   5325  1.1  mrg   \fi
   5326  1.1  mrg   % Now print the heading:
   5327  1.1  mrg   \if \headtype U%
   5328  1.1  mrg     \ifcase\absseclevel
   5329  1.1  mrg 	\unnumberedzzz{#3}%
   5330  1.1  mrg     \or \unnumberedseczzz{#3}%
   5331  1.1  mrg     \or \unnumberedsubseczzz{#3}%
   5332  1.1  mrg     \or \unnumberedsubsubseczzz{#3}%
   5333  1.1  mrg     \fi
   5334  1.1  mrg   \else
   5335  1.1  mrg     \if \headtype A%
   5336  1.1  mrg       \ifcase\absseclevel
   5337  1.1  mrg 	  \appendixzzz{#3}%
   5338  1.1  mrg       \or \appendixsectionzzz{#3}%
   5339  1.1  mrg       \or \appendixsubseczzz{#3}%
   5340  1.1  mrg       \or \appendixsubsubseczzz{#3}%
   5341  1.1  mrg       \fi
   5342  1.1  mrg     \else
   5343  1.1  mrg       \ifcase\absseclevel
   5344  1.1  mrg 	  \chapterzzz{#3}%
   5345  1.1  mrg       \or \seczzz{#3}%
   5346  1.1  mrg       \or \numberedsubseczzz{#3}%
   5347  1.1  mrg       \or \numberedsubsubseczzz{#3}%
   5348  1.1  mrg       \fi
   5349  1.1  mrg     \fi
   5350  1.1  mrg   \fi
   5351  1.1  mrg   \suppressfirstparagraphindent
   5352  1.1  mrg }
   5353  1.1  mrg 
   5354  1.1  mrg % an interface:
   5355  1.1  mrg \def\numhead{\genhead N}
   5356  1.1  mrg \def\apphead{\genhead A}
   5357  1.1  mrg \def\unnmhead{\genhead U}
   5358  1.1  mrg 
   5359  1.1  mrg % @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
   5360  1.1  mrg % all lower-level sectioning counters to zero.
   5361  1.1  mrg %
   5362  1.1  mrg % Also set \chaplevelprefix, which we prepend to @float sequence numbers
   5363  1.1  mrg % (e.g., figures), q.v.  By default (before any chapter), that is empty.
   5364  1.1  mrg \let\chaplevelprefix = \empty
   5365  1.1  mrg %
   5366  1.1  mrg \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
   5367  1.1  mrg \def\chapterzzz#1{%
   5368  1.1  mrg   % section resetting is \global in case the chapter is in a group, such
   5369  1.1  mrg   % as an @include file.
   5370  1.1  mrg   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
   5371  1.1  mrg     \global\advance\chapno by 1
   5372  1.1  mrg   %
   5373  1.1  mrg   % Used for \float.
   5374  1.1  mrg   \gdef\chaplevelprefix{\the\chapno.}%
   5375  1.1  mrg   \resetallfloatnos
   5376  1.1  mrg   %
   5377  1.1  mrg   % \putwordChapter can contain complex things in translations.
   5378  1.1  mrg   \toks0=\expandafter{\putwordChapter}%
   5379  1.1  mrg   \message{\the\toks0 \space \the\chapno}%
   5380  1.1  mrg   %
   5381  1.1  mrg   % Write the actual heading.
   5382  1.1  mrg   \chapmacro{#1}{Ynumbered}{\the\chapno}%
   5383  1.1  mrg   %
   5384  1.1  mrg   % So @section and the like are numbered underneath this chapter.
   5385  1.1  mrg   \global\let\section = \numberedsec
   5386  1.1  mrg   \global\let\subsection = \numberedsubsec
   5387  1.1  mrg   \global\let\subsubsection = \numberedsubsubsec
   5388  1.1  mrg }
   5389  1.1  mrg 
   5390  1.1  mrg \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
   5391  1.1  mrg %
   5392  1.1  mrg \def\appendixzzz#1{%
   5393  1.1  mrg   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
   5394  1.1  mrg     \global\advance\appendixno by 1
   5395  1.1  mrg   \gdef\chaplevelprefix{\appendixletter.}%
   5396  1.1  mrg   \resetallfloatnos
   5397  1.1  mrg   %
   5398  1.1  mrg   % \putwordAppendix can contain complex things in translations.
   5399  1.1  mrg   \toks0=\expandafter{\putwordAppendix}%
   5400  1.1  mrg   \message{\the\toks0 \space \appendixletter}%
   5401  1.1  mrg   %
   5402  1.1  mrg   \chapmacro{#1}{Yappendix}{\appendixletter}%
   5403  1.1  mrg   %
   5404  1.1  mrg   \global\let\section = \appendixsec
   5405  1.1  mrg   \global\let\subsection = \appendixsubsec
   5406  1.1  mrg   \global\let\subsubsection = \appendixsubsubsec
   5407  1.1  mrg }
   5408  1.1  mrg 
   5409  1.1  mrg % normally unnmhead0 calls unnumberedzzz:
   5410  1.1  mrg \outer\parseargdef\unnumbered{\unnmhead0{#1}}
   5411  1.1  mrg \def\unnumberedzzz#1{%
   5412  1.1  mrg   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
   5413  1.1  mrg     \global\advance\unnumberedno by 1
   5414  1.1  mrg   %
   5415  1.1  mrg   % Since an unnumbered has no number, no prefix for figures.
   5416  1.1  mrg   \global\let\chaplevelprefix = \empty
   5417  1.1  mrg   \resetallfloatnos
   5418  1.1  mrg   %
   5419  1.1  mrg   % This used to be simply \message{#1}, but TeX fully expands the
   5420  1.1  mrg   % argument to \message.  Therefore, if #1 contained @-commands, TeX
   5421  1.1  mrg   % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
   5422  1.1  mrg   % expanded @cite (which turns out to cause errors because \cite is meant
   5423  1.1  mrg   % to be executed, not expanded).
   5424  1.1  mrg   %
   5425  1.1  mrg   % Anyway, we don't want the fully-expanded definition of @cite to appear
   5426  1.1  mrg   % as a result of the \message, we just want `@cite' itself.  We use
   5427  1.1  mrg   % \the<toks register> to achieve this: TeX expands \the<toks> only once,
   5428  1.1  mrg   % simply yielding the contents of <toks register>.  (We also do this for
   5429  1.1  mrg   % the toc entries.)
   5430  1.1  mrg   \toks0 = {#1}%
   5431  1.1  mrg   \message{(\the\toks0)}%
   5432  1.1  mrg   %
   5433  1.1  mrg   \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
   5434  1.1  mrg   %
   5435  1.1  mrg   \global\let\section = \unnumberedsec
   5436  1.1  mrg   \global\let\subsection = \unnumberedsubsec
   5437  1.1  mrg   \global\let\subsubsection = \unnumberedsubsubsec
   5438  1.1  mrg }
   5439  1.1  mrg 
   5440  1.1  mrg % @centerchap is like @unnumbered, but the heading is centered.
   5441  1.1  mrg \outer\parseargdef\centerchap{%
   5442  1.1  mrg   % Well, we could do the following in a group, but that would break
   5443  1.1  mrg   % an assumption that \chapmacro is called at the outermost level.
   5444  1.1  mrg   % Thus we are safer this way:		--kasal, 24feb04
   5445  1.1  mrg   \let\centerparametersmaybe = \centerparameters
   5446  1.1  mrg   \unnmhead0{#1}%
   5447  1.1  mrg   \let\centerparametersmaybe = \relax
   5448  1.1  mrg }
   5449  1.1  mrg 
   5450  1.1  mrg % @top is like @unnumbered.
   5451  1.1  mrg \let\top\unnumbered
   5452  1.1  mrg 
   5453  1.1  mrg % Sections.
   5454  1.1  mrg % 
   5455  1.1  mrg \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
   5456  1.1  mrg \def\seczzz#1{%
   5457  1.1  mrg   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   5458  1.1  mrg   \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
   5459  1.1  mrg }
   5460  1.1  mrg 
   5461  1.1  mrg % normally calls appendixsectionzzz:
   5462  1.1  mrg \outer\parseargdef\appendixsection{\apphead1{#1}}
   5463  1.1  mrg \def\appendixsectionzzz#1{%
   5464  1.1  mrg   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   5465  1.1  mrg   \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
   5466  1.1  mrg }
   5467  1.1  mrg \let\appendixsec\appendixsection
   5468  1.1  mrg 
   5469  1.1  mrg % normally calls unnumberedseczzz:
   5470  1.1  mrg \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
   5471  1.1  mrg \def\unnumberedseczzz#1{%
   5472  1.1  mrg   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   5473  1.1  mrg   \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
   5474  1.1  mrg }
   5475  1.1  mrg 
   5476  1.1  mrg % Subsections.
   5477  1.1  mrg % 
   5478  1.1  mrg % normally calls numberedsubseczzz:
   5479  1.1  mrg \outer\parseargdef\numberedsubsec{\numhead2{#1}}
   5480  1.1  mrg \def\numberedsubseczzz#1{%
   5481  1.1  mrg   \global\subsubsecno=0  \global\advance\subsecno by 1
   5482  1.1  mrg   \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
   5483  1.1  mrg }
   5484  1.1  mrg 
   5485  1.1  mrg % normally calls appendixsubseczzz:
   5486  1.1  mrg \outer\parseargdef\appendixsubsec{\apphead2{#1}}
   5487  1.1  mrg \def\appendixsubseczzz#1{%
   5488  1.1  mrg   \global\subsubsecno=0  \global\advance\subsecno by 1
   5489  1.1  mrg   \sectionheading{#1}{subsec}{Yappendix}%
   5490  1.1  mrg                  {\appendixletter.\the\secno.\the\subsecno}%
   5491  1.1  mrg }
   5492  1.1  mrg 
   5493  1.1  mrg % normally calls unnumberedsubseczzz:
   5494  1.1  mrg \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
   5495  1.1  mrg \def\unnumberedsubseczzz#1{%
   5496  1.1  mrg   \global\subsubsecno=0  \global\advance\subsecno by 1
   5497  1.1  mrg   \sectionheading{#1}{subsec}{Ynothing}%
   5498  1.1  mrg                  {\the\unnumberedno.\the\secno.\the\subsecno}%
   5499  1.1  mrg }
   5500  1.1  mrg 
   5501  1.1  mrg % Subsubsections.
   5502  1.1  mrg % 
   5503  1.1  mrg % normally numberedsubsubseczzz:
   5504  1.1  mrg \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
   5505  1.1  mrg \def\numberedsubsubseczzz#1{%
   5506  1.1  mrg   \global\advance\subsubsecno by 1
   5507  1.1  mrg   \sectionheading{#1}{subsubsec}{Ynumbered}%
   5508  1.1  mrg                  {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
   5509  1.1  mrg }
   5510  1.1  mrg 
   5511  1.1  mrg % normally appendixsubsubseczzz:
   5512  1.1  mrg \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
   5513  1.1  mrg \def\appendixsubsubseczzz#1{%
   5514  1.1  mrg   \global\advance\subsubsecno by 1
   5515  1.1  mrg   \sectionheading{#1}{subsubsec}{Yappendix}%
   5516  1.1  mrg                  {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
   5517  1.1  mrg }
   5518  1.1  mrg 
   5519  1.1  mrg % normally unnumberedsubsubseczzz:
   5520  1.1  mrg \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
   5521  1.1  mrg \def\unnumberedsubsubseczzz#1{%
   5522  1.1  mrg   \global\advance\subsubsecno by 1
   5523  1.1  mrg   \sectionheading{#1}{subsubsec}{Ynothing}%
   5524  1.1  mrg                  {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
   5525  1.1  mrg }
   5526  1.1  mrg 
   5527  1.1  mrg % These macros control what the section commands do, according
   5528  1.1  mrg % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
   5529  1.1  mrg % Define them by default for a numbered chapter.
   5530  1.1  mrg \let\section = \numberedsec
   5531  1.1  mrg \let\subsection = \numberedsubsec
   5532  1.1  mrg \let\subsubsection = \numberedsubsubsec
   5533  1.1  mrg 
   5534  1.1  mrg % Define @majorheading, @heading and @subheading
   5535  1.1  mrg 
   5536  1.1  mrg % NOTE on use of \vbox for chapter headings, section headings, and such:
   5537  1.1  mrg %       1) We use \vbox rather than the earlier \line to permit
   5538  1.1  mrg %          overlong headings to fold.
   5539  1.1  mrg %       2) \hyphenpenalty is set to 10000 because hyphenation in a
   5540  1.1  mrg %          heading is obnoxious; this forbids it.
   5541  1.1  mrg %       3) Likewise, headings look best if no \parindent is used, and
   5542  1.1  mrg %          if justification is not attempted.  Hence \raggedright.
   5543  1.1  mrg 
   5544  1.1  mrg \def\majorheading{%
   5545  1.1  mrg   {\advance\chapheadingskip by 10pt \chapbreak }%
   5546  1.1  mrg   \parsearg\chapheadingzzz
   5547  1.1  mrg }
   5548  1.1  mrg 
   5549  1.1  mrg \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
   5550  1.1  mrg \def\chapheadingzzz#1{%
   5551  1.1  mrg   {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
   5552  1.1  mrg                     \parindent=0pt\ptexraggedright
   5553  1.1  mrg                     \rmisbold #1\hfill}}%
   5554  1.1  mrg   \bigskip \par\penalty 200\relax
   5555  1.1  mrg   \suppressfirstparagraphindent
   5556  1.1  mrg }
   5557  1.1  mrg 
   5558  1.1  mrg % @heading, @subheading, @subsubheading.
   5559  1.1  mrg \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
   5560  1.1  mrg   \suppressfirstparagraphindent}
   5561  1.1  mrg \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
   5562  1.1  mrg   \suppressfirstparagraphindent}
   5563  1.1  mrg \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
   5564  1.1  mrg   \suppressfirstparagraphindent}
   5565  1.1  mrg 
   5566  1.1  mrg % These macros generate a chapter, section, etc. heading only
   5567  1.1  mrg % (including whitespace, linebreaking, etc. around it),
   5568  1.1  mrg % given all the information in convenient, parsed form.
   5569  1.1  mrg 
   5570  1.1  mrg % Args are the skip and penalty (usually negative)
   5571  1.1  mrg \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
   5572  1.1  mrg 
   5573  1.1  mrg % Parameter controlling skip before chapter headings (if needed)
   5574  1.1  mrg \newskip\chapheadingskip
   5575  1.1  mrg 
   5576  1.1  mrg % Define plain chapter starts, and page on/off switching for it.
   5577  1.1  mrg \def\chapbreak{\dobreak \chapheadingskip {-4000}}
   5578  1.1  mrg \def\chappager{\par\vfill\supereject}
   5579  1.1  mrg % Because \domark is called before \chapoddpage, the filler page will
   5580  1.1  mrg % get the headings for the next chapter, which is wrong.  But we don't
   5581  1.1  mrg % care -- we just disable all headings on the filler page.
   5582  1.1  mrg \def\chapoddpage{%
   5583  1.1  mrg   \chappager
   5584  1.1  mrg   \ifodd\pageno \else
   5585  1.1  mrg     \begingroup
   5586  1.1  mrg       \headingsoff
   5587  1.1  mrg       \null
   5588  1.1  mrg       \chappager
   5589  1.1  mrg     \endgroup
   5590  1.1  mrg   \fi
   5591  1.1  mrg }
   5592  1.1  mrg 
   5593  1.1  mrg \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
   5594  1.1  mrg 
   5595  1.1  mrg \def\CHAPPAGoff{%
   5596  1.1  mrg \global\let\contentsalignmacro = \chappager
   5597  1.1  mrg \global\let\pchapsepmacro=\chapbreak
   5598  1.1  mrg \global\let\pagealignmacro=\chappager}
   5599  1.1  mrg 
   5600  1.1  mrg \def\CHAPPAGon{%
   5601  1.1  mrg \global\let\contentsalignmacro = \chappager
   5602  1.1  mrg \global\let\pchapsepmacro=\chappager
   5603  1.1  mrg \global\let\pagealignmacro=\chappager
   5604  1.1  mrg \global\def\HEADINGSon{\HEADINGSsingle}}
   5605  1.1  mrg 
   5606  1.1  mrg \def\CHAPPAGodd{%
   5607  1.1  mrg \global\let\contentsalignmacro = \chapoddpage
   5608  1.1  mrg \global\let\pchapsepmacro=\chapoddpage
   5609  1.1  mrg \global\let\pagealignmacro=\chapoddpage
   5610  1.1  mrg \global\def\HEADINGSon{\HEADINGSdouble}}
   5611  1.1  mrg 
   5612  1.1  mrg \CHAPPAGon
   5613  1.1  mrg 
   5614  1.1  mrg % Chapter opening.
   5615  1.1  mrg %
   5616  1.1  mrg % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
   5617  1.1  mrg % Yappendix, Yomitfromtoc), #3 the chapter number.
   5618  1.1  mrg %
   5619  1.1  mrg % To test against our argument.
   5620  1.1  mrg \def\Ynothingkeyword{Ynothing}
   5621  1.1  mrg \def\Yomitfromtockeyword{Yomitfromtoc}
   5622  1.1  mrg \def\Yappendixkeyword{Yappendix}
   5623  1.1  mrg %
   5624  1.1  mrg \def\chapmacro#1#2#3{%
   5625  1.1  mrg   % Insert the first mark before the heading break (see notes for \domark).
   5626  1.1  mrg   \let\prevchapterdefs=\lastchapterdefs
   5627  1.1  mrg   \let\prevsectiondefs=\lastsectiondefs
   5628  1.1  mrg   \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
   5629  1.1  mrg                         \gdef\thissection{}}%
   5630  1.1  mrg   %
   5631  1.1  mrg   \def\temptype{#2}%
   5632  1.1  mrg   \ifx\temptype\Ynothingkeyword
   5633  1.1  mrg     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
   5634  1.1  mrg                           \gdef\thischapter{\thischaptername}}%
   5635  1.1  mrg   \else\ifx\temptype\Yomitfromtockeyword
   5636  1.1  mrg     \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
   5637  1.1  mrg                           \gdef\thischapter{}}%
   5638  1.1  mrg   \else\ifx\temptype\Yappendixkeyword
   5639  1.1  mrg     \toks0={#1}%
   5640  1.1  mrg     \xdef\lastchapterdefs{%
   5641  1.1  mrg       \gdef\noexpand\thischaptername{\the\toks0}%
   5642  1.1  mrg       \gdef\noexpand\thischapternum{\appendixletter}%
   5643  1.1  mrg       % \noexpand\putwordAppendix avoids expanding indigestible
   5644  1.1  mrg       % commands in some of the translations.
   5645  1.1  mrg       \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
   5646  1.1  mrg                                  \noexpand\thischapternum:
   5647  1.1  mrg                                  \noexpand\thischaptername}%
   5648  1.1  mrg     }%
   5649  1.1  mrg   \else
   5650  1.1  mrg     \toks0={#1}%
   5651  1.1  mrg     \xdef\lastchapterdefs{%
   5652  1.1  mrg       \gdef\noexpand\thischaptername{\the\toks0}%
   5653  1.1  mrg       \gdef\noexpand\thischapternum{\the\chapno}%
   5654  1.1  mrg       % \noexpand\putwordChapter avoids expanding indigestible
   5655  1.1  mrg       % commands in some of the translations.
   5656  1.1  mrg       \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
   5657  1.1  mrg                                  \noexpand\thischapternum:
   5658  1.1  mrg                                  \noexpand\thischaptername}%
   5659  1.1  mrg     }%
   5660  1.1  mrg   \fi\fi\fi
   5661  1.1  mrg   %
   5662  1.1  mrg   % Output the mark.  Pass it through \safewhatsit, to take care of
   5663  1.1  mrg   % the preceding space.
   5664  1.1  mrg   \safewhatsit\domark
   5665  1.1  mrg   %
   5666  1.1  mrg   % Insert the chapter heading break.
   5667  1.1  mrg   \pchapsepmacro
   5668  1.1  mrg   %
   5669  1.1  mrg   % Now the second mark, after the heading break.  No break points
   5670  1.1  mrg   % between here and the heading.
   5671  1.1  mrg   \let\prevchapterdefs=\lastchapterdefs
   5672  1.1  mrg   \let\prevsectiondefs=\lastsectiondefs
   5673  1.1  mrg   \domark
   5674  1.1  mrg   %
   5675  1.1  mrg   {%
   5676  1.1  mrg     \chapfonts \rmisbold
   5677  1.1  mrg     %
   5678  1.1  mrg     % Have to define \lastsection before calling \donoderef, because the
   5679  1.1  mrg     % xref code eventually uses it.  On the other hand, it has to be called
   5680  1.1  mrg     % after \pchapsepmacro, or the headline will change too soon.
   5681  1.1  mrg     \gdef\lastsection{#1}%
   5682  1.1  mrg     %
   5683  1.1  mrg     % Only insert the separating space if we have a chapter/appendix
   5684  1.1  mrg     % number, and don't print the unnumbered ``number''.
   5685  1.1  mrg     \ifx\temptype\Ynothingkeyword
   5686  1.1  mrg       \setbox0 = \hbox{}%
   5687  1.1  mrg       \def\toctype{unnchap}%
   5688  1.1  mrg     \else\ifx\temptype\Yomitfromtockeyword
   5689  1.1  mrg       \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
   5690  1.1  mrg       \def\toctype{omit}%
   5691  1.1  mrg     \else\ifx\temptype\Yappendixkeyword
   5692  1.1  mrg       \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
   5693  1.1  mrg       \def\toctype{app}%
   5694  1.1  mrg     \else
   5695  1.1  mrg       \setbox0 = \hbox{#3\enspace}%
   5696  1.1  mrg       \def\toctype{numchap}%
   5697  1.1  mrg     \fi\fi\fi
   5698  1.1  mrg     %
   5699  1.1  mrg     % Write the toc entry for this chapter.  Must come before the
   5700  1.1  mrg     % \donoderef, because we include the current node name in the toc
   5701  1.1  mrg     % entry, and \donoderef resets it to empty.
   5702  1.1  mrg     \writetocentry{\toctype}{#1}{#3}%
   5703  1.1  mrg     %
   5704  1.1  mrg     % For pdftex, we have to write out the node definition (aka, make
   5705  1.1  mrg     % the pdfdest) after any page break, but before the actual text has
   5706  1.1  mrg     % been typeset.  If the destination for the pdf outline is after the
   5707  1.1  mrg     % text, then jumping from the outline may wind up with the text not
   5708  1.1  mrg     % being visible, for instance under high magnification.
   5709  1.1  mrg     \donoderef{#2}%
   5710  1.1  mrg     %
   5711  1.1  mrg     % Typeset the actual heading.
   5712  1.1  mrg     \nobreak % Avoid page breaks at the interline glue.
   5713  1.1  mrg     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
   5714  1.1  mrg           \hangindent=\wd0 \centerparametersmaybe
   5715  1.1  mrg           \unhbox0 #1\par}%
   5716  1.1  mrg   }%
   5717  1.1  mrg   \nobreak\bigskip % no page break after a chapter title
   5718  1.1  mrg   \nobreak
   5719  1.1  mrg }
   5720  1.1  mrg 
   5721  1.1  mrg % @centerchap -- centered and unnumbered.
   5722  1.1  mrg \let\centerparametersmaybe = \relax
   5723  1.1  mrg \def\centerparameters{%
   5724  1.1  mrg   \advance\rightskip by 3\rightskip
   5725  1.1  mrg   \leftskip = \rightskip
   5726  1.1  mrg   \parfillskip = 0pt
   5727  1.1  mrg }
   5728  1.1  mrg 
   5729  1.1  mrg 
   5730  1.1  mrg % I don't think this chapter style is supported any more, so I'm not
   5731  1.1  mrg % updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
   5732  1.1  mrg %
   5733  1.1  mrg \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
   5734  1.1  mrg %
   5735  1.1  mrg \def\unnchfopen #1{%
   5736  1.1  mrg \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
   5737  1.1  mrg                        \parindent=0pt\ptexraggedright
   5738  1.1  mrg                        \rmisbold #1\hfill}}\bigskip \par\nobreak
   5739  1.1  mrg }
   5740  1.1  mrg \def\chfopen #1#2{\chapoddpage {\chapfonts
   5741  1.1  mrg \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
   5742  1.1  mrg \par\penalty 5000 %
   5743  1.1  mrg }
   5744  1.1  mrg \def\centerchfopen #1{%
   5745  1.1  mrg \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
   5746  1.1  mrg                        \parindent=0pt
   5747  1.1  mrg                        \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
   5748  1.1  mrg }
   5749  1.1  mrg \def\CHAPFopen{%
   5750  1.1  mrg   \global\let\chapmacro=\chfopen
   5751  1.1  mrg   \global\let\centerchapmacro=\centerchfopen}
   5752  1.1  mrg 
   5753  1.1  mrg 
   5754  1.1  mrg % Section titles.  These macros combine the section number parts and
   5755  1.1  mrg % call the generic \sectionheading to do the printing.
   5756  1.1  mrg %
   5757  1.1  mrg \newskip\secheadingskip
   5758  1.1  mrg \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
   5759  1.1  mrg 
   5760  1.1  mrg % Subsection titles.
   5761  1.1  mrg \newskip\subsecheadingskip
   5762  1.1  mrg \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
   5763  1.1  mrg 
   5764  1.1  mrg % Subsubsection titles.
   5765  1.1  mrg \def\subsubsecheadingskip{\subsecheadingskip}
   5766  1.1  mrg \def\subsubsecheadingbreak{\subsecheadingbreak}
   5767  1.1  mrg 
   5768  1.1  mrg 
   5769  1.1  mrg % Print any size, any type, section title.
   5770  1.1  mrg %
   5771  1.1  mrg % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
   5772  1.1  mrg % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
   5773  1.1  mrg % section number.
   5774  1.1  mrg %
   5775  1.1  mrg \def\seckeyword{sec}
   5776  1.1  mrg %
   5777  1.1  mrg \def\sectionheading#1#2#3#4{%
   5778  1.1  mrg   {%
   5779  1.1  mrg     \checkenv{}% should not be in an environment.
   5780  1.1  mrg     %
   5781  1.1  mrg     % Switch to the right set of fonts.
   5782  1.1  mrg     \csname #2fonts\endcsname \rmisbold
   5783  1.1  mrg     %
   5784  1.1  mrg     \def\sectionlevel{#2}%
   5785  1.1  mrg     \def\temptype{#3}%
   5786  1.1  mrg     %
   5787  1.1  mrg     % Insert first mark before the heading break (see notes for \domark).
   5788  1.1  mrg     \let\prevsectiondefs=\lastsectiondefs
   5789  1.1  mrg     \ifx\temptype\Ynothingkeyword
   5790  1.1  mrg       \ifx\sectionlevel\seckeyword
   5791  1.1  mrg         \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
   5792  1.1  mrg                               \gdef\thissection{\thissectionname}}%
   5793  1.1  mrg       \fi
   5794  1.1  mrg     \else\ifx\temptype\Yomitfromtockeyword
   5795  1.1  mrg       % Don't redefine \thissection.
   5796  1.1  mrg     \else\ifx\temptype\Yappendixkeyword
   5797  1.1  mrg       \ifx\sectionlevel\seckeyword
   5798  1.1  mrg         \toks0={#1}%
   5799  1.1  mrg         \xdef\lastsectiondefs{%
   5800  1.1  mrg           \gdef\noexpand\thissectionname{\the\toks0}%
   5801  1.1  mrg           \gdef\noexpand\thissectionnum{#4}%
   5802  1.1  mrg           % \noexpand\putwordSection avoids expanding indigestible
   5803  1.1  mrg           % commands in some of the translations.
   5804  1.1  mrg           \gdef\noexpand\thissection{\noexpand\putwordSection{}
   5805  1.1  mrg                                      \noexpand\thissectionnum:
   5806  1.1  mrg                                      \noexpand\thissectionname}%
   5807  1.1  mrg         }%
   5808  1.1  mrg       \fi
   5809  1.1  mrg     \else
   5810  1.1  mrg       \ifx\sectionlevel\seckeyword
   5811  1.1  mrg         \toks0={#1}%
   5812  1.1  mrg         \xdef\lastsectiondefs{%
   5813  1.1  mrg           \gdef\noexpand\thissectionname{\the\toks0}%
   5814  1.1  mrg           \gdef\noexpand\thissectionnum{#4}%
   5815  1.1  mrg           % \noexpand\putwordSection avoids expanding indigestible
   5816  1.1  mrg           % commands in some of the translations.
   5817  1.1  mrg           \gdef\noexpand\thissection{\noexpand\putwordSection{}
   5818  1.1  mrg                                      \noexpand\thissectionnum:
   5819  1.1  mrg                                      \noexpand\thissectionname}%
   5820  1.1  mrg         }%
   5821  1.1  mrg       \fi
   5822  1.1  mrg     \fi\fi\fi
   5823  1.1  mrg     %
   5824  1.1  mrg     % Go into vertical mode.  Usually we'll already be there, but we
   5825  1.1  mrg     % don't want the following whatsit to end up in a preceding paragraph
   5826  1.1  mrg     % if the document didn't happen to have a blank line.
   5827  1.1  mrg     \par
   5828  1.1  mrg     %
   5829  1.1  mrg     % Output the mark.  Pass it through \safewhatsit, to take care of
   5830  1.1  mrg     % the preceding space.
   5831  1.1  mrg     \safewhatsit\domark
   5832  1.1  mrg     %
   5833  1.1  mrg     % Insert space above the heading.
   5834  1.1  mrg     \csname #2headingbreak\endcsname
   5835  1.1  mrg     %
   5836  1.1  mrg     % Now the second mark, after the heading break.  No break points
   5837  1.1  mrg     % between here and the heading.
   5838  1.1  mrg     \let\prevsectiondefs=\lastsectiondefs
   5839  1.1  mrg     \domark
   5840  1.1  mrg     %
   5841  1.1  mrg     % Only insert the space after the number if we have a section number.
   5842  1.1  mrg     \ifx\temptype\Ynothingkeyword
   5843  1.1  mrg       \setbox0 = \hbox{}%
   5844  1.1  mrg       \def\toctype{unn}%
   5845  1.1  mrg       \gdef\lastsection{#1}%
   5846  1.1  mrg     \else\ifx\temptype\Yomitfromtockeyword
   5847  1.1  mrg       % for @headings -- no section number, don't include in toc,
   5848  1.1  mrg       % and don't redefine \lastsection.
   5849  1.1  mrg       \setbox0 = \hbox{}%
   5850  1.1  mrg       \def\toctype{omit}%
   5851  1.1  mrg       \let\sectionlevel=\empty
   5852  1.1  mrg     \else\ifx\temptype\Yappendixkeyword
   5853  1.1  mrg       \setbox0 = \hbox{#4\enspace}%
   5854  1.1  mrg       \def\toctype{app}%
   5855  1.1  mrg       \gdef\lastsection{#1}%
   5856  1.1  mrg     \else
   5857  1.1  mrg       \setbox0 = \hbox{#4\enspace}%
   5858  1.1  mrg       \def\toctype{num}%
   5859  1.1  mrg       \gdef\lastsection{#1}%
   5860  1.1  mrg     \fi\fi\fi
   5861  1.1  mrg     %
   5862  1.1  mrg     % Write the toc entry (before \donoderef).  See comments in \chapmacro.
   5863  1.1  mrg     \writetocentry{\toctype\sectionlevel}{#1}{#4}%
   5864  1.1  mrg     %
   5865  1.1  mrg     % Write the node reference (= pdf destination for pdftex).
   5866  1.1  mrg     % Again, see comments in \chapmacro.
   5867  1.1  mrg     \donoderef{#3}%
   5868  1.1  mrg     %
   5869  1.1  mrg     % Interline glue will be inserted when the vbox is completed.
   5870  1.1  mrg     % That glue will be a valid breakpoint for the page, since it'll be
   5871  1.1  mrg     % preceded by a whatsit (usually from the \donoderef, or from the
   5872  1.1  mrg     % \writetocentry if there was no node).  We don't want to allow that
   5873  1.1  mrg     % break, since then the whatsits could end up on page n while the
   5874  1.1  mrg     % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
   5875  1.1  mrg     \nobreak
   5876  1.1  mrg     %
   5877  1.1  mrg     % Output the actual section heading.
   5878  1.1  mrg     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
   5879  1.1  mrg           \hangindent=\wd0  % zero if no section number
   5880  1.1  mrg           \unhbox0 #1}%
   5881  1.1  mrg   }%
   5882  1.1  mrg   % Add extra space after the heading -- half of whatever came above it.
   5883  1.1  mrg   % Don't allow stretch, though.
   5884  1.1  mrg   \kern .5 \csname #2headingskip\endcsname
   5885  1.1  mrg   %
   5886  1.1  mrg   % Do not let the kern be a potential breakpoint, as it would be if it
   5887  1.1  mrg   % was followed by glue.
   5888  1.1  mrg   \nobreak
   5889  1.1  mrg   %
   5890  1.1  mrg   % We'll almost certainly start a paragraph next, so don't let that
   5891  1.1  mrg   % glue accumulate.  (Not a breakpoint because it's preceded by a
   5892  1.1  mrg   % discardable item.)  However, when a paragraph is not started next
   5893  1.1  mrg   % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
   5894  1.1  mrg   % or the negative glue will cause weirdly wrong output, typically
   5895  1.1  mrg   % obscuring the section heading with something else.
   5896  1.1  mrg   \vskip-\parskip
   5897  1.1  mrg   %
   5898  1.1  mrg   % This is so the last item on the main vertical list is a known
   5899  1.1  mrg   % \penalty > 10000, so \startdefun, etc., can recognize the situation
   5900  1.1  mrg   % and do the needful.
   5901  1.1  mrg   \penalty 10001
   5902  1.1  mrg }
   5903  1.1  mrg 
   5904  1.1  mrg 
   5905  1.1  mrg \message{toc,}
   5906  1.1  mrg % Table of contents.
   5907  1.1  mrg \newwrite\tocfile
   5908  1.1  mrg 
   5909  1.1  mrg % Write an entry to the toc file, opening it if necessary.
   5910  1.1  mrg % Called from @chapter, etc.
   5911  1.1  mrg %
   5912  1.1  mrg % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
   5913  1.1  mrg % We append the current node name (if any) and page number as additional
   5914  1.1  mrg % arguments for the \{chap,sec,...}entry macros which will eventually
   5915  1.1  mrg % read this.  The node name is used in the pdf outlines as the
   5916  1.1  mrg % destination to jump to.
   5917  1.1  mrg %
   5918  1.1  mrg % We open the .toc file for writing here instead of at @setfilename (or
   5919  1.1  mrg % any other fixed time) so that @contents can be anywhere in the document.
   5920  1.1  mrg % But if #1 is `omit', then we don't do anything.  This is used for the
   5921  1.1  mrg % table of contents chapter openings themselves.
   5922  1.1  mrg %
   5923  1.1  mrg \newif\iftocfileopened
   5924  1.1  mrg \def\omitkeyword{omit}%
   5925  1.1  mrg %
   5926  1.1  mrg \def\writetocentry#1#2#3{%
   5927  1.1  mrg   \edef\writetoctype{#1}%
   5928  1.1  mrg   \ifx\writetoctype\omitkeyword \else
   5929  1.1  mrg     \iftocfileopened\else
   5930  1.1  mrg       \immediate\openout\tocfile = \jobname.toc
   5931  1.1  mrg       \global\tocfileopenedtrue
   5932  1.1  mrg     \fi
   5933  1.1  mrg     %
   5934  1.1  mrg     \iflinks
   5935  1.1  mrg       {\atdummies
   5936  1.1  mrg        \edef\temp{%
   5937  1.1  mrg          \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
   5938  1.1  mrg        \temp
   5939  1.1  mrg       }%
   5940  1.1  mrg     \fi
   5941  1.1  mrg   \fi
   5942  1.1  mrg   %
   5943  1.1  mrg   % Tell \shipout to create a pdf destination on each page, if we're
   5944  1.1  mrg   % writing pdf.  These are used in the table of contents.  We can't
   5945  1.1  mrg   % just write one on every page because the title pages are numbered
   5946  1.1  mrg   % 1 and 2 (the page numbers aren't printed), and so are the first
   5947  1.1  mrg   % two pages of the document.  Thus, we'd have two destinations named
   5948  1.1  mrg   % `1', and two named `2'.
   5949  1.1  mrg   \ifpdf \global\pdfmakepagedesttrue \fi
   5950  1.1  mrg }
   5951  1.1  mrg 
   5952  1.1  mrg 
   5953  1.1  mrg % These characters do not print properly in the Computer Modern roman
   5954  1.1  mrg % fonts, so we must take special care.  This is more or less redundant
   5955  1.1  mrg % with the Texinfo input format setup at the end of this file.
   5956  1.1  mrg %
   5957  1.1  mrg \def\activecatcodes{%
   5958  1.1  mrg   \catcode`\"=\active
   5959  1.1  mrg   \catcode`\$=\active
   5960  1.1  mrg   \catcode`\<=\active
   5961  1.1  mrg   \catcode`\>=\active
   5962  1.1  mrg   \catcode`\\=\active
   5963  1.1  mrg   \catcode`\^=\active
   5964  1.1  mrg   \catcode`\_=\active
   5965  1.1  mrg   \catcode`\|=\active
   5966  1.1  mrg   \catcode`\~=\active
   5967  1.1  mrg }
   5968  1.1  mrg 
   5969  1.1  mrg 
   5970  1.1  mrg % Read the toc file, which is essentially Texinfo input.
   5971  1.1  mrg \def\readtocfile{%
   5972  1.1  mrg   \setupdatafile
   5973  1.1  mrg   \activecatcodes
   5974  1.1  mrg   \input \tocreadfilename
   5975  1.1  mrg }
   5976  1.1  mrg 
   5977  1.1  mrg \newskip\contentsrightmargin \contentsrightmargin=1in
   5978  1.1  mrg \newcount\savepageno
   5979  1.1  mrg \newcount\lastnegativepageno \lastnegativepageno = -1
   5980  1.1  mrg 
   5981  1.1  mrg % Prepare to read what we've written to \tocfile.
   5982  1.1  mrg %
   5983  1.1  mrg \def\startcontents#1{%
   5984  1.1  mrg   % If @setchapternewpage on, and @headings double, the contents should
   5985  1.1  mrg   % start on an odd page, unlike chapters.  Thus, we maintain
   5986  1.1  mrg   % \contentsalignmacro in parallel with \pagealignmacro.
   5987  1.1  mrg   % From: Torbjorn Granlund <tege (a] matematik.su.se>
   5988  1.1  mrg   \contentsalignmacro
   5989  1.1  mrg   \immediate\closeout\tocfile
   5990  1.1  mrg   %
   5991  1.1  mrg   % Don't need to put `Contents' or `Short Contents' in the headline.
   5992  1.1  mrg   % It is abundantly clear what they are.
   5993  1.1  mrg   \chapmacro{#1}{Yomitfromtoc}{}%
   5994  1.1  mrg   %
   5995  1.1  mrg   \savepageno = \pageno
   5996  1.1  mrg   \begingroup                  % Set up to handle contents files properly.
   5997  1.1  mrg     \raggedbottom              % Worry more about breakpoints than the bottom.
   5998  1.1  mrg     \advance\hsize by -\contentsrightmargin % Don't use the full line length.
   5999  1.1  mrg     %
   6000  1.1  mrg     % Roman numerals for page numbers.
   6001  1.1  mrg     \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
   6002  1.1  mrg }
   6003  1.1  mrg 
   6004  1.1  mrg % redefined for the two-volume lispref.  We always output on
   6005  1.1  mrg % \jobname.toc even if this is redefined.
   6006  1.1  mrg %
   6007  1.1  mrg \def\tocreadfilename{\jobname.toc}
   6008  1.1  mrg 
   6009  1.1  mrg % Normal (long) toc.
   6010  1.1  mrg %
   6011  1.1  mrg \def\contents{%
   6012  1.1  mrg   \startcontents{\putwordTOC}%
   6013  1.1  mrg     \openin 1 \tocreadfilename\space
   6014  1.1  mrg     \ifeof 1 \else
   6015  1.1  mrg       \readtocfile
   6016  1.1  mrg     \fi
   6017  1.1  mrg     \vfill \eject
   6018  1.1  mrg     \contentsalignmacro % in case @setchapternewpage odd is in effect
   6019  1.1  mrg     \ifeof 1 \else
   6020  1.1  mrg       \pdfmakeoutlines
   6021  1.1  mrg     \fi
   6022  1.1  mrg     \closein 1
   6023  1.1  mrg   \endgroup
   6024  1.1  mrg   \lastnegativepageno = \pageno
   6025  1.1  mrg   \global\pageno = \savepageno
   6026  1.1  mrg }
   6027  1.1  mrg 
   6028  1.1  mrg % And just the chapters.
   6029  1.1  mrg \def\summarycontents{%
   6030  1.1  mrg   \startcontents{\putwordShortTOC}%
   6031  1.1  mrg     %
   6032  1.1  mrg     \let\partentry = \shortpartentry
   6033  1.1  mrg     \let\numchapentry = \shortchapentry
   6034  1.1  mrg     \let\appentry = \shortchapentry
   6035  1.1  mrg     \let\unnchapentry = \shortunnchapentry
   6036  1.1  mrg     % We want a true roman here for the page numbers.
   6037  1.1  mrg     \secfonts
   6038  1.1  mrg     \let\rm=\shortcontrm \let\bf=\shortcontbf
   6039  1.1  mrg     \let\sl=\shortcontsl \let\tt=\shortconttt
   6040  1.1  mrg     \rm
   6041  1.1  mrg     \hyphenpenalty = 10000
   6042  1.1  mrg     \advance\baselineskip by 1pt % Open it up a little.
   6043  1.1  mrg     \def\numsecentry##1##2##3##4{}
   6044  1.1  mrg     \let\appsecentry = \numsecentry
   6045  1.1  mrg     \let\unnsecentry = \numsecentry
   6046  1.1  mrg     \let\numsubsecentry = \numsecentry
   6047  1.1  mrg     \let\appsubsecentry = \numsecentry
   6048  1.1  mrg     \let\unnsubsecentry = \numsecentry
   6049  1.1  mrg     \let\numsubsubsecentry = \numsecentry
   6050  1.1  mrg     \let\appsubsubsecentry = \numsecentry
   6051  1.1  mrg     \let\unnsubsubsecentry = \numsecentry
   6052  1.1  mrg     \openin 1 \tocreadfilename\space
   6053  1.1  mrg     \ifeof 1 \else
   6054  1.1  mrg       \readtocfile
   6055  1.1  mrg     \fi
   6056  1.1  mrg     \closein 1
   6057  1.1  mrg     \vfill \eject
   6058  1.1  mrg     \contentsalignmacro % in case @setchapternewpage odd is in effect
   6059  1.1  mrg   \endgroup
   6060  1.1  mrg   \lastnegativepageno = \pageno
   6061  1.1  mrg   \global\pageno = \savepageno
   6062  1.1  mrg }
   6063  1.1  mrg \let\shortcontents = \summarycontents
   6064  1.1  mrg 
   6065  1.1  mrg % Typeset the label for a chapter or appendix for the short contents.
   6066  1.1  mrg % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
   6067  1.1  mrg %
   6068  1.1  mrg \def\shortchaplabel#1{%
   6069  1.1  mrg   % This space should be enough, since a single number is .5em, and the
   6070  1.1  mrg   % widest letter (M) is 1em, at least in the Computer Modern fonts.
   6071  1.1  mrg   % But use \hss just in case.
   6072  1.1  mrg   % (This space doesn't include the extra space that gets added after
   6073  1.1  mrg   % the label; that gets put in by \shortchapentry above.)
   6074  1.1  mrg   %
   6075  1.1  mrg   % We'd like to right-justify chapter numbers, but that looks strange
   6076  1.1  mrg   % with appendix letters.  And right-justifying numbers and
   6077  1.1  mrg   % left-justifying letters looks strange when there is less than 10
   6078  1.1  mrg   % chapters.  Have to read the whole toc once to know how many chapters
   6079  1.1  mrg   % there are before deciding ...
   6080  1.1  mrg   \hbox to 1em{#1\hss}%
   6081  1.1  mrg }
   6082  1.1  mrg 
   6083  1.1  mrg % These macros generate individual entries in the table of contents.
   6084  1.1  mrg % The first argument is the chapter or section name.
   6085  1.1  mrg % The last argument is the page number.
   6086  1.1  mrg % The arguments in between are the chapter number, section number, ...
   6087  1.1  mrg 
   6088  1.1  mrg % Parts, in the main contents.  Replace the part number, which doesn't
   6089  1.1  mrg % exist, with an empty box.  Let's hope all the numbers have the same width.
   6090  1.1  mrg % Also ignore the page number, which is conventionally not printed.
   6091  1.1  mrg \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
   6092  1.1  mrg \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
   6093  1.1  mrg %
   6094  1.1  mrg % Parts, in the short toc.
   6095  1.1  mrg \def\shortpartentry#1#2#3#4{%
   6096  1.1  mrg   \penalty-300
   6097  1.1  mrg   \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
   6098  1.1  mrg   \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
   6099  1.1  mrg }
   6100  1.1  mrg 
   6101  1.1  mrg % Chapters, in the main contents.
   6102  1.1  mrg \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
   6103  1.1  mrg %
   6104  1.1  mrg % Chapters, in the short toc.
   6105  1.1  mrg % See comments in \dochapentry re vbox and related settings.
   6106  1.1  mrg \def\shortchapentry#1#2#3#4{%
   6107  1.1  mrg   \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
   6108  1.1  mrg }
   6109  1.1  mrg 
   6110  1.1  mrg % Appendices, in the main contents.
   6111  1.1  mrg % Need the word Appendix, and a fixed-size box.
   6112  1.1  mrg %
   6113  1.1  mrg \def\appendixbox#1{%
   6114  1.1  mrg   % We use M since it's probably the widest letter.
   6115  1.1  mrg   \setbox0 = \hbox{\putwordAppendix{} M}%
   6116  1.1  mrg   \hbox to \wd0{\putwordAppendix{} #1\hss}}
   6117  1.1  mrg %
   6118  1.1  mrg \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
   6119  1.1  mrg 
   6120  1.1  mrg % Unnumbered chapters.
   6121  1.1  mrg \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
   6122  1.1  mrg \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
   6123  1.1  mrg 
   6124  1.1  mrg % Sections.
   6125  1.1  mrg \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
   6126  1.1  mrg \let\appsecentry=\numsecentry
   6127  1.1  mrg \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
   6128  1.1  mrg 
   6129  1.1  mrg % Subsections.
   6130  1.1  mrg \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
   6131  1.1  mrg \let\appsubsecentry=\numsubsecentry
   6132  1.1  mrg \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
   6133  1.1  mrg 
   6134  1.1  mrg % And subsubsections.
   6135  1.1  mrg \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
   6136  1.1  mrg \let\appsubsubsecentry=\numsubsubsecentry
   6137  1.1  mrg \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
   6138  1.1  mrg 
   6139  1.1  mrg % This parameter controls the indentation of the various levels.
   6140  1.1  mrg % Same as \defaultparindent.
   6141  1.1  mrg \newdimen\tocindent \tocindent = 15pt
   6142  1.1  mrg 
   6143  1.1  mrg % Now for the actual typesetting. In all these, #1 is the text and #2 is the
   6144  1.1  mrg % page number.
   6145  1.1  mrg %
   6146  1.1  mrg % If the toc has to be broken over pages, we want it to be at chapters
   6147  1.1  mrg % if at all possible; hence the \penalty.
   6148  1.1  mrg \def\dochapentry#1#2{%
   6149  1.1  mrg    \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
   6150  1.1  mrg    \begingroup
   6151  1.1  mrg      \chapentryfonts
   6152  1.1  mrg      \tocentry{#1}{\dopageno\bgroup#2\egroup}%
   6153  1.1  mrg    \endgroup
   6154  1.1  mrg    \nobreak\vskip .25\baselineskip plus.1\baselineskip
   6155  1.1  mrg }
   6156  1.1  mrg 
   6157  1.1  mrg \def\dosecentry#1#2{\begingroup
   6158  1.1  mrg   \secentryfonts \leftskip=\tocindent
   6159  1.1  mrg   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
   6160  1.1  mrg \endgroup}
   6161  1.1  mrg 
   6162  1.1  mrg \def\dosubsecentry#1#2{\begingroup
   6163  1.1  mrg   \subsecentryfonts \leftskip=2\tocindent
   6164  1.1  mrg   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
   6165  1.1  mrg \endgroup}
   6166  1.1  mrg 
   6167  1.1  mrg \def\dosubsubsecentry#1#2{\begingroup
   6168  1.1  mrg   \subsubsecentryfonts \leftskip=3\tocindent
   6169  1.1  mrg   \tocentry{#1}{\dopageno\bgroup#2\egroup}%
   6170  1.1  mrg \endgroup}
   6171  1.1  mrg 
   6172  1.1  mrg % We use the same \entry macro as for the index entries.
   6173  1.1  mrg \let\tocentry = \entry
   6174  1.1  mrg 
   6175  1.1  mrg % Space between chapter (or whatever) number and the title.
   6176  1.1  mrg \def\labelspace{\hskip1em \relax}
   6177  1.1  mrg 
   6178  1.1  mrg \def\dopageno#1{{\rm #1}}
   6179  1.1  mrg \def\doshortpageno#1{{\rm #1}}
   6180  1.1  mrg 
   6181  1.1  mrg \def\chapentryfonts{\secfonts \rm}
   6182  1.1  mrg \def\secentryfonts{\textfonts}
   6183  1.1  mrg \def\subsecentryfonts{\textfonts}
   6184  1.1  mrg \def\subsubsecentryfonts{\textfonts}
   6185  1.1  mrg 
   6186  1.1  mrg 
   6187  1.1  mrg \message{environments,}
   6188  1.1  mrg % @foo ... @end foo.
   6189  1.1  mrg 
   6190  1.1  mrg % @tex ... @end tex    escapes into raw TeX temporarily.
   6191  1.1  mrg % One exception: @ is still an escape character, so that @end tex works.
   6192  1.1  mrg % But \@ or @@ will get a plain @ character.
   6193  1.1  mrg 
   6194  1.1  mrg \envdef\tex{%
   6195  1.1  mrg   \setupmarkupstyle{tex}%
   6196  1.1  mrg   \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
   6197  1.1  mrg   \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
   6198  1.1  mrg   \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
   6199  1.1  mrg   \catcode `\%=14
   6200  1.1  mrg   \catcode `\+=\other
   6201  1.1  mrg   \catcode `\"=\other
   6202  1.1  mrg   \catcode `\|=\other
   6203  1.1  mrg   \catcode `\<=\other
   6204  1.1  mrg   \catcode `\>=\other
   6205  1.1  mrg   \catcode`\`=\other
   6206  1.1  mrg   \catcode`\'=\other
   6207  1.1  mrg   \escapechar=`\\
   6208  1.1  mrg   %
   6209  1.1  mrg   % ' is active in math mode (mathcode"8000).  So reset it, and all our
   6210  1.1  mrg   % other math active characters (just in case), to plain's definitions.
   6211  1.1  mrg   \mathactive
   6212  1.1  mrg   %
   6213  1.1  mrg   \let\b=\ptexb
   6214  1.1  mrg   \let\bullet=\ptexbullet
   6215  1.1  mrg   \let\c=\ptexc
   6216  1.1  mrg   \let\,=\ptexcomma
   6217  1.1  mrg   \let\.=\ptexdot
   6218  1.1  mrg   \let\dots=\ptexdots
   6219  1.1  mrg   \let\equiv=\ptexequiv
   6220  1.1  mrg   \let\!=\ptexexclam
   6221  1.1  mrg   \let\i=\ptexi
   6222  1.1  mrg   \let\indent=\ptexindent
   6223  1.1  mrg   \let\noindent=\ptexnoindent
   6224  1.1  mrg   \let\{=\ptexlbrace
   6225  1.1  mrg   \let\+=\tabalign
   6226  1.1  mrg   \let\}=\ptexrbrace
   6227  1.1  mrg   \let\/=\ptexslash
   6228  1.1  mrg   \let\*=\ptexstar
   6229  1.1  mrg   \let\t=\ptext
   6230  1.1  mrg   \expandafter \let\csname top\endcsname=\ptextop  % outer
   6231  1.1  mrg   \let\frenchspacing=\plainfrenchspacing
   6232  1.1  mrg   %
   6233  1.1  mrg   \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
   6234  1.1  mrg   \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
   6235  1.1  mrg   \def\@{@}%
   6236  1.1  mrg }
   6237  1.1  mrg % There is no need to define \Etex.
   6238  1.1  mrg 
   6239  1.1  mrg % Define @lisp ... @end lisp.
   6240  1.1  mrg % @lisp environment forms a group so it can rebind things,
   6241  1.1  mrg % including the definition of @end lisp (which normally is erroneous).
   6242  1.1  mrg 
   6243  1.1  mrg % Amount to narrow the margins by for @lisp.
   6244  1.1  mrg \newskip\lispnarrowing \lispnarrowing=0.4in
   6245  1.1  mrg 
   6246  1.1  mrg % This is the definition that ^^M gets inside @lisp, @example, and other
   6247  1.1  mrg % such environments.  \null is better than a space, since it doesn't
   6248  1.1  mrg % have any width.
   6249  1.1  mrg \def\lisppar{\null\endgraf}
   6250  1.1  mrg 
   6251  1.1  mrg % This space is always present above and below environments.
   6252  1.1  mrg \newskip\envskipamount \envskipamount = 0pt
   6253  1.1  mrg 
   6254  1.1  mrg % Make spacing and below environment symmetrical.  We use \parskip here
   6255  1.1  mrg % to help in doing that, since in @example-like environments \parskip
   6256  1.1  mrg % is reset to zero; thus the \afterenvbreak inserts no space -- but the
   6257  1.1  mrg % start of the next paragraph will insert \parskip.
   6258  1.1  mrg %
   6259  1.1  mrg \def\aboveenvbreak{{%
   6260  1.1  mrg   % =10000 instead of <10000 because of a special case in \itemzzz and
   6261  1.1  mrg   % \sectionheading, q.v.
   6262  1.1  mrg   \ifnum \lastpenalty=10000 \else
   6263  1.1  mrg     \advance\envskipamount by \parskip
   6264  1.1  mrg     \endgraf
   6265  1.1  mrg     \ifdim\lastskip<\envskipamount
   6266  1.1  mrg       \removelastskip
   6267  1.1  mrg       % it's not a good place to break if the last penalty was \nobreak
   6268  1.1  mrg       % or better ...
   6269  1.1  mrg       \ifnum\lastpenalty<10000 \penalty-50 \fi
   6270  1.1  mrg       \vskip\envskipamount
   6271  1.1  mrg     \fi
   6272  1.1  mrg   \fi
   6273  1.1  mrg }}
   6274  1.1  mrg 
   6275  1.1  mrg \let\afterenvbreak = \aboveenvbreak
   6276  1.1  mrg 
   6277  1.1  mrg % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
   6278  1.1  mrg % also clear it, so that its embedded environments do the narrowing again.
   6279  1.1  mrg \let\nonarrowing=\relax
   6280  1.1  mrg 
   6281  1.1  mrg % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
   6282  1.1  mrg % environment contents.
   6283  1.1  mrg \font\circle=lcircle10
   6284  1.1  mrg \newdimen\circthick
   6285  1.1  mrg \newdimen\cartouter\newdimen\cartinner
   6286  1.1  mrg \newskip\normbskip\newskip\normpskip\newskip\normlskip
   6287  1.1  mrg \circthick=\fontdimen8\circle
   6288  1.1  mrg %
   6289  1.1  mrg \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
   6290  1.1  mrg \def\ctr{{\hskip 6pt\circle\char'010}}
   6291  1.1  mrg \def\cbl{{\circle\char'012\hskip -6pt}}
   6292  1.1  mrg \def\cbr{{\hskip 6pt\circle\char'011}}
   6293  1.1  mrg \def\carttop{\hbox to \cartouter{\hskip\lskip
   6294  1.1  mrg         \ctl\leaders\hrule height\circthick\hfil\ctr
   6295  1.1  mrg         \hskip\rskip}}
   6296  1.1  mrg \def\cartbot{\hbox to \cartouter{\hskip\lskip
   6297  1.1  mrg         \cbl\leaders\hrule height\circthick\hfil\cbr
   6298  1.1  mrg         \hskip\rskip}}
   6299  1.1  mrg %
   6300  1.1  mrg \newskip\lskip\newskip\rskip
   6301  1.1  mrg 
   6302  1.1  mrg \envdef\cartouche{%
   6303  1.1  mrg   \ifhmode\par\fi  % can't be in the midst of a paragraph.
   6304  1.1  mrg   \startsavinginserts
   6305  1.1  mrg   \lskip=\leftskip \rskip=\rightskip
   6306  1.1  mrg   \leftskip=0pt\rightskip=0pt % we want these *outside*.
   6307  1.1  mrg   \cartinner=\hsize \advance\cartinner by-\lskip
   6308  1.1  mrg   \advance\cartinner by-\rskip
   6309  1.1  mrg   \cartouter=\hsize
   6310  1.1  mrg   \advance\cartouter by 18.4pt	% allow for 3pt kerns on either
   6311  1.1  mrg 				% side, and for 6pt waste from
   6312  1.1  mrg 				% each corner char, and rule thickness
   6313  1.1  mrg   \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
   6314  1.1  mrg   % Flag to tell @lisp, etc., not to narrow margin.
   6315  1.1  mrg   \let\nonarrowing = t%
   6316  1.1  mrg   %
   6317  1.1  mrg   % If this cartouche directly follows a sectioning command, we need the
   6318  1.1  mrg   % \parskip glue (backspaced over by default) or the cartouche can
   6319  1.1  mrg   % collide with the section heading.
   6320  1.1  mrg   \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
   6321  1.1  mrg   %
   6322  1.1  mrg   \vbox\bgroup
   6323  1.1  mrg       \baselineskip=0pt\parskip=0pt\lineskip=0pt
   6324  1.1  mrg       \carttop
   6325  1.1  mrg       \hbox\bgroup
   6326  1.1  mrg 	  \hskip\lskip
   6327  1.1  mrg 	  \vrule\kern3pt
   6328  1.1  mrg 	  \vbox\bgroup
   6329  1.1  mrg 	      \kern3pt
   6330  1.1  mrg 	      \hsize=\cartinner
   6331  1.1  mrg 	      \baselineskip=\normbskip
   6332  1.1  mrg 	      \lineskip=\normlskip
   6333  1.1  mrg 	      \parskip=\normpskip
   6334  1.1  mrg 	      \vskip -\parskip
   6335  1.1  mrg 	      \comment % For explanation, see the end of def\group.
   6336  1.1  mrg }
   6337  1.1  mrg \def\Ecartouche{%
   6338  1.1  mrg               \ifhmode\par\fi
   6339  1.1  mrg 	      \kern3pt
   6340  1.1  mrg 	  \egroup
   6341  1.1  mrg 	  \kern3pt\vrule
   6342  1.1  mrg 	  \hskip\rskip
   6343  1.1  mrg       \egroup
   6344  1.1  mrg       \cartbot
   6345  1.1  mrg   \egroup
   6346  1.1  mrg   \checkinserts
   6347  1.1  mrg }
   6348  1.1  mrg 
   6349  1.1  mrg 
   6350  1.1  mrg % This macro is called at the beginning of all the @example variants,
   6351  1.1  mrg % inside a group.
   6352  1.1  mrg \newdimen\nonfillparindent
   6353  1.1  mrg \def\nonfillstart{%
   6354  1.1  mrg   \aboveenvbreak
   6355  1.1  mrg   \hfuzz = 12pt % Don't be fussy
   6356  1.1  mrg   \sepspaces % Make spaces be word-separators rather than space tokens.
   6357  1.1  mrg   \let\par = \lisppar % don't ignore blank lines
   6358  1.1  mrg   \obeylines % each line of input is a line of output
   6359  1.1  mrg   \parskip = 0pt
   6360  1.1  mrg   % Turn off paragraph indentation but redefine \indent to emulate
   6361  1.1  mrg   % the normal \indent.
   6362  1.1  mrg   \nonfillparindent=\parindent
   6363  1.1  mrg   \parindent = 0pt
   6364  1.1  mrg   \let\indent\nonfillindent
   6365  1.1  mrg   %
   6366  1.1  mrg   \emergencystretch = 0pt % don't try to avoid overfull boxes
   6367  1.1  mrg   \ifx\nonarrowing\relax
   6368  1.1  mrg     \advance \leftskip by \lispnarrowing
   6369  1.1  mrg     \exdentamount=\lispnarrowing
   6370  1.1  mrg   \else
   6371  1.1  mrg     \let\nonarrowing = \relax
   6372  1.1  mrg   \fi
   6373  1.1  mrg   \let\exdent=\nofillexdent
   6374  1.1  mrg }
   6375  1.1  mrg 
   6376  1.1  mrg \begingroup
   6377  1.1  mrg \obeyspaces
   6378  1.1  mrg % We want to swallow spaces (but not other tokens) after the fake
   6379  1.1  mrg % @indent in our nonfill-environments, where spaces are normally
   6380  1.1  mrg % active and set to @tie, resulting in them not being ignored after
   6381  1.1  mrg % @indent.
   6382  1.1  mrg \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
   6383  1.1  mrg \gdef\nonfillindentcheck{%
   6384  1.1  mrg \ifx\temp %
   6385  1.1  mrg \expandafter\nonfillindentgobble%
   6386  1.1  mrg \else%
   6387  1.1  mrg \leavevmode\nonfillindentbox%
   6388  1.1  mrg \fi%
   6389  1.1  mrg }%
   6390  1.1  mrg \endgroup
   6391  1.1  mrg \def\nonfillindentgobble#1{\nonfillindent}
   6392  1.1  mrg \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
   6393  1.1  mrg 
   6394  1.1  mrg % If you want all examples etc. small: @set dispenvsize small.
   6395  1.1  mrg % If you want even small examples the full size: @set dispenvsize nosmall.
   6396  1.1  mrg % This affects the following displayed environments:
   6397  1.1  mrg %    @example, @display, @format, @lisp
   6398  1.1  mrg %
   6399  1.1  mrg \def\smallword{small}
   6400  1.1  mrg \def\nosmallword{nosmall}
   6401  1.1  mrg \let\SETdispenvsize\relax
   6402  1.1  mrg \def\setnormaldispenv{%
   6403  1.1  mrg   \ifx\SETdispenvsize\smallword
   6404  1.1  mrg     % end paragraph for sake of leading, in case document has no blank
   6405  1.1  mrg     % line.  This is redundant with what happens in \aboveenvbreak, but
   6406  1.1  mrg     % we need to do it before changing the fonts, and it's inconvenient
   6407  1.1  mrg     % to change the fonts afterward.
   6408  1.1  mrg     \ifnum \lastpenalty=10000 \else \endgraf \fi
   6409  1.1  mrg     \smallexamplefonts \rm
   6410  1.1  mrg   \fi
   6411  1.1  mrg }
   6412  1.1  mrg \def\setsmalldispenv{%
   6413  1.1  mrg   \ifx\SETdispenvsize\nosmallword
   6414  1.1  mrg   \else
   6415  1.1  mrg     \ifnum \lastpenalty=10000 \else \endgraf \fi
   6416  1.1  mrg     \smallexamplefonts \rm
   6417  1.1  mrg   \fi
   6418  1.1  mrg }
   6419  1.1  mrg 
   6420  1.1  mrg % We often define two environments, @foo and @smallfoo.
   6421  1.1  mrg % Let's do it in one command.  #1 is the env name, #2 the definition.
   6422  1.1  mrg \def\makedispenvdef#1#2{%
   6423  1.1  mrg   \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
   6424  1.1  mrg   \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
   6425  1.1  mrg   \expandafter\let\csname E#1\endcsname \afterenvbreak
   6426  1.1  mrg   \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
   6427  1.1  mrg }
   6428  1.1  mrg 
   6429  1.1  mrg % Define two environment synonyms (#1 and #2) for an environment.
   6430  1.1  mrg \def\maketwodispenvdef#1#2#3{%
   6431  1.1  mrg   \makedispenvdef{#1}{#3}%
   6432  1.1  mrg   \makedispenvdef{#2}{#3}%
   6433  1.1  mrg }
   6434  1.1  mrg %
   6435  1.1  mrg % @lisp: indented, narrowed, typewriter font;
   6436  1.1  mrg % @example: same as @lisp.
   6437  1.1  mrg %
   6438  1.1  mrg % @smallexample and @smalllisp: use smaller fonts.
   6439  1.1  mrg % Originally contributed by Pavel@xerox.
   6440  1.1  mrg %
   6441  1.1  mrg \maketwodispenvdef{lisp}{example}{%
   6442  1.1  mrg   \nonfillstart
   6443  1.1  mrg   \tt\setupmarkupstyle{example}%
   6444  1.1  mrg   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
   6445  1.1  mrg   \gobble % eat return
   6446  1.1  mrg }
   6447  1.1  mrg % @display/@smalldisplay: same as @lisp except keep current font.
   6448  1.1  mrg %
   6449  1.1  mrg \makedispenvdef{display}{%
   6450  1.1  mrg   \nonfillstart
   6451  1.1  mrg   \gobble
   6452  1.1  mrg }
   6453  1.1  mrg 
   6454  1.1  mrg % @format/@smallformat: same as @display except don't narrow margins.
   6455  1.1  mrg %
   6456  1.1  mrg \makedispenvdef{format}{%
   6457  1.1  mrg   \let\nonarrowing = t%
   6458  1.1  mrg   \nonfillstart
   6459  1.1  mrg   \gobble
   6460  1.1  mrg }
   6461  1.1  mrg 
   6462  1.1  mrg % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
   6463  1.1  mrg \envdef\flushleft{%
   6464  1.1  mrg   \let\nonarrowing = t%
   6465  1.1  mrg   \nonfillstart
   6466  1.1  mrg   \gobble
   6467  1.1  mrg }
   6468  1.1  mrg \let\Eflushleft = \afterenvbreak
   6469  1.1  mrg 
   6470  1.1  mrg % @flushright.
   6471  1.1  mrg %
   6472  1.1  mrg \envdef\flushright{%
   6473  1.1  mrg   \let\nonarrowing = t%
   6474  1.1  mrg   \nonfillstart
   6475  1.1  mrg   \advance\leftskip by 0pt plus 1fill\relax
   6476  1.1  mrg   \gobble
   6477  1.1  mrg }
   6478  1.1  mrg \let\Eflushright = \afterenvbreak
   6479  1.1  mrg 
   6480  1.1  mrg 
   6481  1.1  mrg % @raggedright does more-or-less normal line breaking but no right
   6482  1.1  mrg % justification.  From plain.tex.
   6483  1.1  mrg \envdef\raggedright{%
   6484  1.1  mrg   \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
   6485  1.1  mrg }
   6486  1.1  mrg \let\Eraggedright\par
   6487  1.1  mrg 
   6488  1.1  mrg \envdef\raggedleft{%
   6489  1.1  mrg   \parindent=0pt \leftskip0pt plus2em
   6490  1.1  mrg   \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
   6491  1.1  mrg   \hbadness=10000 % Last line will usually be underfull, so turn off
   6492  1.1  mrg                   % badness reporting.
   6493  1.1  mrg }
   6494  1.1  mrg \let\Eraggedleft\par
   6495  1.1  mrg 
   6496  1.1  mrg \envdef\raggedcenter{%
   6497  1.1  mrg   \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
   6498  1.1  mrg   \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
   6499  1.1  mrg   \hbadness=10000 % Last line will usually be underfull, so turn off
   6500  1.1  mrg                   % badness reporting.
   6501  1.1  mrg }
   6502  1.1  mrg \let\Eraggedcenter\par
   6503  1.1  mrg 
   6504  1.1  mrg 
   6505  1.1  mrg % @quotation does normal linebreaking (hence we can't use \nonfillstart)
   6506  1.1  mrg % and narrows the margins.  We keep \parskip nonzero in general, since
   6507  1.1  mrg % we're doing normal filling.  So, when using \aboveenvbreak and
   6508  1.1  mrg % \afterenvbreak, temporarily make \parskip 0.
   6509  1.1  mrg %
   6510  1.1  mrg \makedispenvdef{quotation}{\quotationstart}
   6511  1.1  mrg %
   6512  1.1  mrg \def\quotationstart{%
   6513  1.1  mrg   {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
   6514  1.1  mrg   \parindent=0pt
   6515  1.1  mrg   %
   6516  1.1  mrg   % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
   6517  1.1  mrg   \ifx\nonarrowing\relax
   6518  1.1  mrg     \advance\leftskip by \lispnarrowing
   6519  1.1  mrg     \advance\rightskip by \lispnarrowing
   6520  1.1  mrg     \exdentamount = \lispnarrowing
   6521  1.1  mrg   \else
   6522  1.1  mrg     \let\nonarrowing = \relax
   6523  1.1  mrg   \fi
   6524  1.1  mrg   \parsearg\quotationlabel
   6525  1.1  mrg }
   6526  1.1  mrg 
   6527  1.1  mrg % We have retained a nonzero parskip for the environment, since we're
   6528  1.1  mrg % doing normal filling.
   6529  1.1  mrg %
   6530  1.1  mrg \def\Equotation{%
   6531  1.1  mrg   \par
   6532  1.1  mrg   \ifx\quotationauthor\thisisundefined\else
   6533  1.1  mrg     % indent a bit.
   6534  1.1  mrg     \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
   6535  1.1  mrg   \fi
   6536  1.1  mrg   {\parskip=0pt \afterenvbreak}%
   6537  1.1  mrg }
   6538  1.1  mrg \def\Esmallquotation{\Equotation}
   6539  1.1  mrg 
   6540  1.1  mrg % If we're given an argument, typeset it in bold with a colon after.
   6541  1.1  mrg \def\quotationlabel#1{%
   6542  1.1  mrg   \def\temp{#1}%
   6543  1.1  mrg   \ifx\temp\empty \else
   6544  1.1  mrg     {\bf #1: }%
   6545  1.1  mrg   \fi
   6546  1.1  mrg }
   6547  1.1  mrg 
   6548  1.1  mrg 
   6549  1.1  mrg % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
   6550  1.1  mrg % If we want to allow any <char> as delimiter,
   6551  1.1  mrg % we need the curly braces so that makeinfo sees the @verb command, eg:
   6552  1.1  mrg % `@verbx...x' would look like the '@verbx' command.  --janneke (a] gnu.org
   6553  1.1  mrg %
   6554  1.1  mrg % [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
   6555  1.1  mrg %
   6556  1.1  mrg % [Knuth] p.344; only we need to do the other characters Texinfo sets
   6557  1.1  mrg % active too.  Otherwise, they get lost as the first character on a
   6558  1.1  mrg % verbatim line.
   6559  1.1  mrg \def\dospecials{%
   6560  1.1  mrg   \do\ \do\\\do\{\do\}\do\$\do\&%
   6561  1.1  mrg   \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
   6562  1.1  mrg   \do\<\do\>\do\|\do\@\do+\do\"%
   6563  1.1  mrg   % Don't do the quotes -- if we do, @set txicodequoteundirected and
   6564  1.1  mrg   % @set txicodequotebacktick will not have effect on @verb and
   6565  1.1  mrg   % @verbatim, and ?` and !` ligatures won't get disabled.
   6566  1.1  mrg   %\do\`\do\'%
   6567  1.1  mrg }
   6568  1.1  mrg %
   6569  1.1  mrg % [Knuth] p. 380
   6570  1.1  mrg \def\uncatcodespecials{%
   6571  1.1  mrg   \def\do##1{\catcode`##1=\other}\dospecials}
   6572  1.1  mrg %
   6573  1.1  mrg % Setup for the @verb command.
   6574  1.1  mrg %
   6575  1.1  mrg % Eight spaces for a tab
   6576  1.1  mrg \begingroup
   6577  1.1  mrg   \catcode`\^^I=\active
   6578  1.1  mrg   \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
   6579  1.1  mrg \endgroup
   6580  1.1  mrg %
   6581  1.1  mrg \def\setupverb{%
   6582  1.1  mrg   \tt  % easiest (and conventionally used) font for verbatim
   6583  1.1  mrg   \def\par{\leavevmode\endgraf}%
   6584  1.1  mrg   \setupmarkupstyle{verb}%
   6585  1.1  mrg   \tabeightspaces
   6586  1.1  mrg   % Respect line breaks,
   6587  1.1  mrg   % print special symbols as themselves, and
   6588  1.1  mrg   % make each space count
   6589  1.1  mrg   % must do in this order:
   6590  1.1  mrg   \obeylines \uncatcodespecials \sepspaces
   6591  1.1  mrg }
   6592  1.1  mrg 
   6593  1.1  mrg % Setup for the @verbatim environment
   6594  1.1  mrg %
   6595  1.1  mrg % Real tab expansion.
   6596  1.1  mrg \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
   6597  1.1  mrg %
   6598  1.1  mrg % We typeset each line of the verbatim in an \hbox, so we can handle
   6599  1.1  mrg % tabs.  The \global is in case the verbatim line starts with an accent,
   6600  1.1  mrg % or some other command that starts with a begin-group.  Otherwise, the
   6601  1.1  mrg % entire \verbbox would disappear at the corresponding end-group, before
   6602  1.1  mrg % it is typeset.  Meanwhile, we can't have nested verbatim commands
   6603  1.1  mrg % (can we?), so the \global won't be overwriting itself.
   6604  1.1  mrg \newbox\verbbox
   6605  1.1  mrg \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
   6606  1.1  mrg %
   6607  1.1  mrg \begingroup
   6608  1.1  mrg   \catcode`\^^I=\active
   6609  1.1  mrg   \gdef\tabexpand{%
   6610  1.1  mrg     \catcode`\^^I=\active
   6611  1.1  mrg     \def^^I{\leavevmode\egroup
   6612  1.1  mrg       \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
   6613  1.1  mrg       \divide\dimen\verbbox by\tabw
   6614  1.1  mrg       \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
   6615  1.1  mrg       \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
   6616  1.1  mrg       \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
   6617  1.1  mrg     }%
   6618  1.1  mrg   }
   6619  1.1  mrg \endgroup
   6620  1.1  mrg 
   6621  1.1  mrg % start the verbatim environment.
   6622  1.1  mrg \def\setupverbatim{%
   6623  1.1  mrg   \let\nonarrowing = t%
   6624  1.1  mrg   \nonfillstart
   6625  1.1  mrg   \tt % easiest (and conventionally used) font for verbatim
   6626  1.1  mrg   % The \leavevmode here is for blank lines.  Otherwise, we would
   6627  1.1  mrg   % never \starttabox and the \egroup would end verbatim mode.
   6628  1.1  mrg   \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
   6629  1.1  mrg   \tabexpand
   6630  1.1  mrg   \setupmarkupstyle{verbatim}%
   6631  1.1  mrg   % Respect line breaks,
   6632  1.1  mrg   % print special symbols as themselves, and
   6633  1.1  mrg   % make each space count.
   6634  1.1  mrg   % Must do in this order:
   6635  1.1  mrg   \obeylines \uncatcodespecials \sepspaces
   6636  1.1  mrg   \everypar{\starttabbox}%
   6637  1.1  mrg }
   6638  1.1  mrg 
   6639  1.1  mrg % Do the @verb magic: verbatim text is quoted by unique
   6640  1.1  mrg % delimiter characters.  Before first delimiter expect a
   6641  1.1  mrg % right brace, after last delimiter expect closing brace:
   6642  1.1  mrg %
   6643  1.1  mrg %    \def\doverb'{'<char>#1<char>'}'{#1}
   6644  1.1  mrg %
   6645  1.1  mrg % [Knuth] p. 382; only eat outer {}
   6646  1.1  mrg \begingroup
   6647  1.1  mrg   \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
   6648  1.1  mrg   \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
   6649  1.1  mrg \endgroup
   6650  1.1  mrg %
   6651  1.1  mrg \def\verb{\begingroup\setupverb\doverb}
   6652  1.1  mrg %
   6653  1.1  mrg %
   6654  1.1  mrg % Do the @verbatim magic: define the macro \doverbatim so that
   6655  1.1  mrg % the (first) argument ends when '@end verbatim' is reached, ie:
   6656  1.1  mrg %
   6657  1.1  mrg %     \def\doverbatim#1@end verbatim{#1}
   6658  1.1  mrg %
   6659  1.1  mrg % For Texinfo it's a lot easier than for LaTeX,
   6660  1.1  mrg % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
   6661  1.1  mrg % we need not redefine '\', '{' and '}'.
   6662  1.1  mrg %
   6663  1.1  mrg % Inspired by LaTeX's verbatim command set [latex.ltx]
   6664  1.1  mrg %
   6665  1.1  mrg \begingroup
   6666  1.1  mrg   \catcode`\ =\active
   6667  1.1  mrg   \obeylines %
   6668  1.1  mrg   % ignore everything up to the first ^^M, that's the newline at the end
   6669  1.1  mrg   % of the @verbatim input line itself.  Otherwise we get an extra blank
   6670  1.1  mrg   % line in the output.
   6671  1.1  mrg   \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
   6672  1.1  mrg   % We really want {...\end verbatim} in the body of the macro, but
   6673  1.1  mrg   % without the active space; thus we have to use \xdef and \gobble.
   6674  1.1  mrg \endgroup
   6675  1.1  mrg %
   6676  1.1  mrg \envdef\verbatim{%
   6677  1.1  mrg     \setupverbatim\doverbatim
   6678  1.1  mrg }
   6679  1.1  mrg \let\Everbatim = \afterenvbreak
   6680  1.1  mrg 
   6681  1.1  mrg 
   6682  1.1  mrg % @verbatiminclude FILE - insert text of file in verbatim environment.
   6683  1.1  mrg %
   6684  1.1  mrg \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
   6685  1.1  mrg %
   6686  1.1  mrg \def\doverbatiminclude#1{%
   6687  1.1  mrg   {%
   6688  1.1  mrg     \makevalueexpandable
   6689  1.1  mrg     \setupverbatim
   6690  1.1  mrg     \indexnofonts       % Allow `@@' and other weird things in file names.
   6691  1.1  mrg     \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
   6692  1.1  mrg     \input #1
   6693  1.1  mrg     \afterenvbreak
   6694  1.1  mrg   }%
   6695  1.1  mrg }
   6696  1.1  mrg 
   6697  1.1  mrg % @copying ... @end copying.
   6698  1.1  mrg % Save the text away for @insertcopying later.
   6699  1.1  mrg %
   6700  1.1  mrg % We save the uninterpreted tokens, rather than creating a box.
   6701  1.1  mrg % Saving the text in a box would be much easier, but then all the
   6702  1.1  mrg % typesetting commands (@smallbook, font changes, etc.) have to be done
   6703  1.1  mrg % beforehand -- and a) we want @copying to be done first in the source
   6704  1.1  mrg % file; b) letting users define the frontmatter in as flexible order as
   6705  1.1  mrg % possible is very desirable.
   6706  1.1  mrg %
   6707  1.1  mrg \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
   6708  1.1  mrg \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
   6709  1.1  mrg %
   6710  1.1  mrg \def\insertcopying{%
   6711  1.1  mrg   \begingroup
   6712  1.1  mrg     \parindent = 0pt  % paragraph indentation looks wrong on title page
   6713  1.1  mrg     \scanexp\copyingtext
   6714  1.1  mrg   \endgroup
   6715  1.1  mrg }
   6716  1.1  mrg 
   6717  1.1  mrg 
   6718  1.1  mrg \message{defuns,}
   6719  1.1  mrg % @defun etc.
   6720  1.1  mrg 
   6721  1.1  mrg \newskip\defbodyindent \defbodyindent=.4in
   6722  1.1  mrg \newskip\defargsindent \defargsindent=50pt
   6723  1.1  mrg \newskip\deflastargmargin \deflastargmargin=18pt
   6724  1.1  mrg \newcount\defunpenalty
   6725  1.1  mrg 
   6726  1.1  mrg % Start the processing of @deffn:
   6727  1.1  mrg \def\startdefun{%
   6728  1.1  mrg   \ifnum\lastpenalty<10000
   6729  1.1  mrg     \medbreak
   6730  1.1  mrg     \defunpenalty=10003 % Will keep this @deffn together with the
   6731  1.1  mrg                         % following @def command, see below.
   6732  1.1  mrg   \else
   6733  1.1  mrg     % If there are two @def commands in a row, we'll have a \nobreak,
   6734  1.1  mrg     % which is there to keep the function description together with its
   6735  1.1  mrg     % header.  But if there's nothing but headers, we need to allow a
   6736  1.1  mrg     % break somewhere.  Check specifically for penalty 10002, inserted
   6737  1.1  mrg     % by \printdefunline, instead of 10000, since the sectioning
   6738  1.1  mrg     % commands also insert a nobreak penalty, and we don't want to allow
   6739  1.1  mrg     % a break between a section heading and a defun.
   6740  1.1  mrg     %
   6741  1.1  mrg     % As a further refinement, we avoid "club" headers by signalling
   6742  1.1  mrg     % with penalty of 10003 after the very first @deffn in the
   6743  1.1  mrg     % sequence (see above), and penalty of 10002 after any following
   6744  1.1  mrg     % @def command.
   6745  1.1  mrg     \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
   6746  1.1  mrg     %
   6747  1.1  mrg     % Similarly, after a section heading, do not allow a break.
   6748  1.1  mrg     % But do insert the glue.
   6749  1.1  mrg     \medskip  % preceded by discardable penalty, so not a breakpoint
   6750  1.1  mrg   \fi
   6751  1.1  mrg   %
   6752  1.1  mrg   \parindent=0in
   6753  1.1  mrg   \advance\leftskip by \defbodyindent
   6754  1.1  mrg   \exdentamount=\defbodyindent
   6755  1.1  mrg }
   6756  1.1  mrg 
   6757  1.1  mrg \def\dodefunx#1{%
   6758  1.1  mrg   % First, check whether we are in the right environment:
   6759  1.1  mrg   \checkenv#1%
   6760  1.1  mrg   %
   6761  1.1  mrg   % As above, allow line break if we have multiple x headers in a row.
   6762  1.1  mrg   % It's not a great place, though.
   6763  1.1  mrg   \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
   6764  1.1  mrg   %
   6765  1.1  mrg   % And now, it's time to reuse the body of the original defun:
   6766  1.1  mrg   \expandafter\gobbledefun#1%
   6767  1.1  mrg }
   6768  1.1  mrg \def\gobbledefun#1\startdefun{}
   6769  1.1  mrg 
   6770  1.1  mrg % \printdefunline \deffnheader{text}
   6771  1.1  mrg %
   6772  1.1  mrg \def\printdefunline#1#2{%
   6773  1.1  mrg   \begingroup
   6774  1.1  mrg     % call \deffnheader:
   6775  1.1  mrg     #1#2 \endheader
   6776  1.1  mrg     % common ending:
   6777  1.1  mrg     \interlinepenalty = 10000
   6778  1.1  mrg     \advance\rightskip by 0pt plus 1fil\relax
   6779  1.1  mrg     \endgraf
   6780  1.1  mrg     \nobreak\vskip -\parskip
   6781  1.1  mrg     \penalty\defunpenalty  % signal to \startdefun and \dodefunx
   6782  1.1  mrg     % Some of the @defun-type tags do not enable magic parentheses,
   6783  1.1  mrg     % rendering the following check redundant.  But we don't optimize.
   6784  1.1  mrg     \checkparencounts
   6785  1.1  mrg   \endgroup
   6786  1.1  mrg }
   6787  1.1  mrg 
   6788  1.1  mrg \def\Edefun{\endgraf\medbreak}
   6789  1.1  mrg 
   6790  1.1  mrg % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
   6791  1.1  mrg % the only thing remaining is to define \deffnheader.
   6792  1.1  mrg %
   6793  1.1  mrg \def\makedefun#1{%
   6794  1.1  mrg   \expandafter\let\csname E#1\endcsname = \Edefun
   6795  1.1  mrg   \edef\temp{\noexpand\domakedefun
   6796  1.1  mrg     \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
   6797  1.1  mrg   \temp
   6798  1.1  mrg }
   6799  1.1  mrg 
   6800  1.1  mrg % \domakedefun \deffn \deffnx \deffnheader
   6801  1.1  mrg %
   6802  1.1  mrg % Define \deffn and \deffnx, without parameters.
   6803  1.1  mrg % \deffnheader has to be defined explicitly.
   6804  1.1  mrg %
   6805  1.1  mrg \def\domakedefun#1#2#3{%
   6806  1.1  mrg   \envdef#1{%
   6807  1.1  mrg     \startdefun
   6808  1.1  mrg     \doingtypefnfalse    % distinguish typed functions from all else
   6809  1.1  mrg     \parseargusing\activeparens{\printdefunline#3}%
   6810  1.1  mrg   }%
   6811  1.1  mrg   \def#2{\dodefunx#1}%
   6812  1.1  mrg   \def#3%
   6813  1.1  mrg }
   6814  1.1  mrg 
   6815  1.1  mrg \newif\ifdoingtypefn       % doing typed function?
   6816  1.1  mrg \newif\ifrettypeownline    % typeset return type on its own line?
   6817  1.1  mrg 
   6818  1.1  mrg % @deftypefnnewline on|off says whether the return type of typed functions
   6819  1.1  mrg % are printed on their own line.  This affects @deftypefn, @deftypefun,
   6820  1.1  mrg % @deftypeop, and @deftypemethod.
   6821  1.1  mrg % 
   6822  1.1  mrg \parseargdef\deftypefnnewline{%
   6823  1.1  mrg   \def\temp{#1}%
   6824  1.1  mrg   \ifx\temp\onword
   6825  1.1  mrg     \expandafter\let\csname SETtxideftypefnnl\endcsname
   6826  1.1  mrg       = \empty
   6827  1.1  mrg   \else\ifx\temp\offword
   6828  1.1  mrg     \expandafter\let\csname SETtxideftypefnnl\endcsname
   6829  1.1  mrg       = \relax
   6830  1.1  mrg   \else
   6831  1.1  mrg     \errhelp = \EMsimple
   6832  1.1  mrg     \errmessage{Unknown @txideftypefnnl value `\temp',
   6833  1.1  mrg                 must be on|off}%
   6834  1.1  mrg   \fi\fi
   6835  1.1  mrg }
   6836  1.1  mrg 
   6837  1.1  mrg % Untyped functions:
   6838  1.1  mrg 
   6839  1.1  mrg % @deffn category name args
   6840  1.1  mrg \makedefun{deffn}{\deffngeneral{}}
   6841  1.1  mrg 
   6842  1.1  mrg % @deffn category class name args
   6843  1.1  mrg \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
   6844  1.1  mrg 
   6845  1.1  mrg % \defopon {category on}class name args
   6846  1.1  mrg \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
   6847  1.1  mrg 
   6848  1.1  mrg % \deffngeneral {subind}category name args
   6849  1.1  mrg %
   6850  1.1  mrg \def\deffngeneral#1#2 #3 #4\endheader{%
   6851  1.1  mrg   % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
   6852  1.1  mrg   \dosubind{fn}{\code{#3}}{#1}%
   6853  1.1  mrg   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
   6854  1.1  mrg }
   6855  1.1  mrg 
   6856  1.1  mrg % Typed functions:
   6857  1.1  mrg 
   6858  1.1  mrg % @deftypefn category type name args
   6859  1.1  mrg \makedefun{deftypefn}{\deftypefngeneral{}}
   6860  1.1  mrg 
   6861  1.1  mrg % @deftypeop category class type name args
   6862  1.1  mrg \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
   6863  1.1  mrg 
   6864  1.1  mrg % \deftypeopon {category on}class type name args
   6865  1.1  mrg \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
   6866  1.1  mrg 
   6867  1.1  mrg % \deftypefngeneral {subind}category type name args
   6868  1.1  mrg %
   6869  1.1  mrg \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
   6870  1.1  mrg   \dosubind{fn}{\code{#4}}{#1}%
   6871  1.1  mrg   \doingtypefntrue
   6872  1.1  mrg   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
   6873  1.1  mrg }
   6874  1.1  mrg 
   6875  1.1  mrg % Typed variables:
   6876  1.1  mrg 
   6877  1.1  mrg % @deftypevr category type var args
   6878  1.1  mrg \makedefun{deftypevr}{\deftypecvgeneral{}}
   6879  1.1  mrg 
   6880  1.1  mrg % @deftypecv category class type var args
   6881  1.1  mrg \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
   6882  1.1  mrg 
   6883  1.1  mrg % \deftypecvof {category of}class type var args
   6884  1.1  mrg \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
   6885  1.1  mrg 
   6886  1.1  mrg % \deftypecvgeneral {subind}category type var args
   6887  1.1  mrg %
   6888  1.1  mrg \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
   6889  1.1  mrg   \dosubind{vr}{\code{#4}}{#1}%
   6890  1.1  mrg   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
   6891  1.1  mrg }
   6892  1.1  mrg 
   6893  1.1  mrg % Untyped variables:
   6894  1.1  mrg 
   6895  1.1  mrg % @defvr category var args
   6896  1.1  mrg \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
   6897  1.1  mrg 
   6898  1.1  mrg % @defcv category class var args
   6899  1.1  mrg \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
   6900  1.1  mrg 
   6901  1.1  mrg % \defcvof {category of}class var args
   6902  1.1  mrg \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
   6903  1.1  mrg 
   6904  1.1  mrg % Types:
   6905  1.1  mrg 
   6906  1.1  mrg % @deftp category name args
   6907  1.1  mrg \makedefun{deftp}#1 #2 #3\endheader{%
   6908  1.1  mrg   \doind{tp}{\code{#2}}%
   6909  1.1  mrg   \defname{#1}{}{#2}\defunargs{#3\unskip}%
   6910  1.1  mrg }
   6911  1.1  mrg 
   6912  1.1  mrg % Remaining @defun-like shortcuts:
   6913  1.1  mrg \makedefun{defun}{\deffnheader{\putwordDeffunc} }
   6914  1.1  mrg \makedefun{defmac}{\deffnheader{\putwordDefmac} }
   6915  1.1  mrg \makedefun{defspec}{\deffnheader{\putwordDefspec} }
   6916  1.1  mrg \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
   6917  1.1  mrg \makedefun{defvar}{\defvrheader{\putwordDefvar} }
   6918  1.1  mrg \makedefun{defopt}{\defvrheader{\putwordDefopt} }
   6919  1.1  mrg \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
   6920  1.1  mrg \makedefun{defmethod}{\defopon\putwordMethodon}
   6921  1.1  mrg \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
   6922  1.1  mrg \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
   6923  1.1  mrg \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
   6924  1.1  mrg 
   6925  1.1  mrg % \defname, which formats the name of the @def (not the args).
   6926  1.1  mrg % #1 is the category, such as "Function".
   6927  1.1  mrg % #2 is the return type, if any.
   6928  1.1  mrg % #3 is the function name.
   6929  1.1  mrg %
   6930  1.1  mrg % We are followed by (but not passed) the arguments, if any.
   6931  1.1  mrg %
   6932  1.1  mrg \def\defname#1#2#3{%
   6933  1.1  mrg   \par
   6934  1.1  mrg   % Get the values of \leftskip and \rightskip as they were outside the @def...
   6935  1.1  mrg   \advance\leftskip by -\defbodyindent
   6936  1.1  mrg   %
   6937  1.1  mrg   % Determine if we are typesetting the return type of a typed function
   6938  1.1  mrg   % on a line by itself.
   6939  1.1  mrg   \rettypeownlinefalse
   6940  1.1  mrg   \ifdoingtypefn  % doing a typed function specifically?
   6941  1.1  mrg     % then check user option for putting return type on its own line:
   6942  1.1  mrg     \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
   6943  1.1  mrg       \rettypeownlinetrue
   6944  1.1  mrg     \fi
   6945  1.1  mrg   \fi
   6946  1.1  mrg   %
   6947  1.1  mrg   % How we'll format the category name.  Putting it in brackets helps
   6948  1.1  mrg   % distinguish it from the body text that may end up on the next line
   6949  1.1  mrg   % just below it.
   6950  1.1  mrg   \def\temp{#1}%
   6951  1.1  mrg   \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
   6952  1.1  mrg   %
   6953  1.1  mrg   % Figure out line sizes for the paragraph shape.  We'll always have at
   6954  1.1  mrg   % least two.
   6955  1.1  mrg   \tempnum = 2
   6956  1.1  mrg   %
   6957  1.1  mrg   % The first line needs space for \box0; but if \rightskip is nonzero,
   6958  1.1  mrg   % we need only space for the part of \box0 which exceeds it:
   6959  1.1  mrg   \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
   6960  1.1  mrg   %
   6961  1.1  mrg   % If doing a return type on its own line, we'll have another line.
   6962  1.1  mrg   \ifrettypeownline
   6963  1.1  mrg     \advance\tempnum by 1
   6964  1.1  mrg     \def\maybeshapeline{0in \hsize}%
   6965  1.1  mrg   \else
   6966  1.1  mrg     \def\maybeshapeline{}%
   6967  1.1  mrg   \fi
   6968  1.1  mrg   %
   6969  1.1  mrg   % The continuations:
   6970  1.1  mrg   \dimen2=\hsize  \advance\dimen2 by -\defargsindent
   6971  1.1  mrg   %
   6972  1.1  mrg   % The final paragraph shape:
   6973  1.1  mrg   \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
   6974  1.1  mrg   %
   6975  1.1  mrg   % Put the category name at the right margin.
   6976  1.1  mrg   \noindent
   6977  1.1  mrg   \hbox to 0pt{%
   6978  1.1  mrg     \hfil\box0 \kern-\hsize
   6979  1.1  mrg     % \hsize has to be shortened this way:
   6980  1.1  mrg     \kern\leftskip
   6981  1.1  mrg     % Intentionally do not respect \rightskip, since we need the space.
   6982  1.1  mrg   }%
   6983  1.1  mrg   %
   6984  1.1  mrg   % Allow all lines to be underfull without complaint:
   6985  1.1  mrg   \tolerance=10000 \hbadness=10000
   6986  1.1  mrg   \exdentamount=\defbodyindent
   6987  1.1  mrg   {%
   6988  1.1  mrg     % defun fonts. We use typewriter by default (used to be bold) because:
   6989  1.1  mrg     % . we're printing identifiers, they should be in tt in principle.
   6990  1.1  mrg     % . in languages with many accents, such as Czech or French, it's
   6991  1.1  mrg     %   common to leave accents off identifiers.  The result looks ok in
   6992  1.1  mrg     %   tt, but exceedingly strange in rm.
   6993  1.1  mrg     % . we don't want -- and --- to be treated as ligatures.
   6994  1.1  mrg     % . this still does not fix the ?` and !` ligatures, but so far no
   6995  1.1  mrg     %   one has made identifiers using them :).
   6996  1.1  mrg     \df \tt
   6997  1.1  mrg     \def\temp{#2}% text of the return type
   6998  1.1  mrg     \ifx\temp\empty\else
   6999  1.1  mrg       \tclose{\temp}% typeset the return type
   7000  1.1  mrg       \ifrettypeownline
   7001  1.1  mrg         % put return type on its own line; prohibit line break following:
   7002  1.1  mrg         \hfil\vadjust{\nobreak}\break  
   7003  1.1  mrg       \else
   7004  1.1  mrg         \space  % type on same line, so just followed by a space
   7005  1.1  mrg       \fi
   7006  1.1  mrg     \fi           % no return type
   7007  1.1  mrg     #3% output function name
   7008  1.1  mrg   }%
   7009  1.1  mrg   {\rm\enskip}% hskip 0.5 em of \tenrm
   7010  1.1  mrg   %
   7011  1.1  mrg   \boldbrax
   7012  1.1  mrg   % arguments will be output next, if any.
   7013  1.1  mrg }
   7014  1.1  mrg 
   7015  1.1  mrg % Print arguments in slanted roman (not ttsl), inconsistently with using
   7016  1.1  mrg % tt for the name.  This is because literal text is sometimes needed in
   7017  1.1  mrg % the argument list (groff manual), and ttsl and tt are not very
   7018  1.1  mrg % distinguishable.  Prevent hyphenation at `-' chars.
   7019  1.1  mrg %
   7020  1.1  mrg \def\defunargs#1{%
   7021  1.1  mrg   % use sl by default (not ttsl),
   7022  1.1  mrg   % tt for the names.
   7023  1.1  mrg   \df \sl \hyphenchar\font=0
   7024  1.1  mrg   %
   7025  1.1  mrg   % On the other hand, if an argument has two dashes (for instance), we
   7026  1.1  mrg   % want a way to get ttsl.  Let's try @var for that.
   7027  1.1  mrg   \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
   7028  1.1  mrg   #1%
   7029  1.1  mrg   \sl\hyphenchar\font=45
   7030  1.1  mrg }
   7031  1.1  mrg 
   7032  1.1  mrg % We want ()&[] to print specially on the defun line.
   7033  1.1  mrg %
   7034  1.1  mrg \def\activeparens{%
   7035  1.1  mrg   \catcode`\(=\active \catcode`\)=\active
   7036  1.1  mrg   \catcode`\[=\active \catcode`\]=\active
   7037  1.1  mrg   \catcode`\&=\active
   7038  1.1  mrg }
   7039  1.1  mrg 
   7040  1.1  mrg % Make control sequences which act like normal parenthesis chars.
   7041  1.1  mrg \let\lparen = ( \let\rparen = )
   7042  1.1  mrg 
   7043  1.1  mrg % Be sure that we always have a definition for `(', etc.  For example,
   7044  1.1  mrg % if the fn name has parens in it, \boldbrax will not be in effect yet,
   7045  1.1  mrg % so TeX would otherwise complain about undefined control sequence.
   7046  1.1  mrg {
   7047  1.1  mrg   \activeparens
   7048  1.1  mrg   \global\let(=\lparen \global\let)=\rparen
   7049  1.1  mrg   \global\let[=\lbrack \global\let]=\rbrack
   7050  1.1  mrg   \global\let& = \&
   7051  1.1  mrg 
   7052  1.1  mrg   \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
   7053  1.1  mrg   \gdef\magicamp{\let&=\amprm}
   7054  1.1  mrg }
   7055  1.1  mrg 
   7056  1.1  mrg \newcount\parencount
   7057  1.1  mrg 
   7058  1.1  mrg % If we encounter &foo, then turn on ()-hacking afterwards
   7059  1.1  mrg \newif\ifampseen
   7060  1.1  mrg \def\amprm#1 {\ampseentrue{\bf\&#1 }}
   7061  1.1  mrg 
   7062  1.1  mrg \def\parenfont{%
   7063  1.1  mrg   \ifampseen
   7064  1.1  mrg     % At the first level, print parens in roman,
   7065  1.1  mrg     % otherwise use the default font.
   7066  1.1  mrg     \ifnum \parencount=1 \rm \fi
   7067  1.1  mrg   \else
   7068  1.1  mrg     % The \sf parens (in \boldbrax) actually are a little bolder than
   7069  1.1  mrg     % the contained text.  This is especially needed for [ and ] .
   7070  1.1  mrg     \sf
   7071  1.1  mrg   \fi
   7072  1.1  mrg }
   7073  1.1  mrg \def\infirstlevel#1{%
   7074  1.1  mrg   \ifampseen
   7075  1.1  mrg     \ifnum\parencount=1
   7076  1.1  mrg       #1%
   7077  1.1  mrg     \fi
   7078  1.1  mrg   \fi
   7079  1.1  mrg }
   7080  1.1  mrg \def\bfafterword#1 {#1 \bf}
   7081  1.1  mrg 
   7082  1.1  mrg \def\opnr{%
   7083  1.1  mrg   \global\advance\parencount by 1
   7084  1.1  mrg   {\parenfont(}%
   7085  1.1  mrg   \infirstlevel \bfafterword
   7086  1.1  mrg }
   7087  1.1  mrg \def\clnr{%
   7088  1.1  mrg   {\parenfont)}%
   7089  1.1  mrg   \infirstlevel \sl
   7090  1.1  mrg   \global\advance\parencount by -1
   7091  1.1  mrg }
   7092  1.1  mrg 
   7093  1.1  mrg \newcount\brackcount
   7094  1.1  mrg \def\lbrb{%
   7095  1.1  mrg   \global\advance\brackcount by 1
   7096  1.1  mrg   {\bf[}%
   7097  1.1  mrg }
   7098  1.1  mrg \def\rbrb{%
   7099  1.1  mrg   {\bf]}%
   7100  1.1  mrg   \global\advance\brackcount by -1
   7101  1.1  mrg }
   7102  1.1  mrg 
   7103  1.1  mrg \def\checkparencounts{%
   7104  1.1  mrg   \ifnum\parencount=0 \else \badparencount \fi
   7105  1.1  mrg   \ifnum\brackcount=0 \else \badbrackcount \fi
   7106  1.1  mrg }
   7107  1.1  mrg % these should not use \errmessage; the glibc manual, at least, actually
   7108  1.1  mrg % has such constructs (when documenting function pointers).
   7109  1.1  mrg \def\badparencount{%
   7110  1.1  mrg   \message{Warning: unbalanced parentheses in @def...}%
   7111  1.1  mrg   \global\parencount=0
   7112  1.1  mrg }
   7113  1.1  mrg \def\badbrackcount{%
   7114  1.1  mrg   \message{Warning: unbalanced square brackets in @def...}%
   7115  1.1  mrg   \global\brackcount=0
   7116  1.1  mrg }
   7117  1.1  mrg 
   7118  1.1  mrg 
   7119  1.1  mrg \message{macros,}
   7120  1.1  mrg % @macro.
   7121  1.1  mrg 
   7122  1.1  mrg % To do this right we need a feature of e-TeX, \scantokens,
   7123  1.1  mrg % which we arrange to emulate with a temporary file in ordinary TeX.
   7124  1.1  mrg \ifx\eTeXversion\thisisundefined
   7125  1.1  mrg   \newwrite\macscribble
   7126  1.1  mrg   \def\scantokens#1{%
   7127  1.1  mrg     \toks0={#1}%
   7128  1.1  mrg     \immediate\openout\macscribble=\jobname.tmp
   7129  1.1  mrg     \immediate\write\macscribble{\the\toks0}%
   7130  1.1  mrg     \immediate\closeout\macscribble
   7131  1.1  mrg     \input \jobname.tmp
   7132  1.1  mrg   }
   7133  1.1  mrg \fi
   7134  1.1  mrg 
   7135  1.1  mrg \def\scanmacro#1{\begingroup
   7136  1.1  mrg   \newlinechar`\^^M
   7137  1.1  mrg   \let\xeatspaces\eatspaces
   7138  1.1  mrg   %
   7139  1.1  mrg   % Undo catcode changes of \startcontents and \doprintindex
   7140  1.1  mrg   % When called from @insertcopying or (short)caption, we need active
   7141  1.1  mrg   % backslash to get it printed correctly.  Previously, we had
   7142  1.1  mrg   % \catcode`\\=\other instead.  We'll see whether a problem appears
   7143  1.1  mrg   % with macro expansion.				--kasal, 19aug04
   7144  1.1  mrg   \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
   7145  1.1  mrg   %
   7146  1.1  mrg   % ... and for \example:
   7147  1.1  mrg   \spaceisspace
   7148  1.1  mrg   %
   7149  1.1  mrg   % The \empty here causes a following catcode 5 newline to be eaten as
   7150  1.1  mrg   % part of reading whitespace after a control sequence.  It does not
   7151  1.1  mrg   % eat a catcode 13 newline.  There's no good way to handle the two
   7152  1.1  mrg   % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
   7153  1.1  mrg   % would then have different behavior).  See the Macro Details node in
   7154  1.1  mrg   % the manual for the workaround we recommend for macros and
   7155  1.1  mrg   % line-oriented commands.
   7156  1.1  mrg   % 
   7157  1.1  mrg   \scantokens{#1\empty}%
   7158  1.1  mrg \endgroup}
   7159  1.1  mrg 
   7160  1.1  mrg \def\scanexp#1{%
   7161  1.1  mrg   \edef\temp{\noexpand\scanmacro{#1}}%
   7162  1.1  mrg   \temp
   7163  1.1  mrg }
   7164  1.1  mrg 
   7165  1.1  mrg \newcount\paramno   % Count of parameters
   7166  1.1  mrg \newtoks\macname    % Macro name
   7167  1.1  mrg \newif\ifrecursive  % Is it recursive?
   7168  1.1  mrg 
   7169  1.1  mrg % List of all defined macros in the form
   7170  1.1  mrg %    \definedummyword\macro1\definedummyword\macro2...
   7171  1.1  mrg % Currently is also contains all @aliases; the list can be split
   7172  1.1  mrg % if there is a need.
   7173  1.1  mrg \def\macrolist{}
   7174  1.1  mrg 
   7175  1.1  mrg % Add the macro to \macrolist
   7176  1.1  mrg \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
   7177  1.1  mrg \def\addtomacrolistxxx#1{%
   7178  1.1  mrg      \toks0 = \expandafter{\macrolist\definedummyword#1}%
   7179  1.1  mrg      \xdef\macrolist{\the\toks0}%
   7180  1.1  mrg }
   7181  1.1  mrg 
   7182  1.1  mrg % Utility routines.
   7183  1.1  mrg % This does \let #1 = #2, with \csnames; that is,
   7184  1.1  mrg %   \let \csname#1\endcsname = \csname#2\endcsname
   7185  1.1  mrg % (except of course we have to play expansion games).
   7186  1.1  mrg %
   7187  1.1  mrg \def\cslet#1#2{%
   7188  1.1  mrg   \expandafter\let
   7189  1.1  mrg   \csname#1\expandafter\endcsname
   7190  1.1  mrg   \csname#2\endcsname
   7191  1.1  mrg }
   7192  1.1  mrg 
   7193  1.1  mrg % Trim leading and trailing spaces off a string.
   7194  1.1  mrg % Concepts from aro-bend problem 15 (see CTAN).
   7195  1.1  mrg {\catcode`\@=11
   7196  1.1  mrg \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
   7197  1.1  mrg \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
   7198  1.1  mrg \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
   7199  1.1  mrg \def\unbrace#1{#1}
   7200  1.1  mrg \unbrace{\gdef\trim@@@ #1 } #2@{#1}
   7201  1.1  mrg }
   7202  1.1  mrg 
   7203  1.1  mrg % Trim a single trailing ^^M off a string.
   7204  1.1  mrg {\catcode`\^^M=\other \catcode`\Q=3%
   7205  1.1  mrg \gdef\eatcr #1{\eatcra #1Q^^MQ}%
   7206  1.1  mrg \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
   7207  1.1  mrg \gdef\eatcrb#1Q#2Q{#1}%
   7208  1.1  mrg }
   7209  1.1  mrg 
   7210  1.1  mrg % Macro bodies are absorbed as an argument in a context where
   7211  1.1  mrg % all characters are catcode 10, 11 or 12, except \ which is active
   7212  1.1  mrg % (as in normal texinfo). It is necessary to change the definition of \
   7213  1.1  mrg % to recognize macro arguments; this is the job of \mbodybackslash.
   7214  1.1  mrg %
   7215  1.1  mrg % Non-ASCII encodings make 8-bit characters active, so un-activate
   7216  1.1  mrg % them to avoid their expansion.  Must do this non-globally, to
   7217  1.1  mrg % confine the change to the current group.
   7218  1.1  mrg %
   7219  1.1  mrg % It's necessary to have hard CRs when the macro is executed. This is
   7220  1.1  mrg % done by making ^^M (\endlinechar) catcode 12 when reading the macro
   7221  1.1  mrg % body, and then making it the \newlinechar in \scanmacro.
   7222  1.1  mrg %
   7223  1.1  mrg \def\scanctxt{% used as subroutine
   7224  1.1  mrg   \catcode`\"=\other
   7225  1.1  mrg   \catcode`\+=\other
   7226  1.1  mrg   \catcode`\<=\other
   7227  1.1  mrg   \catcode`\>=\other
   7228  1.1  mrg   \catcode`\@=\other
   7229  1.1  mrg   \catcode`\^=\other
   7230  1.1  mrg   \catcode`\_=\other
   7231  1.1  mrg   \catcode`\|=\other
   7232  1.1  mrg   \catcode`\~=\other
   7233  1.1  mrg   \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
   7234  1.1  mrg }
   7235  1.1  mrg 
   7236  1.1  mrg \def\scanargctxt{% used for copying and captions, not macros.
   7237  1.1  mrg   \scanctxt
   7238  1.1  mrg   \catcode`\\=\other
   7239  1.1  mrg   \catcode`\^^M=\other
   7240  1.1  mrg }
   7241  1.1  mrg 
   7242  1.1  mrg \def\macrobodyctxt{% used for @macro definitions
   7243  1.1  mrg   \scanctxt
   7244  1.1  mrg   \catcode`\{=\other
   7245  1.1  mrg   \catcode`\}=\other
   7246  1.1  mrg   \catcode`\^^M=\other
   7247  1.1  mrg   \usembodybackslash
   7248  1.1  mrg }
   7249  1.1  mrg 
   7250  1.1  mrg \def\macroargctxt{% used when scanning invocations
   7251  1.1  mrg   \scanctxt
   7252  1.1  mrg   \catcode`\\=0
   7253  1.1  mrg }
   7254  1.1  mrg % why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
   7255  1.1  mrg % for the single characters \ { }.  Thus, we end up with the "commands"
   7256  1.1  mrg % that would be written @\ @{ @} in a Texinfo document.
   7257  1.1  mrg % 
   7258  1.1  mrg % We already have @{ and @}.  For @\, we define it here, and only for
   7259  1.1  mrg % this purpose, to produce a typewriter backslash (so, the @\ that we
   7260  1.1  mrg % define for @math can't be used with @macro calls):
   7261  1.1  mrg %
   7262  1.1  mrg \def\\{\normalbackslash}%
   7263  1.1  mrg % 
   7264  1.1  mrg % We would like to do this for \, too, since that is what makeinfo does.
   7265  1.1  mrg % But it is not possible, because Texinfo already has a command @, for a
   7266  1.1  mrg % cedilla accent.  Documents must use @comma{} instead.
   7267  1.1  mrg %
   7268  1.1  mrg % \anythingelse will almost certainly be an error of some kind.
   7269  1.1  mrg 
   7270  1.1  mrg 
   7271  1.1  mrg % \mbodybackslash is the definition of \ in @macro bodies.
   7272  1.1  mrg % It maps \foo\ => \csname macarg.foo\endcsname => #N
   7273  1.1  mrg % where N is the macro parameter number.
   7274  1.1  mrg % We define \csname macarg.\endcsname to be \realbackslash, so
   7275  1.1  mrg % \\ in macro replacement text gets you a backslash.
   7276  1.1  mrg %
   7277  1.1  mrg {\catcode`@=0 @catcode`@\=@active
   7278  1.1  mrg  @gdef@usembodybackslash{@let\=@mbodybackslash}
   7279  1.1  mrg  @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
   7280  1.1  mrg }
   7281  1.1  mrg \expandafter\def\csname macarg.\endcsname{\realbackslash}
   7282  1.1  mrg 
   7283  1.1  mrg \def\margbackslash#1{\char`\#1 }
   7284  1.1  mrg 
   7285  1.1  mrg \def\macro{\recursivefalse\parsearg\macroxxx}
   7286  1.1  mrg \def\rmacro{\recursivetrue\parsearg\macroxxx}
   7287  1.1  mrg 
   7288  1.1  mrg \def\macroxxx#1{%
   7289  1.1  mrg   \getargs{#1}% now \macname is the macname and \argl the arglist
   7290  1.1  mrg   \ifx\argl\empty       % no arguments
   7291  1.1  mrg      \paramno=0\relax
   7292  1.1  mrg   \else
   7293  1.1  mrg      \expandafter\parsemargdef \argl;%
   7294  1.1  mrg      \if\paramno>256\relax
   7295  1.1  mrg        \ifx\eTeXversion\thisisundefined
   7296  1.1  mrg          \errhelp = \EMsimple
   7297  1.1  mrg          \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
   7298  1.1  mrg        \fi
   7299  1.1  mrg      \fi
   7300  1.1  mrg   \fi
   7301  1.1  mrg   \if1\csname ismacro.\the\macname\endcsname
   7302  1.1  mrg      \message{Warning: redefining \the\macname}%
   7303  1.1  mrg   \else
   7304  1.1  mrg      \expandafter\ifx\csname \the\macname\endcsname \relax
   7305  1.1  mrg      \else \errmessage{Macro name \the\macname\space already defined}\fi
   7306  1.1  mrg      \global\cslet{macsave.\the\macname}{\the\macname}%
   7307  1.1  mrg      \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
   7308  1.1  mrg      \addtomacrolist{\the\macname}%
   7309  1.1  mrg   \fi
   7310  1.1  mrg   \begingroup \macrobodyctxt
   7311  1.1  mrg   \ifrecursive \expandafter\parsermacbody
   7312  1.1  mrg   \else \expandafter\parsemacbody
   7313  1.1  mrg   \fi}
   7314  1.1  mrg 
   7315  1.1  mrg \parseargdef\unmacro{%
   7316  1.1  mrg   \if1\csname ismacro.#1\endcsname
   7317  1.1  mrg     \global\cslet{#1}{macsave.#1}%
   7318  1.1  mrg     \global\expandafter\let \csname ismacro.#1\endcsname=0%
   7319  1.1  mrg     % Remove the macro name from \macrolist:
   7320  1.1  mrg     \begingroup
   7321  1.1  mrg       \expandafter\let\csname#1\endcsname \relax
   7322  1.1  mrg       \let\definedummyword\unmacrodo
   7323  1.1  mrg       \xdef\macrolist{\macrolist}%
   7324  1.1  mrg     \endgroup
   7325  1.1  mrg   \else
   7326  1.1  mrg     \errmessage{Macro #1 not defined}%
   7327  1.1  mrg   \fi
   7328  1.1  mrg }
   7329  1.1  mrg 
   7330  1.1  mrg % Called by \do from \dounmacro on each macro.  The idea is to omit any
   7331  1.1  mrg % macro definitions that have been changed to \relax.
   7332  1.1  mrg %
   7333  1.1  mrg \def\unmacrodo#1{%
   7334  1.1  mrg   \ifx #1\relax
   7335  1.1  mrg     % remove this
   7336  1.1  mrg   \else
   7337  1.1  mrg     \noexpand\definedummyword \noexpand#1%
   7338  1.1  mrg   \fi
   7339  1.1  mrg }
   7340  1.1  mrg 
   7341  1.1  mrg % This makes use of the obscure feature that if the last token of a
   7342  1.1  mrg % <parameter list> is #, then the preceding argument is delimited by
   7343  1.1  mrg % an opening brace, and that opening brace is not consumed.
   7344  1.1  mrg \def\getargs#1{\getargsxxx#1{}}
   7345  1.1  mrg \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
   7346  1.1  mrg \def\getmacname#1 #2\relax{\macname={#1}}
   7347  1.1  mrg \def\getmacargs#1{\def\argl{#1}}
   7348  1.1  mrg 
   7349  1.1  mrg % For macro processing make @ a letter so that we can make Texinfo private macro names.
   7350  1.1  mrg \edef\texiatcatcode{\the\catcode`\@}
   7351  1.1  mrg \catcode `@=11\relax
   7352  1.1  mrg 
   7353  1.1  mrg % Parse the optional {params} list.  Set up \paramno and \paramlist
   7354  1.1  mrg % so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
   7355  1.1  mrg % in the params list to some hook where the argument si to be expanded.  If
   7356  1.1  mrg % there are less than 10 arguments that hook is to be replaced by ##N where N
   7357  1.1  mrg % is the position in that list, that is to say the macro arguments are to be
   7358  1.1  mrg % defined `a la TeX in the macro body.  
   7359  1.1  mrg %
   7360  1.1  mrg % That gets used by \mbodybackslash (above).
   7361  1.1  mrg %
   7362  1.1  mrg % We need to get `macro parameter char #' into several definitions.
   7363  1.1  mrg % The technique used is stolen from LaTeX: let \hash be something
   7364  1.1  mrg % unexpandable, insert that wherever you need a #, and then redefine
   7365  1.1  mrg % it to # just before using the token list produced.
   7366  1.1  mrg %
   7367  1.1  mrg % The same technique is used to protect \eatspaces till just before
   7368  1.1  mrg % the macro is used.
   7369  1.1  mrg %
   7370  1.1  mrg % If there are 10 or more arguments, a different technique is used, where the
   7371  1.1  mrg % hook remains in the body, and when macro is to be expanded the body is
   7372  1.1  mrg % processed again to replace the arguments.
   7373  1.1  mrg %
   7374  1.1  mrg % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
   7375  1.1  mrg % argument N value and then \edef  the body (nothing else will expand because of
   7376  1.1  mrg % the catcode regime underwhich the body was input).
   7377  1.1  mrg %
   7378  1.1  mrg % If you compile with TeX (not eTeX), and you have macros with 10 or more
   7379  1.1  mrg % arguments, you need that no macro has more than 256 arguments, otherwise an
   7380  1.1  mrg % error is produced.
   7381  1.1  mrg \def\parsemargdef#1;{%
   7382  1.1  mrg   \paramno=0\def\paramlist{}%
   7383  1.1  mrg   \let\hash\relax
   7384  1.1  mrg   \let\xeatspaces\relax
   7385  1.1  mrg   \parsemargdefxxx#1,;,%
   7386  1.1  mrg   % In case that there are 10 or more arguments we parse again the arguments
   7387  1.1  mrg   % list to set new definitions for the \macarg.BLAH macros corresponding to
   7388  1.1  mrg   % each BLAH argument. It was anyhow needed to parse already once this list
   7389  1.1  mrg   % in order to count the arguments, and as macros with at most 9 arguments
   7390  1.1  mrg   % are by far more frequent than macro with 10 or more arguments, defining
   7391  1.1  mrg   % twice the \macarg.BLAH macros does not cost too much processing power.
   7392  1.1  mrg   \ifnum\paramno<10\relax\else
   7393  1.1  mrg     \paramno0\relax
   7394  1.1  mrg     \parsemmanyargdef@@#1,;,% 10 or more arguments
   7395  1.1  mrg   \fi
   7396  1.1  mrg }
   7397  1.1  mrg \def\parsemargdefxxx#1,{%
   7398  1.1  mrg   \if#1;\let\next=\relax
   7399  1.1  mrg   \else \let\next=\parsemargdefxxx
   7400  1.1  mrg     \advance\paramno by 1
   7401  1.1  mrg     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
   7402  1.1  mrg         {\xeatspaces{\hash\the\paramno}}%
   7403  1.1  mrg     \edef\paramlist{\paramlist\hash\the\paramno,}%
   7404  1.1  mrg   \fi\next}
   7405  1.1  mrg 
   7406  1.1  mrg \def\parsemmanyargdef@@#1,{%
   7407  1.1  mrg   \if#1;\let\next=\relax
   7408  1.1  mrg   \else 
   7409  1.1  mrg     \let\next=\parsemmanyargdef@@
   7410  1.1  mrg     \edef\tempb{\eatspaces{#1}}%
   7411  1.1  mrg     \expandafter\def\expandafter\tempa
   7412  1.1  mrg        \expandafter{\csname macarg.\tempb\endcsname}%
   7413  1.1  mrg     % Note that we need some extra \noexpand\noexpand, this is because we
   7414  1.1  mrg     % don't want \the  to be expanded in the \parsermacbody  as it uses an
   7415  1.1  mrg     % \xdef .
   7416  1.1  mrg     \expandafter\edef\tempa
   7417  1.1  mrg       {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
   7418  1.1  mrg     \advance\paramno by 1\relax
   7419  1.1  mrg   \fi\next}
   7420  1.1  mrg 
   7421  1.1  mrg % These two commands read recursive and nonrecursive macro bodies.
   7422  1.1  mrg % (They're different since rec and nonrec macros end differently.)
   7423  1.1  mrg %
   7424  1.1  mrg 
   7425  1.1  mrg \catcode `\@\texiatcatcode
   7426  1.1  mrg \long\def\parsemacbody#1@end macro%
   7427  1.1  mrg {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
   7428  1.1  mrg \long\def\parsermacbody#1@end rmacro%
   7429  1.1  mrg {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
   7430  1.1  mrg \catcode `\@=11\relax
   7431  1.1  mrg 
   7432  1.1  mrg \let\endargs@\relax
   7433  1.1  mrg \let\nil@\relax
   7434  1.1  mrg \def\nilm@{\nil@}%
   7435  1.1  mrg \long\def\nillm@{\nil@}%
   7436  1.1  mrg 
   7437  1.1  mrg % This macro is expanded during the Texinfo macro expansion, not during its
   7438  1.1  mrg % definition.  It gets all the arguments values and assigns them to macros
   7439  1.1  mrg % macarg.ARGNAME
   7440  1.1  mrg %
   7441  1.1  mrg % #1 is the macro name
   7442  1.1  mrg % #2 is the list of argument names
   7443  1.1  mrg % #3 is the list of argument values
   7444  1.1  mrg \def\getargvals@#1#2#3{%
   7445  1.1  mrg   \def\macargdeflist@{}%
   7446  1.1  mrg   \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
   7447  1.1  mrg   \def\paramlist{#2,\nil@}%
   7448  1.1  mrg   \def\macroname{#1}%
   7449  1.1  mrg   \begingroup
   7450  1.1  mrg   \macroargctxt
   7451  1.1  mrg   \def\argvaluelist{#3,\nil@}%
   7452  1.1  mrg   \def\@tempa{#3}%
   7453  1.1  mrg   \ifx\@tempa\empty
   7454  1.1  mrg     \setemptyargvalues@
   7455  1.1  mrg   \else
   7456  1.1  mrg     \getargvals@@
   7457  1.1  mrg   \fi
   7458  1.1  mrg }
   7459  1.1  mrg 
   7460  1.1  mrg % 
   7461  1.1  mrg \def\getargvals@@{%
   7462  1.1  mrg   \ifx\paramlist\nilm@
   7463  1.1  mrg       % Some sanity check needed here that \argvaluelist is also empty.
   7464  1.1  mrg       \ifx\argvaluelist\nillm@
   7465  1.1  mrg       \else
   7466  1.1  mrg         \errhelp = \EMsimple
   7467  1.1  mrg         \errmessage{Too many arguments in macro `\macroname'!}%
   7468  1.1  mrg       \fi
   7469  1.1  mrg       \let\next\macargexpandinbody@
   7470  1.1  mrg   \else
   7471  1.1  mrg     \ifx\argvaluelist\nillm@
   7472  1.1  mrg        % No more arguments values passed to macro.  Set remaining named-arg
   7473  1.1  mrg        % macros to empty.
   7474  1.1  mrg        \let\next\setemptyargvalues@
   7475  1.1  mrg     \else
   7476  1.1  mrg       % pop current arg name into \@tempb
   7477  1.1  mrg       \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
   7478  1.1  mrg       \expandafter\@tempa\expandafter{\paramlist}%
   7479  1.1  mrg        % pop current argument value into \@tempc
   7480  1.1  mrg       \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
   7481  1.1  mrg       \expandafter\@tempa\expandafter{\argvaluelist}%
   7482  1.1  mrg        % Here \@tempb is the current arg name and \@tempc is the current arg value.
   7483  1.1  mrg        % First place the new argument macro definition into \@tempd
   7484  1.1  mrg        \expandafter\macname\expandafter{\@tempc}%
   7485  1.1  mrg        \expandafter\let\csname macarg.\@tempb\endcsname\relax
   7486  1.1  mrg        \expandafter\def\expandafter\@tempe\expandafter{%
   7487  1.1  mrg          \csname macarg.\@tempb\endcsname}%
   7488  1.1  mrg        \edef\@tempd{\long\def\@tempe{\the\macname}}%
   7489  1.1  mrg        \push@\@tempd\macargdeflist@
   7490  1.1  mrg        \let\next\getargvals@@
   7491  1.1  mrg     \fi
   7492  1.1  mrg   \fi
   7493  1.1  mrg   \next
   7494  1.1  mrg }
   7495  1.1  mrg 
   7496  1.1  mrg \def\push@#1#2{%
   7497  1.1  mrg   \expandafter\expandafter\expandafter\def
   7498  1.1  mrg   \expandafter\expandafter\expandafter#2%
   7499  1.1  mrg   \expandafter\expandafter\expandafter{%
   7500  1.1  mrg   \expandafter#1#2}%
   7501  1.1  mrg }
   7502  1.1  mrg 
   7503  1.1  mrg % Replace arguments by their values in the macro body, and place the result
   7504  1.1  mrg % in macro \@tempa
   7505  1.1  mrg \def\macvalstoargs@{%
   7506  1.1  mrg   %  To do this we use the property that token registers that are \the'ed
   7507  1.1  mrg   % within an \edef  expand only once. So we are going to place all argument
   7508  1.1  mrg   % values into respective token registers.
   7509  1.1  mrg   %
   7510  1.1  mrg   % First we save the token context, and initialize argument numbering.
   7511  1.1  mrg   \begingroup
   7512  1.1  mrg     \paramno0\relax
   7513  1.1  mrg     % Then, for each argument number #N, we place the corresponding argument
   7514  1.1  mrg     % value into a new token list register \toks#N
   7515  1.1  mrg     \expandafter\putargsintokens@\saveparamlist@,;,%
   7516  1.1  mrg     % Then, we expand the body so that argument are replaced by their
   7517  1.1  mrg     % values. The trick for values not to be expanded themselves is that they
   7518  1.1  mrg     % are within tokens and that tokens expand only once in an \edef .
   7519  1.1  mrg     \edef\@tempc{\csname mac.\macroname .body\endcsname}%
   7520  1.1  mrg     % Now we restore the token stack pointer to free the token list registers
   7521  1.1  mrg     % which we have used, but we make sure that expanded body is saved after
   7522  1.1  mrg     % group.
   7523  1.1  mrg     \expandafter
   7524  1.1  mrg   \endgroup
   7525  1.1  mrg   \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
   7526  1.1  mrg   }
   7527  1.1  mrg 
   7528  1.1  mrg \def\macargexpandinbody@{% 
   7529  1.1  mrg   %% Define the named-macro outside of this group and then close this group. 
   7530  1.1  mrg   \expandafter
   7531  1.1  mrg   \endgroup
   7532  1.1  mrg   \macargdeflist@
   7533  1.1  mrg   % First the replace in body the macro arguments by their values, the result
   7534  1.1  mrg   % is in \@tempa .
   7535  1.1  mrg   \macvalstoargs@
   7536  1.1  mrg   % Then we point at the \norecurse or \gobble (for recursive) macro value
   7537  1.1  mrg   % with \@tempb .
   7538  1.1  mrg   \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
   7539  1.1  mrg   % Depending on whether it is recursive or not, we need some tailing
   7540  1.1  mrg   % \egroup .
   7541  1.1  mrg   \ifx\@tempb\gobble
   7542  1.1  mrg      \let\@tempc\relax
   7543  1.1  mrg   \else
   7544  1.1  mrg      \let\@tempc\egroup
   7545  1.1  mrg   \fi
   7546  1.1  mrg   % And now we do the real job:
   7547  1.1  mrg   \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
   7548  1.1  mrg   \@tempd
   7549  1.1  mrg }
   7550  1.1  mrg 
   7551  1.1  mrg \def\putargsintokens@#1,{%
   7552  1.1  mrg   \if#1;\let\next\relax
   7553  1.1  mrg   \else
   7554  1.1  mrg     \let\next\putargsintokens@
   7555  1.1  mrg     % First we allocate the new token list register, and give it a temporary
   7556  1.1  mrg     % alias \@tempb .
   7557  1.1  mrg     \toksdef\@tempb\the\paramno
   7558  1.1  mrg     % Then we place the argument value into that token list register.
   7559  1.1  mrg     \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
   7560  1.1  mrg     \expandafter\@tempb\expandafter{\@tempa}%
   7561  1.1  mrg     \advance\paramno by 1\relax
   7562  1.1  mrg   \fi
   7563  1.1  mrg   \next
   7564  1.1  mrg }
   7565  1.1  mrg 
   7566  1.1  mrg % Save the token stack pointer into macro #1
   7567  1.1  mrg \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
   7568  1.1  mrg % Restore the token stack pointer from number in macro #1
   7569  1.1  mrg \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
   7570  1.1  mrg % newtoks that can be used non \outer .
   7571  1.1  mrg \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
   7572  1.1  mrg 
   7573  1.1  mrg % Tailing missing arguments are set to empty
   7574  1.1  mrg \def\setemptyargvalues@{%
   7575  1.1  mrg   \ifx\paramlist\nilm@
   7576  1.1  mrg     \let\next\macargexpandinbody@
   7577  1.1  mrg   \else
   7578  1.1  mrg     \expandafter\setemptyargvaluesparser@\paramlist\endargs@
   7579  1.1  mrg     \let\next\setemptyargvalues@
   7580  1.1  mrg   \fi
   7581  1.1  mrg   \next
   7582  1.1  mrg }
   7583  1.1  mrg 
   7584  1.1  mrg \def\setemptyargvaluesparser@#1,#2\endargs@{%
   7585  1.1  mrg   \expandafter\def\expandafter\@tempa\expandafter{%
   7586  1.1  mrg     \expandafter\def\csname macarg.#1\endcsname{}}%
   7587  1.1  mrg   \push@\@tempa\macargdeflist@
   7588  1.1  mrg   \def\paramlist{#2}%
   7589  1.1  mrg }
   7590  1.1  mrg 
   7591  1.1  mrg % #1 is the element target macro
   7592  1.1  mrg % #2 is the list macro
   7593  1.1  mrg % #3,#4\endargs@ is the list value
   7594  1.1  mrg \def\pop@#1#2#3,#4\endargs@{%
   7595  1.1  mrg    \def#1{#3}%
   7596  1.1  mrg    \def#2{#4}%
   7597  1.1  mrg }
   7598  1.1  mrg \long\def\longpop@#1#2#3,#4\endargs@{%
   7599  1.1  mrg    \long\def#1{#3}%
   7600  1.1  mrg    \long\def#2{#4}%
   7601  1.1  mrg }
   7602  1.1  mrg 
   7603  1.1  mrg % This defines a Texinfo @macro. There are eight cases: recursive and
   7604  1.1  mrg % nonrecursive macros of zero, one, up to nine, and many arguments.
   7605  1.1  mrg % Much magic with \expandafter here.
   7606  1.1  mrg % \xdef is used so that macro definitions will survive the file
   7607  1.1  mrg % they're defined in; @include reads the file inside a group.
   7608  1.1  mrg %
   7609  1.1  mrg \def\defmacro{%
   7610  1.1  mrg   \let\hash=##% convert placeholders to macro parameter chars
   7611  1.1  mrg   \ifrecursive
   7612  1.1  mrg     \ifcase\paramno
   7613  1.1  mrg     % 0
   7614  1.1  mrg       \expandafter\xdef\csname\the\macname\endcsname{%
   7615  1.1  mrg         \noexpand\scanmacro{\temp}}%
   7616  1.1  mrg     \or % 1
   7617  1.1  mrg       \expandafter\xdef\csname\the\macname\endcsname{%
   7618  1.1  mrg          \bgroup\noexpand\macroargctxt
   7619  1.1  mrg          \noexpand\braceorline
   7620  1.1  mrg          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
   7621  1.1  mrg       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
   7622  1.1  mrg          \egroup\noexpand\scanmacro{\temp}}%
   7623  1.1  mrg     \else
   7624  1.1  mrg       \ifnum\paramno<10\relax % at most 9
   7625  1.1  mrg         \expandafter\xdef\csname\the\macname\endcsname{%
   7626  1.1  mrg            \bgroup\noexpand\macroargctxt
   7627  1.1  mrg            \noexpand\csname\the\macname xx\endcsname}%
   7628  1.1  mrg         \expandafter\xdef\csname\the\macname xx\endcsname##1{%
   7629  1.1  mrg             \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
   7630  1.1  mrg         \expandafter\expandafter
   7631  1.1  mrg         \expandafter\xdef
   7632  1.1  mrg         \expandafter\expandafter
   7633  1.1  mrg           \csname\the\macname xxx\endcsname
   7634  1.1  mrg             \paramlist{\egroup\noexpand\scanmacro{\temp}}%
   7635  1.1  mrg       \else % 10 or more
   7636  1.1  mrg         \expandafter\xdef\csname\the\macname\endcsname{%
   7637  1.1  mrg           \noexpand\getargvals@{\the\macname}{\argl}%
   7638  1.1  mrg         }%    
   7639  1.1  mrg         \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
   7640  1.1  mrg         \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
   7641  1.1  mrg       \fi
   7642  1.1  mrg     \fi
   7643  1.1  mrg   \else
   7644  1.1  mrg     \ifcase\paramno
   7645  1.1  mrg     % 0
   7646  1.1  mrg       \expandafter\xdef\csname\the\macname\endcsname{%
   7647  1.1  mrg         \noexpand\norecurse{\the\macname}%
   7648  1.1  mrg         \noexpand\scanmacro{\temp}\egroup}%
   7649  1.1  mrg     \or % 1
   7650  1.1  mrg       \expandafter\xdef\csname\the\macname\endcsname{%
   7651  1.1  mrg          \bgroup\noexpand\macroargctxt
   7652  1.1  mrg          \noexpand\braceorline
   7653  1.1  mrg          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
   7654  1.1  mrg       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
   7655  1.1  mrg         \egroup
   7656  1.1  mrg         \noexpand\norecurse{\the\macname}%
   7657  1.1  mrg         \noexpand\scanmacro{\temp}\egroup}%
   7658  1.1  mrg     \else % at most 9
   7659  1.1  mrg       \ifnum\paramno<10\relax
   7660  1.1  mrg         \expandafter\xdef\csname\the\macname\endcsname{%
   7661  1.1  mrg            \bgroup\noexpand\macroargctxt
   7662  1.1  mrg            \expandafter\noexpand\csname\the\macname xx\endcsname}%
   7663  1.1  mrg         \expandafter\xdef\csname\the\macname xx\endcsname##1{%
   7664  1.1  mrg             \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
   7665  1.1  mrg         \expandafter\expandafter
   7666  1.1  mrg         \expandafter\xdef
   7667  1.1  mrg         \expandafter\expandafter
   7668  1.1  mrg         \csname\the\macname xxx\endcsname
   7669  1.1  mrg         \paramlist{%
   7670  1.1  mrg             \egroup
   7671  1.1  mrg             \noexpand\norecurse{\the\macname}%
   7672  1.1  mrg             \noexpand\scanmacro{\temp}\egroup}%
   7673  1.1  mrg       \else % 10 or more:
   7674  1.1  mrg         \expandafter\xdef\csname\the\macname\endcsname{%
   7675  1.1  mrg           \noexpand\getargvals@{\the\macname}{\argl}%
   7676  1.1  mrg         }%
   7677  1.1  mrg         \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
   7678  1.1  mrg         \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
   7679  1.1  mrg       \fi
   7680  1.1  mrg     \fi
   7681  1.1  mrg   \fi}
   7682  1.1  mrg 
   7683  1.1  mrg \catcode `\@\texiatcatcode\relax
   7684  1.1  mrg 
   7685  1.1  mrg \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
   7686  1.1  mrg 
   7687  1.1  mrg % \braceorline decides whether the next nonwhitespace character is a
   7688  1.1  mrg % {.  If so it reads up to the closing }, if not, it reads the whole
   7689  1.1  mrg % line.  Whatever was read is then fed to the next control sequence
   7690  1.1  mrg % as an argument (by \parsebrace or \parsearg).
   7691  1.1  mrg % 
   7692  1.1  mrg \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
   7693  1.1  mrg \def\braceorlinexxx{%
   7694  1.1  mrg   \ifx\nchar\bgroup\else
   7695  1.1  mrg     \expandafter\parsearg
   7696  1.1  mrg   \fi \macnamexxx}
   7697  1.1  mrg 
   7698  1.1  mrg 
   7699  1.1  mrg % @alias.
   7700  1.1  mrg % We need some trickery to remove the optional spaces around the equal
   7701  1.1  mrg % sign.  Make them active and then expand them all to nothing.
   7702  1.1  mrg %
   7703  1.1  mrg \def\alias{\parseargusing\obeyspaces\aliasxxx}
   7704  1.1  mrg \def\aliasxxx #1{\aliasyyy#1\relax}
   7705  1.1  mrg \def\aliasyyy #1=#2\relax{%
   7706  1.1  mrg   {%
   7707  1.1  mrg     \expandafter\let\obeyedspace=\empty
   7708  1.1  mrg     \addtomacrolist{#1}%
   7709  1.1  mrg     \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
   7710  1.1  mrg   }%
   7711  1.1  mrg   \next
   7712  1.1  mrg }
   7713  1.1  mrg 
   7714  1.1  mrg 
   7715  1.1  mrg \message{cross references,}
   7716  1.1  mrg 
   7717  1.1  mrg \newwrite\auxfile
   7718  1.1  mrg \newif\ifhavexrefs    % True if xref values are known.
   7719  1.1  mrg \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
   7720  1.1  mrg 
   7721  1.1  mrg % @inforef is relatively simple.
   7722  1.1  mrg \def\inforef #1{\inforefzzz #1,,,,**}
   7723  1.1  mrg \def\inforefzzz #1,#2,#3,#4**{%
   7724  1.1  mrg   \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
   7725  1.1  mrg   node \samp{\ignorespaces#1{}}}
   7726  1.1  mrg 
   7727  1.1  mrg % @node's only job in TeX is to define \lastnode, which is used in
   7728  1.1  mrg % cross-references.  The @node line might or might not have commas, and
   7729  1.1  mrg % might or might not have spaces before the first comma, like:
   7730  1.1  mrg % @node foo , bar , ...
   7731  1.1  mrg % We don't want such trailing spaces in the node name.
   7732  1.1  mrg %
   7733  1.1  mrg \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
   7734  1.1  mrg %
   7735  1.1  mrg % also remove a trailing comma, in case of something like this:
   7736  1.1  mrg % @node Help-Cross,  ,  , Cross-refs
   7737  1.1  mrg \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
   7738  1.1  mrg \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
   7739  1.1  mrg 
   7740  1.1  mrg \let\nwnode=\node
   7741  1.1  mrg \let\lastnode=\empty
   7742  1.1  mrg 
   7743  1.1  mrg % Write a cross-reference definition for the current node.  #1 is the
   7744  1.1  mrg % type (Ynumbered, Yappendix, Ynothing).
   7745  1.1  mrg %
   7746  1.1  mrg \def\donoderef#1{%
   7747  1.1  mrg   \ifx\lastnode\empty\else
   7748  1.1  mrg     \setref{\lastnode}{#1}%
   7749  1.1  mrg     \global\let\lastnode=\empty
   7750  1.1  mrg   \fi
   7751  1.1  mrg }
   7752  1.1  mrg 
   7753  1.1  mrg % @anchor{NAME} -- define xref target at arbitrary point.
   7754  1.1  mrg %
   7755  1.1  mrg \newcount\savesfregister
   7756  1.1  mrg %
   7757  1.1  mrg \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
   7758  1.1  mrg \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
   7759  1.1  mrg \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
   7760  1.1  mrg 
   7761  1.1  mrg % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
   7762  1.1  mrg % anchor), which consists of three parts:
   7763  1.1  mrg % 1) NAME-title - the current sectioning name taken from \lastsection,
   7764  1.1  mrg %                 or the anchor name.
   7765  1.1  mrg % 2) NAME-snt   - section number and type, passed as the SNT arg, or
   7766  1.1  mrg %                 empty for anchors.
   7767  1.1  mrg % 3) NAME-pg    - the page number.
   7768  1.1  mrg %
   7769  1.1  mrg % This is called from \donoderef, \anchor, and \dofloat.  In the case of
   7770  1.1  mrg % floats, there is an additional part, which is not written here:
   7771  1.1  mrg % 4) NAME-lof   - the text as it should appear in a @listoffloats.
   7772  1.1  mrg %
   7773  1.1  mrg \def\setref#1#2{%
   7774  1.1  mrg   \pdfmkdest{#1}%
   7775  1.1  mrg   \iflinks
   7776  1.1  mrg     {%
   7777  1.1  mrg       \atdummies  % preserve commands, but don't expand them
   7778  1.1  mrg       \edef\writexrdef##1##2{%
   7779  1.1  mrg 	\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
   7780  1.1  mrg 	  ##1}{##2}}% these are parameters of \writexrdef
   7781  1.1  mrg       }%
   7782  1.1  mrg       \toks0 = \expandafter{\lastsection}%
   7783  1.1  mrg       \immediate \writexrdef{title}{\the\toks0 }%
   7784  1.1  mrg       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
   7785  1.1  mrg       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
   7786  1.1  mrg     }%
   7787  1.1  mrg   \fi
   7788  1.1  mrg }
   7789  1.1  mrg 
   7790  1.1  mrg % @xrefautosectiontitle on|off says whether @section(ing) names are used
   7791  1.1  mrg % automatically in xrefs, if the third arg is not explicitly specified.
   7792  1.1  mrg % This was provided as a "secret" @set xref-automatic-section-title
   7793  1.1  mrg % variable, now it's official.
   7794  1.1  mrg % 
   7795  1.1  mrg \parseargdef\xrefautomaticsectiontitle{%
   7796  1.1  mrg   \def\temp{#1}%
   7797  1.1  mrg   \ifx\temp\onword
   7798  1.1  mrg     \expandafter\let\csname SETxref-automatic-section-title\endcsname
   7799  1.1  mrg       = \empty
   7800  1.1  mrg   \else\ifx\temp\offword
   7801  1.1  mrg     \expandafter\let\csname SETxref-automatic-section-title\endcsname
   7802  1.1  mrg       = \relax
   7803  1.1  mrg   \else
   7804  1.1  mrg     \errhelp = \EMsimple
   7805  1.1  mrg     \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
   7806  1.1  mrg                 must be on|off}%
   7807  1.1  mrg   \fi\fi
   7808  1.1  mrg }
   7809  1.1  mrg 
   7810  1.1  mrg 
   7811  1.1  mrg % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
   7812  1.1  mrg % the node name, #2 the name of the Info cross-reference, #3 the printed
   7813  1.1  mrg % node name, #4 the name of the Info file, #5 the name of the printed
   7814  1.1  mrg % manual.  All but the node name can be omitted.
   7815  1.1  mrg %
   7816  1.1  mrg \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
   7817  1.1  mrg \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
   7818  1.1  mrg \def\ref#1{\xrefX[#1,,,,,,,]}
   7819  1.1  mrg %
   7820  1.1  mrg \newbox\topbox
   7821  1.1  mrg \newbox\printedrefnamebox
   7822  1.1  mrg \newbox\printedmanualbox
   7823  1.1  mrg %
   7824  1.1  mrg \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
   7825  1.1  mrg   \unsepspaces
   7826  1.1  mrg   %
   7827  1.1  mrg   \def\printedrefname{\ignorespaces #3}%
   7828  1.1  mrg   \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
   7829  1.1  mrg   %
   7830  1.1  mrg   \def\printedmanual{\ignorespaces #5}%
   7831  1.1  mrg   \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
   7832  1.1  mrg   %
   7833  1.1  mrg   % If the printed reference name (arg #3) was not explicitly given in
   7834  1.1  mrg   % the @xref, figure out what we want to use.
   7835  1.1  mrg   \ifdim \wd\printedrefnamebox = 0pt
   7836  1.1  mrg     % No printed node name was explicitly given.
   7837  1.1  mrg     \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
   7838  1.1  mrg       % Not auto section-title: use node name inside the square brackets.
   7839  1.1  mrg       \def\printedrefname{\ignorespaces #1}%
   7840  1.1  mrg     \else
   7841  1.1  mrg       % Auto section-title: use chapter/section title inside
   7842  1.1  mrg       % the square brackets if we have it.
   7843  1.1  mrg       \ifdim \wd\printedmanualbox > 0pt
   7844  1.1  mrg         % It is in another manual, so we don't have it; use node name.
   7845  1.1  mrg         \def\printedrefname{\ignorespaces #1}%
   7846  1.1  mrg       \else
   7847  1.1  mrg         \ifhavexrefs
   7848  1.1  mrg           % We (should) know the real title if we have the xref values.
   7849  1.1  mrg           \def\printedrefname{\refx{#1-title}{}}%
   7850  1.1  mrg         \else
   7851  1.1  mrg           % Otherwise just copy the Info node name.
   7852  1.1  mrg           \def\printedrefname{\ignorespaces #1}%
   7853  1.1  mrg         \fi%
   7854  1.1  mrg       \fi
   7855  1.1  mrg     \fi
   7856  1.1  mrg   \fi
   7857  1.1  mrg   %
   7858  1.1  mrg   % Make link in pdf output.
   7859  1.1  mrg   \ifpdf
   7860  1.1  mrg     {\indexnofonts
   7861  1.1  mrg      \turnoffactive
   7862  1.1  mrg      \makevalueexpandable
   7863  1.1  mrg      % This expands tokens, so do it after making catcode changes, so _
   7864  1.1  mrg      % etc. don't get their TeX definitions.
   7865  1.1  mrg      \getfilename{#4}%
   7866  1.1  mrg      %
   7867  1.1  mrg      \edef\pdfxrefdest{#1}%
   7868  1.1  mrg      \txiescapepdf\pdfxrefdest
   7869  1.1  mrg      %
   7870  1.1  mrg      \leavevmode
   7871  1.1  mrg      \startlink attr{/Border [0 0 0]}%
   7872  1.1  mrg      \ifnum\filenamelength>0
   7873  1.1  mrg        goto file{\the\filename.pdf} name{\pdfxrefdest}%
   7874  1.1  mrg      \else
   7875  1.1  mrg        goto name{\pdfmkpgn{\pdfxrefdest}}%
   7876  1.1  mrg      \fi
   7877  1.1  mrg     }%
   7878  1.1  mrg     \setcolor{\linkcolor}%
   7879  1.1  mrg   \fi
   7880  1.1  mrg   %
   7881  1.1  mrg   % Float references are printed completely differently: "Figure 1.2"
   7882  1.1  mrg   % instead of "[somenode], p.3".  We distinguish them by the
   7883  1.1  mrg   % LABEL-title being set to a magic string.
   7884  1.1  mrg   {%
   7885  1.1  mrg     % Have to otherify everything special to allow the \csname to
   7886  1.1  mrg     % include an _ in the xref name, etc.
   7887  1.1  mrg     \indexnofonts
   7888  1.1  mrg     \turnoffactive
   7889  1.1  mrg     \expandafter\global\expandafter\let\expandafter\Xthisreftitle
   7890  1.1  mrg       \csname XR#1-title\endcsname
   7891  1.1  mrg   }%
   7892  1.1  mrg   \iffloat\Xthisreftitle
   7893  1.1  mrg     % If the user specified the print name (third arg) to the ref,
   7894  1.1  mrg     % print it instead of our usual "Figure 1.2".
   7895  1.1  mrg     \ifdim\wd\printedrefnamebox = 0pt
   7896  1.1  mrg       \refx{#1-snt}{}%
   7897  1.1  mrg     \else
   7898  1.1  mrg       \printedrefname
   7899  1.1  mrg     \fi
   7900  1.1  mrg     %
   7901  1.1  mrg     % if the user also gave the printed manual name (fifth arg), append
   7902  1.1  mrg     % "in MANUALNAME".
   7903  1.1  mrg     \ifdim \wd\printedmanualbox > 0pt
   7904  1.1  mrg       \space \putwordin{} \cite{\printedmanual}%
   7905  1.1  mrg     \fi
   7906  1.1  mrg   \else
   7907  1.1  mrg     % node/anchor (non-float) references.
   7908  1.1  mrg     % 
   7909  1.1  mrg     % If we use \unhbox to print the node names, TeX does not insert
   7910  1.1  mrg     % empty discretionaries after hyphens, which means that it will not
   7911  1.1  mrg     % find a line break at a hyphen in a node names.  Since some manuals
   7912  1.1  mrg     % are best written with fairly long node names, containing hyphens,
   7913  1.1  mrg     % this is a loss.  Therefore, we give the text of the node name
   7914  1.1  mrg     % again, so it is as if TeX is seeing it for the first time.
   7915  1.1  mrg     % 
   7916  1.1  mrg     % Cross-manual reference.  Only include the "Section ``foo'' in" if
   7917  1.1  mrg     % the foo is neither missing or Top.  Thus, @xref{,,,foo,The Foo Manual}
   7918  1.1  mrg     % outputs simply "see The Foo Manual".
   7919  1.1  mrg     \ifdim \wd\printedmanualbox > 0pt
   7920  1.1  mrg       % What is the 7sp about?  The idea is that we also want to omit
   7921  1.1  mrg       % the Section part if we would be printing "Top", since they are
   7922  1.1  mrg       % clearly trying to refer to the whole manual.  But, this being
   7923  1.1  mrg       % TeX, we can't easily compare strings while ignoring the possible
   7924  1.1  mrg       % spaces before and after in the input.  By adding the arbitrary
   7925  1.1  mrg       % 7sp, we make it much less likely that a real node name would
   7926  1.1  mrg       % happen to have the same width as "Top" (e.g., in a monospaced font).
   7927  1.1  mrg       % I hope it will never happen in practice.
   7928  1.1  mrg       % 
   7929  1.1  mrg       % For the same basic reason, we retypeset the "Top" at every
   7930  1.1  mrg       % reference, since the current font is indeterminate.
   7931  1.1  mrg       % 
   7932  1.1  mrg       \setbox\topbox = \hbox{Top\kern7sp}%
   7933  1.1  mrg       \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
   7934  1.1  mrg       \ifdim \wd2 > 7sp
   7935  1.1  mrg         \ifdim \wd2 = \wd\topbox \else
   7936  1.1  mrg           \putwordSection{} ``\printedrefname'' \putwordin{}\space
   7937  1.1  mrg         \fi
   7938  1.1  mrg       \fi
   7939  1.1  mrg       \cite{\printedmanual}%
   7940  1.1  mrg     \else
   7941  1.1  mrg       % Reference in this manual.
   7942  1.1  mrg       %
   7943  1.1  mrg       % _ (for example) has to be the character _ for the purposes of the
   7944  1.1  mrg       % control sequence corresponding to the node, but it has to expand
   7945  1.1  mrg       % into the usual \leavevmode...\vrule stuff for purposes of
   7946  1.1  mrg       % printing. So we \turnoffactive for the \refx-snt, back on for the
   7947  1.1  mrg       % printing, back off for the \refx-pg.
   7948  1.1  mrg       {\turnoffactive
   7949  1.1  mrg        % Only output a following space if the -snt ref is nonempty; for
   7950  1.1  mrg        % @unnumbered and @anchor, it won't be.
   7951  1.1  mrg        \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
   7952  1.1  mrg        \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
   7953  1.1  mrg       }%
   7954  1.1  mrg       % output the `[mynode]' via the macro below so it can be overridden.
   7955  1.1  mrg       \xrefprintnodename\printedrefname
   7956  1.1  mrg       %
   7957  1.1  mrg       % But we always want a comma and a space:
   7958  1.1  mrg       ,\space
   7959  1.1  mrg       %
   7960  1.1  mrg       % output the `page 3'.
   7961  1.1  mrg       \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
   7962  1.1  mrg     \fi
   7963  1.1  mrg   \fi
   7964  1.1  mrg   \endlink
   7965  1.1  mrg \endgroup}
   7966  1.1  mrg 
   7967  1.1  mrg % This macro is called from \xrefX for the `[nodename]' part of xref
   7968  1.1  mrg % output.  It's a separate macro only so it can be changed more easily,
   7969  1.1  mrg % since square brackets don't work well in some documents.  Particularly
   7970  1.1  mrg % one that Bob is working on :).
   7971  1.1  mrg %
   7972  1.1  mrg \def\xrefprintnodename#1{[#1]}
   7973  1.1  mrg 
   7974  1.1  mrg % Things referred to by \setref.
   7975  1.1  mrg %
   7976  1.1  mrg \def\Ynothing{}
   7977  1.1  mrg \def\Yomitfromtoc{}
   7978  1.1  mrg \def\Ynumbered{%
   7979  1.1  mrg   \ifnum\secno=0
   7980  1.1  mrg     \putwordChapter@tie \the\chapno
   7981  1.1  mrg   \else \ifnum\subsecno=0
   7982  1.1  mrg     \putwordSection@tie \the\chapno.\the\secno
   7983  1.1  mrg   \else \ifnum\subsubsecno=0
   7984  1.1  mrg     \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
   7985  1.1  mrg   \else
   7986  1.1  mrg     \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
   7987  1.1  mrg   \fi\fi\fi
   7988  1.1  mrg }
   7989  1.1  mrg \def\Yappendix{%
   7990  1.1  mrg   \ifnum\secno=0
   7991  1.1  mrg      \putwordAppendix@tie @char\the\appendixno{}%
   7992  1.1  mrg   \else \ifnum\subsecno=0
   7993  1.1  mrg      \putwordSection@tie @char\the\appendixno.\the\secno
   7994  1.1  mrg   \else \ifnum\subsubsecno=0
   7995  1.1  mrg     \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
   7996  1.1  mrg   \else
   7997  1.1  mrg     \putwordSection@tie
   7998  1.1  mrg       @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
   7999  1.1  mrg   \fi\fi\fi
   8000  1.1  mrg }
   8001  1.1  mrg 
   8002  1.1  mrg % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
   8003  1.1  mrg % If its value is nonempty, SUFFIX is output afterward.
   8004  1.1  mrg %
   8005  1.1  mrg \def\refx#1#2{%
   8006  1.1  mrg   {%
   8007  1.1  mrg     \indexnofonts
   8008  1.1  mrg     \otherbackslash
   8009  1.1  mrg     \expandafter\global\expandafter\let\expandafter\thisrefX
   8010  1.1  mrg       \csname XR#1\endcsname
   8011  1.1  mrg   }%
   8012  1.1  mrg   \ifx\thisrefX\relax
   8013  1.1  mrg     % If not defined, say something at least.
   8014  1.1  mrg     \angleleft un\-de\-fined\angleright
   8015  1.1  mrg     \iflinks
   8016  1.1  mrg       \ifhavexrefs
   8017  1.1  mrg         {\toks0 = {#1}% avoid expansion of possibly-complex value
   8018  1.1  mrg          \message{\linenumber Undefined cross reference `\the\toks0'.}}%
   8019  1.1  mrg       \else
   8020  1.1  mrg         \ifwarnedxrefs\else
   8021  1.1  mrg           \global\warnedxrefstrue
   8022  1.1  mrg           \message{Cross reference values unknown; you must run TeX again.}%
   8023  1.1  mrg         \fi
   8024  1.1  mrg       \fi
   8025  1.1  mrg     \fi
   8026  1.1  mrg   \else
   8027  1.1  mrg     % It's defined, so just use it.
   8028  1.1  mrg     \thisrefX
   8029  1.1  mrg   \fi
   8030  1.1  mrg   #2% Output the suffix in any case.
   8031  1.1  mrg }
   8032  1.1  mrg 
   8033  1.1  mrg % This is the macro invoked by entries in the aux file.  Usually it's
   8034  1.1  mrg % just a \def (we prepend XR to the control sequence name to avoid
   8035  1.1  mrg % collisions).  But if this is a float type, we have more work to do.
   8036  1.1  mrg %
   8037  1.1  mrg \def\xrdef#1#2{%
   8038  1.1  mrg   {% The node name might contain 8-bit characters, which in our current
   8039  1.1  mrg    % implementation are changed to commands like @'e.  Don't let these
   8040  1.1  mrg    % mess up the control sequence name.
   8041  1.1  mrg     \indexnofonts
   8042  1.1  mrg     \turnoffactive
   8043  1.1  mrg     \xdef\safexrefname{#1}%
   8044  1.1  mrg   }%
   8045  1.1  mrg   %
   8046  1.1  mrg   \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
   8047  1.1  mrg   %
   8048  1.1  mrg   % Was that xref control sequence that we just defined for a float?
   8049  1.1  mrg   \expandafter\iffloat\csname XR\safexrefname\endcsname
   8050  1.1  mrg     % it was a float, and we have the (safe) float type in \iffloattype.
   8051  1.1  mrg     \expandafter\let\expandafter\floatlist
   8052  1.1  mrg       \csname floatlist\iffloattype\endcsname
   8053  1.1  mrg     %
   8054  1.1  mrg     % Is this the first time we've seen this float type?
   8055  1.1  mrg     \expandafter\ifx\floatlist\relax
   8056  1.1  mrg       \toks0 = {\do}% yes, so just \do
   8057  1.1  mrg     \else
   8058  1.1  mrg       % had it before, so preserve previous elements in list.
   8059  1.1  mrg       \toks0 = \expandafter{\floatlist\do}%
   8060  1.1  mrg     \fi
   8061  1.1  mrg     %
   8062  1.1  mrg     % Remember this xref in the control sequence \floatlistFLOATTYPE,
   8063  1.1  mrg     % for later use in \listoffloats.
   8064  1.1  mrg     \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
   8065  1.1  mrg       {\safexrefname}}%
   8066  1.1  mrg   \fi
   8067  1.1  mrg }
   8068  1.1  mrg 
   8069  1.1  mrg % Read the last existing aux file, if any.  No error if none exists.
   8070  1.1  mrg %
   8071  1.1  mrg \def\tryauxfile{%
   8072  1.1  mrg   \openin 1 \jobname.aux
   8073  1.1  mrg   \ifeof 1 \else
   8074  1.1  mrg     \readdatafile{aux}%
   8075  1.1  mrg     \global\havexrefstrue
   8076  1.1  mrg   \fi
   8077  1.1  mrg   \closein 1
   8078  1.1  mrg }
   8079  1.1  mrg 
   8080  1.1  mrg \def\setupdatafile{%
   8081  1.1  mrg   \catcode`\^^@=\other
   8082  1.1  mrg   \catcode`\^^A=\other
   8083  1.1  mrg   \catcode`\^^B=\other
   8084  1.1  mrg   \catcode`\^^C=\other
   8085  1.1  mrg   \catcode`\^^D=\other
   8086  1.1  mrg   \catcode`\^^E=\other
   8087  1.1  mrg   \catcode`\^^F=\other
   8088  1.1  mrg   \catcode`\^^G=\other
   8089  1.1  mrg   \catcode`\^^H=\other
   8090  1.1  mrg   \catcode`\^^K=\other
   8091  1.1  mrg   \catcode`\^^L=\other
   8092  1.1  mrg   \catcode`\^^N=\other
   8093  1.1  mrg   \catcode`\^^P=\other
   8094  1.1  mrg   \catcode`\^^Q=\other
   8095  1.1  mrg   \catcode`\^^R=\other
   8096  1.1  mrg   \catcode`\^^S=\other
   8097  1.1  mrg   \catcode`\^^T=\other
   8098  1.1  mrg   \catcode`\^^U=\other
   8099  1.1  mrg   \catcode`\^^V=\other
   8100  1.1  mrg   \catcode`\^^W=\other
   8101  1.1  mrg   \catcode`\^^X=\other
   8102  1.1  mrg   \catcode`\^^Z=\other
   8103  1.1  mrg   \catcode`\^^[=\other
   8104  1.1  mrg   \catcode`\^^\=\other
   8105  1.1  mrg   \catcode`\^^]=\other
   8106  1.1  mrg   \catcode`\^^^=\other
   8107  1.1  mrg   \catcode`\^^_=\other
   8108  1.1  mrg   % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
   8109  1.1  mrg   % in xref tags, i.e., node names.  But since ^^e4 notation isn't
   8110  1.1  mrg   % supported in the main text, it doesn't seem desirable.  Furthermore,
   8111  1.1  mrg   % that is not enough: for node names that actually contain a ^
   8112  1.1  mrg   % character, we would end up writing a line like this: 'xrdef {'hat
   8113  1.1  mrg   % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
   8114  1.1  mrg   % argument, and \hat is not an expandable control sequence.  It could
   8115  1.1  mrg   % all be worked out, but why?  Either we support ^^ or we don't.
   8116  1.1  mrg   %
   8117  1.1  mrg   % The other change necessary for this was to define \auxhat:
   8118  1.1  mrg   % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
   8119  1.1  mrg   % and then to call \auxhat in \setq.
   8120  1.1  mrg   %
   8121  1.1  mrg   \catcode`\^=\other
   8122  1.1  mrg   %
   8123  1.1  mrg   % Special characters.  Should be turned off anyway, but...
   8124  1.1  mrg   \catcode`\~=\other
   8125  1.1  mrg   \catcode`\[=\other
   8126  1.1  mrg   \catcode`\]=\other
   8127  1.1  mrg   \catcode`\"=\other
   8128  1.1  mrg   \catcode`\_=\other
   8129  1.1  mrg   \catcode`\|=\other
   8130  1.1  mrg   \catcode`\<=\other
   8131  1.1  mrg   \catcode`\>=\other
   8132  1.1  mrg   \catcode`\$=\other
   8133  1.1  mrg   \catcode`\#=\other
   8134  1.1  mrg   \catcode`\&=\other
   8135  1.1  mrg   \catcode`\%=\other
   8136  1.1  mrg   \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
   8137  1.1  mrg   %
   8138  1.1  mrg   % This is to support \ in node names and titles, since the \
   8139  1.1  mrg   % characters end up in a \csname.  It's easier than
   8140  1.1  mrg   % leaving it active and making its active definition an actual \
   8141  1.1  mrg   % character.  What I don't understand is why it works in the *value*
   8142  1.1  mrg   % of the xrdef.  Seems like it should be a catcode12 \, and that
   8143  1.1  mrg   % should not typeset properly.  But it works, so I'm moving on for
   8144  1.1  mrg   % now.  --karl, 15jan04.
   8145  1.1  mrg   \catcode`\\=\other
   8146  1.1  mrg   %
   8147  1.1  mrg   % Make the characters 128-255 be printing characters.
   8148  1.1  mrg   {%
   8149  1.1  mrg     \count1=128
   8150  1.1  mrg     \def\loop{%
   8151  1.1  mrg       \catcode\count1=\other
   8152  1.1  mrg       \advance\count1 by 1
   8153  1.1  mrg       \ifnum \count1<256 \loop \fi
   8154  1.1  mrg     }%
   8155  1.1  mrg   }%
   8156  1.1  mrg   %
   8157  1.1  mrg   % @ is our escape character in .aux files, and we need braces.
   8158  1.1  mrg   \catcode`\{=1
   8159  1.1  mrg   \catcode`\}=2
   8160  1.1  mrg   \catcode`\@=0
   8161  1.1  mrg }
   8162  1.1  mrg 
   8163  1.1  mrg \def\readdatafile#1{%
   8164  1.1  mrg \begingroup
   8165  1.1  mrg   \setupdatafile
   8166  1.1  mrg   \input\jobname.#1
   8167  1.1  mrg \endgroup}
   8168  1.1  mrg 
   8169  1.1  mrg 
   8170  1.1  mrg \message{insertions,}
   8171  1.1  mrg % including footnotes.
   8172  1.1  mrg 
   8173  1.1  mrg \newcount \footnoteno
   8174  1.1  mrg 
   8175  1.1  mrg % The trailing space in the following definition for supereject is
   8176  1.1  mrg % vital for proper filling; pages come out unaligned when you do a
   8177  1.1  mrg % pagealignmacro call if that space before the closing brace is
   8178  1.1  mrg % removed. (Generally, numeric constants should always be followed by a
   8179  1.1  mrg % space to prevent strange expansion errors.)
   8180  1.1  mrg \def\supereject{\par\penalty -20000\footnoteno =0 }
   8181  1.1  mrg 
   8182  1.1  mrg % @footnotestyle is meaningful for Info output only.
   8183  1.1  mrg \let\footnotestyle=\comment
   8184  1.1  mrg 
   8185  1.1  mrg {\catcode `\@=11
   8186  1.1  mrg %
   8187  1.1  mrg % Auto-number footnotes.  Otherwise like plain.
   8188  1.1  mrg \gdef\footnote{%
   8189  1.1  mrg   \let\indent=\ptexindent
   8190  1.1  mrg   \let\noindent=\ptexnoindent
   8191  1.1  mrg   \global\advance\footnoteno by \@ne
   8192  1.1  mrg   \edef\thisfootno{$^{\the\footnoteno}$}%
   8193  1.1  mrg   %
   8194  1.1  mrg   % In case the footnote comes at the end of a sentence, preserve the
   8195  1.1  mrg   % extra spacing after we do the footnote number.
   8196  1.1  mrg   \let\@sf\empty
   8197  1.1  mrg   \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
   8198  1.1  mrg   %
   8199  1.1  mrg   % Remove inadvertent blank space before typesetting the footnote number.
   8200  1.1  mrg   \unskip
   8201  1.1  mrg   \thisfootno\@sf
   8202  1.1  mrg   \dofootnote
   8203  1.1  mrg }%
   8204  1.1  mrg 
   8205  1.1  mrg % Don't bother with the trickery in plain.tex to not require the
   8206  1.1  mrg % footnote text as a parameter.  Our footnotes don't need to be so general.
   8207  1.1  mrg %
   8208  1.1  mrg % Oh yes, they do; otherwise, @ifset (and anything else that uses
   8209  1.1  mrg % \parseargline) fails inside footnotes because the tokens are fixed when
   8210  1.1  mrg % the footnote is read.  --karl, 16nov96.
   8211  1.1  mrg %
   8212  1.1  mrg \gdef\dofootnote{%
   8213  1.1  mrg   \insert\footins\bgroup
   8214  1.1  mrg   % We want to typeset this text as a normal paragraph, even if the
   8215  1.1  mrg   % footnote reference occurs in (for example) a display environment.
   8216  1.1  mrg   % So reset some parameters.
   8217  1.1  mrg   \hsize=\pagewidth
   8218  1.1  mrg   \interlinepenalty\interfootnotelinepenalty
   8219  1.1  mrg   \splittopskip\ht\strutbox % top baseline for broken footnotes
   8220  1.1  mrg   \splitmaxdepth\dp\strutbox
   8221  1.1  mrg   \floatingpenalty\@MM
   8222  1.1  mrg   \leftskip\z@skip
   8223  1.1  mrg   \rightskip\z@skip
   8224  1.1  mrg   \spaceskip\z@skip
   8225  1.1  mrg   \xspaceskip\z@skip
   8226  1.1  mrg   \parindent\defaultparindent
   8227  1.1  mrg   %
   8228  1.1  mrg   \smallfonts \rm
   8229  1.1  mrg   %
   8230  1.1  mrg   % Because we use hanging indentation in footnotes, a @noindent appears
   8231  1.1  mrg   % to exdent this text, so make it be a no-op.  makeinfo does not use
   8232  1.1  mrg   % hanging indentation so @noindent can still be needed within footnote
   8233  1.1  mrg   % text after an @example or the like (not that this is good style).
   8234  1.1  mrg   \let\noindent = \relax
   8235  1.1  mrg   %
   8236  1.1  mrg   % Hang the footnote text off the number.  Use \everypar in case the
   8237  1.1  mrg   % footnote extends for more than one paragraph.
   8238  1.1  mrg   \everypar = {\hang}%
   8239  1.1  mrg   \textindent{\thisfootno}%
   8240  1.1  mrg   %
   8241  1.1  mrg   % Don't crash into the line above the footnote text.  Since this
   8242  1.1  mrg   % expands into a box, it must come within the paragraph, lest it
   8243  1.1  mrg   % provide a place where TeX can split the footnote.
   8244  1.1  mrg   \footstrut
   8245  1.1  mrg   %
   8246  1.1  mrg   % Invoke rest of plain TeX footnote routine.
   8247  1.1  mrg   \futurelet\next\fo@t
   8248  1.1  mrg }
   8249  1.1  mrg }%end \catcode `\@=11
   8250  1.1  mrg 
   8251  1.1  mrg % In case a @footnote appears in a vbox, save the footnote text and create
   8252  1.1  mrg % the real \insert just after the vbox finished.  Otherwise, the insertion
   8253  1.1  mrg % would be lost.
   8254  1.1  mrg % Similarly, if a @footnote appears inside an alignment, save the footnote
   8255  1.1  mrg % text to a box and make the \insert when a row of the table is finished.
   8256  1.1  mrg % And the same can be done for other insert classes.  --kasal, 16nov03.
   8257  1.1  mrg 
   8258  1.1  mrg % Replace the \insert primitive by a cheating macro.
   8259  1.1  mrg % Deeper inside, just make sure that the saved insertions are not spilled
   8260  1.1  mrg % out prematurely.
   8261  1.1  mrg %
   8262  1.1  mrg \def\startsavinginserts{%
   8263  1.1  mrg   \ifx \insert\ptexinsert
   8264  1.1  mrg     \let\insert\saveinsert
   8265  1.1  mrg   \else
   8266  1.1  mrg     \let\checkinserts\relax
   8267  1.1  mrg   \fi
   8268  1.1  mrg }
   8269  1.1  mrg 
   8270  1.1  mrg % This \insert replacement works for both \insert\footins{foo} and
   8271  1.1  mrg % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
   8272  1.1  mrg %
   8273  1.1  mrg \def\saveinsert#1{%
   8274  1.1  mrg   \edef\next{\noexpand\savetobox \makeSAVEname#1}%
   8275  1.1  mrg   \afterassignment\next
   8276  1.1  mrg   % swallow the left brace
   8277  1.1  mrg   \let\temp =
   8278  1.1  mrg }
   8279  1.1  mrg \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
   8280  1.1  mrg \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
   8281  1.1  mrg 
   8282  1.1  mrg \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
   8283  1.1  mrg 
   8284  1.1  mrg \def\placesaveins#1{%
   8285  1.1  mrg   \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
   8286  1.1  mrg     {\box#1}%
   8287  1.1  mrg }
   8288  1.1  mrg 
   8289  1.1  mrg % eat @SAVE -- beware, all of them have catcode \other:
   8290  1.1  mrg {
   8291  1.1  mrg   \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
   8292  1.1  mrg   \gdef\gobblesave @SAVE{}
   8293  1.1  mrg }
   8294  1.1  mrg 
   8295  1.1  mrg % initialization:
   8296  1.1  mrg \def\newsaveins #1{%
   8297  1.1  mrg   \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
   8298  1.1  mrg   \next
   8299  1.1  mrg }
   8300  1.1  mrg \def\newsaveinsX #1{%
   8301  1.1  mrg   \csname newbox\endcsname #1%
   8302  1.1  mrg   \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
   8303  1.1  mrg     \checksaveins #1}%
   8304  1.1  mrg }
   8305  1.1  mrg 
   8306  1.1  mrg % initialize:
   8307  1.1  mrg \let\checkinserts\empty
   8308  1.1  mrg \newsaveins\footins
   8309  1.1  mrg \newsaveins\margin
   8310  1.1  mrg 
   8311  1.1  mrg 
   8312  1.1  mrg % @image.  We use the macros from epsf.tex to support this.
   8313  1.1  mrg % If epsf.tex is not installed and @image is used, we complain.
   8314  1.1  mrg %
   8315  1.1  mrg % Check for and read epsf.tex up front.  If we read it only at @image
   8316  1.1  mrg % time, we might be inside a group, and then its definitions would get
   8317  1.1  mrg % undone and the next image would fail.
   8318  1.1  mrg \openin 1 = epsf.tex
   8319  1.1  mrg \ifeof 1 \else
   8320  1.1  mrg   % Do not bother showing banner with epsf.tex v2.7k (available in
   8321  1.1  mrg   % doc/epsf.tex and on ctan).
   8322  1.1  mrg   \def\epsfannounce{\toks0 = }%
   8323  1.1  mrg   \input epsf.tex
   8324  1.1  mrg \fi
   8325  1.1  mrg \closein 1
   8326  1.1  mrg %
   8327  1.1  mrg % We will only complain once about lack of epsf.tex.
   8328  1.1  mrg \newif\ifwarnednoepsf
   8329  1.1  mrg \newhelp\noepsfhelp{epsf.tex must be installed for images to
   8330  1.1  mrg   work.  It is also included in the Texinfo distribution, or you can get
   8331  1.1  mrg   it from ftp://tug.org/tex/epsf.tex.}
   8332  1.1  mrg %
   8333  1.1  mrg \def\image#1{%
   8334  1.1  mrg   \ifx\epsfbox\thisisundefined
   8335  1.1  mrg     \ifwarnednoepsf \else
   8336  1.1  mrg       \errhelp = \noepsfhelp
   8337  1.1  mrg       \errmessage{epsf.tex not found, images will be ignored}%
   8338  1.1  mrg       \global\warnednoepsftrue
   8339  1.1  mrg     \fi
   8340  1.1  mrg   \else
   8341  1.1  mrg     \imagexxx #1,,,,,\finish
   8342  1.1  mrg   \fi
   8343  1.1  mrg }
   8344  1.1  mrg %
   8345  1.1  mrg % Arguments to @image:
   8346  1.1  mrg % #1 is (mandatory) image filename; we tack on .eps extension.
   8347  1.1  mrg % #2 is (optional) width, #3 is (optional) height.
   8348  1.1  mrg % #4 is (ignored optional) html alt text.
   8349  1.1  mrg % #5 is (ignored optional) extension.
   8350  1.1  mrg % #6 is just the usual extra ignored arg for parsing stuff.
   8351  1.1  mrg \newif\ifimagevmode
   8352  1.1  mrg \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
   8353  1.1  mrg   \catcode`\^^M = 5     % in case we're inside an example
   8354  1.1  mrg   \normalturnoffactive  % allow _ et al. in names
   8355  1.1  mrg   % If the image is by itself, center it.
   8356  1.1  mrg   \ifvmode
   8357  1.1  mrg     \imagevmodetrue
   8358  1.1  mrg   \else \ifx\centersub\centerV
   8359  1.1  mrg     % for @center @image, we need a vbox so we can have our vertical space
   8360  1.1  mrg     \imagevmodetrue
   8361  1.1  mrg     \vbox\bgroup % vbox has better behavior than vtop herev
   8362  1.1  mrg   \fi\fi
   8363  1.1  mrg   %
   8364  1.1  mrg   \ifimagevmode
   8365  1.1  mrg     \nobreak\medskip
   8366  1.1  mrg     % Usually we'll have text after the image which will insert
   8367  1.1  mrg     % \parskip glue, so insert it here too to equalize the space
   8368  1.1  mrg     % above and below.
   8369  1.1  mrg     \nobreak\vskip\parskip
   8370  1.1  mrg     \nobreak
   8371  1.1  mrg   \fi
   8372  1.1  mrg   %
   8373  1.1  mrg   % Leave vertical mode so that indentation from an enclosing
   8374  1.1  mrg   %  environment such as @quotation is respected.
   8375  1.1  mrg   % However, if we're at the top level, we don't want the
   8376  1.1  mrg   %  normal paragraph indentation.
   8377  1.1  mrg   % On the other hand, if we are in the case of @center @image, we don't
   8378  1.1  mrg   %  want to start a paragraph, which will create a hsize-width box and
   8379  1.1  mrg   %  eradicate the centering.
   8380  1.1  mrg   \ifx\centersub\centerV\else \noindent \fi
   8381  1.1  mrg   %
   8382  1.1  mrg   % Output the image.
   8383  1.1  mrg   \ifpdf
   8384  1.1  mrg     \dopdfimage{#1}{#2}{#3}%
   8385  1.1  mrg   \else
   8386  1.1  mrg     % \epsfbox itself resets \epsf?size at each figure.
   8387  1.1  mrg     \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
   8388  1.1  mrg     \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
   8389  1.1  mrg     \epsfbox{#1.eps}%
   8390  1.1  mrg   \fi
   8391  1.1  mrg   %
   8392  1.1  mrg   \ifimagevmode
   8393  1.1  mrg     \medskip  % space after a standalone image
   8394  1.1  mrg   \fi  
   8395  1.1  mrg   \ifx\centersub\centerV \egroup \fi
   8396  1.1  mrg \endgroup}
   8397  1.1  mrg 
   8398  1.1  mrg 
   8399  1.1  mrg % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
   8400  1.1  mrg % etc.  We don't actually implement floating yet, we always include the
   8401  1.1  mrg % float "here".  But it seemed the best name for the future.
   8402  1.1  mrg %
   8403  1.1  mrg \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
   8404  1.1  mrg 
   8405  1.1  mrg % There may be a space before second and/or third parameter; delete it.
   8406  1.1  mrg \def\eatcommaspace#1, {#1,}
   8407  1.1  mrg 
   8408  1.1  mrg % #1 is the optional FLOATTYPE, the text label for this float, typically
   8409  1.1  mrg % "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
   8410  1.1  mrg % this float will not be numbered and cannot be referred to.
   8411  1.1  mrg %
   8412  1.1  mrg % #2 is the optional xref label.  Also must be present for the float to
   8413  1.1  mrg % be referable.
   8414  1.1  mrg %
   8415  1.1  mrg % #3 is the optional positioning argument; for now, it is ignored.  It
   8416  1.1  mrg % will somehow specify the positions allowed to float to (here, top, bottom).
   8417  1.1  mrg %
   8418  1.1  mrg % We keep a separate counter for each FLOATTYPE, which we reset at each
   8419  1.1  mrg % chapter-level command.
   8420  1.1  mrg \let\resetallfloatnos=\empty
   8421  1.1  mrg %
   8422  1.1  mrg \def\dofloat#1,#2,#3,#4\finish{%
   8423  1.1  mrg   \let\thiscaption=\empty
   8424  1.1  mrg   \let\thisshortcaption=\empty
   8425  1.1  mrg   %
   8426  1.1  mrg   % don't lose footnotes inside @float.
   8427  1.1  mrg   %
   8428  1.1  mrg   % BEWARE: when the floats start float, we have to issue warning whenever an
   8429  1.1  mrg   % insert appears inside a float which could possibly float. --kasal, 26may04
   8430  1.1  mrg   %
   8431  1.1  mrg   \startsavinginserts
   8432  1.1  mrg   %
   8433  1.1  mrg   % We can't be used inside a paragraph.
   8434  1.1  mrg   \par
   8435  1.1  mrg   %
   8436  1.1  mrg   \vtop\bgroup
   8437  1.1  mrg     \def\floattype{#1}%
   8438  1.1  mrg     \def\floatlabel{#2}%
   8439  1.1  mrg     \def\floatloc{#3}% we do nothing with this yet.
   8440  1.1  mrg     %
   8441  1.1  mrg     \ifx\floattype\empty
   8442  1.1  mrg       \let\safefloattype=\empty
   8443  1.1  mrg     \else
   8444  1.1  mrg       {%
   8445  1.1  mrg         % the floattype might have accents or other special characters,
   8446  1.1  mrg         % but we need to use it in a control sequence name.
   8447  1.1  mrg         \indexnofonts
   8448  1.1  mrg         \turnoffactive
   8449  1.1  mrg         \xdef\safefloattype{\floattype}%
   8450  1.1  mrg       }%
   8451  1.1  mrg     \fi
   8452  1.1  mrg     %
   8453  1.1  mrg     % If label is given but no type, we handle that as the empty type.
   8454  1.1  mrg     \ifx\floatlabel\empty \else
   8455  1.1  mrg       % We want each FLOATTYPE to be numbered separately (Figure 1,
   8456  1.1  mrg       % Table 1, Figure 2, ...).  (And if no label, no number.)
   8457  1.1  mrg       %
   8458  1.1  mrg       \expandafter\getfloatno\csname\safefloattype floatno\endcsname
   8459  1.1  mrg       \global\advance\floatno by 1
   8460  1.1  mrg       %
   8461  1.1  mrg       {%
   8462  1.1  mrg         % This magic value for \lastsection is output by \setref as the
   8463  1.1  mrg         % XREFLABEL-title value.  \xrefX uses it to distinguish float
   8464  1.1  mrg         % labels (which have a completely different output format) from
   8465  1.1  mrg         % node and anchor labels.  And \xrdef uses it to construct the
   8466  1.1  mrg         % lists of floats.
   8467  1.1  mrg         %
   8468  1.1  mrg         \edef\lastsection{\floatmagic=\safefloattype}%
   8469  1.1  mrg         \setref{\floatlabel}{Yfloat}%
   8470  1.1  mrg       }%
   8471  1.1  mrg     \fi
   8472  1.1  mrg     %
   8473  1.1  mrg     % start with \parskip glue, I guess.
   8474  1.1  mrg     \vskip\parskip
   8475  1.1  mrg     %
   8476  1.1  mrg     % Don't suppress indentation if a float happens to start a section.
   8477  1.1  mrg     \restorefirstparagraphindent
   8478  1.1  mrg }
   8479  1.1  mrg 
   8480  1.1  mrg % we have these possibilities:
   8481  1.1  mrg % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
   8482  1.1  mrg % @float Foo,lbl & no caption:    Foo 1.1
   8483  1.1  mrg % @float Foo & @caption{Cap}:     Foo: Cap
   8484  1.1  mrg % @float Foo & no caption:        Foo
   8485  1.1  mrg % @float ,lbl & Caption{Cap}:     1.1: Cap
   8486  1.1  mrg % @float ,lbl & no caption:       1.1
   8487  1.1  mrg % @float & @caption{Cap}:         Cap
   8488  1.1  mrg % @float & no caption:
   8489  1.1  mrg %
   8490  1.1  mrg \def\Efloat{%
   8491  1.1  mrg     \let\floatident = \empty
   8492  1.1  mrg     %
   8493  1.1  mrg     % In all cases, if we have a float type, it comes first.
   8494  1.1  mrg     \ifx\floattype\empty \else \def\floatident{\floattype}\fi
   8495  1.1  mrg     %
   8496  1.1  mrg     % If we have an xref label, the number comes next.
   8497  1.1  mrg     \ifx\floatlabel\empty \else
   8498  1.1  mrg       \ifx\floattype\empty \else % if also had float type, need tie first.
   8499  1.1  mrg         \appendtomacro\floatident{\tie}%
   8500  1.1  mrg       \fi
   8501  1.1  mrg       % the number.
   8502  1.1  mrg       \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
   8503  1.1  mrg     \fi
   8504  1.1  mrg     %
   8505  1.1  mrg     % Start the printed caption with what we've constructed in
   8506  1.1  mrg     % \floatident, but keep it separate; we need \floatident again.
   8507  1.1  mrg     \let\captionline = \floatident
   8508  1.1  mrg     %
   8509  1.1  mrg     \ifx\thiscaption\empty \else
   8510  1.1  mrg       \ifx\floatident\empty \else
   8511  1.1  mrg 	\appendtomacro\captionline{: }% had ident, so need a colon between
   8512  1.1  mrg       \fi
   8513  1.1  mrg       %
   8514  1.1  mrg       % caption text.
   8515  1.1  mrg       \appendtomacro\captionline{\scanexp\thiscaption}%
   8516  1.1  mrg     \fi
   8517  1.1  mrg     %
   8518  1.1  mrg     % If we have anything to print, print it, with space before.
   8519  1.1  mrg     % Eventually this needs to become an \insert.
   8520  1.1  mrg     \ifx\captionline\empty \else
   8521  1.1  mrg       \vskip.5\parskip
   8522  1.1  mrg       \captionline
   8523  1.1  mrg       %
   8524  1.1  mrg       % Space below caption.
   8525  1.1  mrg       \vskip\parskip
   8526  1.1  mrg     \fi
   8527  1.1  mrg     %
   8528  1.1  mrg     % If have an xref label, write the list of floats info.  Do this
   8529  1.1  mrg     % after the caption, to avoid chance of it being a breakpoint.
   8530  1.1  mrg     \ifx\floatlabel\empty \else
   8531  1.1  mrg       % Write the text that goes in the lof to the aux file as
   8532  1.1  mrg       % \floatlabel-lof.  Besides \floatident, we include the short
   8533  1.1  mrg       % caption if specified, else the full caption if specified, else nothing.
   8534  1.1  mrg       {%
   8535  1.1  mrg         \atdummies
   8536  1.1  mrg         %
   8537  1.1  mrg         % since we read the caption text in the macro world, where ^^M
   8538  1.1  mrg         % is turned into a normal character, we have to scan it back, so
   8539  1.1  mrg         % we don't write the literal three characters "^^M" into the aux file.
   8540  1.1  mrg 	\scanexp{%
   8541  1.1  mrg 	  \xdef\noexpand\gtemp{%
   8542  1.1  mrg 	    \ifx\thisshortcaption\empty
   8543  1.1  mrg 	      \thiscaption
   8544  1.1  mrg 	    \else
   8545  1.1  mrg 	      \thisshortcaption
   8546  1.1  mrg 	    \fi
   8547  1.1  mrg 	  }%
   8548  1.1  mrg 	}%
   8549  1.1  mrg         \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
   8550  1.1  mrg 	  \ifx\gtemp\empty \else : \gtemp \fi}}%
   8551  1.1  mrg       }%
   8552  1.1  mrg     \fi
   8553  1.1  mrg   \egroup  % end of \vtop
   8554  1.1  mrg   %
   8555  1.1  mrg   % place the captured inserts
   8556  1.1  mrg   %
   8557  1.1  mrg   % BEWARE: when the floats start floating, we have to issue warning
   8558  1.1  mrg   % whenever an insert appears inside a float which could possibly
   8559  1.1  mrg   % float. --kasal, 26may04
   8560  1.1  mrg   %
   8561  1.1  mrg   \checkinserts
   8562  1.1  mrg }
   8563  1.1  mrg 
   8564  1.1  mrg % Append the tokens #2 to the definition of macro #1, not expanding either.
   8565  1.1  mrg %
   8566  1.1  mrg \def\appendtomacro#1#2{%
   8567  1.1  mrg   \expandafter\def\expandafter#1\expandafter{#1#2}%
   8568  1.1  mrg }
   8569  1.1  mrg 
   8570  1.1  mrg % @caption, @shortcaption
   8571  1.1  mrg %
   8572  1.1  mrg \def\caption{\docaption\thiscaption}
   8573  1.1  mrg \def\shortcaption{\docaption\thisshortcaption}
   8574  1.1  mrg \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
   8575  1.1  mrg \def\defcaption#1#2{\egroup \def#1{#2}}
   8576  1.1  mrg 
   8577  1.1  mrg % The parameter is the control sequence identifying the counter we are
   8578  1.1  mrg % going to use.  Create it if it doesn't exist and assign it to \floatno.
   8579  1.1  mrg \def\getfloatno#1{%
   8580  1.1  mrg   \ifx#1\relax
   8581  1.1  mrg       % Haven't seen this figure type before.
   8582  1.1  mrg       \csname newcount\endcsname #1%
   8583  1.1  mrg       %
   8584  1.1  mrg       % Remember to reset this floatno at the next chap.
   8585  1.1  mrg       \expandafter\gdef\expandafter\resetallfloatnos
   8586  1.1  mrg         \expandafter{\resetallfloatnos #1=0 }%
   8587  1.1  mrg   \fi
   8588  1.1  mrg   \let\floatno#1%
   8589  1.1  mrg }
   8590  1.1  mrg 
   8591  1.1  mrg % \setref calls this to get the XREFLABEL-snt value.  We want an @xref
   8592  1.1  mrg % to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
   8593  1.1  mrg % first read the @float command.
   8594  1.1  mrg %
   8595  1.1  mrg \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
   8596  1.1  mrg 
   8597  1.1  mrg % Magic string used for the XREFLABEL-title value, so \xrefX can
   8598  1.1  mrg % distinguish floats from other xref types.
   8599  1.1  mrg \def\floatmagic{!!float!!}
   8600  1.1  mrg 
   8601  1.1  mrg % #1 is the control sequence we are passed; we expand into a conditional
   8602  1.1  mrg % which is true if #1 represents a float ref.  That is, the magic
   8603  1.1  mrg % \lastsection value which we \setref above.
   8604  1.1  mrg %
   8605  1.1  mrg \def\iffloat#1{\expandafter\doiffloat#1==\finish}
   8606  1.1  mrg %
   8607  1.1  mrg % #1 is (maybe) the \floatmagic string.  If so, #2 will be the
   8608  1.1  mrg % (safe) float type for this float.  We set \iffloattype to #2.
   8609  1.1  mrg %
   8610  1.1  mrg \def\doiffloat#1=#2=#3\finish{%
   8611  1.1  mrg   \def\temp{#1}%
   8612  1.1  mrg   \def\iffloattype{#2}%
   8613  1.1  mrg   \ifx\temp\floatmagic
   8614  1.1  mrg }
   8615  1.1  mrg 
   8616  1.1  mrg % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
   8617  1.1  mrg %
   8618  1.1  mrg \parseargdef\listoffloats{%
   8619  1.1  mrg   \def\floattype{#1}% floattype
   8620  1.1  mrg   {%
   8621  1.1  mrg     % the floattype might have accents or other special characters,
   8622  1.1  mrg     % but we need to use it in a control sequence name.
   8623  1.1  mrg     \indexnofonts
   8624  1.1  mrg     \turnoffactive
   8625  1.1  mrg     \xdef\safefloattype{\floattype}%
   8626  1.1  mrg   }%
   8627  1.1  mrg   %
   8628  1.1  mrg   % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
   8629  1.1  mrg   \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
   8630  1.1  mrg     \ifhavexrefs
   8631  1.1  mrg       % if the user said @listoffloats foo but never @float foo.
   8632  1.1  mrg       \message{\linenumber No `\safefloattype' floats to list.}%
   8633  1.1  mrg     \fi
   8634  1.1  mrg   \else
   8635  1.1  mrg     \begingroup
   8636  1.1  mrg       \leftskip=\tocindent  % indent these entries like a toc
   8637  1.1  mrg       \let\do=\listoffloatsdo
   8638  1.1  mrg       \csname floatlist\safefloattype\endcsname
   8639  1.1  mrg     \endgroup
   8640  1.1  mrg   \fi
   8641  1.1  mrg }
   8642  1.1  mrg 
   8643  1.1  mrg % This is called on each entry in a list of floats.  We're passed the
   8644  1.1  mrg % xref label, in the form LABEL-title, which is how we save it in the
   8645  1.1  mrg % aux file.  We strip off the -title and look up \XRLABEL-lof, which
   8646  1.1  mrg % has the text we're supposed to typeset here.
   8647  1.1  mrg %
   8648  1.1  mrg % Figures without xref labels will not be included in the list (since
   8649  1.1  mrg % they won't appear in the aux file).
   8650  1.1  mrg %
   8651  1.1  mrg \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
   8652  1.1  mrg \def\listoffloatsdoentry#1-title\finish{{%
   8653  1.1  mrg   % Can't fully expand XR#1-lof because it can contain anything.  Just
   8654  1.1  mrg   % pass the control sequence.  On the other hand, XR#1-pg is just the
   8655  1.1  mrg   % page number, and we want to fully expand that so we can get a link
   8656  1.1  mrg   % in pdf output.
   8657  1.1  mrg   \toksA = \expandafter{\csname XR#1-lof\endcsname}%
   8658  1.1  mrg   %
   8659  1.1  mrg   % use the same \entry macro we use to generate the TOC and index.
   8660  1.1  mrg   \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
   8661  1.1  mrg   \writeentry
   8662  1.1  mrg }}
   8663  1.1  mrg 
   8664  1.1  mrg 
   8665  1.1  mrg \message{localization,}
   8666  1.1  mrg 
   8667  1.1  mrg % For single-language documents, @documentlanguage is usually given very
   8668  1.1  mrg % early, just after @documentencoding.  Single argument is the language
   8669  1.1  mrg % (de) or locale (de_DE) abbreviation.
   8670  1.1  mrg %
   8671  1.1  mrg {
   8672  1.1  mrg   \catcode`\_ = \active
   8673  1.1  mrg   \globaldefs=1
   8674  1.1  mrg \parseargdef\documentlanguage{\begingroup
   8675  1.1  mrg   \let_=\normalunderscore  % normal _ character for filenames
   8676  1.1  mrg   \tex % read txi-??.tex file in plain TeX.
   8677  1.1  mrg     % Read the file by the name they passed if it exists.
   8678  1.1  mrg     \openin 1 txi-#1.tex
   8679  1.1  mrg     \ifeof 1
   8680  1.1  mrg       \documentlanguagetrywithoutunderscore{#1_\finish}%
   8681  1.1  mrg     \else
   8682  1.1  mrg       \globaldefs = 1  % everything in the txi-LL files needs to persist
   8683  1.1  mrg       \input txi-#1.tex
   8684  1.1  mrg     \fi
   8685  1.1  mrg     \closein 1
   8686  1.1  mrg   \endgroup % end raw TeX
   8687  1.1  mrg \endgroup}
   8688  1.1  mrg %
   8689  1.1  mrg % If they passed de_DE, and txi-de_DE.tex doesn't exist,
   8690  1.1  mrg % try txi-de.tex.
   8691  1.1  mrg %
   8692  1.1  mrg \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
   8693  1.1  mrg   \openin 1 txi-#1.tex
   8694  1.1  mrg   \ifeof 1
   8695  1.1  mrg     \errhelp = \nolanghelp
   8696  1.1  mrg     \errmessage{Cannot read language file txi-#1.tex}%
   8697  1.1  mrg   \else
   8698  1.1  mrg     \globaldefs = 1  % everything in the txi-LL files needs to persist
   8699  1.1  mrg     \input txi-#1.tex
   8700  1.1  mrg   \fi
   8701  1.1  mrg   \closein 1
   8702  1.1  mrg }
   8703  1.1  mrg }% end of special _ catcode
   8704  1.1  mrg %
   8705  1.1  mrg \newhelp\nolanghelp{The given language definition file cannot be found or
   8706  1.1  mrg is empty.  Maybe you need to install it?  Putting it in the current
   8707  1.1  mrg directory should work if nowhere else does.}
   8708  1.1  mrg 
   8709  1.1  mrg % This macro is called from txi-??.tex files; the first argument is the
   8710  1.1  mrg % \language name to set (without the "\lang@" prefix), the second and
   8711  1.1  mrg % third args are \{left,right}hyphenmin.
   8712  1.1  mrg %
   8713  1.1  mrg % The language names to pass are determined when the format is built.
   8714  1.1  mrg % See the etex.log file created at that time, e.g.,
   8715  1.1  mrg % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
   8716  1.1  mrg %
   8717  1.1  mrg % With TeX Live 2008, etex now includes hyphenation patterns for all
   8718  1.1  mrg % available languages.  This means we can support hyphenation in
   8719  1.1  mrg % Texinfo, at least to some extent.  (This still doesn't solve the
   8720  1.1  mrg % accented characters problem.)
   8721  1.1  mrg %
   8722  1.1  mrg \catcode`@=11
   8723  1.1  mrg \def\txisetlanguage#1#2#3{%
   8724  1.1  mrg   % do not set the language if the name is undefined in the current TeX.
   8725  1.1  mrg   \expandafter\ifx\csname lang@#1\endcsname \relax
   8726  1.1  mrg     \message{no patterns for #1}%
   8727  1.1  mrg   \else
   8728  1.1  mrg     \global\language = \csname lang@#1\endcsname
   8729  1.1  mrg   \fi
   8730  1.1  mrg   % but there is no harm in adjusting the hyphenmin values regardless.
   8731  1.1  mrg   \global\lefthyphenmin = #2\relax
   8732  1.1  mrg   \global\righthyphenmin = #3\relax
   8733  1.1  mrg }
   8734  1.1  mrg 
   8735  1.1  mrg % Helpers for encodings.
   8736  1.1  mrg % Set the catcode of characters 128 through 255 to the specified number.
   8737  1.1  mrg %
   8738  1.1  mrg \def\setnonasciicharscatcode#1{%
   8739  1.1  mrg    \count255=128
   8740  1.1  mrg    \loop\ifnum\count255<256
   8741  1.1  mrg       \global\catcode\count255=#1\relax
   8742  1.1  mrg       \advance\count255 by 1
   8743  1.1  mrg    \repeat
   8744  1.1  mrg }
   8745  1.1  mrg 
   8746  1.1  mrg \def\setnonasciicharscatcodenonglobal#1{%
   8747  1.1  mrg    \count255=128
   8748  1.1  mrg    \loop\ifnum\count255<256
   8749  1.1  mrg       \catcode\count255=#1\relax
   8750  1.1  mrg       \advance\count255 by 1
   8751  1.1  mrg    \repeat
   8752  1.1  mrg }
   8753  1.1  mrg 
   8754  1.1  mrg % @documentencoding sets the definition of non-ASCII characters
   8755  1.1  mrg % according to the specified encoding.
   8756  1.1  mrg %
   8757  1.1  mrg \parseargdef\documentencoding{%
   8758  1.1  mrg   % Encoding being declared for the document.
   8759  1.1  mrg   \def\declaredencoding{\csname #1.enc\endcsname}%
   8760  1.1  mrg   %
   8761  1.1  mrg   % Supported encodings: names converted to tokens in order to be able
   8762  1.1  mrg   % to compare them with \ifx.
   8763  1.1  mrg   \def\ascii{\csname US-ASCII.enc\endcsname}%
   8764  1.1  mrg   \def\latnine{\csname ISO-8859-15.enc\endcsname}%
   8765  1.1  mrg   \def\latone{\csname ISO-8859-1.enc\endcsname}%
   8766  1.1  mrg   \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
   8767  1.1  mrg   \def\utfeight{\csname UTF-8.enc\endcsname}%
   8768  1.1  mrg   %
   8769  1.1  mrg   \ifx \declaredencoding \ascii
   8770  1.1  mrg      \asciichardefs
   8771  1.1  mrg   %
   8772  1.1  mrg   \else \ifx \declaredencoding \lattwo
   8773  1.1  mrg      \setnonasciicharscatcode\active
   8774  1.1  mrg      \lattwochardefs
   8775  1.1  mrg   %
   8776  1.1  mrg   \else \ifx \declaredencoding \latone
   8777  1.1  mrg      \setnonasciicharscatcode\active
   8778  1.1  mrg      \latonechardefs
   8779  1.1  mrg   %
   8780  1.1  mrg   \else \ifx \declaredencoding \latnine
   8781  1.1  mrg      \setnonasciicharscatcode\active
   8782  1.1  mrg      \latninechardefs
   8783  1.1  mrg   %
   8784  1.1  mrg   \else \ifx \declaredencoding \utfeight
   8785  1.1  mrg      \setnonasciicharscatcode\active
   8786  1.1  mrg      \utfeightchardefs
   8787  1.1  mrg   %
   8788  1.1  mrg   \else
   8789  1.1  mrg     \message{Unknown document encoding #1, ignoring.}%
   8790  1.1  mrg   %
   8791  1.1  mrg   \fi % utfeight
   8792  1.1  mrg   \fi % latnine
   8793  1.1  mrg   \fi % latone
   8794  1.1  mrg   \fi % lattwo
   8795  1.1  mrg   \fi % ascii
   8796  1.1  mrg }
   8797  1.1  mrg 
   8798  1.1  mrg % A message to be logged when using a character that isn't available
   8799  1.1  mrg % the default font encoding (OT1).
   8800  1.1  mrg %
   8801  1.1  mrg \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
   8802  1.1  mrg 
   8803  1.1  mrg % Take account of \c (plain) vs. \, (Texinfo) difference.
   8804  1.1  mrg \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
   8805  1.1  mrg 
   8806  1.1  mrg % First, make active non-ASCII characters in order for them to be
   8807  1.1  mrg % correctly categorized when TeX reads the replacement text of
   8808  1.1  mrg % macros containing the character definitions.
   8809  1.1  mrg \setnonasciicharscatcode\active
   8810  1.1  mrg %
   8811  1.1  mrg % Latin1 (ISO-8859-1) character definitions.
   8812  1.1  mrg \def\latonechardefs{%
   8813  1.1  mrg   \gdef^^a0{\tie}
   8814  1.1  mrg   \gdef^^a1{\exclamdown}
   8815  1.1  mrg   \gdef^^a2{\missingcharmsg{CENT SIGN}}
   8816  1.1  mrg   \gdef^^a3{{\pounds}}
   8817  1.1  mrg   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
   8818  1.1  mrg   \gdef^^a5{\missingcharmsg{YEN SIGN}}
   8819  1.1  mrg   \gdef^^a6{\missingcharmsg{BROKEN BAR}}
   8820  1.1  mrg   \gdef^^a7{\S}
   8821  1.1  mrg   \gdef^^a8{\"{}}
   8822  1.1  mrg   \gdef^^a9{\copyright}
   8823  1.1  mrg   \gdef^^aa{\ordf}
   8824  1.1  mrg   \gdef^^ab{\guillemetleft}
   8825  1.1  mrg   \gdef^^ac{$\lnot$}
   8826  1.1  mrg   \gdef^^ad{\-}
   8827  1.1  mrg   \gdef^^ae{\registeredsymbol}
   8828  1.1  mrg   \gdef^^af{\={}}
   8829  1.1  mrg   %
   8830  1.1  mrg   \gdef^^b0{\textdegree}
   8831  1.1  mrg   \gdef^^b1{$\pm$}
   8832  1.1  mrg   \gdef^^b2{$^2$}
   8833  1.1  mrg   \gdef^^b3{$^3$}
   8834  1.1  mrg   \gdef^^b4{\'{}}
   8835  1.1  mrg   \gdef^^b5{$\mu$}
   8836  1.1  mrg   \gdef^^b6{\P}
   8837  1.1  mrg   %
   8838  1.1  mrg   \gdef^^b7{$^.$}
   8839  1.1  mrg   \gdef^^b8{\cedilla\ }
   8840  1.1  mrg   \gdef^^b9{$^1$}
   8841  1.1  mrg   \gdef^^ba{\ordm}
   8842  1.1  mrg   %
   8843  1.1  mrg   \gdef^^bb{\guillemetright}
   8844  1.1  mrg   \gdef^^bc{$1\over4$}
   8845  1.1  mrg   \gdef^^bd{$1\over2$}
   8846  1.1  mrg   \gdef^^be{$3\over4$}
   8847  1.1  mrg   \gdef^^bf{\questiondown}
   8848  1.1  mrg   %
   8849  1.1  mrg   \gdef^^c0{\`A}
   8850  1.1  mrg   \gdef^^c1{\'A}
   8851  1.1  mrg   \gdef^^c2{\^A}
   8852  1.1  mrg   \gdef^^c3{\~A}
   8853  1.1  mrg   \gdef^^c4{\"A}
   8854  1.1  mrg   \gdef^^c5{\ringaccent A}
   8855  1.1  mrg   \gdef^^c6{\AE}
   8856  1.1  mrg   \gdef^^c7{\cedilla C}
   8857  1.1  mrg   \gdef^^c8{\`E}
   8858  1.1  mrg   \gdef^^c9{\'E}
   8859  1.1  mrg   \gdef^^ca{\^E}
   8860  1.1  mrg   \gdef^^cb{\"E}
   8861  1.1  mrg   \gdef^^cc{\`I}
   8862  1.1  mrg   \gdef^^cd{\'I}
   8863  1.1  mrg   \gdef^^ce{\^I}
   8864  1.1  mrg   \gdef^^cf{\"I}
   8865  1.1  mrg   %
   8866  1.1  mrg   \gdef^^d0{\DH}
   8867  1.1  mrg   \gdef^^d1{\~N}
   8868  1.1  mrg   \gdef^^d2{\`O}
   8869  1.1  mrg   \gdef^^d3{\'O}
   8870  1.1  mrg   \gdef^^d4{\^O}
   8871  1.1  mrg   \gdef^^d5{\~O}
   8872  1.1  mrg   \gdef^^d6{\"O}
   8873  1.1  mrg   \gdef^^d7{$\times$}
   8874  1.1  mrg   \gdef^^d8{\O}
   8875  1.1  mrg   \gdef^^d9{\`U}
   8876  1.1  mrg   \gdef^^da{\'U}
   8877  1.1  mrg   \gdef^^db{\^U}
   8878  1.1  mrg   \gdef^^dc{\"U}
   8879  1.1  mrg   \gdef^^dd{\'Y}
   8880  1.1  mrg   \gdef^^de{\TH}
   8881  1.1  mrg   \gdef^^df{\ss}
   8882  1.1  mrg   %
   8883  1.1  mrg   \gdef^^e0{\`a}
   8884  1.1  mrg   \gdef^^e1{\'a}
   8885  1.1  mrg   \gdef^^e2{\^a}
   8886  1.1  mrg   \gdef^^e3{\~a}
   8887  1.1  mrg   \gdef^^e4{\"a}
   8888  1.1  mrg   \gdef^^e5{\ringaccent a}
   8889  1.1  mrg   \gdef^^e6{\ae}
   8890  1.1  mrg   \gdef^^e7{\cedilla c}
   8891  1.1  mrg   \gdef^^e8{\`e}
   8892  1.1  mrg   \gdef^^e9{\'e}
   8893  1.1  mrg   \gdef^^ea{\^e}
   8894  1.1  mrg   \gdef^^eb{\"e}
   8895  1.1  mrg   \gdef^^ec{\`{\dotless i}}
   8896  1.1  mrg   \gdef^^ed{\'{\dotless i}}
   8897  1.1  mrg   \gdef^^ee{\^{\dotless i}}
   8898  1.1  mrg   \gdef^^ef{\"{\dotless i}}
   8899  1.1  mrg   %
   8900  1.1  mrg   \gdef^^f0{\dh}
   8901  1.1  mrg   \gdef^^f1{\~n}
   8902  1.1  mrg   \gdef^^f2{\`o}
   8903  1.1  mrg   \gdef^^f3{\'o}
   8904  1.1  mrg   \gdef^^f4{\^o}
   8905  1.1  mrg   \gdef^^f5{\~o}
   8906  1.1  mrg   \gdef^^f6{\"o}
   8907  1.1  mrg   \gdef^^f7{$\div$}
   8908  1.1  mrg   \gdef^^f8{\o}
   8909  1.1  mrg   \gdef^^f9{\`u}
   8910  1.1  mrg   \gdef^^fa{\'u}
   8911  1.1  mrg   \gdef^^fb{\^u}
   8912  1.1  mrg   \gdef^^fc{\"u}
   8913  1.1  mrg   \gdef^^fd{\'y}
   8914  1.1  mrg   \gdef^^fe{\th}
   8915  1.1  mrg   \gdef^^ff{\"y}
   8916  1.1  mrg }
   8917  1.1  mrg 
   8918  1.1  mrg % Latin9 (ISO-8859-15) encoding character definitions.
   8919  1.1  mrg \def\latninechardefs{%
   8920  1.1  mrg   % Encoding is almost identical to Latin1.
   8921  1.1  mrg   \latonechardefs
   8922  1.1  mrg   %
   8923  1.1  mrg   \gdef^^a4{\euro}
   8924  1.1  mrg   \gdef^^a6{\v S}
   8925  1.1  mrg   \gdef^^a8{\v s}
   8926  1.1  mrg   \gdef^^b4{\v Z}
   8927  1.1  mrg   \gdef^^b8{\v z}
   8928  1.1  mrg   \gdef^^bc{\OE}
   8929  1.1  mrg   \gdef^^bd{\oe}
   8930  1.1  mrg   \gdef^^be{\"Y}
   8931  1.1  mrg }
   8932  1.1  mrg 
   8933  1.1  mrg % Latin2 (ISO-8859-2) character definitions.
   8934  1.1  mrg \def\lattwochardefs{%
   8935  1.1  mrg   \gdef^^a0{\tie}
   8936  1.1  mrg   \gdef^^a1{\ogonek{A}}
   8937  1.1  mrg   \gdef^^a2{\u{}}
   8938  1.1  mrg   \gdef^^a3{\L}
   8939  1.1  mrg   \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
   8940  1.1  mrg   \gdef^^a5{\v L}
   8941  1.1  mrg   \gdef^^a6{\'S}
   8942  1.1  mrg   \gdef^^a7{\S}
   8943  1.1  mrg   \gdef^^a8{\"{}}
   8944  1.1  mrg   \gdef^^a9{\v S}
   8945  1.1  mrg   \gdef^^aa{\cedilla S}
   8946  1.1  mrg   \gdef^^ab{\v T}
   8947  1.1  mrg   \gdef^^ac{\'Z}
   8948  1.1  mrg   \gdef^^ad{\-}
   8949  1.1  mrg   \gdef^^ae{\v Z}
   8950  1.1  mrg   \gdef^^af{\dotaccent Z}
   8951  1.1  mrg   %
   8952  1.1  mrg   \gdef^^b0{\textdegree}
   8953  1.1  mrg   \gdef^^b1{\ogonek{a}}
   8954  1.1  mrg   \gdef^^b2{\ogonek{ }}
   8955  1.1  mrg   \gdef^^b3{\l}
   8956  1.1  mrg   \gdef^^b4{\'{}}
   8957  1.1  mrg   \gdef^^b5{\v l}
   8958  1.1  mrg   \gdef^^b6{\'s}
   8959  1.1  mrg   \gdef^^b7{\v{}}
   8960  1.1  mrg   \gdef^^b8{\cedilla\ }
   8961  1.1  mrg   \gdef^^b9{\v s}
   8962  1.1  mrg   \gdef^^ba{\cedilla s}
   8963  1.1  mrg   \gdef^^bb{\v t}
   8964  1.1  mrg   \gdef^^bc{\'z}
   8965  1.1  mrg   \gdef^^bd{\H{}}
   8966  1.1  mrg   \gdef^^be{\v z}
   8967  1.1  mrg   \gdef^^bf{\dotaccent z}
   8968  1.1  mrg   %
   8969  1.1  mrg   \gdef^^c0{\'R}
   8970  1.1  mrg   \gdef^^c1{\'A}
   8971  1.1  mrg   \gdef^^c2{\^A}
   8972  1.1  mrg   \gdef^^c3{\u A}
   8973  1.1  mrg   \gdef^^c4{\"A}
   8974  1.1  mrg   \gdef^^c5{\'L}
   8975  1.1  mrg   \gdef^^c6{\'C}
   8976  1.1  mrg   \gdef^^c7{\cedilla C}
   8977  1.1  mrg   \gdef^^c8{\v C}
   8978  1.1  mrg   \gdef^^c9{\'E}
   8979  1.1  mrg   \gdef^^ca{\ogonek{E}}
   8980  1.1  mrg   \gdef^^cb{\"E}
   8981  1.1  mrg   \gdef^^cc{\v E}
   8982  1.1  mrg   \gdef^^cd{\'I}
   8983  1.1  mrg   \gdef^^ce{\^I}
   8984  1.1  mrg   \gdef^^cf{\v D}
   8985  1.1  mrg   %
   8986  1.1  mrg   \gdef^^d0{\DH}
   8987  1.1  mrg   \gdef^^d1{\'N}
   8988  1.1  mrg   \gdef^^d2{\v N}
   8989  1.1  mrg   \gdef^^d3{\'O}
   8990  1.1  mrg   \gdef^^d4{\^O}
   8991  1.1  mrg   \gdef^^d5{\H O}
   8992  1.1  mrg   \gdef^^d6{\"O}
   8993  1.1  mrg   \gdef^^d7{$\times$}
   8994  1.1  mrg   \gdef^^d8{\v R}
   8995  1.1  mrg   \gdef^^d9{\ringaccent U}
   8996  1.1  mrg   \gdef^^da{\'U}
   8997  1.1  mrg   \gdef^^db{\H U}
   8998  1.1  mrg   \gdef^^dc{\"U}
   8999  1.1  mrg   \gdef^^dd{\'Y}
   9000  1.1  mrg   \gdef^^de{\cedilla T}
   9001  1.1  mrg   \gdef^^df{\ss}
   9002  1.1  mrg   %
   9003  1.1  mrg   \gdef^^e0{\'r}
   9004  1.1  mrg   \gdef^^e1{\'a}
   9005  1.1  mrg   \gdef^^e2{\^a}
   9006  1.1  mrg   \gdef^^e3{\u a}
   9007  1.1  mrg   \gdef^^e4{\"a}
   9008  1.1  mrg   \gdef^^e5{\'l}
   9009  1.1  mrg   \gdef^^e6{\'c}
   9010  1.1  mrg   \gdef^^e7{\cedilla c}
   9011  1.1  mrg   \gdef^^e8{\v c}
   9012  1.1  mrg   \gdef^^e9{\'e}
   9013  1.1  mrg   \gdef^^ea{\ogonek{e}}
   9014  1.1  mrg   \gdef^^eb{\"e}
   9015  1.1  mrg   \gdef^^ec{\v e}
   9016  1.1  mrg   \gdef^^ed{\'{\dotless{i}}}
   9017  1.1  mrg   \gdef^^ee{\^{\dotless{i}}}
   9018  1.1  mrg   \gdef^^ef{\v d}
   9019  1.1  mrg   %
   9020  1.1  mrg   \gdef^^f0{\dh}
   9021  1.1  mrg   \gdef^^f1{\'n}
   9022  1.1  mrg   \gdef^^f2{\v n}
   9023  1.1  mrg   \gdef^^f3{\'o}
   9024  1.1  mrg   \gdef^^f4{\^o}
   9025  1.1  mrg   \gdef^^f5{\H o}
   9026  1.1  mrg   \gdef^^f6{\"o}
   9027  1.1  mrg   \gdef^^f7{$\div$}
   9028  1.1  mrg   \gdef^^f8{\v r}
   9029  1.1  mrg   \gdef^^f9{\ringaccent u}
   9030  1.1  mrg   \gdef^^fa{\'u}
   9031  1.1  mrg   \gdef^^fb{\H u}
   9032  1.1  mrg   \gdef^^fc{\"u}
   9033  1.1  mrg   \gdef^^fd{\'y}
   9034  1.1  mrg   \gdef^^fe{\cedilla t}
   9035  1.1  mrg   \gdef^^ff{\dotaccent{}}
   9036  1.1  mrg }
   9037  1.1  mrg 
   9038  1.1  mrg % UTF-8 character definitions.
   9039  1.1  mrg %
   9040  1.1  mrg % This code to support UTF-8 is based on LaTeX's utf8.def, with some
   9041  1.1  mrg % changes for Texinfo conventions.  It is included here under the GPL by
   9042  1.1  mrg % permission from Frank Mittelbach and the LaTeX team.
   9043  1.1  mrg %
   9044  1.1  mrg \newcount\countUTFx
   9045  1.1  mrg \newcount\countUTFy
   9046  1.1  mrg \newcount\countUTFz
   9047  1.1  mrg 
   9048  1.1  mrg \gdef\UTFviiiTwoOctets#1#2{\expandafter
   9049  1.1  mrg    \UTFviiiDefined\csname u8:#1\string #2\endcsname}
   9050  1.1  mrg %
   9051  1.1  mrg \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
   9052  1.1  mrg    \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
   9053  1.1  mrg %
   9054  1.1  mrg \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
   9055  1.1  mrg    \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
   9056  1.1  mrg 
   9057  1.1  mrg \gdef\UTFviiiDefined#1{%
   9058  1.1  mrg   \ifx #1\relax
   9059  1.1  mrg     \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
   9060  1.1  mrg   \else
   9061  1.1  mrg     \expandafter #1%
   9062  1.1  mrg   \fi
   9063  1.1  mrg }
   9064  1.1  mrg 
   9065  1.1  mrg \begingroup
   9066  1.1  mrg   \catcode`\~13
   9067  1.1  mrg   \catcode`\"12
   9068  1.1  mrg 
   9069  1.1  mrg   \def\UTFviiiLoop{%
   9070  1.1  mrg     \global\catcode\countUTFx\active
   9071  1.1  mrg     \uccode`\~\countUTFx
   9072  1.1  mrg     \uppercase\expandafter{\UTFviiiTmp}%
   9073  1.1  mrg     \advance\countUTFx by 1
   9074  1.1  mrg     \ifnum\countUTFx < \countUTFy
   9075  1.1  mrg       \expandafter\UTFviiiLoop
   9076  1.1  mrg     \fi}
   9077  1.1  mrg 
   9078  1.1  mrg   \countUTFx = "C2
   9079  1.1  mrg   \countUTFy = "E0
   9080  1.1  mrg   \def\UTFviiiTmp{%
   9081  1.1  mrg     \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
   9082  1.1  mrg   \UTFviiiLoop
   9083  1.1  mrg 
   9084  1.1  mrg   \countUTFx = "E0
   9085  1.1  mrg   \countUTFy = "F0
   9086  1.1  mrg   \def\UTFviiiTmp{%
   9087  1.1  mrg     \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
   9088  1.1  mrg   \UTFviiiLoop
   9089  1.1  mrg 
   9090  1.1  mrg   \countUTFx = "F0
   9091  1.1  mrg   \countUTFy = "F4
   9092  1.1  mrg   \def\UTFviiiTmp{%
   9093  1.1  mrg     \xdef~{\noexpand\UTFviiiFourOctets\string~}}
   9094  1.1  mrg   \UTFviiiLoop
   9095  1.1  mrg \endgroup
   9096  1.1  mrg 
   9097  1.1  mrg \begingroup
   9098  1.1  mrg   \catcode`\"=12
   9099  1.1  mrg   \catcode`\<=12
   9100  1.1  mrg   \catcode`\.=12
   9101  1.1  mrg   \catcode`\,=12
   9102  1.1  mrg   \catcode`\;=12
   9103  1.1  mrg   \catcode`\!=12
   9104  1.1  mrg   \catcode`\~=13
   9105  1.1  mrg 
   9106  1.1  mrg   \gdef\DeclareUnicodeCharacter#1#2{%
   9107  1.1  mrg     \countUTFz = "#1\relax
   9108  1.1  mrg     %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
   9109  1.1  mrg     \begingroup
   9110  1.1  mrg       \parseXMLCharref
   9111  1.1  mrg       \def\UTFviiiTwoOctets##1##2{%
   9112  1.1  mrg         \csname u8:##1\string ##2\endcsname}%
   9113  1.1  mrg       \def\UTFviiiThreeOctets##1##2##3{%
   9114  1.1  mrg         \csname u8:##1\string ##2\string ##3\endcsname}%
   9115  1.1  mrg       \def\UTFviiiFourOctets##1##2##3##4{%
   9116  1.1  mrg         \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
   9117  1.1  mrg       \expandafter\expandafter\expandafter\expandafter
   9118  1.1  mrg        \expandafter\expandafter\expandafter
   9119  1.1  mrg        \gdef\UTFviiiTmp{#2}%
   9120  1.1  mrg     \endgroup}
   9121  1.1  mrg 
   9122  1.1  mrg   \gdef\parseXMLCharref{%
   9123  1.1  mrg     \ifnum\countUTFz < "A0\relax
   9124  1.1  mrg       \errhelp = \EMsimple
   9125  1.1  mrg       \errmessage{Cannot define Unicode char value < 00A0}%
   9126  1.1  mrg     \else\ifnum\countUTFz < "800\relax
   9127  1.1  mrg       \parseUTFviiiA,%
   9128  1.1  mrg       \parseUTFviiiB C\UTFviiiTwoOctets.,%
   9129  1.1  mrg     \else\ifnum\countUTFz < "10000\relax
   9130  1.1  mrg       \parseUTFviiiA;%
   9131  1.1  mrg       \parseUTFviiiA,%
   9132  1.1  mrg       \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
   9133  1.1  mrg     \else
   9134  1.1  mrg       \parseUTFviiiA;%
   9135  1.1  mrg       \parseUTFviiiA,%
   9136  1.1  mrg       \parseUTFviiiA!%
   9137  1.1  mrg       \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
   9138  1.1  mrg     \fi\fi\fi
   9139  1.1  mrg   }
   9140  1.1  mrg 
   9141  1.1  mrg   \gdef\parseUTFviiiA#1{%
   9142  1.1  mrg     \countUTFx = \countUTFz
   9143  1.1  mrg     \divide\countUTFz by 64
   9144  1.1  mrg     \countUTFy = \countUTFz
   9145  1.1  mrg     \multiply\countUTFz by 64
   9146  1.1  mrg     \advance\countUTFx by -\countUTFz
   9147  1.1  mrg     \advance\countUTFx by 128
   9148  1.1  mrg     \uccode `#1\countUTFx
   9149  1.1  mrg     \countUTFz = \countUTFy}
   9150  1.1  mrg 
   9151  1.1  mrg   \gdef\parseUTFviiiB#1#2#3#4{%
   9152  1.1  mrg     \advance\countUTFz by "#10\relax
   9153  1.1  mrg     \uccode `#3\countUTFz
   9154  1.1  mrg     \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
   9155  1.1  mrg \endgroup
   9156  1.1  mrg 
   9157  1.1  mrg \def\utfeightchardefs{%
   9158  1.1  mrg   \DeclareUnicodeCharacter{00A0}{\tie}
   9159  1.1  mrg   \DeclareUnicodeCharacter{00A1}{\exclamdown}
   9160  1.1  mrg   \DeclareUnicodeCharacter{00A3}{\pounds}
   9161  1.1  mrg   \DeclareUnicodeCharacter{00A8}{\"{ }}
   9162  1.1  mrg   \DeclareUnicodeCharacter{00A9}{\copyright}
   9163  1.1  mrg   \DeclareUnicodeCharacter{00AA}{\ordf}
   9164  1.1  mrg   \DeclareUnicodeCharacter{00AB}{\guillemetleft}
   9165  1.1  mrg   \DeclareUnicodeCharacter{00AD}{\-}
   9166  1.1  mrg   \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
   9167  1.1  mrg   \DeclareUnicodeCharacter{00AF}{\={ }}
   9168  1.1  mrg 
   9169  1.1  mrg   \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
   9170  1.1  mrg   \DeclareUnicodeCharacter{00B4}{\'{ }}
   9171  1.1  mrg   \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
   9172  1.1  mrg   \DeclareUnicodeCharacter{00BA}{\ordm}
   9173  1.1  mrg   \DeclareUnicodeCharacter{00BB}{\guillemetright}
   9174  1.1  mrg   \DeclareUnicodeCharacter{00BF}{\questiondown}
   9175  1.1  mrg 
   9176  1.1  mrg   \DeclareUnicodeCharacter{00C0}{\`A}
   9177  1.1  mrg   \DeclareUnicodeCharacter{00C1}{\'A}
   9178  1.1  mrg   \DeclareUnicodeCharacter{00C2}{\^A}
   9179  1.1  mrg   \DeclareUnicodeCharacter{00C3}{\~A}
   9180  1.1  mrg   \DeclareUnicodeCharacter{00C4}{\"A}
   9181  1.1  mrg   \DeclareUnicodeCharacter{00C5}{\AA}
   9182  1.1  mrg   \DeclareUnicodeCharacter{00C6}{\AE}
   9183  1.1  mrg   \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
   9184  1.1  mrg   \DeclareUnicodeCharacter{00C8}{\`E}
   9185  1.1  mrg   \DeclareUnicodeCharacter{00C9}{\'E}
   9186  1.1  mrg   \DeclareUnicodeCharacter{00CA}{\^E}
   9187  1.1  mrg   \DeclareUnicodeCharacter{00CB}{\"E}
   9188  1.1  mrg   \DeclareUnicodeCharacter{00CC}{\`I}
   9189  1.1  mrg   \DeclareUnicodeCharacter{00CD}{\'I}
   9190  1.1  mrg   \DeclareUnicodeCharacter{00CE}{\^I}
   9191  1.1  mrg   \DeclareUnicodeCharacter{00CF}{\"I}
   9192  1.1  mrg 
   9193  1.1  mrg   \DeclareUnicodeCharacter{00D0}{\DH}
   9194  1.1  mrg   \DeclareUnicodeCharacter{00D1}{\~N}
   9195  1.1  mrg   \DeclareUnicodeCharacter{00D2}{\`O}
   9196  1.1  mrg   \DeclareUnicodeCharacter{00D3}{\'O}
   9197  1.1  mrg   \DeclareUnicodeCharacter{00D4}{\^O}
   9198  1.1  mrg   \DeclareUnicodeCharacter{00D5}{\~O}
   9199  1.1  mrg   \DeclareUnicodeCharacter{00D6}{\"O}
   9200  1.1  mrg   \DeclareUnicodeCharacter{00D8}{\O}
   9201  1.1  mrg   \DeclareUnicodeCharacter{00D9}{\`U}
   9202  1.1  mrg   \DeclareUnicodeCharacter{00DA}{\'U}
   9203  1.1  mrg   \DeclareUnicodeCharacter{00DB}{\^U}
   9204  1.1  mrg   \DeclareUnicodeCharacter{00DC}{\"U}
   9205  1.1  mrg   \DeclareUnicodeCharacter{00DD}{\'Y}
   9206  1.1  mrg   \DeclareUnicodeCharacter{00DE}{\TH}
   9207  1.1  mrg   \DeclareUnicodeCharacter{00DF}{\ss}
   9208  1.1  mrg 
   9209  1.1  mrg   \DeclareUnicodeCharacter{00E0}{\`a}
   9210  1.1  mrg   \DeclareUnicodeCharacter{00E1}{\'a}
   9211  1.1  mrg   \DeclareUnicodeCharacter{00E2}{\^a}
   9212  1.1  mrg   \DeclareUnicodeCharacter{00E3}{\~a}
   9213  1.1  mrg   \DeclareUnicodeCharacter{00E4}{\"a}
   9214  1.1  mrg   \DeclareUnicodeCharacter{00E5}{\aa}
   9215  1.1  mrg   \DeclareUnicodeCharacter{00E6}{\ae}
   9216  1.1  mrg   \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
   9217  1.1  mrg   \DeclareUnicodeCharacter{00E8}{\`e}
   9218  1.1  mrg   \DeclareUnicodeCharacter{00E9}{\'e}
   9219  1.1  mrg   \DeclareUnicodeCharacter{00EA}{\^e}
   9220  1.1  mrg   \DeclareUnicodeCharacter{00EB}{\"e}
   9221  1.1  mrg   \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
   9222  1.1  mrg   \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
   9223  1.1  mrg   \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
   9224  1.1  mrg   \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
   9225  1.1  mrg 
   9226  1.1  mrg   \DeclareUnicodeCharacter{00F0}{\dh}
   9227  1.1  mrg   \DeclareUnicodeCharacter{00F1}{\~n}
   9228  1.1  mrg   \DeclareUnicodeCharacter{00F2}{\`o}
   9229  1.1  mrg   \DeclareUnicodeCharacter{00F3}{\'o}
   9230  1.1  mrg   \DeclareUnicodeCharacter{00F4}{\^o}
   9231  1.1  mrg   \DeclareUnicodeCharacter{00F5}{\~o}
   9232  1.1  mrg   \DeclareUnicodeCharacter{00F6}{\"o}
   9233  1.1  mrg   \DeclareUnicodeCharacter{00F8}{\o}
   9234  1.1  mrg   \DeclareUnicodeCharacter{00F9}{\`u}
   9235  1.1  mrg   \DeclareUnicodeCharacter{00FA}{\'u}
   9236  1.1  mrg   \DeclareUnicodeCharacter{00FB}{\^u}
   9237  1.1  mrg   \DeclareUnicodeCharacter{00FC}{\"u}
   9238  1.1  mrg   \DeclareUnicodeCharacter{00FD}{\'y}
   9239  1.1  mrg   \DeclareUnicodeCharacter{00FE}{\th}
   9240  1.1  mrg   \DeclareUnicodeCharacter{00FF}{\"y}
   9241  1.1  mrg 
   9242  1.1  mrg   \DeclareUnicodeCharacter{0100}{\=A}
   9243  1.1  mrg   \DeclareUnicodeCharacter{0101}{\=a}
   9244  1.1  mrg   \DeclareUnicodeCharacter{0102}{\u{A}}
   9245  1.1  mrg   \DeclareUnicodeCharacter{0103}{\u{a}}
   9246  1.1  mrg   \DeclareUnicodeCharacter{0104}{\ogonek{A}}
   9247  1.1  mrg   \DeclareUnicodeCharacter{0105}{\ogonek{a}}
   9248  1.1  mrg   \DeclareUnicodeCharacter{0106}{\'C}
   9249  1.1  mrg   \DeclareUnicodeCharacter{0107}{\'c}
   9250  1.1  mrg   \DeclareUnicodeCharacter{0108}{\^C}
   9251  1.1  mrg   \DeclareUnicodeCharacter{0109}{\^c}
   9252  1.1  mrg   \DeclareUnicodeCharacter{0118}{\ogonek{E}}
   9253  1.1  mrg   \DeclareUnicodeCharacter{0119}{\ogonek{e}}
   9254  1.1  mrg   \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
   9255  1.1  mrg   \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
   9256  1.1  mrg   \DeclareUnicodeCharacter{010C}{\v{C}}
   9257  1.1  mrg   \DeclareUnicodeCharacter{010D}{\v{c}}
   9258  1.1  mrg   \DeclareUnicodeCharacter{010E}{\v{D}}
   9259  1.1  mrg 
   9260  1.1  mrg   \DeclareUnicodeCharacter{0112}{\=E}
   9261  1.1  mrg   \DeclareUnicodeCharacter{0113}{\=e}
   9262  1.1  mrg   \DeclareUnicodeCharacter{0114}{\u{E}}
   9263  1.1  mrg   \DeclareUnicodeCharacter{0115}{\u{e}}
   9264  1.1  mrg   \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
   9265  1.1  mrg   \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
   9266  1.1  mrg   \DeclareUnicodeCharacter{011A}{\v{E}}
   9267  1.1  mrg   \DeclareUnicodeCharacter{011B}{\v{e}}
   9268  1.1  mrg   \DeclareUnicodeCharacter{011C}{\^G}
   9269  1.1  mrg   \DeclareUnicodeCharacter{011D}{\^g}
   9270  1.1  mrg   \DeclareUnicodeCharacter{011E}{\u{G}}
   9271  1.1  mrg   \DeclareUnicodeCharacter{011F}{\u{g}}
   9272  1.1  mrg 
   9273  1.1  mrg   \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
   9274  1.1  mrg   \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
   9275  1.1  mrg   \DeclareUnicodeCharacter{0124}{\^H}
   9276  1.1  mrg   \DeclareUnicodeCharacter{0125}{\^h}
   9277  1.1  mrg   \DeclareUnicodeCharacter{0128}{\~I}
   9278  1.1  mrg   \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
   9279  1.1  mrg   \DeclareUnicodeCharacter{012A}{\=I}
   9280  1.1  mrg   \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
   9281  1.1  mrg   \DeclareUnicodeCharacter{012C}{\u{I}}
   9282  1.1  mrg   \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
   9283  1.1  mrg 
   9284  1.1  mrg   \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
   9285  1.1  mrg   \DeclareUnicodeCharacter{0131}{\dotless{i}}
   9286  1.1  mrg   \DeclareUnicodeCharacter{0132}{IJ}
   9287  1.1  mrg   \DeclareUnicodeCharacter{0133}{ij}
   9288  1.1  mrg   \DeclareUnicodeCharacter{0134}{\^J}
   9289  1.1  mrg   \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
   9290  1.1  mrg   \DeclareUnicodeCharacter{0139}{\'L}
   9291  1.1  mrg   \DeclareUnicodeCharacter{013A}{\'l}
   9292  1.1  mrg 
   9293  1.1  mrg   \DeclareUnicodeCharacter{0141}{\L}
   9294  1.1  mrg   \DeclareUnicodeCharacter{0142}{\l}
   9295  1.1  mrg   \DeclareUnicodeCharacter{0143}{\'N}
   9296  1.1  mrg   \DeclareUnicodeCharacter{0144}{\'n}
   9297  1.1  mrg   \DeclareUnicodeCharacter{0147}{\v{N}}
   9298  1.1  mrg   \DeclareUnicodeCharacter{0148}{\v{n}}
   9299  1.1  mrg   \DeclareUnicodeCharacter{014C}{\=O}
   9300  1.1  mrg   \DeclareUnicodeCharacter{014D}{\=o}
   9301  1.1  mrg   \DeclareUnicodeCharacter{014E}{\u{O}}
   9302  1.1  mrg   \DeclareUnicodeCharacter{014F}{\u{o}}
   9303  1.1  mrg 
   9304  1.1  mrg   \DeclareUnicodeCharacter{0150}{\H{O}}
   9305  1.1  mrg   \DeclareUnicodeCharacter{0151}{\H{o}}
   9306  1.1  mrg   \DeclareUnicodeCharacter{0152}{\OE}
   9307  1.1  mrg   \DeclareUnicodeCharacter{0153}{\oe}
   9308  1.1  mrg   \DeclareUnicodeCharacter{0154}{\'R}
   9309  1.1  mrg   \DeclareUnicodeCharacter{0155}{\'r}
   9310  1.1  mrg   \DeclareUnicodeCharacter{0158}{\v{R}}
   9311  1.1  mrg   \DeclareUnicodeCharacter{0159}{\v{r}}
   9312  1.1  mrg   \DeclareUnicodeCharacter{015A}{\'S}
   9313  1.1  mrg   \DeclareUnicodeCharacter{015B}{\'s}
   9314  1.1  mrg   \DeclareUnicodeCharacter{015C}{\^S}
   9315  1.1  mrg   \DeclareUnicodeCharacter{015D}{\^s}
   9316  1.1  mrg   \DeclareUnicodeCharacter{015E}{\cedilla{S}}
   9317  1.1  mrg   \DeclareUnicodeCharacter{015F}{\cedilla{s}}
   9318  1.1  mrg 
   9319  1.1  mrg   \DeclareUnicodeCharacter{0160}{\v{S}}
   9320  1.1  mrg   \DeclareUnicodeCharacter{0161}{\v{s}}
   9321  1.1  mrg   \DeclareUnicodeCharacter{0162}{\cedilla{t}}
   9322  1.1  mrg   \DeclareUnicodeCharacter{0163}{\cedilla{T}}
   9323  1.1  mrg   \DeclareUnicodeCharacter{0164}{\v{T}}
   9324  1.1  mrg 
   9325  1.1  mrg   \DeclareUnicodeCharacter{0168}{\~U}
   9326  1.1  mrg   \DeclareUnicodeCharacter{0169}{\~u}
   9327  1.1  mrg   \DeclareUnicodeCharacter{016A}{\=U}
   9328  1.1  mrg   \DeclareUnicodeCharacter{016B}{\=u}
   9329  1.1  mrg   \DeclareUnicodeCharacter{016C}{\u{U}}
   9330  1.1  mrg   \DeclareUnicodeCharacter{016D}{\u{u}}
   9331  1.1  mrg   \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
   9332  1.1  mrg   \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
   9333  1.1  mrg 
   9334  1.1  mrg   \DeclareUnicodeCharacter{0170}{\H{U}}
   9335  1.1  mrg   \DeclareUnicodeCharacter{0171}{\H{u}}
   9336  1.1  mrg   \DeclareUnicodeCharacter{0174}{\^W}
   9337  1.1  mrg   \DeclareUnicodeCharacter{0175}{\^w}
   9338  1.1  mrg   \DeclareUnicodeCharacter{0176}{\^Y}
   9339  1.1  mrg   \DeclareUnicodeCharacter{0177}{\^y}
   9340  1.1  mrg   \DeclareUnicodeCharacter{0178}{\"Y}
   9341  1.1  mrg   \DeclareUnicodeCharacter{0179}{\'Z}
   9342  1.1  mrg   \DeclareUnicodeCharacter{017A}{\'z}
   9343  1.1  mrg   \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
   9344  1.1  mrg   \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
   9345  1.1  mrg   \DeclareUnicodeCharacter{017D}{\v{Z}}
   9346  1.1  mrg   \DeclareUnicodeCharacter{017E}{\v{z}}
   9347  1.1  mrg 
   9348  1.1  mrg   \DeclareUnicodeCharacter{01C4}{D\v{Z}}
   9349  1.1  mrg   \DeclareUnicodeCharacter{01C5}{D\v{z}}
   9350  1.1  mrg   \DeclareUnicodeCharacter{01C6}{d\v{z}}
   9351  1.1  mrg   \DeclareUnicodeCharacter{01C7}{LJ}
   9352  1.1  mrg   \DeclareUnicodeCharacter{01C8}{Lj}
   9353  1.1  mrg   \DeclareUnicodeCharacter{01C9}{lj}
   9354  1.1  mrg   \DeclareUnicodeCharacter{01CA}{NJ}
   9355  1.1  mrg   \DeclareUnicodeCharacter{01CB}{Nj}
   9356  1.1  mrg   \DeclareUnicodeCharacter{01CC}{nj}
   9357  1.1  mrg   \DeclareUnicodeCharacter{01CD}{\v{A}}
   9358  1.1  mrg   \DeclareUnicodeCharacter{01CE}{\v{a}}
   9359  1.1  mrg   \DeclareUnicodeCharacter{01CF}{\v{I}}
   9360  1.1  mrg 
   9361  1.1  mrg   \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
   9362  1.1  mrg   \DeclareUnicodeCharacter{01D1}{\v{O}}
   9363  1.1  mrg   \DeclareUnicodeCharacter{01D2}{\v{o}}
   9364  1.1  mrg   \DeclareUnicodeCharacter{01D3}{\v{U}}
   9365  1.1  mrg   \DeclareUnicodeCharacter{01D4}{\v{u}}
   9366  1.1  mrg 
   9367  1.1  mrg   \DeclareUnicodeCharacter{01E2}{\={\AE}}
   9368  1.1  mrg   \DeclareUnicodeCharacter{01E3}{\={\ae}}
   9369  1.1  mrg   \DeclareUnicodeCharacter{01E6}{\v{G}}
   9370  1.1  mrg   \DeclareUnicodeCharacter{01E7}{\v{g}}
   9371  1.1  mrg   \DeclareUnicodeCharacter{01E8}{\v{K}}
   9372  1.1  mrg   \DeclareUnicodeCharacter{01E9}{\v{k}}
   9373  1.1  mrg 
   9374  1.1  mrg   \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
   9375  1.1  mrg   \DeclareUnicodeCharacter{01F1}{DZ}
   9376  1.1  mrg   \DeclareUnicodeCharacter{01F2}{Dz}
   9377  1.1  mrg   \DeclareUnicodeCharacter{01F3}{dz}
   9378  1.1  mrg   \DeclareUnicodeCharacter{01F4}{\'G}
   9379  1.1  mrg   \DeclareUnicodeCharacter{01F5}{\'g}
   9380  1.1  mrg   \DeclareUnicodeCharacter{01F8}{\`N}
   9381  1.1  mrg   \DeclareUnicodeCharacter{01F9}{\`n}
   9382  1.1  mrg   \DeclareUnicodeCharacter{01FC}{\'{\AE}}
   9383  1.1  mrg   \DeclareUnicodeCharacter{01FD}{\'{\ae}}
   9384  1.1  mrg   \DeclareUnicodeCharacter{01FE}{\'{\O}}
   9385  1.1  mrg   \DeclareUnicodeCharacter{01FF}{\'{\o}}
   9386  1.1  mrg 
   9387  1.1  mrg   \DeclareUnicodeCharacter{021E}{\v{H}}
   9388  1.1  mrg   \DeclareUnicodeCharacter{021F}{\v{h}}
   9389  1.1  mrg 
   9390  1.1  mrg   \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
   9391  1.1  mrg   \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
   9392  1.1  mrg   \DeclareUnicodeCharacter{0228}{\cedilla{E}}
   9393  1.1  mrg   \DeclareUnicodeCharacter{0229}{\cedilla{e}}
   9394  1.1  mrg   \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
   9395  1.1  mrg   \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
   9396  1.1  mrg 
   9397  1.1  mrg   \DeclareUnicodeCharacter{0232}{\=Y}
   9398  1.1  mrg   \DeclareUnicodeCharacter{0233}{\=y}
   9399  1.1  mrg   \DeclareUnicodeCharacter{0237}{\dotless{j}}
   9400  1.1  mrg 
   9401  1.1  mrg   \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
   9402  1.1  mrg 
   9403  1.1  mrg   \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
   9404  1.1  mrg   \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
   9405  1.1  mrg   \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
   9406  1.1  mrg   \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
   9407  1.1  mrg   \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
   9408  1.1  mrg   \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
   9409  1.1  mrg   \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
   9410  1.1  mrg   \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
   9411  1.1  mrg   \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
   9412  1.1  mrg   \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
   9413  1.1  mrg   \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
   9414  1.1  mrg   \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
   9415  1.1  mrg 
   9416  1.1  mrg   \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
   9417  1.1  mrg   \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
   9418  1.1  mrg 
   9419  1.1  mrg   \DeclareUnicodeCharacter{1E20}{\=G}
   9420  1.1  mrg   \DeclareUnicodeCharacter{1E21}{\=g}
   9421  1.1  mrg   \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
   9422  1.1  mrg   \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
   9423  1.1  mrg   \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
   9424  1.1  mrg   \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
   9425  1.1  mrg   \DeclareUnicodeCharacter{1E26}{\"H}
   9426  1.1  mrg   \DeclareUnicodeCharacter{1E27}{\"h}
   9427  1.1  mrg 
   9428  1.1  mrg   \DeclareUnicodeCharacter{1E30}{\'K}
   9429  1.1  mrg   \DeclareUnicodeCharacter{1E31}{\'k}
   9430  1.1  mrg   \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
   9431  1.1  mrg   \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
   9432  1.1  mrg   \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
   9433  1.1  mrg   \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
   9434  1.1  mrg   \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
   9435  1.1  mrg   \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
   9436  1.1  mrg   \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
   9437  1.1  mrg   \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
   9438  1.1  mrg   \DeclareUnicodeCharacter{1E3E}{\'M}
   9439  1.1  mrg   \DeclareUnicodeCharacter{1E3F}{\'m}
   9440  1.1  mrg 
   9441  1.1  mrg   \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
   9442  1.1  mrg   \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
   9443  1.1  mrg   \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
   9444  1.1  mrg   \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
   9445  1.1  mrg   \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
   9446  1.1  mrg   \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
   9447  1.1  mrg   \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
   9448  1.1  mrg   \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
   9449  1.1  mrg   \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
   9450  1.1  mrg   \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
   9451  1.1  mrg 
   9452  1.1  mrg   \DeclareUnicodeCharacter{1E54}{\'P}
   9453  1.1  mrg   \DeclareUnicodeCharacter{1E55}{\'p}
   9454  1.1  mrg   \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
   9455  1.1  mrg   \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
   9456  1.1  mrg   \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
   9457  1.1  mrg   \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
   9458  1.1  mrg   \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
   9459  1.1  mrg   \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
   9460  1.1  mrg   \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
   9461  1.1  mrg   \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
   9462  1.1  mrg 
   9463  1.1  mrg   \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
   9464  1.1  mrg   \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
   9465  1.1  mrg   \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
   9466  1.1  mrg   \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
   9467  1.1  mrg   \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
   9468  1.1  mrg   \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
   9469  1.1  mrg   \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
   9470  1.1  mrg   \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
   9471  1.1  mrg   \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
   9472  1.1  mrg   \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
   9473  1.1  mrg 
   9474  1.1  mrg   \DeclareUnicodeCharacter{1E7C}{\~V}
   9475  1.1  mrg   \DeclareUnicodeCharacter{1E7D}{\~v}
   9476  1.1  mrg   \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
   9477  1.1  mrg   \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
   9478  1.1  mrg 
   9479  1.1  mrg   \DeclareUnicodeCharacter{1E80}{\`W}
   9480  1.1  mrg   \DeclareUnicodeCharacter{1E81}{\`w}
   9481  1.1  mrg   \DeclareUnicodeCharacter{1E82}{\'W}
   9482  1.1  mrg   \DeclareUnicodeCharacter{1E83}{\'w}
   9483  1.1  mrg   \DeclareUnicodeCharacter{1E84}{\"W}
   9484  1.1  mrg   \DeclareUnicodeCharacter{1E85}{\"w}
   9485  1.1  mrg   \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
   9486  1.1  mrg   \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
   9487  1.1  mrg   \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
   9488  1.1  mrg   \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
   9489  1.1  mrg   \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
   9490  1.1  mrg   \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
   9491  1.1  mrg   \DeclareUnicodeCharacter{1E8C}{\"X}
   9492  1.1  mrg   \DeclareUnicodeCharacter{1E8D}{\"x}
   9493  1.1  mrg   \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
   9494  1.1  mrg   \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
   9495  1.1  mrg 
   9496  1.1  mrg   \DeclareUnicodeCharacter{1E90}{\^Z}
   9497  1.1  mrg   \DeclareUnicodeCharacter{1E91}{\^z}
   9498  1.1  mrg   \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
   9499  1.1  mrg   \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
   9500  1.1  mrg   \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
   9501  1.1  mrg   \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
   9502  1.1  mrg   \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
   9503  1.1  mrg   \DeclareUnicodeCharacter{1E97}{\"t}
   9504  1.1  mrg   \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
   9505  1.1  mrg   \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
   9506  1.1  mrg 
   9507  1.1  mrg   \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
   9508  1.1  mrg   \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
   9509  1.1  mrg 
   9510  1.1  mrg   \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
   9511  1.1  mrg   \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
   9512  1.1  mrg   \DeclareUnicodeCharacter{1EBC}{\~E}
   9513  1.1  mrg   \DeclareUnicodeCharacter{1EBD}{\~e}
   9514  1.1  mrg 
   9515  1.1  mrg   \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
   9516  1.1  mrg   \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
   9517  1.1  mrg   \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
   9518  1.1  mrg   \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
   9519  1.1  mrg 
   9520  1.1  mrg   \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
   9521  1.1  mrg   \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
   9522  1.1  mrg 
   9523  1.1  mrg   \DeclareUnicodeCharacter{1EF2}{\`Y}
   9524  1.1  mrg   \DeclareUnicodeCharacter{1EF3}{\`y}
   9525  1.1  mrg   \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
   9526  1.1  mrg 
   9527  1.1  mrg   \DeclareUnicodeCharacter{1EF8}{\~Y}
   9528  1.1  mrg   \DeclareUnicodeCharacter{1EF9}{\~y}
   9529  1.1  mrg 
   9530  1.1  mrg   \DeclareUnicodeCharacter{2013}{--}
   9531  1.1  mrg   \DeclareUnicodeCharacter{2014}{---}
   9532  1.1  mrg   \DeclareUnicodeCharacter{2018}{\quoteleft}
   9533  1.1  mrg   \DeclareUnicodeCharacter{2019}{\quoteright}
   9534  1.1  mrg   \DeclareUnicodeCharacter{201A}{\quotesinglbase}
   9535  1.1  mrg   \DeclareUnicodeCharacter{201C}{\quotedblleft}
   9536  1.1  mrg   \DeclareUnicodeCharacter{201D}{\quotedblright}
   9537  1.1  mrg   \DeclareUnicodeCharacter{201E}{\quotedblbase}
   9538  1.1  mrg   \DeclareUnicodeCharacter{2022}{\bullet}
   9539  1.1  mrg   \DeclareUnicodeCharacter{2026}{\dots}
   9540  1.1  mrg   \DeclareUnicodeCharacter{2039}{\guilsinglleft}
   9541  1.1  mrg   \DeclareUnicodeCharacter{203A}{\guilsinglright}
   9542  1.1  mrg   \DeclareUnicodeCharacter{20AC}{\euro}
   9543  1.1  mrg 
   9544  1.1  mrg   \DeclareUnicodeCharacter{2192}{\expansion}
   9545  1.1  mrg   \DeclareUnicodeCharacter{21D2}{\result}
   9546  1.1  mrg 
   9547  1.1  mrg   \DeclareUnicodeCharacter{2212}{\minus}
   9548  1.1  mrg   \DeclareUnicodeCharacter{2217}{\point}
   9549  1.1  mrg   \DeclareUnicodeCharacter{2261}{\equiv}
   9550  1.1  mrg }% end of \utfeightchardefs
   9551  1.1  mrg 
   9552  1.1  mrg 
   9553  1.1  mrg % US-ASCII character definitions.
   9554  1.1  mrg \def\asciichardefs{% nothing need be done
   9555  1.1  mrg    \relax
   9556  1.1  mrg }
   9557  1.1  mrg 
   9558  1.1  mrg % Make non-ASCII characters printable again for compatibility with
   9559  1.1  mrg % existing Texinfo documents that may use them, even without declaring a
   9560  1.1  mrg % document encoding.
   9561  1.1  mrg %
   9562  1.1  mrg \setnonasciicharscatcode \other
   9563  1.1  mrg 
   9564  1.1  mrg 
   9565  1.1  mrg \message{formatting,}
   9566  1.1  mrg 
   9567  1.1  mrg \newdimen\defaultparindent \defaultparindent = 15pt
   9568  1.1  mrg 
   9569  1.1  mrg \chapheadingskip = 15pt plus 4pt minus 2pt
   9570  1.1  mrg \secheadingskip = 12pt plus 3pt minus 2pt
   9571  1.1  mrg \subsecheadingskip = 9pt plus 2pt minus 2pt
   9572  1.1  mrg 
   9573  1.1  mrg % Prevent underfull vbox error messages.
   9574  1.1  mrg \vbadness = 10000
   9575  1.1  mrg 
   9576  1.1  mrg % Don't be very finicky about underfull hboxes, either.
   9577  1.1  mrg \hbadness = 6666
   9578  1.1  mrg 
   9579  1.1  mrg % Following George Bush, get rid of widows and orphans.
   9580  1.1  mrg \widowpenalty=10000
   9581  1.1  mrg \clubpenalty=10000
   9582  1.1  mrg 
   9583  1.1  mrg % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
   9584  1.1  mrg % using an old version of TeX, don't do anything.  We want the amount of
   9585  1.1  mrg % stretch added to depend on the line length, hence the dependence on
   9586  1.1  mrg % \hsize.  We call this whenever the paper size is set.
   9587  1.1  mrg %
   9588  1.1  mrg \def\setemergencystretch{%
   9589  1.1  mrg   \ifx\emergencystretch\thisisundefined
   9590  1.1  mrg     % Allow us to assign to \emergencystretch anyway.
   9591  1.1  mrg     \def\emergencystretch{\dimen0}%
   9592  1.1  mrg   \else
   9593  1.1  mrg     \emergencystretch = .15\hsize
   9594  1.1  mrg   \fi
   9595  1.1  mrg }
   9596  1.1  mrg 
   9597  1.1  mrg % Parameters in order: 1) textheight; 2) textwidth;
   9598  1.1  mrg % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
   9599  1.1  mrg % 7) physical page height; 8) physical page width.
   9600  1.1  mrg %
   9601  1.1  mrg % We also call \setleading{\textleading}, so the caller should define
   9602  1.1  mrg % \textleading.  The caller should also set \parskip.
   9603  1.1  mrg %
   9604  1.1  mrg \def\internalpagesizes#1#2#3#4#5#6#7#8{%
   9605  1.1  mrg   \voffset = #3\relax
   9606  1.1  mrg   \topskip = #6\relax
   9607  1.1  mrg   \splittopskip = \topskip
   9608  1.1  mrg   %
   9609  1.1  mrg   \vsize = #1\relax
   9610  1.1  mrg   \advance\vsize by \topskip
   9611  1.1  mrg   \outervsize = \vsize
   9612  1.1  mrg   \advance\outervsize by 2\topandbottommargin
   9613  1.1  mrg   \pageheight = \vsize
   9614  1.1  mrg   %
   9615  1.1  mrg   \hsize = #2\relax
   9616  1.1  mrg   \outerhsize = \hsize
   9617  1.1  mrg   \advance\outerhsize by 0.5in
   9618  1.1  mrg   \pagewidth = \hsize
   9619  1.1  mrg   %
   9620  1.1  mrg   \normaloffset = #4\relax
   9621  1.1  mrg   \bindingoffset = #5\relax
   9622  1.1  mrg   %
   9623  1.1  mrg   \ifpdf
   9624  1.1  mrg     \pdfpageheight #7\relax
   9625  1.1  mrg     \pdfpagewidth #8\relax
   9626  1.1  mrg     % if we don't reset these, they will remain at "1 true in" of
   9627  1.1  mrg     % whatever layout pdftex was dumped with.
   9628  1.1  mrg     \pdfhorigin = 1 true in
   9629  1.1  mrg     \pdfvorigin = 1 true in
   9630  1.1  mrg   \fi
   9631  1.1  mrg   %
   9632  1.1  mrg   \setleading{\textleading}
   9633  1.1  mrg   %
   9634  1.1  mrg   \parindent = \defaultparindent
   9635  1.1  mrg   \setemergencystretch
   9636  1.1  mrg }
   9637  1.1  mrg 
   9638  1.1  mrg % @letterpaper (the default).
   9639  1.1  mrg \def\letterpaper{{\globaldefs = 1
   9640  1.1  mrg   \parskip = 3pt plus 2pt minus 1pt
   9641  1.1  mrg   \textleading = 13.2pt
   9642  1.1  mrg   %
   9643  1.1  mrg   % If page is nothing but text, make it come out even.
   9644  1.1  mrg   \internalpagesizes{607.2pt}{6in}% that's 46 lines
   9645  1.1  mrg                     {\voffset}{.25in}%
   9646  1.1  mrg                     {\bindingoffset}{36pt}%
   9647  1.1  mrg                     {11in}{8.5in}%
   9648  1.1  mrg }}
   9649  1.1  mrg 
   9650  1.1  mrg % Use @smallbook to reset parameters for 7x9.25 trim size.
   9651  1.1  mrg \def\smallbook{{\globaldefs = 1
   9652  1.1  mrg   \parskip = 2pt plus 1pt
   9653  1.1  mrg   \textleading = 12pt
   9654  1.1  mrg   %
   9655  1.1  mrg   \internalpagesizes{7.5in}{5in}%
   9656  1.1  mrg                     {-.2in}{0in}%
   9657  1.1  mrg                     {\bindingoffset}{16pt}%
   9658  1.1  mrg                     {9.25in}{7in}%
   9659  1.1  mrg   %
   9660  1.1  mrg   \lispnarrowing = 0.3in
   9661  1.1  mrg   \tolerance = 700
   9662  1.1  mrg   \hfuzz = 1pt
   9663  1.1  mrg   \contentsrightmargin = 0pt
   9664  1.1  mrg   \defbodyindent = .5cm
   9665  1.1  mrg }}
   9666  1.1  mrg 
   9667  1.1  mrg % Use @smallerbook to reset parameters for 6x9 trim size.
   9668  1.1  mrg % (Just testing, parameters still in flux.)
   9669  1.1  mrg \def\smallerbook{{\globaldefs = 1
   9670  1.1  mrg   \parskip = 1.5pt plus 1pt
   9671  1.1  mrg   \textleading = 12pt
   9672  1.1  mrg   %
   9673  1.1  mrg   \internalpagesizes{7.4in}{4.8in}%
   9674  1.1  mrg                     {-.2in}{-.4in}%
   9675  1.1  mrg                     {0pt}{14pt}%
   9676  1.1  mrg                     {9in}{6in}%
   9677  1.1  mrg   %
   9678  1.1  mrg   \lispnarrowing = 0.25in
   9679  1.1  mrg   \tolerance = 700
   9680  1.1  mrg   \hfuzz = 1pt
   9681  1.1  mrg   \contentsrightmargin = 0pt
   9682  1.1  mrg   \defbodyindent = .4cm
   9683  1.1  mrg }}
   9684  1.1  mrg 
   9685  1.1  mrg % Use @afourpaper to print on European A4 paper.
   9686  1.1  mrg \def\afourpaper{{\globaldefs = 1
   9687  1.1  mrg   \parskip = 3pt plus 2pt minus 1pt
   9688  1.1  mrg   \textleading = 13.2pt
   9689  1.1  mrg   %
   9690  1.1  mrg   % Double-side printing via postscript on Laserjet 4050
   9691  1.1  mrg   % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
   9692  1.1  mrg   % To change the settings for a different printer or situation, adjust
   9693  1.1  mrg   % \normaloffset until the front-side and back-side texts align.  Then
   9694  1.1  mrg   % do the same for \bindingoffset.  You can set these for testing in
   9695  1.1  mrg   % your texinfo source file like this:
   9696  1.1  mrg   % @tex
   9697  1.1  mrg   % \global\normaloffset = -6mm
   9698  1.1  mrg   % \global\bindingoffset = 10mm
   9699  1.1  mrg   % @end tex
   9700  1.1  mrg   \internalpagesizes{673.2pt}{160mm}% that's 51 lines
   9701  1.1  mrg                     {\voffset}{\hoffset}%
   9702  1.1  mrg                     {\bindingoffset}{44pt}%
   9703  1.1  mrg                     {297mm}{210mm}%
   9704  1.1  mrg   %
   9705  1.1  mrg   \tolerance = 700
   9706  1.1  mrg   \hfuzz = 1pt
   9707  1.1  mrg   \contentsrightmargin = 0pt
   9708  1.1  mrg   \defbodyindent = 5mm
   9709  1.1  mrg }}
   9710  1.1  mrg 
   9711  1.1  mrg % Use @afivepaper to print on European A5 paper.
   9712  1.1  mrg % From romildo (a] urano.iceb.ufop.br, 2 July 2000.
   9713  1.1  mrg % He also recommends making @example and @lisp be small.
   9714  1.1  mrg \def\afivepaper{{\globaldefs = 1
   9715  1.1  mrg   \parskip = 2pt plus 1pt minus 0.1pt
   9716  1.1  mrg   \textleading = 12.5pt
   9717  1.1  mrg   %
   9718  1.1  mrg   \internalpagesizes{160mm}{120mm}%
   9719  1.1  mrg                     {\voffset}{\hoffset}%
   9720  1.1  mrg                     {\bindingoffset}{8pt}%
   9721  1.1  mrg                     {210mm}{148mm}%
   9722  1.1  mrg   %
   9723  1.1  mrg   \lispnarrowing = 0.2in
   9724  1.1  mrg   \tolerance = 800
   9725  1.1  mrg   \hfuzz = 1.2pt
   9726  1.1  mrg   \contentsrightmargin = 0pt
   9727  1.1  mrg   \defbodyindent = 2mm
   9728  1.1  mrg   \tableindent = 12mm
   9729  1.1  mrg }}
   9730  1.1  mrg 
   9731  1.1  mrg % A specific text layout, 24x15cm overall, intended for A4 paper.
   9732  1.1  mrg \def\afourlatex{{\globaldefs = 1
   9733  1.1  mrg   \afourpaper
   9734  1.1  mrg   \internalpagesizes{237mm}{150mm}%
   9735  1.1  mrg                     {\voffset}{4.6mm}%
   9736  1.1  mrg                     {\bindingoffset}{7mm}%
   9737  1.1  mrg                     {297mm}{210mm}%
   9738  1.1  mrg   %
   9739  1.1  mrg   % Must explicitly reset to 0 because we call \afourpaper.
   9740  1.1  mrg   \globaldefs = 0
   9741  1.1  mrg }}
   9742  1.1  mrg 
   9743  1.1  mrg % Use @afourwide to print on A4 paper in landscape format.
   9744  1.1  mrg \def\afourwide{{\globaldefs = 1
   9745  1.1  mrg   \afourpaper
   9746  1.1  mrg   \internalpagesizes{241mm}{165mm}%
   9747  1.1  mrg                     {\voffset}{-2.95mm}%
   9748  1.1  mrg                     {\bindingoffset}{7mm}%
   9749  1.1  mrg                     {297mm}{210mm}%
   9750  1.1  mrg   \globaldefs = 0
   9751  1.1  mrg }}
   9752  1.1  mrg 
   9753  1.1  mrg % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
   9754  1.1  mrg % Perhaps we should allow setting the margins, \topskip, \parskip,
   9755  1.1  mrg % and/or leading, also. Or perhaps we should compute them somehow.
   9756  1.1  mrg %
   9757  1.1  mrg \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
   9758  1.1  mrg \def\pagesizesyyy#1,#2,#3\finish{{%
   9759  1.1  mrg   \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
   9760  1.1  mrg   \globaldefs = 1
   9761  1.1  mrg   %
   9762  1.1  mrg   \parskip = 3pt plus 2pt minus 1pt
   9763  1.1  mrg   \setleading{\textleading}%
   9764  1.1  mrg   %
   9765  1.1  mrg   \dimen0 = #1\relax
   9766  1.1  mrg   \advance\dimen0 by \voffset
   9767  1.1  mrg   %
   9768  1.1  mrg   \dimen2 = \hsize
   9769  1.1  mrg   \advance\dimen2 by \normaloffset
   9770  1.1  mrg   %
   9771  1.1  mrg   \internalpagesizes{#1}{\hsize}%
   9772  1.1  mrg                     {\voffset}{\normaloffset}%
   9773  1.1  mrg                     {\bindingoffset}{44pt}%
   9774  1.1  mrg                     {\dimen0}{\dimen2}%
   9775  1.1  mrg }}
   9776  1.1  mrg 
   9777  1.1  mrg % Set default to letter.
   9778  1.1  mrg %
   9779  1.1  mrg \letterpaper
   9780  1.1  mrg 
   9781  1.1  mrg 
   9782  1.1  mrg \message{and turning on texinfo input format.}
   9783  1.1  mrg 
   9784  1.1  mrg \def^^L{\par} % remove \outer, so ^L can appear in an @comment
   9785  1.1  mrg 
   9786  1.1  mrg % DEL is a comment character, in case @c does not suffice.
   9787  1.1  mrg \catcode`\^^? = 14
   9788  1.1  mrg 
   9789  1.1  mrg % Define macros to output various characters with catcode for normal text.
   9790  1.1  mrg \catcode`\"=\other \def\normaldoublequote{"}
   9791  1.1  mrg \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
   9792  1.1  mrg \catcode`\+=\other \def\normalplus{+}
   9793  1.1  mrg \catcode`\<=\other \def\normalless{<}
   9794  1.1  mrg \catcode`\>=\other \def\normalgreater{>}
   9795  1.1  mrg \catcode`\^=\other \def\normalcaret{^}
   9796  1.1  mrg \catcode`\_=\other \def\normalunderscore{_}
   9797  1.1  mrg \catcode`\|=\other \def\normalverticalbar{|}
   9798  1.1  mrg \catcode`\~=\other \def\normaltilde{~}
   9799  1.1  mrg 
   9800  1.1  mrg % This macro is used to make a character print one way in \tt
   9801  1.1  mrg % (where it can probably be output as-is), and another way in other fonts,
   9802  1.1  mrg % where something hairier probably needs to be done.
   9803  1.1  mrg %
   9804  1.1  mrg % #1 is what to print if we are indeed using \tt; #2 is what to print
   9805  1.1  mrg % otherwise.  Since all the Computer Modern typewriter fonts have zero
   9806  1.1  mrg % interword stretch (and shrink), and it is reasonable to expect all
   9807  1.1  mrg % typewriter fonts to have this, we can check that font parameter.
   9808  1.1  mrg %
   9809  1.1  mrg \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
   9810  1.1  mrg 
   9811  1.1  mrg % Same as above, but check for italic font.  Actually this also catches
   9812  1.1  mrg % non-italic slanted fonts since it is impossible to distinguish them from
   9813  1.1  mrg % italic fonts.  But since this is only used by $ and it uses \sl anyway
   9814  1.1  mrg % this is not a problem.
   9815  1.1  mrg \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
   9816  1.1  mrg 
   9817  1.1  mrg % Turn off all special characters except @
   9818  1.1  mrg % (and those which the user can use as if they were ordinary).
   9819  1.1  mrg % Most of these we simply print from the \tt font, but for some, we can
   9820  1.1  mrg % use math or other variants that look better in normal text.
   9821  1.1  mrg 
   9822  1.1  mrg \catcode`\"=\active
   9823  1.1  mrg \def\activedoublequote{{\tt\char34}}
   9824  1.1  mrg \let"=\activedoublequote
   9825  1.1  mrg \catcode`\~=\active
   9826  1.1  mrg \def~{{\tt\char126}}
   9827  1.1  mrg \chardef\hat=`\^
   9828  1.1  mrg \catcode`\^=\active
   9829  1.1  mrg \def^{{\tt \hat}}
   9830  1.1  mrg 
   9831  1.1  mrg \catcode`\_=\active
   9832  1.1  mrg \def_{\ifusingtt\normalunderscore\_}
   9833  1.1  mrg \let\realunder=_
   9834  1.1  mrg % Subroutine for the previous macro.
   9835  1.1  mrg \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
   9836  1.1  mrg 
   9837  1.1  mrg \catcode`\|=\active
   9838  1.1  mrg \def|{{\tt\char124}}
   9839  1.1  mrg \chardef \less=`\<
   9840  1.1  mrg \catcode`\<=\active
   9841  1.1  mrg \def<{{\tt \less}}
   9842  1.1  mrg \chardef \gtr=`\>
   9843  1.1  mrg \catcode`\>=\active
   9844  1.1  mrg \def>{{\tt \gtr}}
   9845  1.1  mrg \catcode`\+=\active
   9846  1.1  mrg \def+{{\tt \char 43}}
   9847  1.1  mrg \catcode`\$=\active
   9848  1.1  mrg \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
   9849  1.1  mrg 
   9850  1.1  mrg % If a .fmt file is being used, characters that might appear in a file
   9851  1.1  mrg % name cannot be active until we have parsed the command line.
   9852  1.1  mrg % So turn them off again, and have \everyjob (or @setfilename) turn them on.
   9853  1.1  mrg % \otherifyactive is called near the end of this file.
   9854  1.1  mrg \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
   9855  1.1  mrg 
   9856  1.1  mrg % Used sometimes to turn off (effectively) the active characters even after
   9857  1.1  mrg % parsing them.
   9858  1.1  mrg \def\turnoffactive{%
   9859  1.1  mrg   \normalturnoffactive
   9860  1.1  mrg   \otherbackslash
   9861  1.1  mrg }
   9862  1.1  mrg 
   9863  1.1  mrg \catcode`\@=0
   9864  1.1  mrg 
   9865  1.1  mrg % \backslashcurfont outputs one backslash character in current font,
   9866  1.1  mrg % as in \char`\\.
   9867  1.1  mrg \global\chardef\backslashcurfont=`\\
   9868  1.1  mrg \global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
   9869  1.1  mrg 
   9870  1.1  mrg % \realbackslash is an actual character `\' with catcode other, and
   9871  1.1  mrg % \doublebackslash is two of them (for the pdf outlines).
   9872  1.1  mrg {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
   9873  1.1  mrg 
   9874  1.1  mrg % In texinfo, backslash is an active character; it prints the backslash
   9875  1.1  mrg % in fixed width font.
   9876  1.1  mrg \catcode`\\=\active  % @ for escape char from now on.
   9877  1.1  mrg 
   9878  1.1  mrg % The story here is that in math mode, the \char of \backslashcurfont
   9879  1.1  mrg % ends up printing the roman \ from the math symbol font (because \char
   9880  1.1  mrg % in math mode uses the \mathcode, and plain.tex sets
   9881  1.1  mrg % \mathcode`\\="026E).  It seems better for @backslashchar{} to always
   9882  1.1  mrg % print a typewriter backslash, hence we use an explicit \mathchar,
   9883  1.1  mrg % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
   9884  1.1  mrg % ignored family value; char position "5C).  We can't use " for the
   9885  1.1  mrg % usual hex value because it has already been made active.
   9886  1.1  mrg @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
   9887  1.1  mrg @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
   9888  1.1  mrg 
   9889  1.1  mrg % On startup, @fixbackslash assigns:
   9890  1.1  mrg %  @let \ = @normalbackslash
   9891  1.1  mrg % \rawbackslash defines an active \ to do \backslashcurfont.
   9892  1.1  mrg % \otherbackslash defines an active \ to be a literal `\' character with
   9893  1.1  mrg % catcode other.  We switch back and forth between these.
   9894  1.1  mrg @gdef@rawbackslash{@let\=@backslashcurfont}
   9895  1.1  mrg @gdef@otherbackslash{@let\=@realbackslash}
   9896  1.1  mrg 
   9897  1.1  mrg % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
   9898  1.1  mrg % the literal character `\'.
   9899  1.1  mrg %
   9900  1.1  mrg @def@normalturnoffactive{%
   9901  1.1  mrg   @let"=@normaldoublequote
   9902  1.1  mrg   @let$=@normaldollar %$ font-lock fix
   9903  1.1  mrg   @let+=@normalplus
   9904  1.1  mrg   @let<=@normalless
   9905  1.1  mrg   @let>=@normalgreater
   9906  1.1  mrg   @let\=@normalbackslash
   9907  1.1  mrg   @let^=@normalcaret
   9908  1.1  mrg   @let_=@normalunderscore
   9909  1.1  mrg   @let|=@normalverticalbar
   9910  1.1  mrg   @let~=@normaltilde
   9911  1.1  mrg   @markupsetuplqdefault
   9912  1.1  mrg   @markupsetuprqdefault
   9913  1.1  mrg   @unsepspaces
   9914  1.1  mrg }
   9915  1.1  mrg 
   9916  1.1  mrg % Make _ and + \other characters, temporarily.
   9917  1.1  mrg % This is canceled by @fixbackslash.
   9918  1.1  mrg @otherifyactive
   9919  1.1  mrg 
   9920  1.1  mrg % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
   9921  1.1  mrg % That is what \eatinput is for; after that, the `\' should revert to printing
   9922  1.1  mrg % a backslash.
   9923  1.1  mrg %
   9924  1.1  mrg @gdef@eatinput input texinfo{@fixbackslash}
   9925  1.1  mrg @global@let\ = @eatinput
   9926  1.1  mrg 
   9927  1.1  mrg % On the other hand, perhaps the file did not have a `\input texinfo'. Then
   9928  1.1  mrg % the first `\' in the file would cause an error. This macro tries to fix
   9929  1.1  mrg % that, assuming it is called before the first `\' could plausibly occur.
   9930  1.1  mrg % Also turn back on active characters that might appear in the input
   9931  1.1  mrg % file name, in case not using a pre-dumped format.
   9932  1.1  mrg %
   9933  1.1  mrg @gdef@fixbackslash{%
   9934  1.1  mrg   @ifx\@eatinput @let\ = @normalbackslash @fi
   9935  1.1  mrg   @catcode`+=@active
   9936  1.1  mrg   @catcode`@_=@active
   9937  1.1  mrg }
   9938  1.1  mrg 
   9939  1.1  mrg % Say @foo, not \foo, in error messages.
   9940  1.1  mrg @escapechar = `@@
   9941  1.1  mrg 
   9942  1.1  mrg % These (along with & and #) are made active for url-breaking, so need
   9943  1.1  mrg % active definitions as the normal characters.
   9944  1.1  mrg @def@normaldot{.}
   9945  1.1  mrg @def@normalquest{?}
   9946  1.1  mrg @def@normalslash{/}
   9947  1.1  mrg 
   9948  1.1  mrg % These look ok in all fonts, so just make them not special.
   9949  1.1  mrg % @hashchar{} gets its own user-level command, because of #line.
   9950  1.1  mrg @catcode`@& = @other @def@normalamp{&}
   9951  1.1  mrg @catcode`@# = @other @def@normalhash{#}
   9952  1.1  mrg @catcode`@% = @other @def@normalpercent{%}
   9953  1.1  mrg 
   9954  1.1  mrg @let @hashchar = @normalhash
   9955  1.1  mrg 
   9956  1.1  mrg @c Finally, make ` and ' active, so that txicodequoteundirected and
   9957  1.1  mrg @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
   9958  1.1  mrg @c don't make ` and ' active, @code will not get them as active chars.
   9959  1.1  mrg @c Do this last of all since we use ` in the previous @catcode assignments.
   9960  1.1  mrg @catcode`@'=@active
   9961  1.1  mrg @catcode`@`=@active
   9962  1.1  mrg @markupsetuplqdefault
   9963  1.1  mrg @markupsetuprqdefault
   9964  1.1  mrg 
   9965  1.1  mrg @c Local variables:
   9966  1.1  mrg @c eval: (add-hook 'write-file-hooks 'time-stamp)
   9967  1.1  mrg @c page-delimiter: "^\\\\message"
   9968  1.1  mrg @c time-stamp-start: "def\\\\texinfoversion{"
   9969  1.1  mrg @c time-stamp-format: "%:y-%02m-%02d.%02H"
   9970  1.1  mrg @c time-stamp-end: "}"
   9971  1.1  mrg @c End:
   9972  1.1  mrg 
   9973  1.1  mrg @c vim:sw=2:
   9974  1.1  mrg 
   9975  1.1  mrg @ignore
   9976  1.1  mrg    arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
   9977  1.1  mrg @end ignore
   9978