OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [doc/] [texinfo.tex] - Diff between revs 19 and 82

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 19 Rev 82
% texinfo.tex -- TeX macros to handle Texinfo files.
% texinfo.tex -- TeX macros to handle Texinfo files.
%
%
% Load plain if necessary, i.e., if running under initex.
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
%
\def\texinfoversion{2007-12-02.17}
\def\texinfoversion{2009-08-14.15}
%
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 2007,
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
% 2007 Free Software Foundation, Inc.
% 2007, 2008, 2009 Free Software Foundation, Inc.
%
%
% This texinfo.tex file is free software: you can redistribute it and/or
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
% modify it under the terms of the GNU General Public License as
% published by the Free Software Foundation, either version 3 of the
% published by the Free Software Foundation, either version 3 of the
% License, or (at your option) any later version.
% License, or (at your option) any later version.
%
%
% This texinfo.tex file is distributed in the hope that it will be
% This texinfo.tex file is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% General Public License for more details.
% General Public License for more details.
%
%
% You should have received a copy of the GNU General Public License
% You should have received a copy of the GNU General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
%
% As a special exception, when this file is read by TeX when processing
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
% a Texinfo source document, you may use the result without
% restriction.  (This has been our intent since Texinfo was invented.)
% restriction.  (This has been our intent since Texinfo was invented.)
%
%
% Please try the latest version of texinfo.tex before submitting bug
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% reports; you can get the latest version from:
%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
%   ftp://tug.org/tex/texinfo.tex
%   ftp://tug.org/tex/texinfo.tex
%     (and all CTAN mirrors, see http://www.ctan.org).
%     (and all CTAN mirrors, see http://www.ctan.org).
% The texinfo.tex in any given distribution could well be out
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
% of date, so if that's what you're using, please check.
%
%
% Send bug reports to bug-texinfo@gnu.org.  Please include including a
% Send bug reports to bug-texinfo@gnu.org.  Please include including a
% complete document in each bug report with which we can reproduce the
% complete document in each bug report with which we can reproduce the
% problem.  Patches are, of course, greatly appreciated.
% problem.  Patches are, of course, greatly appreciated.
%
%
% To process a Texinfo manual with TeX, it's most reliable to use the
% To process a Texinfo manual with TeX, it's most reliable to use the
% texi2dvi shell script that comes with the distribution.  For a simple
% texi2dvi shell script that comes with the distribution.  For a simple
% manual foo.texi, however, you can get away with this:
% manual foo.texi, however, you can get away with this:
%   tex foo.texi
%   tex foo.texi
%   texindex foo.??
%   texindex foo.??
%   tex foo.texi
%   tex foo.texi
%   tex foo.texi
%   tex foo.texi
%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
% The extra TeX runs get the cross-reference information correct.
% The extra TeX runs get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
% than two; texi2dvi does it as many times as necessary.
%
%
% It is possible to adapt texinfo.tex for other languages, to some
% It is possible to adapt texinfo.tex for other languages, to some
% extent.  You can get the existing language-specific files from the
% extent.  You can get the existing language-specific files from the
% full Texinfo distribution.
% full Texinfo distribution.
%
%
% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
 
 
 
 
\message{Loading texinfo [version \texinfoversion]:}
\message{Loading texinfo [version \texinfoversion]:}
 
 
% If in a .fmt file, print the version number
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
% they might have appeared in the input file name.
\everyjob{\message{[Texinfo version \texinfoversion]}%
\everyjob{\message{[Texinfo version \texinfoversion]}%
  \catcode`+=\active \catcode`\_=\active}
  \catcode`+=\active \catcode`\_=\active}
 
 
 
 
\chardef\other=12
\chardef\other=12
 
 
% We never want plain's \outer definition of \+ in Texinfo.
% We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign.
% For @tex, we can use \tabalign.
\let\+ = \relax
\let\+ = \relax
 
 
% Save some plain tex macros whose names we will redefine.
% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexbullet=\bullet
\let\ptexc=\c
\let\ptexc=\c
\let\ptexcomma=\,
\let\ptexcomma=\,
\let\ptexdot=\.
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexdots=\dots
\let\ptexend=\end
\let\ptexend=\end
\let\ptexequiv=\equiv
\let\ptexequiv=\equiv
\let\ptexexclam=\!
\let\ptexexclam=\!
\let\ptexfootnote=\footnote
\let\ptexfootnote=\footnote
\let\ptexgtr=>
\let\ptexgtr=>
\let\ptexhat=^
\let\ptexhat=^
\let\ptexi=\i
\let\ptexi=\i
\let\ptexindent=\indent
\let\ptexindent=\indent
\let\ptexinsert=\insert
\let\ptexinsert=\insert
\let\ptexlbrace=\{
\let\ptexlbrace=\{
\let\ptexless=<
\let\ptexless=<
\let\ptexnewwrite\newwrite
\let\ptexnewwrite\newwrite
\let\ptexnoindent=\noindent
\let\ptexnoindent=\noindent
\let\ptexplus=+
\let\ptexplus=+
\let\ptexrbrace=\}
\let\ptexrbrace=\}
\let\ptexslash=\/
\let\ptexslash=\/
\let\ptexstar=\*
\let\ptexstar=\*
\let\ptext=\t
\let\ptext=\t
 
\let\ptextop=\top
 
{\catcode`\'=\active
 
\global\let\ptexquoteright'}% Math-mode def from plain.tex.
 
\let\ptexraggedright=\raggedright
 
 
% If this character appears in an error message or help string, it
% If this character appears in an error message or help string, it
% starts a new line in the output.
% starts a new line in the output.
\newlinechar = `^^J
\newlinechar = `^^J
 
 
% Use TeX 3.0's \inputlineno to get the line number, for better error
% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
% messages, but if we're using an old version of TeX, don't do anything.
%
%
\ifx\inputlineno\thisisundefined
\ifx\inputlineno\thisisundefined
  \let\linenumber = \empty % Pre-3.0.
  \let\linenumber = \empty % Pre-3.0.
\else
\else
  \def\linenumber{l.\the\inputlineno:\space}
  \def\linenumber{l.\the\inputlineno:\space}
\fi
\fi
 
 
% Set up fixed words for English if not already set.
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
%
%
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
%
%
\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
 
 
% Since the category of space is not known, we have to be careful.
% Since the category of space is not known, we have to be careful.
\chardef\spacecat = 10
\chardef\spacecat = 10
\def\spaceisspace{\catcode`\ =\spacecat}
\def\spaceisspace{\catcode`\ =\spacecat}
 
 
% sometimes characters are active, so we need control sequences.
% sometimes characters are active, so we need control sequences.
\chardef\colonChar = `\:
\chardef\colonChar = `\:
\chardef\commaChar = `\,
\chardef\commaChar = `\,
\chardef\dashChar  = `\-
\chardef\dashChar  = `\-
\chardef\dotChar   = `\.
\chardef\dotChar   = `\.
\chardef\exclamChar= `\!
\chardef\exclamChar= `\!
\chardef\lquoteChar= `\`
\chardef\lquoteChar= `\`
\chardef\questChar = `\?
\chardef\questChar = `\?
\chardef\rquoteChar= `\'
\chardef\rquoteChar= `\'
\chardef\semiChar  = `\;
\chardef\semiChar  = `\;
\chardef\underChar = `\_
\chardef\underChar = `\_
 
 
% Ignore a token.
% Ignore a token.
%
%
\def\gobble#1{}
\def\gobble#1{}
 
 
% The following is used inside several \edef's.
% The following is used inside several \edef's.
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
 
 
% Hyphenation fixes.
% Hyphenation fixes.
\hyphenation{
\hyphenation{
  Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  ap-pen-dix bit-map bit-maps
  ap-pen-dix bit-map bit-maps
  data-base data-bases eshell fall-ing half-way long-est man-u-script
  data-base data-bases eshell fall-ing half-way long-est man-u-script
  man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  spell-ing spell-ings
  spell-ing spell-ings
  stand-alone strong-est time-stamp time-stamps which-ever white-space
  stand-alone strong-est time-stamp time-stamps which-ever white-space
  wide-spread wrap-around
  wide-spread wrap-around
}
}
 
 
% Margin to add to right of even pages, to left of odd pages.
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
\newdimen\bindingoffset
\newdimen\normaloffset
\newdimen\normaloffset
\newdimen\pagewidth \newdimen\pageheight
\newdimen\pagewidth \newdimen\pageheight
 
 
% For a final copy, take out the rectangles
% For a final copy, take out the rectangles
% that mark overfull boxes (in case you have decided
% that mark overfull boxes (in case you have decided
% that the text looks ok even though it passes the margin).
% that the text looks ok even though it passes the margin).
%
%
\def\finalout{\overfullrule=0pt}
\def\finalout{\overfullrule=0pt}
 
 
% @| inserts a changebar to the left of the current line.  It should
% @| inserts a changebar to the left of the current line.  It should
% surround any changed text.  This approach does *not* work if the
% surround any changed text.  This approach does *not* work if the
% change spans more than two lines of output.  To handle that, we would
% change spans more than two lines of output.  To handle that, we would
% have adopt a much more difficult approach (putting marks into the main
% have adopt a much more difficult approach (putting marks into the main
% vertical list for the beginning and end of each change).
% vertical list for the beginning and end of each change).
%
%
\def\|{%
\def\|{%
  % \vadjust can only be used in horizontal mode.
  % \vadjust can only be used in horizontal mode.
  \leavevmode
  \leavevmode
  %
  %
  % Append this vertical mode material after the current line in the output.
  % Append this vertical mode material after the current line in the output.
  \vadjust{%
  \vadjust{%
    % We want to insert a rule with the height and depth of the current
    % We want to insert a rule with the height and depth of the current
    % leading; that is exactly what \strutbox is supposed to record.
    % leading; that is exactly what \strutbox is supposed to record.
    \vskip-\baselineskip
    \vskip-\baselineskip
    %
    %
    % \vadjust-items are inserted at the left edge of the type.  So
    % \vadjust-items are inserted at the left edge of the type.  So
    % the \llap here moves out into the left-hand margin.
    % the \llap here moves out into the left-hand margin.
    \llap{%
    \llap{%
      %
      %
      % For a thicker or thinner bar, change the `1pt'.
      % For a thicker or thinner bar, change the `1pt'.
      \vrule height\baselineskip width1pt
      \vrule height\baselineskip width1pt
      %
      %
      % This is the space between the bar and the text.
      % This is the space between the bar and the text.
      \hskip 12pt
      \hskip 12pt
    }%
    }%
  }%
  }%
}
}
 
 
% Sometimes it is convenient to have everything in the transcript file
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal.  We don't just call \tracingall here,
% and nothing on the terminal.  We don't just call \tracingall here,
% since that produces some useless output on the terminal.  We also make
% since that produces some useless output on the terminal.  We also make
% some effort to order the tracing commands to reduce output in the log
% some effort to order the tracing commands to reduce output in the log
% file; cf. trace.sty in LaTeX.
% file; cf. trace.sty in LaTeX.
%
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\loggingall{%
\def\loggingall{%
  \tracingstats2
  \tracingstats2
  \tracingpages1
  \tracingpages1
  \tracinglostchars2  % 2 gives us more in etex
  \tracinglostchars2  % 2 gives us more in etex
  \tracingparagraphs1
  \tracingparagraphs1
  \tracingoutput1
  \tracingoutput1
  \tracingmacros2
  \tracingmacros2
  \tracingrestores1
  \tracingrestores1
  \showboxbreadth\maxdimen \showboxdepth\maxdimen
  \showboxbreadth\maxdimen \showboxdepth\maxdimen
  \ifx\eTeXversion\undefined\else % etex gives us more logging
  \ifx\eTeXversion\undefined\else % etex gives us more logging
    \tracingscantokens1
    \tracingscantokens1
    \tracingifs1
    \tracingifs1
    \tracinggroups1
    \tracinggroups1
    \tracingnesting2
    \tracingnesting2
    \tracingassigns1
    \tracingassigns1
  \fi
  \fi
  \tracingcommands3  % 3 gives us more in etex
  \tracingcommands3  % 3 gives us more in etex
  \errorcontextlines16
  \errorcontextlines16
}%
}%
 
 
% add check for \lastpenalty to plain's definitions.  If the last thing
% add check for \lastpenalty to plain's definitions.  If the last thing
% we did was a \nobreak, we don't want to insert more space.
% we did was a \nobreak, we don't want to insert more space.
%
%
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  \removelastskip\penalty-50\smallskip\fi\fi}
  \removelastskip\penalty-50\smallskip\fi\fi}
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  \removelastskip\penalty-100\medskip\fi\fi}
  \removelastskip\penalty-100\medskip\fi\fi}
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  \removelastskip\penalty-200\bigskip\fi\fi}
  \removelastskip\penalty-200\bigskip\fi\fi}
 
 
% For @cropmarks command.
% For @cropmarks command.
% Do @cropmarks to get crop marks.
% Do @cropmarks to get crop marks.
%
%
\newif\ifcropmarks
\newif\ifcropmarks
\let\cropmarks = \cropmarkstrue
\let\cropmarks = \cropmarkstrue
%
%
% Dimensions to add cropmarks at corners.
% Dimensions to add cropmarks at corners.
% Added by P. A. MacKay, 12 Nov. 1986
% Added by P. A. MacKay, 12 Nov. 1986
%
%
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
\newdimen\cornerlong  \cornerlong=1pc
\newdimen\cornerlong  \cornerlong=1pc
\newdimen\cornerthick \cornerthick=.3pt
\newdimen\cornerthick \cornerthick=.3pt
\newdimen\topandbottommargin \topandbottommargin=.75in
\newdimen\topandbottommargin \topandbottommargin=.75in
 
 
% Output a mark which sets \thischapter, \thissection and \thiscolor.
% Output a mark which sets \thischapter, \thissection and \thiscolor.
% We dump everything together because we only have one kind of mark.
% We dump everything together because we only have one kind of mark.
% This works because we only use \botmark / \topmark, not \firstmark.
% This works because we only use \botmark / \topmark, not \firstmark.
%
%
% A mark contains a subexpression of the \ifcase ... \fi construct.
% A mark contains a subexpression of the \ifcase ... \fi construct.
% \get*marks macros below extract the needed part using \ifcase.
% \get*marks macros below extract the needed part using \ifcase.
%
%
% Another complication is to let the user choose whether \thischapter
% Another complication is to let the user choose whether \thischapter
% (\thissection) refers to the chapter (section) in effect at the top
% (\thissection) refers to the chapter (section) in effect at the top
% of a page, or that at the bottom of a page.  The solution is
% of a page, or that at the bottom of a page.  The solution is
% described on page 260 of The TeXbook.  It involves outputting two
% described on page 260 of The TeXbook.  It involves outputting two
% marks for the sectioning macros, one before the section break, and
% marks for the sectioning macros, one before the section break, and
% one after.  I won't pretend I can describe this better than DEK...
% one after.  I won't pretend I can describe this better than DEK...
\def\domark{%
\def\domark{%
  \toks0=\expandafter{\lastchapterdefs}%
  \toks0=\expandafter{\lastchapterdefs}%
  \toks2=\expandafter{\lastsectiondefs}%
  \toks2=\expandafter{\lastsectiondefs}%
  \toks4=\expandafter{\prevchapterdefs}%
  \toks4=\expandafter{\prevchapterdefs}%
  \toks6=\expandafter{\prevsectiondefs}%
  \toks6=\expandafter{\prevsectiondefs}%
  \toks8=\expandafter{\lastcolordefs}%
  \toks8=\expandafter{\lastcolordefs}%
  \mark{%
  \mark{%
                   \the\toks0 \the\toks2
                   \the\toks0 \the\toks2
      \noexpand\or \the\toks4 \the\toks6
      \noexpand\or \the\toks4 \the\toks6
    \noexpand\else \the\toks8
    \noexpand\else \the\toks8
  }%
  }%
}
}
% \topmark doesn't work for the very first chapter (after the title
% \topmark doesn't work for the very first chapter (after the title
% page or the contents), so we use \firstmark there -- this gets us
% page or the contents), so we use \firstmark there -- this gets us
% the mark with the chapter defs, unless the user sneaks in, e.g.,
% the mark with the chapter defs, unless the user sneaks in, e.g.,
% @setcolor (or @url, or @link, etc.) between @contents and the very
% @setcolor (or @url, or @link, etc.) between @contents and the very
% first @chapter.
% first @chapter.
\def\gettopheadingmarks{%
\def\gettopheadingmarks{%
  \ifcase0\topmark\fi
  \ifcase0\topmark\fi
  \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
}
}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
\def\getcolormarks{\ifcase2\topmark\fi}
\def\getcolormarks{\ifcase2\topmark\fi}
 
 
% Avoid "undefined control sequence" errors.
% Avoid "undefined control sequence" errors.
\def\lastchapterdefs{}
\def\lastchapterdefs{}
\def\lastsectiondefs{}
\def\lastsectiondefs{}
\def\prevchapterdefs{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
\def\prevsectiondefs{}
\def\lastcolordefs{}
\def\lastcolordefs{}
 
 
% Main output routine.
% Main output routine.
\chardef\PAGE = 255
\chardef\PAGE = 255
\output = {\onepageout{\pagecontents\PAGE}}
\output = {\onepageout{\pagecontents\PAGE}}
 
 
\newbox\headlinebox
\newbox\headlinebox
\newbox\footlinebox
\newbox\footlinebox
 
 
% \onepageout takes a vbox as an argument.  Note that \pagecontents
% \onepageout takes a vbox as an argument.  Note that \pagecontents
% does insertions, but you have to call it yourself.
% does insertions, but you have to call it yourself.
\def\onepageout#1{%
\def\onepageout#1{%
  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  %
  %
  \ifodd\pageno  \advance\hoffset by \bindingoffset
  \ifodd\pageno  \advance\hoffset by \bindingoffset
  \else \advance\hoffset by -\bindingoffset\fi
  \else \advance\hoffset by -\bindingoffset\fi
  %
  %
  % Do this outside of the \shipout so @code etc. will be expanded in
  % Do this outside of the \shipout so @code etc. will be expanded in
  % the headline as they should be, not taken literally (outputting ''code).
  % the headline as they should be, not taken literally (outputting ''code).
  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  %
  %
  {%
  {%
    % Have to do this stuff outside the \shipout because we want it to
    % Have to do this stuff outside the \shipout because we want it to
    % take effect in \write's, yet the group defined by the \vbox ends
    % take effect in \write's, yet the group defined by the \vbox ends
    % before the \shipout runs.
    % before the \shipout runs.
    %
    %
    \indexdummies         % don't expand commands in the output.
    \indexdummies         % don't expand commands in the output.
    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
               % the page break happens to be in the middle of an example.
               % the page break happens to be in the middle of an example.
               % We don't want .vr (or whatever) entries like this:
               % We don't want .vr (or whatever) entries like this:
               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
               % "\acronym" won't work when it's read back in;
               % "\acronym" won't work when it's read back in;
               % it needs to be
               % it needs to be
               % {\code {{\tt \backslashcurfont }acronym}
               % {\code {{\tt \backslashcurfont }acronym}
    \shipout\vbox{%
    \shipout\vbox{%
      % Do this early so pdf references go to the beginning of the page.
      % Do this early so pdf references go to the beginning of the page.
      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
      %
      %
      \ifcropmarks \vbox to \outervsize\bgroup
      \ifcropmarks \vbox to \outervsize\bgroup
        \hsize = \outerhsize
        \hsize = \outerhsize
        \vskip-\topandbottommargin
        \vskip-\topandbottommargin
        \vtop to0pt{%
        \vtop to0pt{%
          \line{\ewtop\hfil\ewtop}%
          \line{\ewtop\hfil\ewtop}%
          \nointerlineskip
          \nointerlineskip
          \line{%
          \line{%
            \vbox{\moveleft\cornerthick\nstop}%
            \vbox{\moveleft\cornerthick\nstop}%
            \hfill
            \hfill
            \vbox{\moveright\cornerthick\nstop}%
            \vbox{\moveright\cornerthick\nstop}%
          }%
          }%
          \vss}%
          \vss}%
        \vskip\topandbottommargin
        \vskip\topandbottommargin
        \line\bgroup
        \line\bgroup
          \hfil % center the page within the outer (page) hsize.
          \hfil % center the page within the outer (page) hsize.
          \ifodd\pageno\hskip\bindingoffset\fi
          \ifodd\pageno\hskip\bindingoffset\fi
          \vbox\bgroup
          \vbox\bgroup
      \fi
      \fi
      %
      %
      \unvbox\headlinebox
      \unvbox\headlinebox
      \pagebody{#1}%
      \pagebody{#1}%
      \ifdim\ht\footlinebox > 0pt
      \ifdim\ht\footlinebox > 0pt
        % Only leave this space if the footline is nonempty.
        % Only leave this space if the footline is nonempty.
        % (We lessened \vsize for it in \oddfootingyyy.)
        % (We lessened \vsize for it in \oddfootingyyy.)
        % The \baselineskip=24pt in plain's \makefootline has no effect.
        % The \baselineskip=24pt in plain's \makefootline has no effect.
        \vskip 24pt
        \vskip 24pt
        \unvbox\footlinebox
        \unvbox\footlinebox
      \fi
      \fi
      %
      %
      \ifcropmarks
      \ifcropmarks
          \egroup % end of \vbox\bgroup
          \egroup % end of \vbox\bgroup
        \hfil\egroup % end of (centering) \line\bgroup
        \hfil\egroup % end of (centering) \line\bgroup
        \vskip\topandbottommargin plus1fill minus1fill
        \vskip\topandbottommargin plus1fill minus1fill
        \boxmaxdepth = \cornerthick
        \boxmaxdepth = \cornerthick
        \vbox to0pt{\vss
        \vbox to0pt{\vss
          \line{%
          \line{%
            \vbox{\moveleft\cornerthick\nsbot}%
            \vbox{\moveleft\cornerthick\nsbot}%
            \hfill
            \hfill
            \vbox{\moveright\cornerthick\nsbot}%
            \vbox{\moveright\cornerthick\nsbot}%
          }%
          }%
          \nointerlineskip
          \nointerlineskip
          \line{\ewbot\hfil\ewbot}%
          \line{\ewbot\hfil\ewbot}%
        }%
        }%
      \egroup % \vbox from first cropmarks clause
      \egroup % \vbox from first cropmarks clause
      \fi
      \fi
    }% end of \shipout\vbox
    }% end of \shipout\vbox
  }% end of group with \indexdummies
  }% end of group with \indexdummies
  \advancepageno
  \advancepageno
  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
}
 
 
\newinsert\margin \dimen\margin=\maxdimen
\newinsert\margin \dimen\margin=\maxdimen
 
 
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
% marginal hacks, juha@viisa.uucp (Juha Takala)
% marginal hacks, juha@viisa.uucp (Juha Takala)
\ifvoid\margin\else % marginal info is present
\ifvoid\margin\else % marginal info is present
  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
\dimen@=\dp#1\relax \unvbox#1\relax
\dimen@=\dp#1\relax \unvbox#1\relax
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
}
 
 
% Here are the rules for the cropmarks.  Note that they are
% Here are the rules for the cropmarks.  Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
% (P. A. MacKay, 12 November, 1986)
%
%
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
\def\nstop{\vbox
\def\nstop{\vbox
  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
\def\nsbot{\vbox
\def\nsbot{\vbox
  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
 
 
% Parse an argument, then pass it to #1.  The argument is the rest of
% Parse an argument, then pass it to #1.  The argument is the rest of
% the input line (except we remove a trailing comment).  #1 should be a
% the input line (except we remove a trailing comment).  #1 should be a
% macro which expects an ordinary undelimited TeX argument.
% macro which expects an ordinary undelimited TeX argument.
%
%
\def\parsearg{\parseargusing{}}
\def\parsearg{\parseargusing{}}
\def\parseargusing#1#2{%
\def\parseargusing#1#2{%
  \def\argtorun{#2}%
  \def\argtorun{#2}%
  \begingroup
  \begingroup
    \obeylines
    \obeylines
    \spaceisspace
    \spaceisspace
    #1%
    #1%
    \parseargline\empty% Insert the \empty token, see \finishparsearg below.
    \parseargline\empty% Insert the \empty token, see \finishparsearg below.
}
}
 
 
{\obeylines %
{\obeylines %
  \gdef\parseargline#1^^M{%
  \gdef\parseargline#1^^M{%
    \endgroup % End of the group started in \parsearg.
    \endgroup % End of the group started in \parsearg.
    \argremovecomment #1\comment\ArgTerm%
    \argremovecomment #1\comment\ArgTerm%
  }%
  }%
}
}
 
 
% First remove any @comment, then any @c comment.
% First remove any @comment, then any @c comment.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
 
 
% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
%
% \argremovec might leave us with trailing space, e.g.,
% \argremovec might leave us with trailing space, e.g.,
%    @end itemize  @c foo
%    @end itemize  @c foo
% This space token undergoes the same procedure and is eventually removed
% This space token undergoes the same procedure and is eventually removed
% by \finishparsearg.
% by \finishparsearg.
%
%
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  \def\temp{#3}%
  \def\temp{#3}%
  \ifx\temp\empty
  \ifx\temp\empty
    % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
    % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
    \let\temp\finishparsearg
    \let\temp\finishparsearg
  \else
  \else
    \let\temp\argcheckspaces
    \let\temp\argcheckspaces
  \fi
  \fi
  % Put the space token in:
  % Put the space token in:
  \temp#1 #3\ArgTerm
  \temp#1 #3\ArgTerm
}
}
 
 
% If a _delimited_ argument is enclosed in braces, they get stripped; so
% If a _delimited_ argument is enclosed in braces, they get stripped; so
% to get _exactly_ the rest of the line, we had to prevent such situation.
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it now,
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \argtorun.
% just before passing the control to \argtorun.
% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
% that a pair of braces would be stripped.
%
%
% But first, we have to remove the trailing space token.
% But first, we have to remove the trailing space token.
%
%
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
 
 
% \parseargdef\foo{...}
% \parseargdef\foo{...}
%       is roughly equivalent to
%       is roughly equivalent to
% \def\foo{\parsearg\Xfoo}
% \def\foo{\parsearg\Xfoo}
% \def\Xfoo#1{...}
% \def\Xfoo#1{...}
%
%
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
% favourite TeX trick.  --kasal, 16nov03
% favourite TeX trick.  --kasal, 16nov03
 
 
\def\parseargdef#1{%
\def\parseargdef#1{%
  \expandafter \doparseargdef \csname\string#1\endcsname #1%
  \expandafter \doparseargdef \csname\string#1\endcsname #1%
}
}
\def\doparseargdef#1#2{%
\def\doparseargdef#1#2{%
  \def#2{\parsearg#1}%
  \def#2{\parsearg#1}%
  \def#1##1%
  \def#1##1%
}
}
 
 
% Several utility definitions with active space:
% Several utility definitions with active space:
{
{
  \obeyspaces
  \obeyspaces
  \gdef\obeyedspace{ }
  \gdef\obeyedspace{ }
 
 
  % Make each space character in the input produce a normal interword
  % Make each space character in the input produce a normal interword
  % space in the output.  Don't allow a line break at this space, as this
  % space in the output.  Don't allow a line break at this space, as this
  % is used only in environments like @example, where each line of input
  % is used only in environments like @example, where each line of input
  % should produce a line of output anyway.
  % should produce a line of output anyway.
  %
  %
  \gdef\sepspaces{\obeyspaces\let =\tie}
  \gdef\sepspaces{\obeyspaces\let =\tie}
 
 
  % If an index command is used in an @example environment, any spaces
  % If an index command is used in an @example environment, any spaces
  % therein should become regular spaces in the raw index file, not the
  % therein should become regular spaces in the raw index file, not the
  % expansion of \tie (\leavevmode \penalty \@M \ ).
  % expansion of \tie (\leavevmode \penalty \@M \ ).
  \gdef\unsepspaces{\let =\space}
  \gdef\unsepspaces{\let =\space}
}
}
 
 
 
 
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
 
 
% Define the framework for environments in texinfo.tex.  It's used like this:
% Define the framework for environments in texinfo.tex.  It's used like this:
%
%
%   \envdef\foo{...}
%   \envdef\foo{...}
%   \def\Efoo{...}
%   \def\Efoo{...}
%
%
% It's the responsibility of \envdef to insert \begingroup before the
% It's the responsibility of \envdef to insert \begingroup before the
% actual body; @end closes the group after calling \Efoo.  \envdef also
% actual body; @end closes the group after calling \Efoo.  \envdef also
% defines \thisenv, so the current environment is known; @end checks
% defines \thisenv, so the current environment is known; @end checks
% whether the environment name matches.  The \checkenv macro can also be
% whether the environment name matches.  The \checkenv macro can also be
% used to check whether the current environment is the one expected.
% used to check whether the current environment is the one expected.
%
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
% are not treated as enviroments; they don't open a group.  (The
% are not treated as environments; they don't open a group.  (The
% implementation of @end takes care not to call \endgroup in this
% implementation of @end takes care not to call \endgroup in this
% special case.)
% special case.)
 
 
 
 
% At runtime, environments start with this:
% At run-time, environments start with this:
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
% initialize
% initialize
\let\thisenv\empty
\let\thisenv\empty
 
 
% ... but they get defined via ``\envdef\foo{...}'':
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
 
 
% Check whether we're in the right environment:
% Check whether we're in the right environment:
\def\checkenv#1{%
\def\checkenv#1{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\thisenv\temp
  \ifx\thisenv\temp
  \else
  \else
    \badenverr
    \badenverr
  \fi
  \fi
}
}
 
 
% Evironment mismatch, #1 expected:
% Environment mismatch, #1 expected:
\def\badenverr{%
\def\badenverr{%
  \errhelp = \EMsimple
  \errhelp = \EMsimple
  \errmessage{This command can appear only \inenvironment\temp,
  \errmessage{This command can appear only \inenvironment\temp,
    not \inenvironment\thisenv}%
    not \inenvironment\thisenv}%
}
}
\def\inenvironment#1{%
\def\inenvironment#1{%
  \ifx#1\empty
  \ifx#1\empty
    out of any environment%
    out of any environment%
  \else
  \else
    in environment \expandafter\string#1%
    in environment \expandafter\string#1%
  \fi
  \fi
}
}
 
 
% @end foo executes the definition of \Efoo.
% @end foo executes the definition of \Efoo.
% But first, it executes a specialized version of \checkenv
% But first, it executes a specialized version of \checkenv
%
%
\parseargdef\end{%
\parseargdef\end{%
  \if 1\csname iscond.#1\endcsname
  \if 1\csname iscond.#1\endcsname
  \else
  \else
    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
    \expandafter\checkenv\csname#1\endcsname
    \expandafter\checkenv\csname#1\endcsname
    \csname E#1\endcsname
    \csname E#1\endcsname
    \endgroup
    \endgroup
  \fi
  \fi
}
}
 
 
\newhelp\EMsimple{Press RETURN to continue.}
\newhelp\EMsimple{Press RETURN to continue.}
 
 
 
 
%% Simple single-character @ commands
%% Simple single-character @ commands
 
 
% @@ prints an @
% @@ prints an @
% Kludge this until the fonts are right (grr).
% Kludge this until the fonts are right (grr).
\def\@{{\tt\char64}}
\def\@{{\tt\char64}}
 
 
% This is turned off because it was never documented
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
% and you can use @w{...} around a quote to suppress ligatures.
%% Define @` and @' to be the same as ` and '
%% Define @` and @' to be the same as ` and '
%% but suppressing ligatures.
%% but suppressing ligatures.
%\def\`{{`}}
%\def\`{{`}}
%\def\'{{'}}
%\def\'{{'}}
 
 
% Used to generate quoted braces.
% Used to generate quoted braces.
\def\mylbrace {{\tt\char123}}
\def\mylbrace {{\tt\char123}}
\def\myrbrace {{\tt\char125}}
\def\myrbrace {{\tt\char125}}
\let\{=\mylbrace
\let\{=\mylbrace
\let\}=\myrbrace
\let\}=\myrbrace
\begingroup
\begingroup
  % Definitions to produce \{ and \} commands for indices,
  % Definitions to produce \{ and \} commands for indices,
  % and @{ and @} for the aux/toc files.
  % and @{ and @} for the aux/toc files.
  \catcode`\{ = \other \catcode`\} = \other
  \catcode`\{ = \other \catcode`\} = \other
  \catcode`\[ = 1 \catcode`\] = 2
  \catcode`\[ = 1 \catcode`\] = 2
  \catcode`\! = 0 \catcode`\\ = \other
  \catcode`\! = 0 \catcode`\\ = \other
  !gdef!lbracecmd[\{]%
  !gdef!lbracecmd[\{]%
  !gdef!rbracecmd[\}]%
  !gdef!rbracecmd[\}]%
  !gdef!lbraceatcmd[@{]%
  !gdef!lbraceatcmd[@{]%
  !gdef!rbraceatcmd[@}]%
  !gdef!rbraceatcmd[@}]%
!endgroup
!endgroup
 
 
% @comma{} to avoid , parsing problems.
% @comma{} to avoid , parsing problems.
\let\comma = ,
\let\comma = ,
 
 
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c
\let\, = \c
\let\dotaccent = \.
\let\dotaccent = \.
\def\ringaccent#1{{\accent23 #1}}
\def\ringaccent#1{{\accent23 #1}}
\let\tieaccent = \t
\let\tieaccent = \t
\let\ubaraccent = \b
\let\ubaraccent = \b
\let\udotaccent = \d
\let\udotaccent = \d
 
 
% Other special characters: @questiondown @exclamdown @ordf @ordm
% Other special characters: @questiondown @exclamdown @ordf @ordm
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\questiondown{?`}
\def\exclamdown{!`}
\def\exclamdown{!`}
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
 
 
% Dotless i and dotless j, used for accents.
% Dotless i and dotless j, used for accents.
\def\imacro{i}
\def\imacro{i}
\def\jmacro{j}
\def\jmacro{j}
\def\dotless#1{%
\def\dotless#1{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\imacro \ptexi
  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  \else\ifx\temp\jmacro \j
  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  \else \errmessage{@dotless can be used only with i or j}%
  \else \errmessage{@dotless can be used only with i or j}%
  \fi\fi
  \fi\fi
}
}
 
 
% The \TeX{} logo, as in plain, but resetting the spacing so that a
% The \TeX{} logo, as in plain, but resetting the spacing so that a
% period following counts as ending a sentence.  (Idea found in latex.)
% period following counts as ending a sentence.  (Idea found in latex.)
%
%
\edef\TeX{\TeX \spacefactor=1000 }
\edef\TeX{\TeX \spacefactor=1000 }
 
 
% @LaTeX{} logo.  Not quite the same results as the definition in
% @LaTeX{} logo.  Not quite the same results as the definition in
% latex.ltx, since we use a different font for the raised A; it's most
% latex.ltx, since we use a different font for the raised A; it's most
% convenient for us to use an explicitly smaller font, rather than using
% convenient for us to use an explicitly smaller font, rather than using
% the \scriptstyle font (since we don't reset \scriptstyle and
% the \scriptstyle font (since we don't reset \scriptstyle and
% \scriptscriptstyle).
% \scriptscriptstyle).
%
%
\def\LaTeX{%
\def\LaTeX{%
  L\kern-.36em
  L\kern-.36em
  {\setbox0=\hbox{T}%
  {\setbox0=\hbox{T}%
   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
  \kern-.15em
  \kern-.15em
  \TeX
  \TeX
}
}
 
 
% Be sure we're in horizontal mode when doing a tie, since we make space
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
{\catcode`@ = 11
 % Avoid using \@M directly, because that causes trouble
 % Avoid using \@M directly, because that causes trouble
 % if the definition is written into an index file.
 % if the definition is written into an index file.
 \global\let\tiepenalty = \@M
 \global\let\tiepenalty = \@M
 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
}
 
 
% @: forces normal size whitespace following.
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
\def\:{\spacefactor=1000 }
 
 
% @* forces a line break.
% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}
\def\*{\hfil\break\hbox{}\ignorespaces}
 
 
% @/ allows a line break.
% @/ allows a line break.
\let\/=\allowbreak
\let\/=\allowbreak
 
 
% @. is an end-of-sentence period.
% @. is an end-of-sentence period.
\def\.{.\spacefactor=\endofsentencespacefactor\space}
\def\.{.\spacefactor=\endofsentencespacefactor\space}
 
 
% @! is an end-of-sentence bang.
% @! is an end-of-sentence bang.
\def\!{!\spacefactor=\endofsentencespacefactor\space}
\def\!{!\spacefactor=\endofsentencespacefactor\space}
 
 
% @? is an end-of-sentence query.
% @? is an end-of-sentence query.
\def\?{?\spacefactor=\endofsentencespacefactor\space}
\def\?{?\spacefactor=\endofsentencespacefactor\space}
 
 
% @frenchspacing on|off  says whether to put extra space after punctuation.
% @frenchspacing on|off  says whether to put extra space after punctuation.
%
%
\def\onword{on}
\def\onword{on}
\def\offword{off}
\def\offword{off}
%
%
\parseargdef\frenchspacing{%
\parseargdef\frenchspacing{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\onword \plainfrenchspacing
  \ifx\temp\onword \plainfrenchspacing
  \else\ifx\temp\offword \plainnonfrenchspacing
  \else\ifx\temp\offword \plainnonfrenchspacing
  \else
  \else
    \errhelp = \EMsimple
    \errhelp = \EMsimple
    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
  \fi\fi
  \fi\fi
}
}
 
 
% @w prevents a word break.  Without the \leavevmode, @w at the
% @w prevents a word break.  Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
% beginning of a paragraph, when TeX is still in vertical mode, would
% produce a whole line of output instead of starting the paragraph.
% produce a whole line of output instead of starting the paragraph.
\def\w#1{\leavevmode\hbox{#1}}
\def\w#1{\leavevmode\hbox{#1}}
 
 
% @group ... @end group forces ... to be all on one page, by enclosing
% @group ... @end group forces ... to be all on one page, by enclosing
% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
% to keep its height that of a normal line.  According to the rules for
% to keep its height that of a normal line.  According to the rules for
% \topskip (p.114 of the TeXbook), the glue inserted is
% \topskip (p.114 of the TeXbook), the glue inserted is
% max (\topskip - \ht (first item), 0).  If that height is large,
% max (\topskip - \ht (first item), 0).  If that height is large,
% therefore, no glue is inserted, and the space between the headline and
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
% the text is small, which looks bad.
%
%
% Another complication is that the group might be very large.  This can
% Another complication is that the group might be very large.  This can
% cause the glue on the previous page to be unduly stretched, because it
% cause the glue on the previous page to be unduly stretched, because it
% does not have much material.  In this case, it's better to add an
% does not have much material.  In this case, it's better to add an
% explicit \vfill so that the extra space is at the bottom.  The
% explicit \vfill so that the extra space is at the bottom.  The
% threshold for doing this is if the group is more than \vfilllimit
% threshold for doing this is if the group is more than \vfilllimit
% percent of a page (\vfilllimit can be changed inside of @tex).
% percent of a page (\vfilllimit can be changed inside of @tex).
%
%
\newbox\groupbox
\newbox\groupbox
\def\vfilllimit{0.7}
\def\vfilllimit{0.7}
%
%
\envdef\group{%
\envdef\group{%
  \ifnum\catcode`\^^M=\active \else
  \ifnum\catcode`\^^M=\active \else
    \errhelp = \groupinvalidhelp
    \errhelp = \groupinvalidhelp
    \errmessage{@group invalid in context where filling is enabled}%
    \errmessage{@group invalid in context where filling is enabled}%
  \fi
  \fi
  \startsavinginserts
  \startsavinginserts
  %
  %
  \setbox\groupbox = \vtop\bgroup
  \setbox\groupbox = \vtop\bgroup
    % Do @comment since we are called inside an environment such as
    % Do @comment since we are called inside an environment such as
    % @example, where each end-of-line in the input causes an
    % @example, where each end-of-line in the input causes an
    % end-of-line in the output.  We don't want the end-of-line after
    % end-of-line in the output.  We don't want the end-of-line after
    % the `@group' to put extra space in the output.  Since @group
    % the `@group' to put extra space in the output.  Since @group
    % should appear on a line by itself (according to the Texinfo
    % should appear on a line by itself (according to the Texinfo
    % manual), we don't worry about eating any user text.
    % manual), we don't worry about eating any user text.
    \comment
    \comment
}
}
%
%
% The \vtop produces a box with normal height and large depth; thus, TeX puts
% The \vtop produces a box with normal height and large depth; thus, TeX puts
% \baselineskip glue before it, and (when the next line of text is done)
% \baselineskip glue before it, and (when the next line of text is done)
% \lineskip glue after it.  Thus, space below is not quite equal to space
% \lineskip glue after it.  Thus, space below is not quite equal to space
% above.  But it's pretty close.
% above.  But it's pretty close.
\def\Egroup{%
\def\Egroup{%
    % To get correct interline space between the last line of the group
    % To get correct interline space between the last line of the group
    % and the first line afterwards, we have to propagate \prevdepth.
    % and the first line afterwards, we have to propagate \prevdepth.
    \endgraf % Not \par, as it may have been set to \lisppar.
    \endgraf % Not \par, as it may have been set to \lisppar.
    \global\dimen1 = \prevdepth
    \global\dimen1 = \prevdepth
  \egroup           % End the \vtop.
  \egroup           % End the \vtop.
  % \dimen0 is the vertical size of the group's box.
  % \dimen0 is the vertical size of the group's box.
  \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
  \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
  % \dimen2 is how much space is left on the page (more or less).
  % \dimen2 is how much space is left on the page (more or less).
  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
  % if the group doesn't fit on the current page, and it's a big big
  % if the group doesn't fit on the current page, and it's a big big
  % group, force a page break.
  % group, force a page break.
  \ifdim \dimen0 > \dimen2
  \ifdim \dimen0 > \dimen2
    \ifdim \pagetotal < \vfilllimit\pageheight
    \ifdim \pagetotal < \vfilllimit\pageheight
      \page
      \page
    \fi
    \fi
  \fi
  \fi
  \box\groupbox
  \box\groupbox
  \prevdepth = \dimen1
  \prevdepth = \dimen1
  \checkinserts
  \checkinserts
}
}
%
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
% message, so this ends up printing `@group can only ...'.
%
%
\newhelp\groupinvalidhelp{%
\newhelp\groupinvalidhelp{%
group can only be used in environments such as @example,^^J%
group can only be used in environments such as @example,^^J%
where each line of input produces a line of output.}
where each line of input produces a line of output.}
 
 
% @need space-in-mils
% @need space-in-mils
% forces a page break if there is not space-in-mils remaining.
% forces a page break if there is not space-in-mils remaining.
 
 
\newdimen\mil  \mil=0.001in
\newdimen\mil  \mil=0.001in
 
 
% Old definition--didn't work.
% Old definition--didn't work.
%\parseargdef\need{\par %
%\parseargdef\need{\par %
%% This method tries to make TeX break the page naturally
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
%{\baselineskip=0pt%
%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
%\prevdepth=-1000pt
%\prevdepth=-1000pt
%}}
%}}
 
 
\parseargdef\need{%
\parseargdef\need{%
  % Ensure vertical mode, so we don't make a big box in the middle of a
  % Ensure vertical mode, so we don't make a big box in the middle of a
  % paragraph.
  % paragraph.
  \par
  \par
  %
  %
  % If the @need value is less than one line space, it's useless.
  % If the @need value is less than one line space, it's useless.
  \dimen0 = #1\mil
  \dimen0 = #1\mil
  \dimen2 = \ht\strutbox
  \dimen2 = \ht\strutbox
  \advance\dimen2 by \dp\strutbox
  \advance\dimen2 by \dp\strutbox
  \ifdim\dimen0 > \dimen2
  \ifdim\dimen0 > \dimen2
    %
    %
    % Do a \strut just to make the height of this box be normal, so the
    % Do a \strut just to make the height of this box be normal, so the
    % normal leading is inserted relative to the preceding line.
    % normal leading is inserted relative to the preceding line.
    % And a page break here is fine.
    % And a page break here is fine.
    \vtop to #1\mil{\strut\vfil}%
    \vtop to #1\mil{\strut\vfil}%
    %
    %
    % TeX does not even consider page breaks if a penalty added to the
    % TeX does not even consider page breaks if a penalty added to the
    % main vertical list is 10000 or more.  But in order to see if the
    % main vertical list is 10000 or more.  But in order to see if the
    % empty box we just added fits on the page, we must make it consider
    % empty box we just added fits on the page, we must make it consider
    % page breaks.  On the other hand, we don't want to actually break the
    % page breaks.  On the other hand, we don't want to actually break the
    % page after the empty box.  So we use a penalty of 9999.
    % page after the empty box.  So we use a penalty of 9999.
    %
    %
    % There is an extremely small chance that TeX will actually break the
    % There is an extremely small chance that TeX will actually break the
    % page at this \penalty, if there are no other feasible breakpoints in
    % page at this \penalty, if there are no other feasible breakpoints in
    % sight.  (If the user is using lots of big @group commands, which
    % sight.  (If the user is using lots of big @group commands, which
    % almost-but-not-quite fill up a page, TeX will have a hard time doing
    % almost-but-not-quite fill up a page, TeX will have a hard time doing
    % good page breaking, for example.)  However, I could not construct an
    % good page breaking, for example.)  However, I could not construct an
    % example where a page broke at this \penalty; if it happens in a real
    % example where a page broke at this \penalty; if it happens in a real
    % document, then we can reconsider our strategy.
    % document, then we can reconsider our strategy.
    \penalty9999
    \penalty9999
    %
    %
    % Back up by the size of the box, whether we did a page break or not.
    % Back up by the size of the box, whether we did a page break or not.
    \kern -#1\mil
    \kern -#1\mil
    %
    %
    % Do not allow a page break right after this kern.
    % Do not allow a page break right after this kern.
    \nobreak
    \nobreak
  \fi
  \fi
}
}
 
 
% @br   forces paragraph break (and is undocumented).
% @br   forces paragraph break (and is undocumented).
 
 
\let\br = \par
\let\br = \par
 
 
% @page forces the start of a new page.
% @page forces the start of a new page.
%
%
\def\page{\par\vfill\supereject}
\def\page{\par\vfill\supereject}
 
 
% @exdent text....
% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin
% outputs text on separate line in roman font, starting at standard page margin
 
 
% This records the amount of indent in the innermost environment.
% This records the amount of indent in the innermost environment.
% That's how much \exdent should take out.
% That's how much \exdent should take out.
\newskip\exdentamount
\newskip\exdentamount
 
 
% This defn is used inside fill environments such as @defun.
% This defn is used inside fill environments such as @defun.
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
 
 
% This defn is used inside nofill environments such as @example.
% This defn is used inside nofill environments such as @example.
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  \leftline{\hskip\leftskip{\rm#1}}}}
  \leftline{\hskip\leftskip{\rm#1}}}}
 
 
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% paragraph.  For more general purposes, use the \margin insertion
% paragraph.  For more general purposes, use the \margin insertion
% class.  WHICH is `l' or `r'.
% class.  WHICH is `l' or `r'.
%
%
\newskip\inmarginspacing \inmarginspacing=1cm
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
\def\strutdepth{\dp\strutbox}
%
%
\def\doinmargin#1#2{\strut\vadjust{%
\def\doinmargin#1#2{\strut\vadjust{%
  \nobreak
  \nobreak
  \kern-\strutdepth
  \kern-\strutdepth
  \vtop to \strutdepth{%
  \vtop to \strutdepth{%
    \baselineskip=\strutdepth
    \baselineskip=\strutdepth
    \vss
    \vss
    % if you have multiple lines of stuff to put here, you'll need to
    % if you have multiple lines of stuff to put here, you'll need to
    % make the vbox yourself of the appropriate size.
    % make the vbox yourself of the appropriate size.
    \ifx#1l%
    \ifx#1l%
      \llap{\ignorespaces #2\hskip\inmarginspacing}%
      \llap{\ignorespaces #2\hskip\inmarginspacing}%
    \else
    \else
      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
    \fi
    \fi
    \null
    \null
  }%
  }%
}}
}}
\def\inleftmargin{\doinmargin l}
\def\inleftmargin{\doinmargin l}
\def\inrightmargin{\doinmargin r}
\def\inrightmargin{\doinmargin r}
%
%
% @inmargin{TEXT [, RIGHT-TEXT]}
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
% else use TEXT for both).
%
%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  \setbox0 = \hbox{\ignorespaces #2}%
  \setbox0 = \hbox{\ignorespaces #2}%
  \ifdim\wd0 > 0pt
  \ifdim\wd0 > 0pt
    \def\lefttext{#1}%  have both texts
    \def\lefttext{#1}%  have both texts
    \def\righttext{#2}%
    \def\righttext{#2}%
  \else
  \else
    \def\lefttext{#1}%  have only one text
    \def\lefttext{#1}%  have only one text
    \def\righttext{#1}%
    \def\righttext{#1}%
  \fi
  \fi
  %
  %
  \ifodd\pageno
  \ifodd\pageno
    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  \else
  \else
    \def\temp{\inleftmargin\lefttext}%
    \def\temp{\inleftmargin\lefttext}%
  \fi
  \fi
  \temp
  \temp
}
}
 
 
% @include file    insert text of that file as input.
% @include FILE -- \input text of FILE.
%
%
\def\include{\parseargusing\filenamecatcodes\includezzz}
\def\include{\parseargusing\filenamecatcodes\includezzz}
\def\includezzz#1{%
\def\includezzz#1{%
  \pushthisfilestack
  \pushthisfilestack
  \def\thisfile{#1}%
  \def\thisfile{#1}%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable  % we want to expand any @value in FILE.
    \def\temp{\input #1 }%
    \turnoffactive        % and allow special characters in the expansion
 
    \indexnofonts         % Allow `@@' and other weird things in file names.
 
    \edef\temp{\noexpand\input #1 }%
 
    %
 
    % This trickery is to read FILE outside of a group, in case it makes
 
    % definitions, etc.
    \expandafter
    \expandafter
  }\temp
  }\temp
  \popthisfilestack
  \popthisfilestack
}
}
\def\filenamecatcodes{%
\def\filenamecatcodes{%
  \catcode`\\=\other
  \catcode`\\=\other
  \catcode`~=\other
  \catcode`~=\other
  \catcode`^=\other
  \catcode`^=\other
  \catcode`_=\other
  \catcode`_=\other
  \catcode`|=\other
  \catcode`|=\other
  \catcode`<=\other
  \catcode`<=\other
  \catcode`>=\other
  \catcode`>=\other
  \catcode`+=\other
  \catcode`+=\other
  \catcode`-=\other
  \catcode`-=\other
 
  \catcode`\`=\other
 
  \catcode`\'=\other
}
}
 
 
\def\pushthisfilestack{%
\def\pushthisfilestack{%
  \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
}
}
\def\pushthisfilestackX{%
\def\pushthisfilestackX{%
  \expandafter\pushthisfilestackY\thisfile\StackTerm
  \expandafter\pushthisfilestackY\thisfile\StackTerm
}
}
\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
}
}
 
 
\def\popthisfilestack{\errthisfilestackempty}
\def\popthisfilestack{\errthisfilestackempty}
\def\errthisfilestackempty{\errmessage{Internal error:
\def\errthisfilestackempty{\errmessage{Internal error:
  the stack of filenames is empty.}}
  the stack of filenames is empty.}}
 
 
\def\thisfile{}
\def\thisfile{}
 
 
% @center line
% @center line
% outputs that line, centered.
% outputs that line, centered.
%
%
\parseargdef\center{%
\parseargdef\center{%
  \ifhmode
  \ifhmode
    \let\next\centerH
    \let\next\centerH
  \else
  \else
    \let\next\centerV
    \let\next\centerV
  \fi
  \fi
  \next{\hfil \ignorespaces#1\unskip \hfil}%
  \next{\hfil \ignorespaces#1\unskip \hfil}%
}
}
\def\centerH#1{%
\def\centerH#1{%
  {%
  {%
    \hfil\break
    \hfil\break
    \advance\hsize by -\leftskip
    \advance\hsize by -\leftskip
    \advance\hsize by -\rightskip
    \advance\hsize by -\rightskip
    \line{#1}%
    \line{#1}%
    \break
    \break
  }%
  }%
}
}
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
 
 
% @sp n   outputs n lines of vertical space
% @sp n   outputs n lines of vertical space
 
 
\parseargdef\sp{\vskip #1\baselineskip}
\parseargdef\sp{\vskip #1\baselineskip}
 
 
% @comment ...line which is ignored...
% @comment ...line which is ignored...
% @c is the same as @comment
% @c is the same as @comment
% @ignore ... @end ignore  is another way to write a comment
% @ignore ... @end ignore  is another way to write a comment
 
 
\def\comment{\begingroup \catcode`\^^M=\other%
\def\comment{\begingroup \catcode`\^^M=\other%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\commentxxx}
\commentxxx}
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
 
 
\let\c=\comment
\let\c=\comment
 
 
% @paragraphindent NCHARS
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
% We'll use ems for NCHARS, close enough.
% NCHARS can also be the word `asis' or `none'.
% NCHARS can also be the word `asis' or `none'.
% We cannot feasibly implement @paragraphindent asis, though.
% We cannot feasibly implement @paragraphindent asis, though.
%
%
\def\asisword{asis} % no translation, these are keywords
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
\def\noneword{none}
%
%
\parseargdef\paragraphindent{%
\parseargdef\paragraphindent{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\asisword
  \ifx\temp\asisword
  \else
  \else
    \ifx\temp\noneword
    \ifx\temp\noneword
      \defaultparindent = 0pt
      \defaultparindent = 0pt
    \else
    \else
      \defaultparindent = #1em
      \defaultparindent = #1em
    \fi
    \fi
  \fi
  \fi
  \parindent = \defaultparindent
  \parindent = \defaultparindent
}
}
 
 
% @exampleindent NCHARS
% @exampleindent NCHARS
% We'll use ems for NCHARS like @paragraphindent.
% We'll use ems for NCHARS like @paragraphindent.
% It seems @exampleindent asis isn't necessary, but
% It seems @exampleindent asis isn't necessary, but
% I preserve it to make it similar to @paragraphindent.
% I preserve it to make it similar to @paragraphindent.
\parseargdef\exampleindent{%
\parseargdef\exampleindent{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\asisword
  \ifx\temp\asisword
  \else
  \else
    \ifx\temp\noneword
    \ifx\temp\noneword
      \lispnarrowing = 0pt
      \lispnarrowing = 0pt
    \else
    \else
      \lispnarrowing = #1em
      \lispnarrowing = #1em
    \fi
    \fi
  \fi
  \fi
}
}
 
 
% @firstparagraphindent WORD
% @firstparagraphindent WORD
% If WORD is `none', then suppress indentation of the first paragraph
% If WORD is `none', then suppress indentation of the first paragraph
% after a section heading.  If WORD is `insert', then do indent at such
% after a section heading.  If WORD is `insert', then do indent at such
% paragraphs.
% paragraphs.
%
%
% The paragraph indentation is suppressed or not by calling
% The paragraph indentation is suppressed or not by calling
% \suppressfirstparagraphindent, which the sectioning commands do.
% \suppressfirstparagraphindent, which the sectioning commands do.
% We switch the definition of this back and forth according to WORD.
% We switch the definition of this back and forth according to WORD.
% By default, we suppress indentation.
% By default, we suppress indentation.
%
%
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
\def\insertword{insert}
\def\insertword{insert}
%
%
\parseargdef\firstparagraphindent{%
\parseargdef\firstparagraphindent{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\noneword
  \ifx\temp\noneword
    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  \else\ifx\temp\insertword
  \else\ifx\temp\insertword
    \let\suppressfirstparagraphindent = \relax
    \let\suppressfirstparagraphindent = \relax
  \else
  \else
    \errhelp = \EMsimple
    \errhelp = \EMsimple
    \errmessage{Unknown @firstparagraphindent option `\temp'}%
    \errmessage{Unknown @firstparagraphindent option `\temp'}%
  \fi\fi
  \fi\fi
}
}
 
 
% Here is how we actually suppress indentation.  Redefine \everypar to
% Here is how we actually suppress indentation.  Redefine \everypar to
% \kern backwards by \parindent, and then reset itself to empty.
% \kern backwards by \parindent, and then reset itself to empty.
%
%
% We also make \indent itself not actually do anything until the next
% We also make \indent itself not actually do anything until the next
% paragraph.
% paragraph.
%
%
\gdef\dosuppressfirstparagraphindent{%
\gdef\dosuppressfirstparagraphindent{%
  \gdef\indent{%
  \gdef\indent{%
    \restorefirstparagraphindent
    \restorefirstparagraphindent
    \indent
    \indent
  }%
  }%
  \gdef\noindent{%
  \gdef\noindent{%
    \restorefirstparagraphindent
    \restorefirstparagraphindent
    \noindent
    \noindent
  }%
  }%
  \global\everypar = {%
  \global\everypar = {%
    \kern -\parindent
    \kern -\parindent
    \restorefirstparagraphindent
    \restorefirstparagraphindent
  }%
  }%
}
}
 
 
\gdef\restorefirstparagraphindent{%
\gdef\restorefirstparagraphindent{%
  \global \let \indent = \ptexindent
  \global \let \indent = \ptexindent
  \global \let \noindent = \ptexnoindent
  \global \let \noindent = \ptexnoindent
  \global \everypar = {}%
  \global \everypar = {}%
}
}
 
 
 
 
% @asis just yields its argument.  Used with @table, for example.
% @asis just yields its argument.  Used with @table, for example.
%
%
\def\asis#1{#1}
\def\asis#1{#1}
 
 
% @math outputs its argument in math mode.
% @math outputs its argument in math mode.
%
%
% One complication: _ usually means subscripts, but it could also mean
% One complication: _ usually means subscripts, but it could also mean
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
% _ active, and distinguish by seeing if the current family is \slfam,
% _ active, and distinguish by seeing if the current family is \slfam,
% which is what @var uses.
% which is what @var uses.
{
{
  \catcode`\_ = \active
  \catcode`\_ = \active
  \gdef\mathunderscore{%
  \gdef\mathunderscore{%
    \catcode`\_=\active
    \catcode`\_=\active
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  }
  }
}
}
% Another complication: we want \\ (and @\) to output a \ character.
% Another complication: we want \\ (and @\) to output a \ character.
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
% this is not advertised and we don't care.  Texinfo does not
% this is not advertised and we don't care.  Texinfo does not
% otherwise define @\.
% otherwise define @\.
%
%
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
%
%
\def\math{%
\def\math{%
  \tex
  \tex
  \mathunderscore
  \mathunderscore
  \let\\ = \mathbackslash
  \let\\ = \mathbackslash
  \mathactive
  \mathactive
 
  % make the texinfo accent commands work in math mode
 
  \let\"=\ddot
 
  \let\'=\acute
 
  \let\==\bar
 
  \let\^=\hat
 
  \let\`=\grave
 
  \let\u=\breve
 
  \let\v=\check
 
  \let\~=\tilde
 
  \let\dotaccent=\dot
  $\finishmath
  $\finishmath
}
}
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
 
 
% Some active characters (such as <) are spaced differently in math.
% Some active characters (such as <) are spaced differently in math.
% We have to reset their definitions in case the @math was an argument
% We have to reset their definitions in case the @math was an argument
% to a command which sets the catcodes (such as @item or @section).
% to a command which sets the catcodes (such as @item or @section).
%
%
{
{
  \catcode`^ = \active
  \catcode`^ = \active
  \catcode`< = \active
  \catcode`< = \active
  \catcode`> = \active
  \catcode`> = \active
  \catcode`+ = \active
  \catcode`+ = \active
 
  \catcode`' = \active
  \gdef\mathactive{%
  \gdef\mathactive{%
    \let^ = \ptexhat
    \let^ = \ptexhat
    \let< = \ptexless
    \let< = \ptexless
    \let> = \ptexgtr
    \let> = \ptexgtr
    \let+ = \ptexplus
    \let+ = \ptexplus
 
    \let' = \ptexquoteright
  }
  }
}
}
 
 
% @bullet and @minus need the same treatment as @math, just above.
% Some math mode symbols.
\def\bullet{$\ptexbullet$}
\def\bullet{$\ptexbullet$}
\def\minus{$-$}
\def\geq{\ifmmode \ge\else $\ge$\fi}
 
\def\leq{\ifmmode \le\else $\le$\fi}
 
\def\minus{\ifmmode -\else $-$\fi}
 
 
% @dots{} outputs an ellipsis using the current font.
% @dots{} outputs an ellipsis using the current font.
% We do .5em per period so that it has the same spacing in the cm
% We do .5em per period so that it has the same spacing in the cm
% typewriter fonts as three actual period characters; on the other hand,
% typewriter fonts as three actual period characters; on the other hand,
% in other typewriter fonts three periods are wider than 1.5em.  So do
% in other typewriter fonts three periods are wider than 1.5em.  So do
% whichever is larger.
% whichever is larger.
%
%
\def\dots{%
\def\dots{%
  \leavevmode
  \leavevmode
  \setbox0=\hbox{...}% get width of three periods
  \setbox0=\hbox{...}% get width of three periods
  \ifdim\wd0 > 1.5em
  \ifdim\wd0 > 1.5em
    \dimen0 = \wd0
    \dimen0 = \wd0
  \else
  \else
    \dimen0 = 1.5em
    \dimen0 = 1.5em
  \fi
  \fi
  \hbox to \dimen0{%
  \hbox to \dimen0{%
    \hskip 0pt plus.25fil
    \hskip 0pt plus.25fil
    .\hskip 0pt plus1fil
    .\hskip 0pt plus1fil
    .\hskip 0pt plus1fil
    .\hskip 0pt plus1fil
    .\hskip 0pt plus.5fil
    .\hskip 0pt plus.5fil
  }%
  }%
}
}
 
 
% @enddots{} is an end-of-sentence ellipsis.
% @enddots{} is an end-of-sentence ellipsis.
%
%
\def\enddots{%
\def\enddots{%
  \dots
  \dots
  \spacefactor=\endofsentencespacefactor
  \spacefactor=\endofsentencespacefactor
}
}
 
 
% @comma{} is so commas can be inserted into text without messing up
% @comma{} is so commas can be inserted into text without messing up
% Texinfo's parsing.
% Texinfo's parsing.
%
%
\let\comma = ,
\let\comma = ,
 
 
% @refill is a no-op.
% @refill is a no-op.
\let\refill=\relax
\let\refill=\relax
 
 
% If working on a large document in chapters, it is convenient to
% If working on a large document in chapters, it is convenient to
% be able to disable indexing, cross-referencing, and contents, for test runs.
% be able to disable indexing, cross-referencing, and contents, for test runs.
% This is done with @novalidate (before @setfilename).
% This is done with @novalidate (before @setfilename).
%
%
\newif\iflinks \linkstrue % by default we want the aux files.
\newif\iflinks \linkstrue % by default we want the aux files.
\let\novalidate = \linksfalse
\let\novalidate = \linksfalse
 
 
% @setfilename is done at the beginning of every texinfo file.
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
\def\setfilename{%
   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
   \iflinks
   \iflinks
     \tryauxfile
     \tryauxfile
     % Open the new aux file.  TeX will close it automatically at exit.
     % Open the new aux file.  TeX will close it automatically at exit.
     \immediate\openout\auxfile=\jobname.aux
     \immediate\openout\auxfile=\jobname.aux
   \fi % \openindices needs to do some work in any case.
   \fi % \openindices needs to do some work in any case.
   \openindices
   \openindices
   \let\setfilename=\comment % Ignore extra @setfilename cmds.
   \let\setfilename=\comment % Ignore extra @setfilename cmds.
   %
   %
   % If texinfo.cnf is present on the system, read it.
   % If texinfo.cnf is present on the system, read it.
   % Useful for site-wide @afourpaper, etc.
   % Useful for site-wide @afourpaper, etc.
   \openin 1 texinfo.cnf
   \openin 1 texinfo.cnf
   \ifeof 1 \else \input texinfo.cnf \fi
   \ifeof 1 \else \input texinfo.cnf \fi
   \closein 1
   \closein 1
   %
   %
   \comment % Ignore the actual filename.
   \comment % Ignore the actual filename.
}
}
 
 
% Called from \setfilename.
% Called from \setfilename.
%
%
\def\openindices{%
\def\openindices{%
  \newindex{cp}%
  \newindex{cp}%
  \newcodeindex{fn}%
  \newcodeindex{fn}%
  \newcodeindex{vr}%
  \newcodeindex{vr}%
  \newcodeindex{tp}%
  \newcodeindex{tp}%
  \newcodeindex{ky}%
  \newcodeindex{ky}%
  \newcodeindex{pg}%
  \newcodeindex{pg}%
}
}
 
 
% @bye.
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
 
 
 
 
\message{pdf,}
\message{pdf,}
% adobe `portable' document format
% adobe `portable' document format
\newcount\tempnum
\newcount\tempnum
\newcount\lnkcount
\newcount\lnkcount
\newtoks\filename
\newtoks\filename
\newcount\filenamelength
\newcount\filenamelength
\newcount\pgn
\newcount\pgn
\newtoks\toksA
\newtoks\toksA
\newtoks\toksB
\newtoks\toksB
\newtoks\toksC
\newtoks\toksC
\newtoks\toksD
\newtoks\toksD
\newbox\boxA
\newbox\boxA
\newcount\countA
\newcount\countA
\newif\ifpdf
\newif\ifpdf
\newif\ifpdfmakepagedest
\newif\ifpdfmakepagedest
 
 
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
% can be set).  So we test for \relax and 0 as well as \undefined,
% can be set).  So we test for \relax and 0 as well as \undefined,
% borrowed from ifpdf.sty.
% borrowed from ifpdf.sty.
\ifx\pdfoutput\undefined
\ifx\pdfoutput\undefined
\else
\else
  \ifx\pdfoutput\relax
  \ifx\pdfoutput\relax
  \else
  \else
    \ifcase\pdfoutput
    \ifcase\pdfoutput
    \else
    \else
      \pdftrue
      \pdftrue
    \fi
    \fi
  \fi
  \fi
\fi
\fi
 
 
% PDF uses PostScript string constants for the names of xref targets,
% PDF uses PostScript string constants for the names of xref targets,
% for display in the outlines, and in other places.  Thus, we have to
% for display in the outlines, and in other places.  Thus, we have to
% double any backslashes.  Otherwise, a name like "\node" will be
% double any backslashes.  Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e.  Not good.
% interpreted as a newline (\n), followed by o, d, e.  Not good.
% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
% (and related messages, the final outcome is that it is up to the TeX
% (and related messages, the final outcome is that it is up to the TeX
% user to double the backslashes and otherwise make the string valid, so
% user to double the backslashes and otherwise make the string valid, so
% that's what we do).
% that's what we do).
 
 
% double active backslashes.
% double active backslashes.
%
%
{\catcode`\@=0 \catcode`\\=\active
{\catcode`\@=0 \catcode`\\=\active
 @gdef@activebackslashdouble{%
 @gdef@activebackslashdouble{%
   @catcode`@\=@active
   @catcode`@\=@active
   @let\=@doublebackslash}
   @let\=@doublebackslash}
}
}
 
 
% To handle parens, we must adopt a different approach, since parens are
% To handle parens, we must adopt a different approach, since parens are
% not active characters.  hyperref.dtx (which has the same problem as
% not active characters.  hyperref.dtx (which has the same problem as
% us) handles it with this amazing macro to replace tokens, with minor
% us) handles it with this amazing macro to replace tokens, with minor
% changes for Texinfo.  It is included here under the GPL by permission
% changes for Texinfo.  It is included here under the GPL by permission
% from the author, Heiko Oberdiek.
% from the author, Heiko Oberdiek.
%
%
% #1 is the tokens to replace.
% #1 is the tokens to replace.
% #2 is the replacement.
% #2 is the replacement.
% #3 is the control sequence with the string.
% #3 is the control sequence with the string.
%
%
\def\HyPsdSubst#1#2#3{%
\def\HyPsdSubst#1#2#3{%
  \def\HyPsdReplace##1#1##2\END{%
  \def\HyPsdReplace##1#1##2\END{%
    ##1%
    ##1%
    \ifx\\##2\\%
    \ifx\\##2\\%
    \else
    \else
      #2%
      #2%
      \HyReturnAfterFi{%
      \HyReturnAfterFi{%
        \HyPsdReplace##2\END
        \HyPsdReplace##2\END
      }%
      }%
    \fi
    \fi
  }%
  }%
  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
}
}
\long\def\HyReturnAfterFi#1\fi{\fi#1}
\long\def\HyReturnAfterFi#1\fi{\fi#1}
 
 
% #1 is a control sequence in which to do the replacements.
% #1 is a control sequence in which to do the replacements.
\def\backslashparens#1{%
\def\backslashparens#1{%
  \xdef#1{#1}% redefine it as its expansion; the definition is simply
  \xdef#1{#1}% redefine it as its expansion; the definition is simply
             % \lastnode when called from \setref -> \pdfmkdest.
             % \lastnode when called from \setref -> \pdfmkdest.
  \HyPsdSubst{(}{\realbackslash(}{#1}%
  \HyPsdSubst{(}{\realbackslash(}{#1}%
  \HyPsdSubst{)}{\realbackslash)}{#1}%
  \HyPsdSubst{)}{\realbackslash)}{#1}%
}
}
 
 
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
with PDF output, and none of those formats could be found.  (.eps cannot
with PDF output, and none of those formats could be found.  (.eps cannot
be supported due to the design of the PDF format; use regular TeX (DVI
be supported due to the design of the PDF format; use regular TeX (DVI
output) for that.)}
output) for that.)}
 
 
\ifpdf
\ifpdf
  %
  %
  % Color manipulation macros based on pdfcolor.tex.
  % Color manipulation macros based on pdfcolor.tex,
  \def\cmykDarkRed{0.28 1 1 0.35}
  % except using rgb instead of cmyk; the latter is said to render as a
  \def\cmykBlack{0 0 0 1}
  % very dark gray on-screen and a very dark halftone in print, instead
 
  % of actual black.
 
  \def\rgbDarkRed{0.50 0.09 0.12}
 
  \def\rgbBlack{0 0 0}
 
  %
 
  % k sets the color for filling (usual text, etc.);
 
  % K sets the color for stroking (thin rules, e.g., normal _'s).
 
  \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
  %
  %
  \def\pdfsetcolor#1{\pdfliteral{#1 k}}
 
  % Set color, and create a mark which defines \thiscolor accordingly,
  % Set color, and create a mark which defines \thiscolor accordingly,
  % so that \makeheadline knows which color to restore.
  % so that \makeheadline knows which color to restore.
  \def\setcolor#1{%
  \def\setcolor#1{%
    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
    \domark
    \domark
    \pdfsetcolor{#1}%
    \pdfsetcolor{#1}%
  }
  }
  %
  %
  \def\maincolor{\cmykBlack}
  \def\maincolor{\rgbBlack}
  \pdfsetcolor{\maincolor}
  \pdfsetcolor{\maincolor}
  \edef\thiscolor{\maincolor}
  \edef\thiscolor{\maincolor}
  \def\lastcolordefs{}
  \def\lastcolordefs{}
  %
  %
  \def\makefootline{%
  \def\makefootline{%
    \baselineskip24pt
    \baselineskip24pt
    \line{\pdfsetcolor{\maincolor}\the\footline}%
    \line{\pdfsetcolor{\maincolor}\the\footline}%
  }
  }
  %
  %
  \def\makeheadline{%
  \def\makeheadline{%
    \vbox to 0pt{%
    \vbox to 0pt{%
      \vskip-22.5pt
      \vskip-22.5pt
      \line{%
      \line{%
        \vbox to8.5pt{}%
        \vbox to8.5pt{}%
        % Extract \thiscolor definition from the marks.
        % Extract \thiscolor definition from the marks.
        \getcolormarks
        \getcolormarks
        % Typeset the headline with \maincolor, then restore the color.
        % Typeset the headline with \maincolor, then restore the color.
        \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
        \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
      }%
      }%
      \vss
      \vss
    }%
    }%
    \nointerlineskip
    \nointerlineskip
  }
  }
  %
  %
  %
  %
  \pdfcatalog{/PageMode /UseOutlines}
  \pdfcatalog{/PageMode /UseOutlines}
  %
  %
  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  \def\dopdfimage#1#2#3{%
  \def\dopdfimage#1#2#3{%
    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
    %
    %
    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
    % others).  Let's try in that order.
    % others).  Let's try in that order.
    \let\pdfimgext=\empty
    \let\pdfimgext=\empty
    \begingroup
    \begingroup
      \openin 1 #1.png \ifeof 1
      \openin 1 #1.png \ifeof 1
        \openin 1 #1.jpg \ifeof 1
        \openin 1 #1.jpg \ifeof 1
          \openin 1 #1.jpeg \ifeof 1
          \openin 1 #1.jpeg \ifeof 1
            \openin 1 #1.JPG \ifeof 1
            \openin 1 #1.JPG \ifeof 1
              \openin 1 #1.pdf \ifeof 1
              \openin 1 #1.pdf \ifeof 1
 
                \openin 1 #1.PDF \ifeof 1
                \errhelp = \nopdfimagehelp
                \errhelp = \nopdfimagehelp
                \errmessage{Could not find image file #1 for pdf}%
                \errmessage{Could not find image file #1 for pdf}%
 
                \else \gdef\pdfimgext{PDF}%
 
                \fi
              \else \gdef\pdfimgext{pdf}%
              \else \gdef\pdfimgext{pdf}%
              \fi
              \fi
            \else \gdef\pdfimgext{JPG}%
            \else \gdef\pdfimgext{JPG}%
            \fi
            \fi
          \else \gdef\pdfimgext{jpeg}%
          \else \gdef\pdfimgext{jpeg}%
          \fi
          \fi
        \else \gdef\pdfimgext{jpg}%
        \else \gdef\pdfimgext{jpg}%
        \fi
        \fi
      \else \gdef\pdfimgext{png}%
      \else \gdef\pdfimgext{png}%
      \fi
      \fi
      \closein 1
      \closein 1
    \endgroup
    \endgroup
    %
    %
    % without \immediate, pdftex seg faults when the same image is
    % without \immediate, ancient pdftex seg faults when the same image is
    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
    \ifnum\pdftexversion < 14
    \ifnum\pdftexversion < 14
      \immediate\pdfimage
      \immediate\pdfimage
    \else
    \else
      \immediate\pdfximage
      \immediate\pdfximage
    \fi
    \fi
      \ifdim \wd0 >0pt width \imagewidth \fi
      \ifdim \wd0 >0pt width \imagewidth \fi
      \ifdim \wd2 >0pt height \imageheight \fi
      \ifdim \wd2 >0pt height \imageheight \fi
      \ifnum\pdftexversion<13
      \ifnum\pdftexversion<13
         #1.\pdfimgext
         #1.\pdfimgext
       \else
       \else
         {#1.\pdfimgext}%
         {#1.\pdfimgext}%
       \fi
       \fi
    \ifnum\pdftexversion < 14 \else
    \ifnum\pdftexversion < 14 \else
      \pdfrefximage \pdflastximage
      \pdfrefximage \pdflastximage
    \fi}
    \fi}
  %
  %
  \def\pdfmkdest#1{{%
  \def\pdfmkdest#1{{%
    % We have to set dummies so commands such as @code, and characters
    % We have to set dummies so commands such as @code, and characters
    % such as \, aren't expanded when present in a section title.
    % such as \, aren't expanded when present in a section title.
    \indexnofonts
    \indexnofonts
    \turnoffactive
    \turnoffactive
    \activebackslashdouble
    \activebackslashdouble
    \makevalueexpandable
    \makevalueexpandable
    \def\pdfdestname{#1}%
    \def\pdfdestname{#1}%
    \backslashparens\pdfdestname
    \backslashparens\pdfdestname
    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  }}
  }}
  %
  %
  % used to mark target names; must be expandable.
  % used to mark target names; must be expandable.
  \def\pdfmkpgn#1{#1}
  \def\pdfmkpgn#1{#1}
  %
  %
  % by default, use a color that is dark enough to print on paper as
  % by default, use a color that is dark enough to print on paper as
  % nearly black, but still distinguishable for online viewing.
  % nearly black, but still distinguishable for online viewing.
  \def\urlcolor{\cmykDarkRed}
  \def\urlcolor{\rgbDarkRed}
  \def\linkcolor{\cmykDarkRed}
  \def\linkcolor{\rgbDarkRed}
  \def\endlink{\setcolor{\maincolor}\pdfendlink}
  \def\endlink{\setcolor{\maincolor}\pdfendlink}
  %
  %
  % Adding outlines to PDF; macros for calculating structure of outlines
  % Adding outlines to PDF; macros for calculating structure of outlines
  % come from Petr Olsak
  % come from Petr Olsak
  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
    \else \csname#1\endcsname \fi}
    \else \csname#1\endcsname \fi}
  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
    \advance\tempnum by 1
    \advance\tempnum by 1
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  %
  %
  % #1 is the section text, which is what will be displayed in the
  % #1 is the section text, which is what will be displayed in the
  % outline by the pdf viewer.  #2 is the pdf expression for the number
  % outline by the pdf viewer.  #2 is the pdf expression for the number
  % of subentries (or empty, for subsubsections).  #3 is the node text,
  % of subentries (or empty, for subsubsections).  #3 is the node text,
  % which might be empty if this toc entry had no corresponding node.
  % which might be empty if this toc entry had no corresponding node.
  % #4 is the page number
  % #4 is the page number
  %
  %
  \def\dopdfoutline#1#2#3#4{%
  \def\dopdfoutline#1#2#3#4{%
    % Generate a link to the node text if that exists; else, use the
    % Generate a link to the node text if that exists; else, use the
    % page number.  We could generate a destination for the section
    % page number.  We could generate a destination for the section
    % text in the case where a section has no node, but it doesn't
    % text in the case where a section has no node, but it doesn't
    % seem worth the trouble, since most documents are normally structured.
    % seem worth the trouble, since most documents are normally structured.
    \def\pdfoutlinedest{#3}%
    \def\pdfoutlinedest{#3}%
    \ifx\pdfoutlinedest\empty
    \ifx\pdfoutlinedest\empty
      \def\pdfoutlinedest{#4}%
      \def\pdfoutlinedest{#4}%
    \else
    \else
      % Doubled backslashes in the name.
      % Doubled backslashes in the name.
      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
       \backslashparens\pdfoutlinedest}%
       \backslashparens\pdfoutlinedest}%
    \fi
    \fi
    %
    %
    % Also double the backslashes in the display string.
    % Also double the backslashes in the display string.
    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
     \backslashparens\pdfoutlinetext}%
     \backslashparens\pdfoutlinetext}%
    %
    %
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  }
  }
  %
  %
  \def\pdfmakeoutlines{%
  \def\pdfmakeoutlines{%
    \begingroup
    \begingroup
      % Thanh's hack / proper braces in bookmarks
      % Thanh's hack / proper braces in bookmarks
      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
      %
      %
      % Read toc silently, to get counts of subentries for \pdfoutline.
      % Read toc silently, to get counts of subentries for \pdfoutline.
      \def\numchapentry##1##2##3##4{%
      \def\numchapentry##1##2##3##4{%
        \def\thischapnum{##2}%
        \def\thischapnum{##2}%
        \def\thissecnum{0}%
        \def\thissecnum{0}%
        \def\thissubsecnum{0}%
        \def\thissubsecnum{0}%
      }%
      }%
      \def\numsecentry##1##2##3##4{%
      \def\numsecentry##1##2##3##4{%
        \advancenumber{chap\thischapnum}%
        \advancenumber{chap\thischapnum}%
        \def\thissecnum{##2}%
        \def\thissecnum{##2}%
        \def\thissubsecnum{0}%
        \def\thissubsecnum{0}%
      }%
      }%
      \def\numsubsecentry##1##2##3##4{%
      \def\numsubsecentry##1##2##3##4{%
        \advancenumber{sec\thissecnum}%
        \advancenumber{sec\thissecnum}%
        \def\thissubsecnum{##2}%
        \def\thissubsecnum{##2}%
      }%
      }%
      \def\numsubsubsecentry##1##2##3##4{%
      \def\numsubsubsecentry##1##2##3##4{%
        \advancenumber{subsec\thissubsecnum}%
        \advancenumber{subsec\thissubsecnum}%
      }%
      }%
      \def\thischapnum{0}%
      \def\thischapnum{0}%
      \def\thissecnum{0}%
      \def\thissecnum{0}%
      \def\thissubsecnum{0}%
      \def\thissubsecnum{0}%
      %
      %
      % use \def rather than \let here because we redefine \chapentry et
      % use \def rather than \let here because we redefine \chapentry et
      % al. a second time, below.
      % al. a second time, below.
      \def\appentry{\numchapentry}%
      \def\appentry{\numchapentry}%
      \def\appsecentry{\numsecentry}%
      \def\appsecentry{\numsecentry}%
      \def\appsubsecentry{\numsubsecentry}%
      \def\appsubsecentry{\numsubsecentry}%
      \def\appsubsubsecentry{\numsubsubsecentry}%
      \def\appsubsubsecentry{\numsubsubsecentry}%
      \def\unnchapentry{\numchapentry}%
      \def\unnchapentry{\numchapentry}%
      \def\unnsecentry{\numsecentry}%
      \def\unnsecentry{\numsecentry}%
      \def\unnsubsecentry{\numsubsecentry}%
      \def\unnsubsecentry{\numsubsecentry}%
      \def\unnsubsubsecentry{\numsubsubsecentry}%
      \def\unnsubsubsecentry{\numsubsubsecentry}%
      \readdatafile{toc}%
      \readdatafile{toc}%
      %
      %
      % Read toc second time, this time actually producing the outlines.
      % Read toc second time, this time actually producing the outlines.
      % The `-' means take the \expnumber as the absolute number of
      % The `-' means take the \expnumber as the absolute number of
      % subentries, which we calculated on our first read of the .toc above.
      % subentries, which we calculated on our first read of the .toc above.
      %
      %
      % We use the node names as the destinations.
      % We use the node names as the destinations.
      \def\numchapentry##1##2##3##4{%
      \def\numchapentry##1##2##3##4{%
        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
      \def\numsecentry##1##2##3##4{%
      \def\numsecentry##1##2##3##4{%
        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
      \def\numsubsecentry##1##2##3##4{%
      \def\numsubsecentry##1##2##3##4{%
        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
      \def\numsubsubsecentry##1##2##3##4{% count is always zero
      \def\numsubsubsecentry##1##2##3##4{% count is always zero
        \dopdfoutline{##1}{}{##3}{##4}}%
        \dopdfoutline{##1}{}{##3}{##4}}%
      %
      %
      % PDF outlines are displayed using system fonts, instead of
      % PDF outlines are displayed using system fonts, instead of
      % document fonts.  Therefore we cannot use special characters,
      % document fonts.  Therefore we cannot use special characters,
      % since the encoding is unknown.  For example, the eogonek from
      % since the encoding is unknown.  For example, the eogonek from
      % Latin 2 (0xea) gets translated to a | character.  Info from
      % Latin 2 (0xea) gets translated to a | character.  Info from
      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
      %
      %
      % xx to do this right, we have to translate 8-bit characters to
      % xx to do this right, we have to translate 8-bit characters to
      % their "best" equivalent, based on the @documentencoding.  Right
      % their "best" equivalent, based on the @documentencoding.  Right
      % now, I guess we'll just let the pdf reader have its way.
      % now, I guess we'll just let the pdf reader have its way.
      \indexnofonts
      \indexnofonts
      \setupdatafile
      \setupdatafile
      \catcode`\\=\active \otherbackslash
      \catcode`\\=\active \otherbackslash
      \input \tocreadfilename
      \input \tocreadfilename
    \endgroup
    \endgroup
  }
  }
  %
  %
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
    \ifx\PP\D\let\nextsp\relax
    \ifx\PP\D\let\nextsp\relax
    \else\let\nextsp\skipspaces
    \else\let\nextsp\skipspaces
      \ifx\p\space\else\addtokens{\filename}{\PP}%
      \ifx\p\space\else\addtokens{\filename}{\PP}%
        \advance\filenamelength by 1
        \advance\filenamelength by 1
      \fi
      \fi
    \fi
    \fi
    \nextsp}
    \nextsp}
  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
  \ifnum\pdftexversion < 14
  \ifnum\pdftexversion < 14
    \let \startlink \pdfannotlink
    \let \startlink \pdfannotlink
  \else
  \else
    \let \startlink \pdfstartlink
    \let \startlink \pdfstartlink
  \fi
  \fi
  % make a live url in pdf output.
  % make a live url in pdf output.
  \def\pdfurl#1{%
  \def\pdfurl#1{%
    \begingroup
    \begingroup
      % it seems we really need yet another set of dummies; have not
      % it seems we really need yet another set of dummies; have not
      % tried to figure out what each command should do in the context
      % tried to figure out what each command should do in the context
      % of @url.  for now, just make @/ a no-op, that's the only one
      % of @url.  for now, just make @/ a no-op, that's the only one
      % people have actually reported a problem with.
      % people have actually reported a problem with.
      %
      %
      \normalturnoffactive
      \normalturnoffactive
      \def\@{@}%
      \def\@{@}%
      \let\/=\empty
      \let\/=\empty
      \makevalueexpandable
      \makevalueexpandable
 
      % do we want to go so far as to use \indexnofonts instead of just
 
      % special-casing \var here?
 
      \def\var##1{##1}%
 
      %
      \leavevmode\setcolor{\urlcolor}%
      \leavevmode\setcolor{\urlcolor}%
      \startlink attr{/Border [0 0 0]}%
      \startlink attr{/Border [0 0 0]}%
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
    \endgroup}
    \endgroup}
  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  \def\maketoks{%
  \def\maketoks{%
    \expandafter\poptoks\the\toksA|ENDTOKS|\relax
    \expandafter\poptoks\the\toksA|ENDTOKS|\relax
    \ifx\first0\adn0
    \ifx\first0\adn0
    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
    \else
    \else
      \ifnum0=\countA\else\makelink\fi
      \ifnum0=\countA\else\makelink\fi
      \ifx\first.\let\next=\done\else
      \ifx\first.\let\next=\done\else
        \let\next=\maketoks
        \let\next=\maketoks
        \addtokens{\toksB}{\the\toksD}
        \addtokens{\toksB}{\the\toksD}
        \ifx\first,\addtokens{\toksB}{\space}\fi
        \ifx\first,\addtokens{\toksB}{\space}\fi
      \fi
      \fi
    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
    \next}
    \next}
  \def\makelink{\addtokens{\toksB}%
  \def\makelink{\addtokens{\toksB}%
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  \def\pdflink#1{%
  \def\pdflink#1{%
    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
    \setcolor{\linkcolor}#1\endlink}
    \setcolor{\linkcolor}#1\endlink}
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\else
\else
 
  % non-pdf mode
  \let\pdfmkdest = \gobble
  \let\pdfmkdest = \gobble
  \let\pdfurl = \gobble
  \let\pdfurl = \gobble
  \let\endlink = \relax
  \let\endlink = \relax
  \let\setcolor = \gobble
  \let\setcolor = \gobble
  \let\pdfsetcolor = \gobble
  \let\pdfsetcolor = \gobble
  \let\pdfmakeoutlines = \relax
  \let\pdfmakeoutlines = \relax
\fi  % \ifx\pdfoutput
\fi  % \ifx\pdfoutput
 
 
 
 
\message{fonts,}
\message{fonts,}
 
 
% Change the current font style to #1, remembering it in \curfontstyle.
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
% italics, not bold italics.
%
%
\def\setfontstyle#1{%
\def\setfontstyle#1{%
  \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  \csname ten#1\endcsname  % change the current font
  \csname ten#1\endcsname  % change the current font
}
}
 
 
% Select #1 fonts with the current style.
% Select #1 fonts with the current style.
%
%
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
 
 
\def\rm{\fam=0 \setfontstyle{rm}}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
 
 
 
% Unfortunately, we have to override this for titles and the like, since
 
% in those cases "rm" is bold.  Sigh.
 
\def\rmisbold{\rm\def\curfontstyle{bf}}
 
 
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
% So we set up a \sf.
\newfam\sffam
\newfam\sffam
\def\sf{\fam=\sffam \setfontstyle{sf}}
\def\sf{\fam=\sffam \setfontstyle{sf}}
\let\li = \sf % Sometimes we call it \li, not \sf.
\let\li = \sf % Sometimes we call it \li, not \sf.
 
 
% We don't need math for this font style.
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
\def\ttsl{\setfontstyle{ttsl}}
 
 
 
 
% Default leading.
% Default leading.
\newdimen\textleading  \textleading = 13.2pt
\newdimen\textleading  \textleading = 13.2pt
 
 
% Set the baselineskip to #1, and the lineskip and strut size
% Set the baselineskip to #1, and the lineskip and strut size
% correspondingly.  There is no deep meaning behind these magic numbers
% correspondingly.  There is no deep meaning behind these magic numbers
% used as factors; they just match (closely enough) what Knuth defined.
% used as factors; they just match (closely enough) what Knuth defined.
%
%
\def\lineskipfactor{.08333}
\def\lineskipfactor{.08333}
\def\strutheightpercent{.70833}
\def\strutheightpercent{.70833}
\def\strutdepthpercent {.29167}
\def\strutdepthpercent {.29167}
%
%
% can get a sort of poor man's double spacing by redefining this.
% can get a sort of poor man's double spacing by redefining this.
\def\baselinefactor{1}
\def\baselinefactor{1}
%
%
\def\setleading#1{%
\def\setleading#1{%
  \dimen0 = #1\relax
  \dimen0 = #1\relax
  \normalbaselineskip = \baselinefactor\dimen0
  \normalbaselineskip = \baselinefactor\dimen0
  \normallineskip = \lineskipfactor\normalbaselineskip
  \normallineskip = \lineskipfactor\normalbaselineskip
  \normalbaselines
  \normalbaselines
  \setbox\strutbox =\hbox{%
  \setbox\strutbox =\hbox{%
    \vrule width0pt height\strutheightpercent\baselineskip
    \vrule width0pt height\strutheightpercent\baselineskip
                    depth \strutdepthpercent \baselineskip
                    depth \strutdepthpercent \baselineskip
  }%
  }%
}
}
 
 
% PDF CMaps.  See also LaTeX's t1.cmap.
% PDF CMaps.  See also LaTeX's t1.cmap.
%
%
% do nothing with this by default.
% do nothing with this by default.
\expandafter\let\csname cmapOT1\endcsname\gobble
\expandafter\let\csname cmapOT1\endcsname\gobble
\expandafter\let\csname cmapOT1IT\endcsname\gobble
\expandafter\let\csname cmapOT1IT\endcsname\gobble
\expandafter\let\csname cmapOT1TT\endcsname\gobble
\expandafter\let\csname cmapOT1TT\endcsname\gobble
 
 
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
% (\pdffontattr was introduced many years ago, but people still run
% (\pdffontattr was introduced many years ago, but people still run
% older pdftex's; it's easy to conditionalize, so we do.)
% older pdftex's; it's easy to conditionalize, so we do.)
\ifpdf \ifx\pdffontattr\undefined \else
\ifpdf \ifx\pdffontattr\undefined \else
  \begingroup
  \begingroup
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1-0)
%%BeginResource: CMap (TeX-OT1-0)
%%Title: (TeX-OT1-0 TeX OT1 0)
%%Title: (TeX-OT1-0 TeX OT1 0)
%%Version: 1.000
%%Version: 1.000
%%EndComments
%%EndComments
/CIDInit /ProcSet findresource begin
/CIDInit /ProcSet findresource begin
12 dict begin
12 dict begin
begincmap
begincmap
/CIDSystemInfo
/CIDSystemInfo
<< /Registry (TeX)
<< /Registry (TeX)
/Ordering (OT1)
/Ordering (OT1)
/Supplement 0
/Supplement 0
>> def
>> def
/CMapName /TeX-OT1-0 def
/CMapName /TeX-OT1-0 def
/CMapType 2 def
/CMapType 2 def
1 begincodespacerange
1 begincodespacerange
<00> <7F>
<00> <7F>
endcodespacerange
endcodespacerange
8 beginbfrange
8 beginbfrange
<00> <01> <0393>
<00> <01> <0393>
<09> <0A> <03A8>
<09> <0A> <03A8>
<23> <26> <0023>
<23> <26> <0023>
<28> <3B> <0028>
<28> <3B> <0028>
<3F> <5B> <003F>
<3F> <5B> <003F>
<5D> <5E> <005D>
<5D> <5E> <005D>
<61> <7A> <0061>
<61> <7A> <0061>
<7B> <7C> <2013>
<7B> <7C> <2013>
endbfrange
endbfrange
40 beginbfchar
40 beginbfchar
<02> <0398>
<02> <0398>
<03> <039B>
<03> <039B>
<04> <039E>
<04> <039E>
<05> <03A0>
<05> <03A0>
<06> <03A3>
<06> <03A3>
<07> <03D2>
<07> <03D2>
<08> <03A6>
<08> <03A6>
<0B> <00660066>
<0B> <00660066>
<0C> <00660069>
<0C> <00660069>
<0D> <0066006C>
<0D> <0066006C>
<0E> <006600660069>
<0E> <006600660069>
<0F> <00660066006C>
<0F> <00660066006C>
<10> <0131>
<10> <0131>
<11> <0237>
<11> <0237>
<12> <0060>
<12> <0060>
<13> <00B4>
<13> <00B4>
<14> <02C7>
<14> <02C7>
<15> <02D8>
<15> <02D8>
<16> <00AF>
<16> <00AF>
<17> <02DA>
<17> <02DA>
<18> <00B8>
<18> <00B8>
<19> <00DF>
<19> <00DF>
<1A> <00E6>
<1A> <00E6>
<1B> <0153>
<1B> <0153>
<1C> <00F8>
<1C> <00F8>
<1D> <00C6>
<1D> <00C6>
<1E> <0152>
<1E> <0152>
<1F> <00D8>
<1F> <00D8>
<21> <0021>
<21> <0021>
<22> <201D>
<22> <201D>
<27> <2019>
<27> <2019>
<3C> <00A1>
<3C> <00A1>
<3D> <003D>
<3D> <003D>
<3E> <00BF>
<3E> <00BF>
<5C> <201C>
<5C> <201C>
<5F> <02D9>
<5F> <02D9>
<60> <2018>
<60> <2018>
<7D> <02DD>
<7D> <02DD>
<7E> <007E>
<7E> <007E>
<7F> <00A8>
<7F> <00A8>
endbfchar
endbfchar
endcmap
endcmap
CMapName currentdict /CMap defineresource pop
CMapName currentdict /CMap defineresource pop
end
end
end
end
%%EndResource
%%EndResource
%%EOF
%%EOF
    }\endgroup
    }\endgroup
  \expandafter\edef\csname cmapOT1\endcsname#1{%
  \expandafter\edef\csname cmapOT1\endcsname#1{%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  }%
  }%
%
%
% \cmapOT1IT
% \cmapOT1IT
  \begingroup
  \begingroup
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1IT-0)
%%BeginResource: CMap (TeX-OT1IT-0)
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
%%Version: 1.000
%%Version: 1.000
%%EndComments
%%EndComments
/CIDInit /ProcSet findresource begin
/CIDInit /ProcSet findresource begin
12 dict begin
12 dict begin
begincmap
begincmap
/CIDSystemInfo
/CIDSystemInfo
<< /Registry (TeX)
<< /Registry (TeX)
/Ordering (OT1IT)
/Ordering (OT1IT)
/Supplement 0
/Supplement 0
>> def
>> def
/CMapName /TeX-OT1IT-0 def
/CMapName /TeX-OT1IT-0 def
/CMapType 2 def
/CMapType 2 def
1 begincodespacerange
1 begincodespacerange
<00> <7F>
<00> <7F>
endcodespacerange
endcodespacerange
8 beginbfrange
8 beginbfrange
<00> <01> <0393>
<00> <01> <0393>
<09> <0A> <03A8>
<09> <0A> <03A8>
<25> <26> <0025>
<25> <26> <0025>
<28> <3B> <0028>
<28> <3B> <0028>
<3F> <5B> <003F>
<3F> <5B> <003F>
<5D> <5E> <005D>
<5D> <5E> <005D>
<61> <7A> <0061>
<61> <7A> <0061>
<7B> <7C> <2013>
<7B> <7C> <2013>
endbfrange
endbfrange
42 beginbfchar
42 beginbfchar
<02> <0398>
<02> <0398>
<03> <039B>
<03> <039B>
<04> <039E>
<04> <039E>
<05> <03A0>
<05> <03A0>
<06> <03A3>
<06> <03A3>
<07> <03D2>
<07> <03D2>
<08> <03A6>
<08> <03A6>
<0B> <00660066>
<0B> <00660066>
<0C> <00660069>
<0C> <00660069>
<0D> <0066006C>
<0D> <0066006C>
<0E> <006600660069>
<0E> <006600660069>
<0F> <00660066006C>
<0F> <00660066006C>
<10> <0131>
<10> <0131>
<11> <0237>
<11> <0237>
<12> <0060>
<12> <0060>
<13> <00B4>
<13> <00B4>
<14> <02C7>
<14> <02C7>
<15> <02D8>
<15> <02D8>
<16> <00AF>
<16> <00AF>
<17> <02DA>
<17> <02DA>
<18> <00B8>
<18> <00B8>
<19> <00DF>
<19> <00DF>
<1A> <00E6>
<1A> <00E6>
<1B> <0153>
<1B> <0153>
<1C> <00F8>
<1C> <00F8>
<1D> <00C6>
<1D> <00C6>
<1E> <0152>
<1E> <0152>
<1F> <00D8>
<1F> <00D8>
<21> <0021>
<21> <0021>
<22> <201D>
<22> <201D>
<23> <0023>
<23> <0023>
<24> <00A3>
<24> <00A3>
<27> <2019>
<27> <2019>
<3C> <00A1>
<3C> <00A1>
<3D> <003D>
<3D> <003D>
<3E> <00BF>
<3E> <00BF>
<5C> <201C>
<5C> <201C>
<5F> <02D9>
<5F> <02D9>
<60> <2018>
<60> <2018>
<7D> <02DD>
<7D> <02DD>
<7E> <007E>
<7E> <007E>
<7F> <00A8>
<7F> <00A8>
endbfchar
endbfchar
endcmap
endcmap
CMapName currentdict /CMap defineresource pop
CMapName currentdict /CMap defineresource pop
end
end
end
end
%%EndResource
%%EndResource
%%EOF
%%EOF
    }\endgroup
    }\endgroup
  \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  \expandafter\edef\csname cmapOT1IT\endcsname#1{%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  }%
  }%
%
%
% \cmapOT1TT
% \cmapOT1TT
  \begingroup
  \begingroup
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1TT-0)
%%BeginResource: CMap (TeX-OT1TT-0)
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
%%Version: 1.000
%%Version: 1.000
%%EndComments
%%EndComments
/CIDInit /ProcSet findresource begin
/CIDInit /ProcSet findresource begin
12 dict begin
12 dict begin
begincmap
begincmap
/CIDSystemInfo
/CIDSystemInfo
<< /Registry (TeX)
<< /Registry (TeX)
/Ordering (OT1TT)
/Ordering (OT1TT)
/Supplement 0
/Supplement 0
>> def
>> def
/CMapName /TeX-OT1TT-0 def
/CMapName /TeX-OT1TT-0 def
/CMapType 2 def
/CMapType 2 def
1 begincodespacerange
1 begincodespacerange
<00> <7F>
<00> <7F>
endcodespacerange
endcodespacerange
5 beginbfrange
5 beginbfrange
<00> <01> <0393>
<00> <01> <0393>
<09> <0A> <03A8>
<09> <0A> <03A8>
<21> <26> <0021>
<21> <26> <0021>
<28> <5F> <0028>
<28> <5F> <0028>
<61> <7E> <0061>
<61> <7E> <0061>
endbfrange
endbfrange
32 beginbfchar
32 beginbfchar
<02> <0398>
<02> <0398>
<03> <039B>
<03> <039B>
<04> <039E>
<04> <039E>
<05> <03A0>
<05> <03A0>
<06> <03A3>
<06> <03A3>
<07> <03D2>
<07> <03D2>
<08> <03A6>
<08> <03A6>
<0B> <2191>
<0B> <2191>
<0C> <2193>
<0C> <2193>
<0D> <0027>
<0D> <0027>
<0E> <00A1>
<0E> <00A1>
<0F> <00BF>
<0F> <00BF>
<10> <0131>
<10> <0131>
<11> <0237>
<11> <0237>
<12> <0060>
<12> <0060>
<13> <00B4>
<13> <00B4>
<14> <02C7>
<14> <02C7>
<15> <02D8>
<15> <02D8>
<16> <00AF>
<16> <00AF>
<17> <02DA>
<17> <02DA>
<18> <00B8>
<18> <00B8>
<19> <00DF>
<19> <00DF>
<1A> <00E6>
<1A> <00E6>
<1B> <0153>
<1B> <0153>
<1C> <00F8>
<1C> <00F8>
<1D> <00C6>
<1D> <00C6>
<1E> <0152>
<1E> <0152>
<1F> <00D8>
<1F> <00D8>
<20> <2423>
<20> <2423>
<27> <2019>
<27> <2019>
<60> <2018>
<60> <2018>
<7F> <00A8>
<7F> <00A8>
endbfchar
endbfchar
endcmap
endcmap
CMapName currentdict /CMap defineresource pop
CMapName currentdict /CMap defineresource pop
end
end
end
end
%%EndResource
%%EndResource
%%EOF
%%EOF
    }\endgroup
    }\endgroup
  \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  \expandafter\edef\csname cmapOT1TT\endcsname#1{%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  }%
  }%
\fi\fi
\fi\fi
 
 
 
 
% Set the font macro #1 to the font named #2, adding on the
% Set the font macro #1 to the font named #2, adding on the
% specified font prefix (normally `cm').
% specified font prefix (normally `cm').
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
% empty to omit).
% empty to omit).
\def\setfont#1#2#3#4#5{%
\def\setfont#1#2#3#4#5{%
  \font#1=\fontprefix#2#3 scaled #4
  \font#1=\fontprefix#2#3 scaled #4
  \csname cmap#5\endcsname#1%
  \csname cmap#5\endcsname#1%
}
}
% This is what gets called when #5 of \setfont is empty.
% This is what gets called when #5 of \setfont is empty.
\let\cmap\gobble
\let\cmap\gobble
% emacs-page end of cmaps
% emacs-page end of cmaps
 
 
% Use cm as the default font prefix.
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
% To specify the font prefix, you must define \fontprefix
% before you read in texinfo.tex.
% before you read in texinfo.tex.
\ifx\fontprefix\undefined
\ifx\fontprefix\undefined
\def\fontprefix{cm}
\def\fontprefix{cm}
\fi
\fi
% Support font families that don't use the same naming scheme as CM.
% Support font families that don't use the same naming scheme as CM.
\def\rmshape{r}
\def\rmshape{r}
\def\rmbshape{bx}               %where the normal face is bold
\def\rmbshape{bx}               %where the normal face is bold
\def\bfshape{b}
\def\bfshape{b}
\def\bxshape{bx}
\def\bxshape{bx}
\def\ttshape{tt}
\def\ttshape{tt}
\def\ttbshape{tt}
\def\ttbshape{tt}
\def\ttslshape{sltt}
\def\ttslshape{sltt}
\def\itshape{ti}
\def\itshape{ti}
\def\itbshape{bxti}
\def\itbshape{bxti}
\def\slshape{sl}
\def\slshape{sl}
\def\slbshape{bxsl}
\def\slbshape{bxsl}
\def\sfshape{ss}
\def\sfshape{ss}
\def\sfbshape{ss}
\def\sfbshape{ss}
\def\scshape{csc}
\def\scshape{csc}
\def\scbshape{csc}
\def\scbshape{csc}
 
 
% Definitions for a main text size of 11pt.  This is the default in
% Definitions for a main text size of 11pt.  This is the default in
% Texinfo.
% Texinfo.
%
%
\def\definetextfontsizexi{%
\def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1).
% Text fonts (11.2pt, magstep1).
\def\textnominalsize{11pt}
\def\textnominalsize{11pt}
\edef\mainmagstep{\magstephalf}
\edef\mainmagstep{\magstephalf}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1095}
\def\textecsize{1095}
 
 
% A few fonts for @defun names and args.
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
 
 
% Fonts for indices, footnotes, small examples (9pt).
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smalli=cmmi9
\font\smallsy=cmsy9
\font\smallsy=cmsy9
\def\smallecsize{0900}
\def\smallecsize{0900}
 
 
% Fonts for small examples (8pt).
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
\def\smallerecsize{0800}
 
 
% Fonts for title page (20.4pt):
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\font\titlesy=cmsy10 scaled \magstep4
\def\authorrm{\secrm}
 
\def\authortt{\sectt}
 
\def\titleecsize{2074}
\def\titleecsize{2074}
 
 
% Chapter (and unnumbered) fonts (17.28pt).
% Chapter (and unnumbered) fonts (17.28pt).
\def\chapnominalsize{17pt}
\def\chapnominalsize{17pt}
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
\setfont\chapsf\sfbshape{17}{1000}{OT1}
\setfont\chapsf\sfbshape{17}{1000}{OT1}
\let\chapbf=\chaprm
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
\font\chapi=cmmi12 scaled \magstep2
\font\chapi=cmmi12 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep3
\font\chapsy=cmsy10 scaled \magstep3
\def\chapecsize{1728}
\def\chapecsize{1728}
 
 
% Section fonts (14.4pt).
% Section fonts (14.4pt).
\def\secnominalsize{14pt}
\def\secnominalsize{14pt}
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
\let\secbf\secrm
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
\font\seci=cmmi12 scaled \magstep1
\font\seci=cmmi12 scaled \magstep1
\font\secsy=cmsy10 scaled \magstep2
\font\secsy=cmsy10 scaled \magstep2
\def\sececsize{1440}
\def\sececsize{1440}
 
 
% Subsection fonts (13.15pt).
% Subsection fonts (13.15pt).
\def\ssecnominalsize{13pt}
\def\ssecnominalsize{13pt}
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
\setfont\ssecsl\slbshape{10}{1315}{OT1}
\setfont\ssecsl\slbshape{10}{1315}{OT1}
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
\let\ssecbf\ssecrm
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1315}{OT1}
\setfont\ssecsc\scbshape{10}{1315}{OT1}
\font\sseci=cmmi12 scaled \magstephalf
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled 1315
\font\ssecsy=cmsy10 scaled 1315
\def\ssececsize{1200}
\def\ssececsize{1200}
 
 
% Reduced fonts for @acro in text (10pt).
% Reduced fonts for @acro in text (10pt).
\def\reducednominalsize{10pt}
\def\reducednominalsize{10pt}
\setfont\reducedrm\rmshape{10}{1000}{OT1}
\setfont\reducedrm\rmshape{10}{1000}{OT1}
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{1000}{OT1}
\setfont\reducedbf\bfshape{10}{1000}{OT1}
\setfont\reducedit\itshape{10}{1000}{OT1IT}
\setfont\reducedit\itshape{10}{1000}{OT1IT}
\setfont\reducedsl\slshape{10}{1000}{OT1}
\setfont\reducedsl\slshape{10}{1000}{OT1}
\setfont\reducedsf\sfshape{10}{1000}{OT1}
\setfont\reducedsf\sfshape{10}{1000}{OT1}
\setfont\reducedsc\scshape{10}{1000}{OT1}
\setfont\reducedsc\scshape{10}{1000}{OT1}
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
\font\reducedi=cmmi10
\font\reducedi=cmmi10
\font\reducedsy=cmsy10
\font\reducedsy=cmsy10
\def\reducedecsize{1000}
\def\reducedecsize{1000}
 
 
% reset the current fonts
% reset the current fonts
\textfonts
\textfonts
\rm
\rm
} % end of 11pt text font size definitions
} % end of 11pt text font size definitions
 
 
 
 
% Definitions to make the main text be 10pt Computer Modern, with
% Definitions to make the main text be 10pt Computer Modern, with
% section, chapter, etc., sizes following suit.  This is for the GNU
% section, chapter, etc., sizes following suit.  This is for the GNU
% Press printing of the Emacs 22 manual.  Maybe other manuals in the
% Press printing of the Emacs 22 manual.  Maybe other manuals in the
% future.  Used with @smallbook, which sets the leading to 12pt.
% future.  Used with @smallbook, which sets the leading to 12pt.
%
%
\def\definetextfontsizex{%
\def\definetextfontsizex{%
% Text fonts (10pt).
% Text fonts (10pt).
\def\textnominalsize{10pt}
\def\textnominalsize{10pt}
\edef\mainmagstep{1000}
\edef\mainmagstep{1000}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1000}
\def\textecsize{1000}
 
 
% A few fonts for @defun names and args.
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
 
 
% Fonts for indices, footnotes, small examples (9pt).
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smalli=cmmi9
\font\smallsy=cmsy9
\font\smallsy=cmsy9
\def\smallecsize{0900}
\def\smallecsize{0900}
 
 
% Fonts for small examples (8pt).
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
\def\smallerecsize{0800}
 
 
% Fonts for title page (20.4pt):
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\font\titlesy=cmsy10 scaled \magstep4
\def\authorrm{\secrm}
 
\def\authortt{\sectt}
 
\def\titleecsize{2074}
\def\titleecsize{2074}
 
 
% Chapter fonts (14.4pt).
% Chapter fonts (14.4pt).
\def\chapnominalsize{14pt}
\def\chapnominalsize{14pt}
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
\let\chapbf\chaprm
\let\chapbf\chaprm
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
\font\chapi=cmmi12 scaled \magstep1
\font\chapi=cmmi12 scaled \magstep1
\font\chapsy=cmsy10 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep2
\def\chapecsize{1440}
\def\chapecsize{1440}
 
 
% Section fonts (12pt).
% Section fonts (12pt).
\def\secnominalsize{12pt}
\def\secnominalsize{12pt}
\setfont\secrm\rmbshape{12}{1000}{OT1}
\setfont\secrm\rmbshape{12}{1000}{OT1}
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
\setfont\secsf\sfbshape{12}{1000}{OT1}
\setfont\secsf\sfbshape{12}{1000}{OT1}
\let\secbf\secrm
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
\font\seci=cmmi12
\font\seci=cmmi12
\font\secsy=cmsy10 scaled \magstep1
\font\secsy=cmsy10 scaled \magstep1
\def\sececsize{1200}
\def\sececsize{1200}
 
 
% Subsection fonts (10pt).
% Subsection fonts (10pt).
\def\ssecnominalsize{10pt}
\def\ssecnominalsize{10pt}
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
\setfont\ssecsl\slbshape{10}{1000}{OT1}
\setfont\ssecsl\slbshape{10}{1000}{OT1}
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
\let\ssecbf\ssecrm
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1000}{OT1}
\setfont\ssecsc\scbshape{10}{1000}{OT1}
\font\sseci=cmmi10
\font\sseci=cmmi10
\font\ssecsy=cmsy10
\font\ssecsy=cmsy10
\def\ssececsize{1000}
\def\ssececsize{1000}
 
 
% Reduced fonts for @acro in text (9pt).
% Reduced fonts for @acro in text (9pt).
\def\reducednominalsize{9pt}
\def\reducednominalsize{9pt}
\setfont\reducedrm\rmshape{9}{1000}{OT1}
\setfont\reducedrm\rmshape{9}{1000}{OT1}
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{900}{OT1}
\setfont\reducedbf\bfshape{10}{900}{OT1}
\setfont\reducedit\itshape{9}{1000}{OT1IT}
\setfont\reducedit\itshape{9}{1000}{OT1IT}
\setfont\reducedsl\slshape{9}{1000}{OT1}
\setfont\reducedsl\slshape{9}{1000}{OT1}
\setfont\reducedsf\sfshape{9}{1000}{OT1}
\setfont\reducedsf\sfshape{9}{1000}{OT1}
\setfont\reducedsc\scshape{10}{900}{OT1}
\setfont\reducedsc\scshape{10}{900}{OT1}
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
\font\reducedi=cmmi9
\font\reducedi=cmmi9
\font\reducedsy=cmsy9
\font\reducedsy=cmsy9
\def\reducedecsize{0900}
\def\reducedecsize{0900}
 
 
% reduce space between paragraphs
% reduce space between paragraphs
\divide\parskip by 2
\divide\parskip by 2
 
 
% reset the current fonts
% reset the current fonts
\textfonts
\textfonts
\rm
\rm
} % end of 10pt text font size definitions
} % end of 10pt text font size definitions
 
 
 
 
% We provide the user-level command
% We provide the user-level command
%   @fonttextsize 10
%   @fonttextsize 10
% (or 11) to redefine the text font size.  pt is assumed.
% (or 11) to redefine the text font size.  pt is assumed.
%
%
\def\xword{10}
\def\xword{10}
\def\xiword{11}
\def\xiword{11}
%
%
\parseargdef\fonttextsize{%
\parseargdef\fonttextsize{%
  \def\textsizearg{#1}%
  \def\textsizearg{#1}%
  \wlog{doing @fonttextsize \textsizearg}%
  \wlog{doing @fonttextsize \textsizearg}%
  %
  %
  % Set \globaldefs so that documents can use this inside @tex, since
  % Set \globaldefs so that documents can use this inside @tex, since
  % makeinfo 4.8 does not support it, but we need it nonetheless.
  % makeinfo 4.8 does not support it, but we need it nonetheless.
  %
  %
 \begingroup \globaldefs=1
 \begingroup \globaldefs=1
  \ifx\textsizearg\xword \definetextfontsizex
  \ifx\textsizearg\xword \definetextfontsizex
  \else \ifx\textsizearg\xiword \definetextfontsizexi
  \else \ifx\textsizearg\xiword \definetextfontsizexi
  \else
  \else
    \errhelp=\EMsimple
    \errhelp=\EMsimple
    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  \fi\fi
  \fi\fi
 \endgroup
 \endgroup
}
}
 
 
 
 
% In order for the font changes to affect most math symbols and letters,
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families.  Since
% we have to define the \textfont of the standard families.  Since
% texinfo doesn't allow for producing subscripts and superscripts except
% texinfo doesn't allow for producing subscripts and superscripts except
% in the main text, we don't bother to reset \scriptfont and
% in the main text, we don't bother to reset \scriptfont and
% \scriptscriptfont (which would also require loading a lot more fonts).
% \scriptscriptfont (which would also require loading a lot more fonts).
%
%
\def\resetmathfonts{%
\def\resetmathfonts{%
  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  \textfont\ttfam=\tentt \textfont\sffam=\tensf
  \textfont\ttfam=\tentt \textfont\sffam=\tensf
}
}
 
 
% The font-changing commands redefine the meanings of \tenSTYLE, instead
% The font-changing commands redefine the meanings of \tenSTYLE, instead
% of just \STYLE.  We do this because \STYLE needs to also set the
% of just \STYLE.  We do this because \STYLE needs to also set the
% current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
% current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
% \tenSTYLE to set the current font.
% \tenSTYLE to set the current font.
%
%
% Each font-changing command also sets the names \lsize (one size lower)
% Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower).  These relative commands are used in
% and \lllsize (three sizes lower).  These relative commands are used in
% the LaTeX logo and acronyms.
% the LaTeX logo and acronyms.
%
%
% This all needs generalizing, badly.
% This all needs generalizing, badly.
%
%
\def\textfonts{%
\def\textfonts{%
  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  \let\tenttsl=\textttsl
  \let\tenttsl=\textttsl
  \def\curfontsize{text}%
  \def\curfontsize{text}%
  \def\lsize{reduced}\def\lllsize{smaller}%
  \def\lsize{reduced}\def\lllsize{smaller}%
  \resetmathfonts \setleading{\textleading}}
  \resetmathfonts \setleading{\textleading}}
\def\titlefonts{%
\def\titlefonts{%
  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  \let\tenttsl=\titlettsl
  \let\tenttsl=\titlettsl
  \def\curfontsize{title}%
  \def\curfontsize{title}%
  \def\lsize{chap}\def\lllsize{subsec}%
  \def\lsize{chap}\def\lllsize{subsec}%
  \resetmathfonts \setleading{25pt}}
  \resetmathfonts \setleading{25pt}}
\def\titlefont#1{{\titlefonts\rm #1}}
\def\titlefont#1{{\titlefonts\rmisbold #1}}
\def\chapfonts{%
\def\chapfonts{%
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  \let\tenttsl=\chapttsl
  \let\tenttsl=\chapttsl
  \def\curfontsize{chap}%
  \def\curfontsize{chap}%
  \def\lsize{sec}\def\lllsize{text}%
  \def\lsize{sec}\def\lllsize{text}%
  \resetmathfonts \setleading{19pt}}
  \resetmathfonts \setleading{19pt}}
\def\secfonts{%
\def\secfonts{%
  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  \let\tenttsl=\secttsl
  \let\tenttsl=\secttsl
  \def\curfontsize{sec}%
  \def\curfontsize{sec}%
  \def\lsize{subsec}\def\lllsize{reduced}%
  \def\lsize{subsec}\def\lllsize{reduced}%
  \resetmathfonts \setleading{16pt}}
  \resetmathfonts \setleading{16pt}}
\def\subsecfonts{%
\def\subsecfonts{%
  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  \let\tenttsl=\ssecttsl
  \let\tenttsl=\ssecttsl
  \def\curfontsize{ssec}%
  \def\curfontsize{ssec}%
  \def\lsize{text}\def\lllsize{small}%
  \def\lsize{text}\def\lllsize{small}%
  \resetmathfonts \setleading{15pt}}
  \resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts
\let\subsubsecfonts = \subsecfonts
\def\reducedfonts{%
\def\reducedfonts{%
  \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  \let\tenttsl=\reducedttsl
  \let\tenttsl=\reducedttsl
  \def\curfontsize{reduced}%
  \def\curfontsize{reduced}%
  \def\lsize{small}\def\lllsize{smaller}%
  \def\lsize{small}\def\lllsize{smaller}%
  \resetmathfonts \setleading{10.5pt}}
  \resetmathfonts \setleading{10.5pt}}
\def\smallfonts{%
\def\smallfonts{%
  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  \let\tenttsl=\smallttsl
  \let\tenttsl=\smallttsl
  \def\curfontsize{small}%
  \def\curfontsize{small}%
  \def\lsize{smaller}\def\lllsize{smaller}%
  \def\lsize{smaller}\def\lllsize{smaller}%
  \resetmathfonts \setleading{10.5pt}}
  \resetmathfonts \setleading{10.5pt}}
\def\smallerfonts{%
\def\smallerfonts{%
  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  \let\tenttsl=\smallerttsl
  \let\tenttsl=\smallerttsl
  \def\curfontsize{smaller}%
  \def\curfontsize{smaller}%
  \def\lsize{smaller}\def\lllsize{smaller}%
  \def\lsize{smaller}\def\lllsize{smaller}%
  \resetmathfonts \setleading{9.5pt}}
  \resetmathfonts \setleading{9.5pt}}
 
 
 
% Fonts for short table of contents.
 
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
 
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
 
\setfont\shortcontsl\slshape{12}{1000}{OT1}
 
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 
 
 
% Define these just so they can be easily changed for other fonts.
 
\def\angleleft{$\langle$}
 
\def\angleright{$\rangle$}
 
 
% Set the fonts to use with the @small... environments.
% Set the fonts to use with the @small... environments.
\let\smallexamplefonts = \smallfonts
\let\smallexamplefonts = \smallfonts
 
 
% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
% can fit this many characters:
% can fit this many characters:
%   8.5x11=86   smallbook=72  a4=90  a5=69
%   8.5x11=86   smallbook=72  a4=90  a5=69
% If we use \scriptfonts (8pt), then we can fit this many characters:
% If we use \scriptfonts (8pt), then we can fit this many characters:
%   8.5x11=90+  smallbook=80  a4=90+  a5=77
%   8.5x11=90+  smallbook=80  a4=90+  a5=77
% For me, subjectively, the few extra characters that fit aren't worth
% For me, subjectively, the few extra characters that fit aren't worth
% the additional smallness of 8pt.  So I'm making the default 9pt.
% the additional smallness of 8pt.  So I'm making the default 9pt.
%
%
% By the way, for comparison, here's what fits with @example (10pt):
% By the way, for comparison, here's what fits with @example (10pt):
%   8.5x11=71  smallbook=60  a4=75  a5=58
%   8.5x11=71  smallbook=60  a4=75  a5=58
%
 
% I wish the USA used A4 paper.
 
% --karl, 24jan03.
% --karl, 24jan03.
 
 
 
 
% Set up the default fonts, so we can use them for creating boxes.
% Set up the default fonts, so we can use them for creating boxes.
%
%
\definetextfontsizexi
\definetextfontsizexi
 
 
% Define these so they can be easily changed for other fonts.
 
\def\angleleft{$\langle$}
\message{markup,}
\def\angleright{$\rangle$}
 
 
% Check if we are currently using a typewriter font.  Since all the
 
% Computer Modern typewriter fonts have zero interword stretch (and
 
% shrink), and it is reasonable to expect all typewriter fonts to have
 
% this property, we can check that font parameter.
 
%
 
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
 
 
 
% Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
 
% define and register \INITMACRO to be called on markup style changes.
 
% \INITMACRO can check \currentmarkupstyle for the innermost
 
% style and the set of \ifmarkupSTYLE switches for all styles
 
% currently in effect.
 
\newif\ifmarkupvar
 
\newif\ifmarkupsamp
 
\newif\ifmarkupkey
 
%\newif\ifmarkupfile % @file == @samp.
 
%\newif\ifmarkupoption % @option == @samp.
 
\newif\ifmarkupcode
 
\newif\ifmarkupkbd
 
%\newif\ifmarkupenv % @env == @code.
 
%\newif\ifmarkupcommand % @command == @code.
 
\newif\ifmarkuptex % @tex (and part of @math, for now).
 
\newif\ifmarkupexample
 
\newif\ifmarkupverb
 
\newif\ifmarkupverbatim
 
 
 
\let\currentmarkupstyle\empty
 
 
 
\def\setupmarkupstyle#1{%
 
  \csname markup#1true\endcsname
 
  \def\currentmarkupstyle{#1}%
 
  \markupstylesetup
 
}
 
 
 
\let\markupstylesetup\empty
 
 
 
\def\defmarkupstylesetup#1{%
 
  \expandafter\def\expandafter\markupstylesetup
 
    \expandafter{\markupstylesetup #1}%
 
  \def#1%
 
}
 
 
 
% Markup style setup for left and right quotes.
 
\defmarkupstylesetup\markupsetuplq{%
 
  \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
 
  \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
 
}
 
 
 
\defmarkupstylesetup\markupsetuprq{%
 
  \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
 
  \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
 
}
 
 
 
{
 
\catcode`\'=\active
 
\catcode`\`=\active
 
 
 
\gdef\markupsetuplqdefault{\let`\lq}
 
\gdef\markupsetuprqdefault{\let'\rq}
 
 
 
\gdef\markupsetcodequoteleft{\let`\codequoteleft}
 
\gdef\markupsetcodequoteright{\let'\codequoteright}
 
 
 
\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
 
}
 
 
 
\let\markupsetuplqcode \markupsetcodequoteleft
 
\let\markupsetuprqcode \markupsetcodequoteright
 
\let\markupsetuplqexample \markupsetcodequoteleft
 
\let\markupsetuprqexample \markupsetcodequoteright
 
\let\markupsetuplqverb \markupsetcodequoteleft
 
\let\markupsetuprqverb \markupsetcodequoteright
 
\let\markupsetuplqverbatim \markupsetcodequoteleft
 
\let\markupsetuprqverbatim \markupsetcodequoteright
 
 
 
\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
 
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
 
 
 
% Allow an option to not replace quotes with a regular directed right
 
% quote/apostrophe (char 0x27), but instead use the undirected quote
 
% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
 
% the default, but it works for pasting with more pdf viewers (at least
 
% evince), the lilypond developers report.  xpdf does work with the
 
% regular 0x27.
 
%
 
\def\codequoteright{%
 
  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
 
    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
 
      '%
 
    \else \char'15 \fi
 
  \else \char'15 \fi
 
}
 
%
 
% and a similar option for the left quote char vs. a grave accent.
 
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
 
% the code environments to do likewise.
 
%
 
\def\codequoteleft{%
 
  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
 
    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
 
      % [Knuth] pp. 380,381,391
 
      % \relax disables Spanish ligatures ?` and !` of \tt font.
 
      \relax`%
 
    \else \char'22 \fi
 
  \else \char'22 \fi
 
}
 
 
 
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
 
\def\noligaturesquoteleft{\relax\lq}
 
 
% Count depth in font-changes, for error checks
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
\newcount\fontdepth \fontdepth=0
 
 
% Fonts for short table of contents.
 
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
 
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
 
\setfont\shortcontsl\slshape{12}{1000}{OT1}
 
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
 
 
 
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
%% serif) and @ii for TeX italic
%% serif) and @ii for TeX italic
 
 
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
                    \ptexslash\fi\fi\fi}
                    \ptexslash\fi\fi\fi}
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
 
 
% like \smartslanted except unconditionally uses \ttsl.
% like \smartslanted except unconditionally uses \ttsl.
% @var is set to this for defun arguments.
% @var is set to this for defun arguments.
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
 
 
% like \smartslanted except unconditionally use \sl.  We never want
% @cite is like \smartslanted except unconditionally use \sl.  We never want
% ttsl for book titles, do we?
% ttsl for book titles, do we?
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
 
 
\let\i=\smartitalic
\let\i=\smartitalic
\let\slanted=\smartslanted
\let\slanted=\smartslanted
\let\var=\smartslanted
\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
\let\dfn=\smartslanted
\let\dfn=\smartslanted
\let\emph=\smartitalic
\let\emph=\smartitalic
 
 
% @b, explicit bold.
% Explicit font changes: @r, @sc, undocumented @ii.
 
\def\r#1{{\rm #1}}              % roman font
 
\def\sc#1{{\smallcaps#1}}       % smallcaps font
 
\def\ii#1{{\it #1}}             % italic font
 
 
 
% @b, explicit bold.  Also @strong.
\def\b#1{{\bf #1}}
\def\b#1{{\bf #1}}
\let\strong=\b
\let\strong=\b
 
 
% @sansserif, explicit sans.
% @sansserif, explicit sans.
\def\sansserif#1{{\sf #1}}
\def\sansserif#1{{\sf #1}}
 
 
% We can't just use \exhyphenpenalty, because that only has effect at
% We can't just use \exhyphenpenalty, because that only has effect at
% the end of a paragraph.  Restore normal hyphenation at the end of the
% the end of a paragraph.  Restore normal hyphenation at the end of the
% group within which \nohyphenation is presumably called.
% group within which \nohyphenation is presumably called.
%
%
\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- }
\def\restorehyphenation{\hyphenchar\font = `- }
 
 
% Set sfcode to normal for the chars that usually have another value.
% Set sfcode to normal for the chars that usually have another value.
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% sometimes \x has an active definition that messes things up.
% sometimes \x has an active definition that messes things up.
%
%
\catcode`@=11
\catcode`@=11
  \def\plainfrenchspacing{%
  \def\plainfrenchspacing{%
    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
    \def\endofsentencespacefactor{1000}% for @. and friends
    \def\endofsentencespacefactor{1000}% for @. and friends
  }
  }
  \def\plainnonfrenchspacing{%
  \def\plainnonfrenchspacing{%
    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
    \def\endofsentencespacefactor{3000}% for @. and friends
    \def\endofsentencespacefactor{3000}% for @. and friends
  }
  }
\catcode`@=\other
\catcode`@=\other
\def\endofsentencespacefactor{3000}% default
\def\endofsentencespacefactor{3000}% default
 
 
 
% @t, explicit typewriter.
\def\t#1{%
\def\t#1{%
  {\tt \rawbackslash \plainfrenchspacing #1}%
  {\tt \rawbackslash \plainfrenchspacing #1}%
  \null
  \null
}
}
\def\samp#1{`\tclose{#1}'\null}
 
\setfont\keyrm\rmshape{8}{1000}{OT1}
% @samp.
\font\keysy=cmsy9
\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
 
  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
% definition of @key that produces a lozenge.  Doesn't adjust to text size.
    \vbox{\hrule\kern-0.4pt
%\setfont\keyrm\rmshape{8}{1000}{OT1}
     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
%\font\keysy=cmsy9
    \kern-0.4pt\hrule}%
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\def\key #1{{\nohyphenation \uppercase{#1}}\null}
%    \vbox{\hrule\kern-0.4pt
% The old definition, with no lozenge:
%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
%    \kern-0.4pt\hrule}%
 
%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
 
 
 
% definition of @key with no lozenge.  If the current font is already
 
% monospace, don't change it; that way, we respect @kbdinputstyle.  But
 
% if it isn't monospace, then use \tt.
 
%
 
\def\key#1{{\setupmarkupstyle{key}%
 
  \nohyphenation
 
  \ifmonospace\else\tt\fi
 
  #1}\null}
 
 
 
% ctrl is no longer a Texinfo command.
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
 
 
% @file, @option are the same as @samp.
% @file, @option are the same as @samp.
\let\file=\samp
\let\file=\samp
\let\option=\samp
\let\option=\samp
 
 
% @code is a modification of @t,
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
% which makes spaces the same size as normal in the surrounding text.
\def\tclose#1{%
\def\tclose#1{%
  {%
  {%
    % Change normal interword space to be same as for the current font.
    % Change normal interword space to be same as for the current font.
    \spaceskip = \fontdimen2\font
    \spaceskip = \fontdimen2\font
    %
    %
    % Switch to typewriter.
    % Switch to typewriter.
    \tt
    \tt
    %
    %
    % But `\ ' produces the large typewriter interword space.
    % But `\ ' produces the large typewriter interword space.
    \def\ {{\spaceskip = 0pt{} }}%
    \def\ {{\spaceskip = 0pt{} }}%
    %
    %
    % Turn off hyphenation.
    % Turn off hyphenation.
    \nohyphenation
    \nohyphenation
    %
    %
    \rawbackslash
    \rawbackslash
    \plainfrenchspacing
    \plainfrenchspacing
    #1%
    #1%
  }%
  }%
  \null
  \null
}
}
 
 
% We *must* turn on hyphenation at `-' and `_' in @code.
% We *must* turn on hyphenation at `-' and `_' in @code.
% Otherwise, it is too hard to avoid overfull hboxes
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
% in the Emacs manual, the Library manual, etc.
 
 
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
% both hyphenation at - and hyphenation within words.
% both hyphenation at - and hyphenation within words.
% We must therefore turn them both off (\tclose does that)
% We must therefore turn them both off (\tclose does that)
% and arrange explicitly to hyphenate at a dash.
% and arrange explicitly to hyphenate at a dash.
%  -- rms.
%  -- rms.
{
{
  \catcode`\-=\active \catcode`\_=\active
  \catcode`\-=\active \catcode`\_=\active
  \catcode`\'=\active \catcode`\`=\active
  \catcode`\'=\active \catcode`\`=\active
 
  \global\let'=\rq \global\let`=\lq  % default definitions
  %
  %
  \global\def\code{\begingroup
  \global\def\code{\begingroup
    \catcode\rquoteChar=\active \catcode\lquoteChar=\active
    \setupmarkupstyle{code}%
    \let'\codequoteright \let`\codequoteleft
    % The following should really be moved into \setupmarkupstyle handlers.
    %
 
    \catcode\dashChar=\active  \catcode\underChar=\active
    \catcode\dashChar=\active  \catcode\underChar=\active
    \ifallowcodebreaks
    \ifallowcodebreaks
     \let-\codedash
     \let-\codedash
     \let_\codeunder
     \let_\codeunder
    \else
    \else
     \let-\realdash
     \let-\realdash
     \let_\realunder
     \let_\realunder
    \fi
    \fi
    \codex
    \codex
  }
  }
}
}
 
 
\def\realdash{-}
\def\realdash{-}
\def\codedash{-\discretionary{}{}{}}
\def\codedash{-\discretionary{}{}{}}
\def\codeunder{%
\def\codeunder{%
  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  % will therefore expand the active definition of _, which is us
  % will therefore expand the active definition of _, which is us
  % (inside @code that is), therefore an endless loop.
  % (inside @code that is), therefore an endless loop.
  \ifusingtt{\ifmmode
  \ifusingtt{\ifmmode
               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
             \else\normalunderscore \fi
             \else\normalunderscore \fi
             \discretionary{}{}{}}%
             \discretionary{}{}{}}%
            {\_}%
            {\_}%
}
}
\def\codex #1{\tclose{#1}\endgroup}
\def\codex #1{\tclose{#1}\endgroup}
 
 
% An additional complication: the above will allow breaks after, e.g.,
% An additional complication: the above will allow breaks after, e.g.,
% each of the four underscores in __typeof__.  This is undesirable in
% each of the four underscores in __typeof__.  This is undesirable in
% some manuals, especially if they don't have long identifiers in
% some manuals, especially if they don't have long identifiers in
% general.  @allowcodebreaks provides a way to control this.
% general.  @allowcodebreaks provides a way to control this.
%
%
\newif\ifallowcodebreaks  \allowcodebreakstrue
\newif\ifallowcodebreaks  \allowcodebreakstrue
 
 
\def\keywordtrue{true}
\def\keywordtrue{true}
\def\keywordfalse{false}
\def\keywordfalse{false}
 
 
\parseargdef\allowcodebreaks{%
\parseargdef\allowcodebreaks{%
  \def\txiarg{#1}%
  \def\txiarg{#1}%
  \ifx\txiarg\keywordtrue
  \ifx\txiarg\keywordtrue
    \allowcodebreakstrue
    \allowcodebreakstrue
  \else\ifx\txiarg\keywordfalse
  \else\ifx\txiarg\keywordfalse
    \allowcodebreaksfalse
    \allowcodebreaksfalse
  \else
  \else
    \errhelp = \EMsimple
    \errhelp = \EMsimple
    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
  \fi\fi
  \fi\fi
}
}
 
 
% @kbd is like @code, except that if the argument is just one @key command,
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
% then @kbd has no effect.
 
\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
 
 
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
%   `example' (@kbd uses ttsl only inside of @example and friends),
%   `example' (@kbd uses ttsl only inside of @example and friends),
%   or `code' (@kbd uses normal tty font always).
%   or `code' (@kbd uses normal tty font always).
\parseargdef\kbdinputstyle{%
\parseargdef\kbdinputstyle{%
  \def\txiarg{#1}%
  \def\txiarg{#1}%
  \ifx\txiarg\worddistinct
  \ifx\txiarg\worddistinct
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  \else\ifx\txiarg\wordexample
  \else\ifx\txiarg\wordexample
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  \else\ifx\txiarg\wordcode
  \else\ifx\txiarg\wordcode
    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  \else
  \else
    \errhelp = \EMsimple
    \errhelp = \EMsimple
    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
  \fi\fi\fi
  \fi\fi\fi
}
}
\def\worddistinct{distinct}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordexample{example}
\def\wordcode{code}
\def\wordcode{code}
 
 
% Default is `distinct.'
% Default is `distinct'.
\kbdinputstyle distinct
\kbdinputstyle distinct
 
 
\def\xkey{\key}
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\kbdfont\look}}\fi
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
\else{\tclose{\kbdfont\look}}\fi}
\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
 
 
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
\let\indicateurl=\code
\let\indicateurl=\code
\let\env=\code
\let\env=\code
\let\command=\code
\let\command=\code
 
 
 
% @clicksequence{File @click{} Open ...}
 
\def\clicksequence#1{\begingroup #1\endgroup}
 
 
 
% @clickstyle @arrow   (by default)
 
\parseargdef\clickstyle{\def\click{#1}}
 
\def\click{\arrow}
 
 
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
% second argument specifying the text to display and an optional third
% second argument specifying the text to display and an optional third
% arg as text to display instead of (rather than in addition to) the url
% arg as text to display instead of (rather than in addition to) the url
% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
% a hypertex \special here.
% a hypertex \special here.
%
%
\def\uref#1{\douref #1,,,\finish}
\def\uref#1{\douref #1,,,\finish}
\def\douref#1,#2,#3,#4\finish{\begingroup
\def\douref#1,#2,#3,#4\finish{\begingroup
  \unsepspaces
  \unsepspaces
  \pdfurl{#1}%
  \pdfurl{#1}%
  \setbox0 = \hbox{\ignorespaces #3}%
  \setbox0 = \hbox{\ignorespaces #3}%
  \ifdim\wd0 > 0pt
  \ifdim\wd0 > 0pt
    \unhbox0 % third arg given, show only that
    \unhbox0 % third arg given, show only that
  \else
  \else
    \setbox0 = \hbox{\ignorespaces #2}%
    \setbox0 = \hbox{\ignorespaces #2}%
    \ifdim\wd0 > 0pt
    \ifdim\wd0 > 0pt
      \ifpdf
      \ifpdf
        \unhbox0             % PDF: 2nd arg given, show only it
        \unhbox0             % PDF: 2nd arg given, show only it
      \else
      \else
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
      \fi
      \fi
    \else
    \else
      \code{#1}% only url given, so show it
      \code{#1}% only url given, so show it
    \fi
    \fi
  \fi
  \fi
  \endlink
  \endlink
\endgroup}
\endgroup}
 
 
% @url synonym for @uref, since that's how everyone uses it.
% @url synonym for @uref, since that's how everyone uses it.
%
%
\let\url=\uref
\let\url=\uref
 
 
% rms does not like angle brackets --karl, 17may97.
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
% So now @email is just like @uref, unless we are pdf.
%
%
%\def\email#1{\angleleft{\tt #1}\angleright}
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdf
\ifpdf
  \def\email#1{\doemail#1,,\finish}
  \def\email#1{\doemail#1,,\finish}
  \def\doemail#1,#2,#3\finish{\begingroup
  \def\doemail#1,#2,#3\finish{\begingroup
    \unsepspaces
    \unsepspaces
    \pdfurl{mailto:#1}%
    \pdfurl{mailto:#1}%
    \setbox0 = \hbox{\ignorespaces #2}%
    \setbox0 = \hbox{\ignorespaces #2}%
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
    \endlink
    \endlink
  \endgroup}
  \endgroup}
\else
\else
  \let\email=\uref
  \let\email=\uref
\fi
\fi
 
 
% Check if we are currently using a typewriter font.  Since all the
 
% Computer Modern typewriter fonts have zero interword stretch (and
 
% shrink), and it is reasonable to expect all typewriter fonts to have
 
% this property, we can check that font parameter.
 
%
 
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
 
 
 
% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
%
\def\dmn#1{\thinspace #1}
\def\dmn#1{\thinspace #1}
 
 
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
 
 
 
% @l was never documented to mean ``switch to the Lisp font'',
% @l was never documented to mean ``switch to the Lisp font'',
% and it is not used as such in any manual I can find.  We need it for
% and it is not used as such in any manual I can find.  We need it for
% Polish suppressed-l.  --karl, 22sep96.
% Polish suppressed-l.  --karl, 22sep96.
%\def\l#1{{\li #1}\null}
%\def\l#1{{\li #1}\null}
 
 
% Explicit font changes: @r, @sc, undocumented @ii.
 
\def\r#1{{\rm #1}}              % roman font
 
\def\sc#1{{\smallcaps#1}}       % smallcaps font
 
\def\ii#1{{\it #1}}             % italic font
 
 
 
% @acronym for "FBI", "NATO", and the like.
% @acronym for "FBI", "NATO", and the like.
% We print this one point size smaller, since it's intended for
% We print this one point size smaller, since it's intended for
% all-uppercase.
% all-uppercase.
%
%
\def\acronym#1{\doacronym #1,,\finish}
\def\acronym#1{\doacronym #1,,\finish}
\def\doacronym#1,#2,#3\finish{%
\def\doacronym#1,#2,#3\finish{%
  {\selectfonts\lsize #1}%
  {\selectfonts\lsize #1}%
  \def\temp{#2}%
  \def\temp{#2}%
  \ifx\temp\empty \else
  \ifx\temp\empty \else
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
  \fi
  \fi
}
}
 
 
% @abbr for "Comput. J." and the like.
% @abbr for "Comput. J." and the like.
% No font change, but don't do end-of-sentence spacing.
% No font change, but don't do end-of-sentence spacing.
%
%
\def\abbr#1{\doabbr #1,,\finish}
\def\abbr#1{\doabbr #1,,\finish}
\def\doabbr#1,#2,#3\finish{%
\def\doabbr#1,#2,#3\finish{%
  {\plainfrenchspacing #1}%
  {\plainfrenchspacing #1}%
  \def\temp{#2}%
  \def\temp{#2}%
  \ifx\temp\empty \else
  \ifx\temp\empty \else
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
  \fi
  \fi
}
}
 
 
 
 
 
\message{glyphs,}
 
 
 
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
%
 
% Since these characters are used in examples, they should be an even number of
 
% \tt widths. Each \tt character is 1en, so two makes it 1em.
 
%
 
\def\point{$\star$}
 
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
 
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
 
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
 
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
 
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
 
 
 
% The @error{} command.
 
% Adapted from the TeXbook's \boxit.
 
%
 
\newbox\errorbox
 
%
 
{\tentt \global\dimen0 = 3em}% Width of the box.
 
\dimen2 = .55pt % Thickness of rules
 
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
 
\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
 
%
 
\setbox\errorbox=\hbox to \dimen0{\hfil
 
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
 
   \advance\hsize by -2\dimen2 % Rules.
 
   \vbox{%
 
      \hrule height\dimen2
 
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
 
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
 
         \kern3pt\vrule width\dimen2}% Space to right.
 
      \hrule height\dimen2}
 
    \hfil}
 
%
 
\def\error{\leavevmode\lower.7ex\copy\errorbox}
 
 
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
%
%
\def\pounds{{\it\$}}
\def\pounds{{\it\$}}
 
 
% @euro{} comes from a separate font, depending on the current style.
% @euro{} comes from a separate font, depending on the current style.
% We use the free feym* fonts from the eurosym package by Henrik
% We use the free feym* fonts from the eurosym package by Henrik
% Theiling, which support regular, slanted, bold and bold slanted (and
% Theiling, which support regular, slanted, bold and bold slanted (and
% "outlined" (blackboard board, sort of) versions, which we don't need).
% "outlined" (blackboard board, sort of) versions, which we don't need).
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
%
%
% Although only regular is the truly official Euro symbol, we ignore
% Although only regular is the truly official Euro symbol, we ignore
% that.  The Euro is designed to be slightly taller than the regular
% that.  The Euro is designed to be slightly taller than the regular
% font height.
% font height.
%
%
% feymr - regular
% feymr - regular
% feymo - slanted
% feymo - slanted
% feybr - bold
% feybr - bold
% feybo - bold slanted
% feybo - bold slanted
%
%
% There is no good (free) typewriter version, to my knowledge.
% There is no good (free) typewriter version, to my knowledge.
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
% Hmm.
% Hmm.
%
%
% Also doesn't work in math.  Do we need to do math with euro symbols?
% Also doesn't work in math.  Do we need to do math with euro symbols?
% Hope not.
% Hope not.
%
%
%
%
\def\euro{{\eurofont e}}
\def\euro{{\eurofont e}}
\def\eurofont{%
\def\eurofont{%
  % We set the font at each command, rather than predefining it in
  % We set the font at each command, rather than predefining it in
  % \textfonts and the other font-switching commands, so that
  % \textfonts and the other font-switching commands, so that
  % installations which never need the symbol don't have to have the
  % installations which never need the symbol don't have to have the
  % font installed.
  % font installed.
  %
  %
  % There is only one designed size (nominal 10pt), so we always scale
  % There is only one designed size (nominal 10pt), so we always scale
  % that to the current nominal size.
  % that to the current nominal size.
  %
  %
  % By the way, simply using "at 1em" works for cmr10 and the like, but
  % By the way, simply using "at 1em" works for cmr10 and the like, but
  % does not work for cmbx10 and other extended/shrunken fonts.
  % does not work for cmbx10 and other extended/shrunken fonts.
  %
  %
  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  %
  %
  \ifx\curfontstyle\bfstylename
  \ifx\curfontstyle\bfstylename
    % bold:
    % bold:
    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  \else
  \else
    % regular:
    % regular:
    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  \fi
  \fi
  \thiseurofont
  \thiseurofont
}
}
 
 
% Hacks for glyphs from the EC fonts similar to \euro.  We don't
% Glyphs from the EC fonts.  We don't use \let for the aliases, because
% use \let for the aliases, because sometimes we redefine the original
% sometimes we redefine the original macro, and the alias should reflect
% macro, and the alias should reflect the redefinition.
% the redefinition.
 
%
 
% Use LaTeX names for the Icelandic letters.
 
\def\DH{{\ecfont \char"D0}} % Eth
 
\def\dh{{\ecfont \char"F0}} % eth
 
\def\TH{{\ecfont \char"DE}} % Thorn
 
\def\th{{\ecfont \char"FE}} % thorn
 
%
\def\guillemetleft{{\ecfont \char"13}}
\def\guillemetleft{{\ecfont \char"13}}
\def\guillemotleft{\guillemetleft}
\def\guillemotleft{\guillemetleft}
\def\guillemetright{{\ecfont \char"14}}
\def\guillemetright{{\ecfont \char"14}}
\def\guillemotright{\guillemetright}
\def\guillemotright{\guillemetright}
\def\guilsinglleft{{\ecfont \char"0E}}
\def\guilsinglleft{{\ecfont \char"0E}}
\def\guilsinglright{{\ecfont \char"0F}}
\def\guilsinglright{{\ecfont \char"0F}}
\def\quotedblbase{{\ecfont \char"12}}
\def\quotedblbase{{\ecfont \char"12}}
\def\quotesinglbase{{\ecfont \char"0D}}
\def\quotesinglbase{{\ecfont \char"0D}}
%
%
 
% This positioning is not perfect (see the ogonek LaTeX package), but
 
% we have the precomposed glyphs for the most common cases.  We put the
 
% tests to use those glyphs in the single \ogonek macro so we have fewer
 
% dummy definitions to worry about for index entries, etc.
 
%
 
% ogonek is also used with other letters in Lithuanian (IOU), but using
 
% the precomposed glyphs for those is not so easy since they aren't in
 
% the same EC font.
 
\def\ogonek#1{{%
 
  \def\temp{#1}%
 
  \ifx\temp\macrocharA\Aogonek
 
  \else\ifx\temp\macrochara\aogonek
 
  \else\ifx\temp\macrocharE\Eogonek
 
  \else\ifx\temp\macrochare\eogonek
 
  \else
 
    \ecfont \setbox0=\hbox{#1}%
 
    \ifdim\ht0=1ex\accent"0C #1%
 
    \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
 
    \fi
 
  \fi\fi\fi\fi
 
  }%
 
}
 
\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
 
\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
 
\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
 
\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
 
%
 
% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
\def\ecfont{%
\def\ecfont{%
  % We can't distinguish serif/sanserif and italic/slanted, but this
  % We can't distinguish serif/sans and italic/slanted, but this
  % is used for crude hacks anyway (like adding French and German
  % is used for crude hacks anyway (like adding French and German
  % quotes to documents typeset with CM, where we lose kerning), so
  % quotes to documents typeset with CM, where we lose kerning), so
  % hopefully nobody will notice/care.
  % hopefully nobody will notice/care.
  \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  \ifx\curfontstyle\bfstylename
  \ifx\curfontstyle\bfstylename
    % bold:
    % bold:
    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  \else
  \else
    % regular:
    % regular:
    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  \fi
  \fi
  \thisecfont
  \thisecfont
}
}
 
 
% @registeredsymbol - R in a circle.  The font for the R should really
% @registeredsymbol - R in a circle.  The font for the R should really
% be smaller yet, but lllsize is the best we can do for now.
% be smaller yet, but lllsize is the best we can do for now.
% Adapted from the plain.tex definition of \copyright.
% Adapted from the plain.tex definition of \copyright.
%
%
\def\registeredsymbol{%
\def\registeredsymbol{%
  $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
               \hfil\crcr\Orb}}%
               \hfil\crcr\Orb}}%
    }$%
    }$%
}
}
 
 
% @textdegree - the normal degrees sign.
% @textdegree - the normal degrees sign.
%
%
\def\textdegree{$^\circ$}
\def\textdegree{$^\circ$}
 
 
% Laurent Siebenmann reports \Orb undefined with:
% Laurent Siebenmann reports \Orb undefined with:
%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
% so we'll define it if necessary.
% so we'll define it if necessary.
%
%
\ifx\Orb\undefined
\ifx\Orb\undefined
\def\Orb{\mathhexbox20D}
\def\Orb{\mathhexbox20D}
\fi
\fi
 
 
% Quotes.
% Quotes.
\chardef\quotedblleft="5C
\chardef\quotedblleft="5C
\chardef\quotedblright=`\"
\chardef\quotedblright=`\"
\chardef\quoteleft=`\`
\chardef\quoteleft=`\`
\chardef\quoteright=`\'
\chardef\quoteright=`\'
 
 
 
 
\message{page headings,}
\message{page headings,}
 
 
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
 
 
% First the title page.  Must do @settitle before @titlepage.
% First the title page.  Must do @settitle before @titlepage.
\newif\ifseenauthor
\newif\ifseenauthor
\newif\iffinishedtitlepage
\newif\iffinishedtitlepage
 
 
% Do an implicit @contents or @shortcontents after @end titlepage if the
% Do an implicit @contents or @shortcontents after @end titlepage if the
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
%
%
\newif\ifsetcontentsaftertitlepage
\newif\ifsetcontentsaftertitlepage
 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
\newif\ifsetshortcontentsaftertitlepage
\newif\ifsetshortcontentsaftertitlepage
 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
 
 
\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
        \endgroup\page\hbox{}\page}
        \endgroup\page\hbox{}\page}
 
 
\envdef\titlepage{%
\envdef\titlepage{%
  % Open one extra group, as we want to close it in the middle of \Etitlepage.
  % Open one extra group, as we want to close it in the middle of \Etitlepage.
  \begingroup
  \begingroup
    \parindent=0pt \textfonts
    \parindent=0pt \textfonts
    % Leave some space at the very top of the page.
    % Leave some space at the very top of the page.
    \vglue\titlepagetopglue
    \vglue\titlepagetopglue
    % No rule at page bottom unless we print one at the top with @title.
    % No rule at page bottom unless we print one at the top with @title.
    \finishedtitlepagetrue
    \finishedtitlepagetrue
    %
    %
    % Most title ``pages'' are actually two pages long, with space
    % Most title ``pages'' are actually two pages long, with space
    % at the top of the second.  We don't want the ragged left on the second.
    % at the top of the second.  We don't want the ragged left on the second.
    \let\oldpage = \page
    \let\oldpage = \page
    \def\page{%
    \def\page{%
      \iffinishedtitlepage\else
      \iffinishedtitlepage\else
         \finishtitlepage
         \finishtitlepage
      \fi
      \fi
      \let\page = \oldpage
      \let\page = \oldpage
      \page
      \page
      \null
      \null
    }%
    }%
}
}
 
 
\def\Etitlepage{%
\def\Etitlepage{%
    \iffinishedtitlepage\else
    \iffinishedtitlepage\else
        \finishtitlepage
        \finishtitlepage
    \fi
    \fi
    % It is important to do the page break before ending the group,
    % It is important to do the page break before ending the group,
    % because the headline and footline are only empty inside the group.
    % because the headline and footline are only empty inside the group.
    % If we use the new definition of \page, we always get a blank page
    % If we use the new definition of \page, we always get a blank page
    % after the title page, which we certainly don't want.
    % after the title page, which we certainly don't want.
    \oldpage
    \oldpage
  \endgroup
  \endgroup
  %
  %
  % Need this before the \...aftertitlepage checks so that if they are
  % Need this before the \...aftertitlepage checks so that if they are
  % in effect the toc pages will come out with page numbers.
  % in effect the toc pages will come out with page numbers.
  \HEADINGSon
  \HEADINGSon
  %
  %
  % If they want short, they certainly want long too.
  % If they want short, they certainly want long too.
  \ifsetshortcontentsaftertitlepage
  \ifsetshortcontentsaftertitlepage
    \shortcontents
    \shortcontents
    \contents
    \contents
    \global\let\shortcontents = \relax
    \global\let\shortcontents = \relax
    \global\let\contents = \relax
    \global\let\contents = \relax
  \fi
  \fi
  %
  %
  \ifsetcontentsaftertitlepage
  \ifsetcontentsaftertitlepage
    \contents
    \contents
    \global\let\contents = \relax
    \global\let\contents = \relax
    \global\let\shortcontents = \relax
    \global\let\shortcontents = \relax
  \fi
  \fi
}
}
 
 
\def\finishtitlepage{%
\def\finishtitlepage{%
  \vskip4pt \hrule height 2pt width \hsize
  \vskip4pt \hrule height 2pt width \hsize
  \vskip\titlepagebottomglue
  \vskip\titlepagebottomglue
  \finishedtitlepagetrue
  \finishedtitlepagetrue
}
}
 
 
%%% Macros to be used within @titlepage:
%%% Macros to be used within @titlepage:
 
 
\let\subtitlerm=\tenrm
\let\subtitlerm=\tenrm
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
 
 
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
 
                \let\tt=\authortt}
 
 
 
\parseargdef\title{%
\parseargdef\title{%
  \checkenv\titlepage
  \checkenv\titlepage
  \leftline{\titlefonts\rm #1}
  \leftline{\titlefonts\rmisbold #1}
  % print a rule at the page bottom also.
  % print a rule at the page bottom also.
  \finishedtitlepagefalse
  \finishedtitlepagefalse
  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
}
}
 
 
\parseargdef\subtitle{%
\parseargdef\subtitle{%
  \checkenv\titlepage
  \checkenv\titlepage
  {\subtitlefont \rightline{#1}}%
  {\subtitlefont \rightline{#1}}%
}
}
 
 
% @author should come last, but may come many times.
% @author should come last, but may come many times.
% It can also be used inside @quotation.
% It can also be used inside @quotation.
%
%
\parseargdef\author{%
\parseargdef\author{%
  \def\temp{\quotation}%
  \def\temp{\quotation}%
  \ifx\thisenv\temp
  \ifx\thisenv\temp
    \def\quotationauthor{#1}% printed in \Equotation.
    \def\quotationauthor{#1}% printed in \Equotation.
  \else
  \else
    \checkenv\titlepage
    \checkenv\titlepage
    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
    {\authorfont \leftline{#1}}%
    {\secfonts\rmisbold \leftline{#1}}%
  \fi
  \fi
}
}
 
 
 
 
%%% Set up page headings and footings.
%%% Set up page headings and footings.
 
 
\let\thispage=\folio
\let\thispage=\folio
 
 
\newtoks\evenheadline    % headline on even pages
\newtoks\evenheadline    % headline on even pages
\newtoks\oddheadline     % headline on odd pages
\newtoks\oddheadline     % headline on odd pages
\newtoks\evenfootline    % footline on even pages
\newtoks\evenfootline    % footline on even pages
\newtoks\oddfootline     % footline on odd pages
\newtoks\oddfootline     % footline on odd pages
 
 
% Now make TeX use those variables
% Now make TeX use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
                            \else \the\evenheadline \fi}}
                            \else \the\evenheadline \fi}}
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
                            \else \the\evenfootline \fi}\HEADINGShook}
                            \else \the\evenfootline \fi}\HEADINGShook}
\let\HEADINGShook=\relax
\let\HEADINGShook=\relax
 
 
% Commands to set those variables.
% Commands to set those variables.
% For example, this is what  @headings on  does
% For example, this is what  @headings on  does
% @evenheading @thistitle|@thispage|@thischapter
% @evenheading @thistitle|@thispage|@thischapter
% @oddheading @thischapter|@thispage|@thistitle
% @oddheading @thischapter|@thispage|@thistitle
% @evenfooting @thisfile||
% @evenfooting @thisfile||
% @oddfooting ||@thisfile
% @oddfooting ||@thisfile
 
 
 
 
\def\evenheading{\parsearg\evenheadingxxx}
\def\evenheading{\parsearg\evenheadingxxx}
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
 
 
\def\oddheading{\parsearg\oddheadingxxx}
\def\oddheading{\parsearg\oddheadingxxx}
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
 
 
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
 
 
\def\evenfooting{\parsearg\evenfootingxxx}
\def\evenfooting{\parsearg\evenfootingxxx}
\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
 
 
\def\oddfooting{\parsearg\oddfootingxxx}
\def\oddfooting{\parsearg\oddfootingxxx}
\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  %
  %
  % Leave some space for the footline.  Hopefully ok to assume
  % Leave some space for the footline.  Hopefully ok to assume
  % @evenfooting will not be used by itself.
  % @evenfooting will not be used by itself.
  \global\advance\pageheight by -12pt
  \global\advance\pageheight by -12pt
  \global\advance\vsize by -12pt
  \global\advance\vsize by -12pt
}
}
 
 
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
 
 
% @evenheadingmarks top     \thischapter <- chapter at the top of a page
% @evenheadingmarks top     \thischapter <- chapter at the top of a page
% @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
% @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
%
%
% The same set of arguments for:
% The same set of arguments for:
%
%
% @oddheadingmarks
% @oddheadingmarks
% @evenfootingmarks
% @evenfootingmarks
% @oddfootingmarks
% @oddfootingmarks
% @everyheadingmarks
% @everyheadingmarks
% @everyfootingmarks
% @everyfootingmarks
 
 
\def\evenheadingmarks{\headingmarks{even}{heading}}
\def\evenheadingmarks{\headingmarks{even}{heading}}
\def\oddheadingmarks{\headingmarks{odd}{heading}}
\def\oddheadingmarks{\headingmarks{odd}{heading}}
\def\evenfootingmarks{\headingmarks{even}{footing}}
\def\evenfootingmarks{\headingmarks{even}{footing}}
\def\oddfootingmarks{\headingmarks{odd}{footing}}
\def\oddfootingmarks{\headingmarks{odd}{footing}}
\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
                          \headingmarks{odd}{heading}{#1} }
                          \headingmarks{odd}{heading}{#1} }
\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
                          \headingmarks{odd}{footing}{#1} }
                          \headingmarks{odd}{footing}{#1} }
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
\def\headingmarks#1#2#3 {%
\def\headingmarks#1#2#3 {%
  \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  \global\expandafter\let\csname get#1#2marks\endcsname \temp
  \global\expandafter\let\csname get#1#2marks\endcsname \temp
}
}
 
 
\everyheadingmarks bottom
\everyheadingmarks bottom
\everyfootingmarks bottom
\everyfootingmarks bottom
 
 
% @headings double      turns headings on for double-sided printing.
% @headings double      turns headings on for double-sided printing.
% @headings single      turns headings on for single-sided printing.
% @headings single      turns headings on for single-sided printing.
% @headings off         turns them off.
% @headings off         turns them off.
% @headings on          same as @headings double, retained for compatibility.
% @headings on          same as @headings double, retained for compatibility.
% @headings after       turns on double-sided headings after this page.
% @headings after       turns on double-sided headings after this page.
% @headings doubleafter turns on double-sided headings after this page.
% @headings doubleafter turns on double-sided headings after this page.
% @headings singleafter turns on single-sided headings after this page.
% @headings singleafter turns on single-sided headings after this page.
% By default, they are off at the start of a document,
% By default, they are off at the start of a document,
% and turned `on' after @end titlepage.
% and turned `on' after @end titlepage.
 
 
\def\headings #1 {\csname HEADINGS#1\endcsname}
\def\headings #1 {\csname HEADINGS#1\endcsname}
 
 
\def\HEADINGSoff{%
\def\HEADINGSoff{%
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
\HEADINGSoff
\HEADINGSoff
% When we turn headings on, set the page number to 1.
% When we turn headings on, set the page number to 1.
% For double-sided printing, put current file name in lower left corner,
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
% edge of all pages.
\def\HEADINGSdouble{%
\def\HEADINGSdouble{%
\global\pageno=1
\global\pageno=1
\global\evenfootline={\hfil}
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
\global\let\contentsalignmacro = \chapoddpage
}
}
\let\contentsalignmacro = \chappager
\let\contentsalignmacro = \chappager
 
 
% For single-sided printing, chapter title goes across top left of page,
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
% page number on top right.
\def\HEADINGSsingle{%
\def\HEADINGSsingle{%
\global\pageno=1
\global\pageno=1
\global\evenfootline={\hfil}
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chappager
\global\let\contentsalignmacro = \chappager
}
}
\def\HEADINGSon{\HEADINGSdouble}
\def\HEADINGSon{\HEADINGSdouble}
 
 
\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
\let\HEADINGSdoubleafter=\HEADINGSafter
\let\HEADINGSdoubleafter=\HEADINGSafter
\def\HEADINGSdoublex{%
\def\HEADINGSdoublex{%
\global\evenfootline={\hfil}
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
\global\let\contentsalignmacro = \chapoddpage
}
}
 
 
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
\def\HEADINGSsinglex{%
\def\HEADINGSsinglex{%
\global\evenfootline={\hfil}
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\let\contentsalignmacro = \chappager
\global\let\contentsalignmacro = \chappager
}
}
 
 
% Subroutines used in generating headings
% Subroutines used in generating headings
% This produces Day Month Year style of output.
% This produces Day Month Year style of output.
% Only define if not already defined, in case a txi-??.tex file has set
% Only define if not already defined, in case a txi-??.tex file has set
% up a different format (e.g., txi-cs.tex does this).
% up a different format (e.g., txi-cs.tex does this).
\ifx\today\undefined
\ifx\today\undefined
\def\today{%
\def\today{%
  \number\day\space
  \number\day\space
  \ifcase\month
  \ifcase\month
  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  \fi
  \fi
  \space\number\year}
  \space\number\year}
\fi
\fi
 
 
% @settitle line...  specifies the title of the document, for headings.
% @settitle line...  specifies the title of the document, for headings.
% It generates no output of its own.
% It generates no output of its own.
\def\thistitle{\putwordNoTitle}
\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg{\gdef\thistitle}}
\def\settitle{\parsearg{\gdef\thistitle}}
 
 
 
 
\message{tables,}
\message{tables,}
% Tables -- @table, @ftable, @vtable, @item(x).
% Tables -- @table, @ftable, @vtable, @item(x).
 
 
% default indentation of table text
% default indentation of table text
\newdimen\tableindent \tableindent=.8in
\newdimen\tableindent \tableindent=.8in
% default indentation of @itemize and @enumerate text
% default indentation of @itemize and @enumerate text
\newdimen\itemindent  \itemindent=.3in
\newdimen\itemindent  \itemindent=.3in
% margin between end of table item and start of table text.
% margin between end of table item and start of table text.
\newdimen\itemmargin  \itemmargin=.1in
\newdimen\itemmargin  \itemmargin=.1in
 
 
% used internally for \itemindent minus \itemmargin
% used internally for \itemindent minus \itemmargin
\newdimen\itemmax
\newdimen\itemmax
 
 
% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
% these defs.
% these defs.
% They also define \itemindex
% They also define \itemindex
% to index the item name in whatever manner is desired (perhaps none).
% to index the item name in whatever manner is desired (perhaps none).
 
 
\newif\ifitemxneedsnegativevskip
\newif\ifitemxneedsnegativevskip
 
 
\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
 
 
\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
 
 
\def\itemzzz #1{\begingroup %
\def\itemzzz #1{\begingroup %
  \advance\hsize by -\rightskip
  \advance\hsize by -\rightskip
  \advance\hsize by -\tableindent
  \advance\hsize by -\tableindent
  \setbox0=\hbox{\itemindicate{#1}}%
  \setbox0=\hbox{\itemindicate{#1}}%
  \itemindex{#1}%
  \itemindex{#1}%
  \nobreak % This prevents a break before @itemx.
  \nobreak % This prevents a break before @itemx.
  %
  %
  % If the item text does not fit in the space we have, put it on a line
  % If the item text does not fit in the space we have, put it on a line
  % by itself, and do not allow a page break either before or after that
  % by itself, and do not allow a page break either before or after that
  % line.  We do not start a paragraph here because then if the next
  % line.  We do not start a paragraph here because then if the next
  % command is, e.g., @kindex, the whatsit would get put into the
  % command is, e.g., @kindex, the whatsit would get put into the
  % horizontal list on a line by itself, resulting in extra blank space.
  % horizontal list on a line by itself, resulting in extra blank space.
  \ifdim \wd0>\itemmax
  \ifdim \wd0>\itemmax
    %
    %
    % Make this a paragraph so we get the \parskip glue and wrapping,
    % Make this a paragraph so we get the \parskip glue and wrapping,
    % but leave it ragged-right.
    % but leave it ragged-right.
    \begingroup
    \begingroup
      \advance\leftskip by-\tableindent
      \advance\leftskip by-\tableindent
      \advance\hsize by\tableindent
      \advance\hsize by\tableindent
      \advance\rightskip by0pt plus1fil
      \advance\rightskip by0pt plus1fil
      \leavevmode\unhbox0\par
      \leavevmode\unhbox0\par
    \endgroup
    \endgroup
    %
    %
    % We're going to be starting a paragraph, but we don't want the
    % We're going to be starting a paragraph, but we don't want the
    % \parskip glue -- logically it's part of the @item we just started.
    % \parskip glue -- logically it's part of the @item we just started.
    \nobreak \vskip-\parskip
    \nobreak \vskip-\parskip
    %
    %
    % Stop a page break at the \parskip glue coming up.  However, if
    % Stop a page break at the \parskip glue coming up.  However, if
    % what follows is an environment such as @example, there will be no
    % what follows is an environment such as @example, there will be no
    % \parskip glue; then the negative vskip we just inserted would
    % \parskip glue; then the negative vskip we just inserted would
    % cause the example and the item to crash together.  So we use this
    % cause the example and the item to crash together.  So we use this
    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
    % \parskip glue after all.  Section titles are handled this way also.
    % \parskip glue after all.  Section titles are handled this way also.
    %
    %
    \penalty 10001
    \penalty 10001
    \endgroup
    \endgroup
    \itemxneedsnegativevskipfalse
    \itemxneedsnegativevskipfalse
  \else
  \else
    % The item text fits into the space.  Start a paragraph, so that the
    % The item text fits into the space.  Start a paragraph, so that the
    % following text (if any) will end up on the same line.
    % following text (if any) will end up on the same line.
    \noindent
    \noindent
    % Do this with kerns and \unhbox so that if there is a footnote in
    % Do this with kerns and \unhbox so that if there is a footnote in
    % the item text, it can migrate to the main vertical list and
    % the item text, it can migrate to the main vertical list and
    % eventually be printed.
    % eventually be printed.
    \nobreak\kern-\tableindent
    \nobreak\kern-\tableindent
    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
    \unhbox0
    \unhbox0
    \nobreak\kern\dimen0
    \nobreak\kern\dimen0
    \endgroup
    \endgroup
    \itemxneedsnegativevskiptrue
    \itemxneedsnegativevskiptrue
  \fi
  \fi
}
}
 
 
\def\item{\errmessage{@item while not in a list environment}}
\def\item{\errmessage{@item while not in a list environment}}
\def\itemx{\errmessage{@itemx while not in a list environment}}
\def\itemx{\errmessage{@itemx while not in a list environment}}
 
 
% @table, @ftable, @vtable.
% @table, @ftable, @vtable.
\envdef\table{%
\envdef\table{%
  \let\itemindex\gobble
  \let\itemindex\gobble
  \tablecheck{table}%
  \tablecheck{table}%
}
}
\envdef\ftable{%
\envdef\ftable{%
  \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  \tablecheck{ftable}%
  \tablecheck{ftable}%
}
}
\envdef\vtable{%
\envdef\vtable{%
  \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  \tablecheck{vtable}%
  \tablecheck{vtable}%
}
}
\def\tablecheck#1{%
\def\tablecheck#1{%
  \ifnum \the\catcode`\^^M=\active
  \ifnum \the\catcode`\^^M=\active
    \endgroup
    \endgroup
    \errmessage{This command won't work in this context; perhaps the problem is
    \errmessage{This command won't work in this context; perhaps the problem is
      that we are \inenvironment\thisenv}%
      that we are \inenvironment\thisenv}%
    \def\next{\doignore{#1}}%
    \def\next{\doignore{#1}}%
  \else
  \else
    \let\next\tablex
    \let\next\tablex
  \fi
  \fi
  \next
  \next
}
}
\def\tablex#1{%
\def\tablex#1{%
  \def\itemindicate{#1}%
  \def\itemindicate{#1}%
  \parsearg\tabley
  \parsearg\tabley
}
}
\def\tabley#1{%
\def\tabley#1{%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable
    \edef\temp{\noexpand\tablez #1\space\space\space}%
    \edef\temp{\noexpand\tablez #1\space\space\space}%
    \expandafter
    \expandafter
  }\temp \endtablez
  }\temp \endtablez
}
}
\def\tablez #1 #2 #3 #4\endtablez{%
\def\tablez #1 #2 #3 #4\endtablez{%
  \aboveenvbreak
  \aboveenvbreak
  \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  \ifnum 0#2>0 \tableindent=#2\mil \fi
  \ifnum 0#2>0 \tableindent=#2\mil \fi
  \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  \itemmax=\tableindent
  \itemmax=\tableindent
  \advance \itemmax by -\itemmargin
  \advance \itemmax by -\itemmargin
  \advance \leftskip by \tableindent
  \advance \leftskip by \tableindent
  \exdentamount=\tableindent
  \exdentamount=\tableindent
  \parindent = 0pt
  \parindent = 0pt
  \parskip = \smallskipamount
  \parskip = \smallskipamount
  \ifdim \parskip=0pt \parskip=2pt \fi
  \ifdim \parskip=0pt \parskip=2pt \fi
  \let\item = \internalBitem
  \let\item = \internalBitem
  \let\itemx = \internalBitemx
  \let\itemx = \internalBitemx
}
}
\def\Etable{\endgraf\afterenvbreak}
\def\Etable{\endgraf\afterenvbreak}
\let\Eftable\Etable
\let\Eftable\Etable
\let\Evtable\Etable
\let\Evtable\Etable
\let\Eitemize\Etable
\let\Eitemize\Etable
\let\Eenumerate\Etable
\let\Eenumerate\Etable
 
 
% This is the counter used by @enumerate, which is really @itemize
% This is the counter used by @enumerate, which is really @itemize
 
 
\newcount \itemno
\newcount \itemno
 
 
\envdef\itemize{\parsearg\doitemize}
\envdef\itemize{\parsearg\doitemize}
 
 
\def\doitemize#1{%
\def\doitemize#1{%
  \aboveenvbreak
  \aboveenvbreak
  \itemmax=\itemindent
  \itemmax=\itemindent
  \advance\itemmax by -\itemmargin
  \advance\itemmax by -\itemmargin
  \advance\leftskip by \itemindent
  \advance\leftskip by \itemindent
  \exdentamount=\itemindent
  \exdentamount=\itemindent
  \parindent=0pt
  \parindent=0pt
  \parskip=\smallskipamount
  \parskip=\smallskipamount
  \ifdim\parskip=0pt \parskip=2pt \fi
  \ifdim\parskip=0pt \parskip=2pt \fi
 
  %
 
  % Try typesetting the item mark that if the document erroneously says
 
  % something like @itemize @samp (intending @table), there's an error
 
  % right away at the @itemize.  It's not the best error message in the
 
  % world, but it's better than leaving it to the @item.  This means if
 
  % the user wants an empty mark, they have to say @w{} not just @w.
  \def\itemcontents{#1}%
  \def\itemcontents{#1}%
 
  \setbox0 = \hbox{\itemcontents}%
 
  %
  % @itemize with no arg is equivalent to @itemize @bullet.
  % @itemize with no arg is equivalent to @itemize @bullet.
  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
 
  %
  \let\item=\itemizeitem
  \let\item=\itemizeitem
}
}
 
 
% Definition of @item while inside @itemize and @enumerate.
% Definition of @item while inside @itemize and @enumerate.
%
%
\def\itemizeitem{%
\def\itemizeitem{%
  \advance\itemno by 1  % for enumerations
  \advance\itemno by 1  % for enumerations
  {\let\par=\endgraf \smallbreak}% reasonable place to break
  {\let\par=\endgraf \smallbreak}% reasonable place to break
  {%
  {%
   % If the document has an @itemize directly after a section title, a
   % If the document has an @itemize directly after a section title, a
   % \nobreak will be last on the list, and \sectionheading will have
   % \nobreak will be last on the list, and \sectionheading will have
   % done a \vskip-\parskip.  In that case, we don't want to zero
   % done a \vskip-\parskip.  In that case, we don't want to zero
   % parskip, or the item text will crash with the heading.  On the
   % parskip, or the item text will crash with the heading.  On the
   % other hand, when there is normal text preceding the item (as there
   % other hand, when there is normal text preceding the item (as there
   % usually is), we do want to zero parskip, or there would be too much
   % usually is), we do want to zero parskip, or there would be too much
   % space.  In that case, we won't have a \nobreak before.  At least
   % space.  In that case, we won't have a \nobreak before.  At least
   % that's the theory.
   % that's the theory.
   \ifnum\lastpenalty<10000 \parskip=0in \fi
   \ifnum\lastpenalty<10000 \parskip=0in \fi
   \noindent
   \noindent
   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
 
   %
   \vadjust{\penalty 1200}}% not good to break after first line of item.
   \vadjust{\penalty 1200}}% not good to break after first line of item.
  \flushcr
  \flushcr
}
}
 
 
% \splitoff TOKENS\endmark defines \first to be the first token in
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
% TOKENS, and \rest to be the remainder.
%
%
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
 
 
% Allow an optional argument of an uppercase letter, lowercase letter,
% Allow an optional argument of an uppercase letter, lowercase letter,
% or number, to specify the first label in the enumerated list.  No
% or number, to specify the first label in the enumerated list.  No
% argument is the same as `1'.
% argument is the same as `1'.
%
%
\envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
\envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
\def\enumeratey #1 #2\endenumeratey{%
\def\enumeratey #1 #2\endenumeratey{%
  % If we were given no argument, pretend we were given `1'.
  % If we were given no argument, pretend we were given `1'.
  \def\thearg{#1}%
  \def\thearg{#1}%
  \ifx\thearg\empty \def\thearg{1}\fi
  \ifx\thearg\empty \def\thearg{1}\fi
  %
  %
  % Detect if the argument is a single token.  If so, it might be a
  % Detect if the argument is a single token.  If so, it might be a
  % letter.  Otherwise, the only valid thing it can be is a number.
  % letter.  Otherwise, the only valid thing it can be is a number.
  % (We will always have one token, because of the test we just made.
  % (We will always have one token, because of the test we just made.
  % This is a good thing, since \splitoff doesn't work given nothing at
  % This is a good thing, since \splitoff doesn't work given nothing at
  % all -- the first parameter is undelimited.)
  % all -- the first parameter is undelimited.)
  \expandafter\splitoff\thearg\endmark
  \expandafter\splitoff\thearg\endmark
  \ifx\rest\empty
  \ifx\rest\empty
    % Only one token in the argument.  It could still be anything.
    % Only one token in the argument.  It could still be anything.
    % A ``lowercase letter'' is one whose \lccode is nonzero.
    % A ``lowercase letter'' is one whose \lccode is nonzero.
    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
    %   not equal to itself.
    %   not equal to itself.
    % Otherwise, we assume it's a number.
    % Otherwise, we assume it's a number.
    %
    %
    % We need the \relax at the end of the \ifnum lines to stop TeX from
    % We need the \relax at the end of the \ifnum lines to stop TeX from
    % continuing to look for a <number>.
    % continuing to look for a <number>.
    %
    %
    \ifnum\lccode\expandafter`\thearg=0\relax
    \ifnum\lccode\expandafter`\thearg=0\relax
      \numericenumerate % a number (we hope)
      \numericenumerate % a number (we hope)
    \else
    \else
      % It's a letter.
      % It's a letter.
      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
        \lowercaseenumerate % lowercase letter
        \lowercaseenumerate % lowercase letter
      \else
      \else
        \uppercaseenumerate % uppercase letter
        \uppercaseenumerate % uppercase letter
      \fi
      \fi
    \fi
    \fi
  \else
  \else
    % Multiple tokens in the argument.  We hope it's a number.
    % Multiple tokens in the argument.  We hope it's a number.
    \numericenumerate
    \numericenumerate
  \fi
  \fi
}
}
 
 
% An @enumerate whose labels are integers.  The starting integer is
% An @enumerate whose labels are integers.  The starting integer is
% given in \thearg.
% given in \thearg.
%
%
\def\numericenumerate{%
\def\numericenumerate{%
  \itemno = \thearg
  \itemno = \thearg
  \startenumeration{\the\itemno}%
  \startenumeration{\the\itemno}%
}
}
 
 
% The starting (lowercase) letter is in \thearg.
% The starting (lowercase) letter is in \thearg.
\def\lowercaseenumerate{%
\def\lowercaseenumerate{%
  \itemno = \expandafter`\thearg
  \itemno = \expandafter`\thearg
  \startenumeration{%
  \startenumeration{%
    % Be sure we're not beyond the end of the alphabet.
    % Be sure we're not beyond the end of the alphabet.
    \ifnum\itemno=0
    \ifnum\itemno=0
      \errmessage{No more lowercase letters in @enumerate; get a bigger
      \errmessage{No more lowercase letters in @enumerate; get a bigger
                  alphabet}%
                  alphabet}%
    \fi
    \fi
    \char\lccode\itemno
    \char\lccode\itemno
  }%
  }%
}
}
 
 
% The starting (uppercase) letter is in \thearg.
% The starting (uppercase) letter is in \thearg.
\def\uppercaseenumerate{%
\def\uppercaseenumerate{%
  \itemno = \expandafter`\thearg
  \itemno = \expandafter`\thearg
  \startenumeration{%
  \startenumeration{%
    % Be sure we're not beyond the end of the alphabet.
    % Be sure we're not beyond the end of the alphabet.
    \ifnum\itemno=0
    \ifnum\itemno=0
      \errmessage{No more uppercase letters in @enumerate; get a bigger
      \errmessage{No more uppercase letters in @enumerate; get a bigger
                  alphabet}
                  alphabet}
    \fi
    \fi
    \char\uccode\itemno
    \char\uccode\itemno
  }%
  }%
}
}
 
 
% Call \doitemize, adding a period to the first argument and supplying the
% Call \doitemize, adding a period to the first argument and supplying the
% common last two arguments.  Also subtract one from the initial value in
% common last two arguments.  Also subtract one from the initial value in
% \itemno, since @item increments \itemno.
% \itemno, since @item increments \itemno.
%
%
\def\startenumeration#1{%
\def\startenumeration#1{%
  \advance\itemno by -1
  \advance\itemno by -1
  \doitemize{#1.}\flushcr
  \doitemize{#1.}\flushcr
}
}
 
 
% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
% to @enumerate.
% to @enumerate.
%
%
\def\alphaenumerate{\enumerate{a}}
\def\alphaenumerate{\enumerate{a}}
\def\capsenumerate{\enumerate{A}}
\def\capsenumerate{\enumerate{A}}
\def\Ealphaenumerate{\Eenumerate}
\def\Ealphaenumerate{\Eenumerate}
\def\Ecapsenumerate{\Eenumerate}
\def\Ecapsenumerate{\Eenumerate}
 
 
 
 
% @multitable macros
% @multitable macros
% Amy Hendrickson, 8/18/94, 3/6/96
% Amy Hendrickson, 8/18/94, 3/6/96
%
%
% @multitable ... @end multitable will make as many columns as desired.
% @multitable ... @end multitable will make as many columns as desired.
% Contents of each column will wrap at width given in preamble.  Width
% Contents of each column will wrap at width given in preamble.  Width
% can be specified either with sample text given in a template line,
% can be specified either with sample text given in a template line,
% or in percent of \hsize, the current width of text on page.
% or in percent of \hsize, the current width of text on page.
 
 
% Table can continue over pages but will only break between lines.
% Table can continue over pages but will only break between lines.
 
 
% To make preamble:
% To make preamble:
%
%
% Either define widths of columns in terms of percent of \hsize:
% Either define widths of columns in terms of percent of \hsize:
%   @multitable @columnfractions .25 .3 .45
%   @multitable @columnfractions .25 .3 .45
%   @item ...
%   @item ...
%
%
%   Numbers following @columnfractions are the percent of the total
%   Numbers following @columnfractions are the percent of the total
%   current hsize to be used for each column. You may use as many
%   current hsize to be used for each column. You may use as many
%   columns as desired.
%   columns as desired.
 
 
 
 
% Or use a template:
% Or use a template:
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
%   @item ...
%   @item ...
%   using the widest term desired in each column.
%   using the widest term desired in each column.
 
 
% Each new table line starts with @item, each subsequent new column
% Each new table line starts with @item, each subsequent new column
% starts with @tab. Empty columns may be produced by supplying @tab's
% starts with @tab. Empty columns may be produced by supplying @tab's
% with nothing between them for as many times as empty columns are needed,
% with nothing between them for as many times as empty columns are needed,
% ie, @tab@tab@tab will produce two empty columns.
% ie, @tab@tab@tab will produce two empty columns.
 
 
% @item, @tab do not need to be on their own lines, but it will not hurt
% @item, @tab do not need to be on their own lines, but it will not hurt
% if they are.
% if they are.
 
 
% Sample multitable:
% Sample multitable:
 
 
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
%   @item first col stuff @tab second col stuff @tab third col
%   @item first col stuff @tab second col stuff @tab third col
%   @item
%   @item
%   first col stuff
%   first col stuff
%   @tab
%   @tab
%   second col stuff
%   second col stuff
%   @tab
%   @tab
%   third col
%   third col
%   @item first col stuff @tab second col stuff
%   @item first col stuff @tab second col stuff
%   @tab Many paragraphs of text may be used in any column.
%   @tab Many paragraphs of text may be used in any column.
%
%
%         They will wrap at the width determined by the template.
%         They will wrap at the width determined by the template.
%   @item@tab@tab This will be in third column.
%   @item@tab@tab This will be in third column.
%   @end multitable
%   @end multitable
 
 
% Default dimensions may be reset by user.
% Default dimensions may be reset by user.
% @multitableparskip is vertical space between paragraphs in table.
% @multitableparskip is vertical space between paragraphs in table.
% @multitableparindent is paragraph indent in table.
% @multitableparindent is paragraph indent in table.
% @multitablecolmargin is horizontal space to be left between columns.
% @multitablecolmargin is horizontal space to be left between columns.
% @multitablelinespace is space to leave between table items, baseline
% @multitablelinespace is space to leave between table items, baseline
%                                                            to baseline.
%                                                            to baseline.
%   0pt means it depends on current normal line spacing.
%   0pt means it depends on current normal line spacing.
%
%
\newskip\multitableparskip
\newskip\multitableparskip
\newskip\multitableparindent
\newskip\multitableparindent
\newdimen\multitablecolspace
\newdimen\multitablecolspace
\newskip\multitablelinespace
\newskip\multitablelinespace
\multitableparskip=0pt
\multitableparskip=0pt
\multitableparindent=6pt
\multitableparindent=6pt
\multitablecolspace=12pt
\multitablecolspace=12pt
\multitablelinespace=0pt
\multitablelinespace=0pt
 
 
% Macros used to set up halign preamble:
% Macros used to set up halign preamble:
%
%
\let\endsetuptable\relax
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
\newif\ifsetpercent
 
 
% #1 is the @columnfraction, usually a decimal number like .5, but might
% #1 is the @columnfraction, usually a decimal number like .5, but might
% be just 1.  We just use it, whatever it is.
% be just 1.  We just use it, whatever it is.
%
%
\def\pickupwholefraction#1 {%
\def\pickupwholefraction#1 {%
  \global\advance\colcount by 1
  \global\advance\colcount by 1
  \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  \setuptable
  \setuptable
}
}
 
 
\newcount\colcount
\newcount\colcount
\def\setuptable#1{%
\def\setuptable#1{%
  \def\firstarg{#1}%
  \def\firstarg{#1}%
  \ifx\firstarg\xendsetuptable
  \ifx\firstarg\xendsetuptable
    \let\go = \relax
    \let\go = \relax
  \else
  \else
    \ifx\firstarg\xcolumnfractions
    \ifx\firstarg\xcolumnfractions
      \global\setpercenttrue
      \global\setpercenttrue
    \else
    \else
      \ifsetpercent
      \ifsetpercent
         \let\go\pickupwholefraction
         \let\go\pickupwholefraction
      \else
      \else
         \global\advance\colcount by 1
         \global\advance\colcount by 1
         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
                   % separator; typically that is always in the input, anyway.
                   % separator; typically that is always in the input, anyway.
         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
      \fi
      \fi
    \fi
    \fi
    \ifx\go\pickupwholefraction
    \ifx\go\pickupwholefraction
      % Put the argument back for the \pickupwholefraction call, so
      % Put the argument back for the \pickupwholefraction call, so
      % we'll always have a period there to be parsed.
      % we'll always have a period there to be parsed.
      \def\go{\pickupwholefraction#1}%
      \def\go{\pickupwholefraction#1}%
    \else
    \else
      \let\go = \setuptable
      \let\go = \setuptable
    \fi%
    \fi%
  \fi
  \fi
  \go
  \go
}
}
 
 
% multitable-only commands.
% multitable-only commands.
%
%
% @headitem starts a heading row, which we typeset in bold.
% @headitem starts a heading row, which we typeset in bold.
% Assignments have to be global since we are inside the implicit group
% Assignments have to be global since we are inside the implicit group
% of an alignment entry.  Note that \everycr resets \everytab.
% of an alignment entry.  \everycr resets \everytab so we don't have to
\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
% undo it ourselves.
 
\def\headitemfont{\b}% for people to use in the template row; not changeable
 
\def\headitem{%
 
  \checkenv\multitable
 
  \crcr
 
  \global\everytab={\bf}% can't use \headitemfont since the parsing differs
 
  \the\everytab % for the first item
 
}%
%
%
% A \tab used to include \hskip1sp.  But then the space in a template
% A \tab used to include \hskip1sp.  But then the space in a template
% line is not enough.  That is bad.  So let's go back to just `&' until
% line is not enough.  That is bad.  So let's go back to just `&' until
% we encounter the problem it was intended to solve again.
% we again encounter the problem the 1sp was intended to solve.
%                                       --karl, nathan@acm.org, 20apr99.
%                                       --karl, nathan@acm.org, 20apr99.
\def\tab{\checkenv\multitable &\the\everytab}%
\def\tab{\checkenv\multitable &\the\everytab}%
 
 
% @multitable ... @end multitable definitions:
% @multitable ... @end multitable definitions:
%
%
\newtoks\everytab  % insert after every tab.
\newtoks\everytab  % insert after every tab.
%
%
\envdef\multitable{%
\envdef\multitable{%
  \vskip\parskip
  \vskip\parskip
  \startsavinginserts
  \startsavinginserts
  %
  %
  % @item within a multitable starts a normal row.
  % @item within a multitable starts a normal row.
  % We use \def instead of \let so that if one of the multitable entries
  % We use \def instead of \let so that if one of the multitable entries
  % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  % \endtemplate) expanding \doitemize.
  % \endtemplate) expanding \doitemize.
  \def\item{\crcr}%
  \def\item{\crcr}%
  %
  %
  \tolerance=9500
  \tolerance=9500
  \hbadness=9500
  \hbadness=9500
  \setmultitablespacing
  \setmultitablespacing
  \parskip=\multitableparskip
  \parskip=\multitableparskip
  \parindent=\multitableparindent
  \parindent=\multitableparindent
  \overfullrule=0pt
  \overfullrule=0pt
  \global\colcount=0
  \global\colcount=0
  %
  %
  \everycr = {%
  \everycr = {%
    \noalign{%
    \noalign{%
      \global\everytab={}%
      \global\everytab={}%
      \global\colcount=0 % Reset the column counter.
      \global\colcount=0 % Reset the column counter.
      % Check for saved footnotes, etc.
      % Check for saved footnotes, etc.
      \checkinserts
      \checkinserts
      % Keeps underfull box messages off when table breaks over pages.
      % Keeps underfull box messages off when table breaks over pages.
      %\filbreak
      %\filbreak
        % Maybe so, but it also creates really weird page breaks when the
        % Maybe so, but it also creates really weird page breaks when the
        % table breaks over pages. Wouldn't \vfil be better?  Wait until the
        % table breaks over pages. Wouldn't \vfil be better?  Wait until the
        % problem manifests itself, so it can be fixed for real --karl.
        % problem manifests itself, so it can be fixed for real --karl.
    }%
    }%
  }%
  }%
  %
  %
  \parsearg\domultitable
  \parsearg\domultitable
}
}
\def\domultitable#1{%
\def\domultitable#1{%
  % To parse everything between @multitable and @item:
  % To parse everything between @multitable and @item:
  \setuptable#1 \endsetuptable
  \setuptable#1 \endsetuptable
  %
  %
  % This preamble sets up a generic column definition, which will
  % This preamble sets up a generic column definition, which will
  % be used as many times as user calls for columns.
  % be used as many times as user calls for columns.
  % \vtop will set a single line and will also let text wrap and
  % \vtop will set a single line and will also let text wrap and
  % continue for many paragraphs if desired.
  % continue for many paragraphs if desired.
  \halign\bgroup &%
  \halign\bgroup &%
    \global\advance\colcount by 1
    \global\advance\colcount by 1
    \multistrut
    \multistrut
    \vtop{%
    \vtop{%
      % Use the current \colcount to find the correct column width:
      % Use the current \colcount to find the correct column width:
      \hsize=\expandafter\csname col\the\colcount\endcsname
      \hsize=\expandafter\csname col\the\colcount\endcsname
      %
      %
      % In order to keep entries from bumping into each other
      % In order to keep entries from bumping into each other
      % we will add a \leftskip of \multitablecolspace to all columns after
      % we will add a \leftskip of \multitablecolspace to all columns after
      % the first one.
      % the first one.
      %
      %
      % If a template has been used, we will add \multitablecolspace
      % If a template has been used, we will add \multitablecolspace
      % to the width of each template entry.
      % to the width of each template entry.
      %
      %
      % If the user has set preamble in terms of percent of \hsize we will
      % If the user has set preamble in terms of percent of \hsize we will
      % use that dimension as the width of the column, and the \leftskip
      % use that dimension as the width of the column, and the \leftskip
      % will keep entries from bumping into each other.  Table will start at
      % will keep entries from bumping into each other.  Table will start at
      % left margin and final column will justify at right margin.
      % left margin and final column will justify at right margin.
      %
      %
      % Make sure we don't inherit \rightskip from the outer environment.
      % Make sure we don't inherit \rightskip from the outer environment.
      \rightskip=0pt
      \rightskip=0pt
      \ifnum\colcount=1
      \ifnum\colcount=1
        % The first column will be indented with the surrounding text.
        % The first column will be indented with the surrounding text.
        \advance\hsize by\leftskip
        \advance\hsize by\leftskip
      \else
      \else
        \ifsetpercent \else
        \ifsetpercent \else
          % If user has not set preamble in terms of percent of \hsize
          % If user has not set preamble in terms of percent of \hsize
          % we will advance \hsize by \multitablecolspace.
          % we will advance \hsize by \multitablecolspace.
          \advance\hsize by \multitablecolspace
          \advance\hsize by \multitablecolspace
        \fi
        \fi
       % In either case we will make \leftskip=\multitablecolspace:
       % In either case we will make \leftskip=\multitablecolspace:
      \leftskip=\multitablecolspace
      \leftskip=\multitablecolspace
      \fi
      \fi
      % Ignoring space at the beginning and end avoids an occasional spurious
      % Ignoring space at the beginning and end avoids an occasional spurious
      % blank line, when TeX decides to break the line at the space before the
      % blank line, when TeX decides to break the line at the space before the
      % box from the multistrut, so the strut ends up on a line by itself.
      % box from the multistrut, so the strut ends up on a line by itself.
      % For example:
      % For example:
      % @multitable @columnfractions .11 .89
      % @multitable @columnfractions .11 .89
      % @item @code{#}
      % @item @code{#}
      % @tab Legal holiday which is valid in major parts of the whole country.
      % @tab Legal holiday which is valid in major parts of the whole country.
      % Is automatically provided with highlighting sequences respectively
      % Is automatically provided with highlighting sequences respectively
      % marking characters.
      % marking characters.
      \noindent\ignorespaces##\unskip\multistrut
      \noindent\ignorespaces##\unskip\multistrut
    }\cr
    }\cr
}
}
\def\Emultitable{%
\def\Emultitable{%
  \crcr
  \crcr
  \egroup % end the \halign
  \egroup % end the \halign
  \global\setpercentfalse
  \global\setpercentfalse
}
}
 
 
\def\setmultitablespacing{%
\def\setmultitablespacing{%
  \def\multistrut{\strut}% just use the standard line spacing
  \def\multistrut{\strut}% just use the standard line spacing
  %
  %
  % Compute \multitablelinespace (if not defined by user) for use in
  % Compute \multitablelinespace (if not defined by user) for use in
  % \multitableparskip calculation.  We used define \multistrut based on
  % \multitableparskip calculation.  We used define \multistrut based on
  % this, but (ironically) that caused the spacing to be off.
  % this, but (ironically) that caused the spacing to be off.
  % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
\ifdim\multitablelinespace=0pt
\ifdim\multitablelinespace=0pt
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
\global\advance\multitablelinespace by-\ht0
\global\advance\multitablelinespace by-\ht0
\fi
\fi
%% Test to see if parskip is larger than space between lines of
%% Test to see if parskip is larger than space between lines of
%% table. If not, do nothing.
%% table. If not, do nothing.
%%        If so, set to same dimension as multitablelinespace.
%%        If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
                                      %% than skip between lines in the table.
                                      %% than skip between lines in the table.
\fi%
\fi%
\ifdim\multitableparskip=0pt
\ifdim\multitableparskip=0pt
\global\multitableparskip=\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
                                      %% than skip between lines in the table.
                                      %% than skip between lines in the table.
\fi}
\fi}
 
 
 
 
\message{conditionals,}
\message{conditionals,}
 
 
% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
% @ifnotxml always succeed.  They currently do nothing; we don't
% @ifnotxml always succeed.  They currently do nothing; we don't
% attempt to check whether the conditionals are properly nested.  But we
% attempt to check whether the conditionals are properly nested.  But we
% have to remember that they are conditionals, so that @end doesn't
% have to remember that they are conditionals, so that @end doesn't
% attempt to close an environment group.
% attempt to close an environment group.
%
%
\def\makecond#1{%
\def\makecond#1{%
  \expandafter\let\csname #1\endcsname = \relax
  \expandafter\let\csname #1\endcsname = \relax
  \expandafter\let\csname iscond.#1\endcsname = 1
  \expandafter\let\csname iscond.#1\endcsname = 1
}
}
\makecond{iftex}
\makecond{iftex}
\makecond{ifnotdocbook}
\makecond{ifnotdocbook}
\makecond{ifnothtml}
\makecond{ifnothtml}
\makecond{ifnotinfo}
\makecond{ifnotinfo}
\makecond{ifnotplaintext}
\makecond{ifnotplaintext}
\makecond{ifnotxml}
\makecond{ifnotxml}
 
 
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
%
%
\def\direntry{\doignore{direntry}}
\def\direntry{\doignore{direntry}}
\def\documentdescription{\doignore{documentdescription}}
\def\documentdescription{\doignore{documentdescription}}
\def\docbook{\doignore{docbook}}
\def\docbook{\doignore{docbook}}
\def\html{\doignore{html}}
\def\html{\doignore{html}}
\def\ifdocbook{\doignore{ifdocbook}}
\def\ifdocbook{\doignore{ifdocbook}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifinfo{\doignore{ifinfo}}
\def\ifinfo{\doignore{ifinfo}}
\def\ifnottex{\doignore{ifnottex}}
\def\ifnottex{\doignore{ifnottex}}
\def\ifplaintext{\doignore{ifplaintext}}
\def\ifplaintext{\doignore{ifplaintext}}
\def\ifxml{\doignore{ifxml}}
\def\ifxml{\doignore{ifxml}}
\def\ignore{\doignore{ignore}}
\def\ignore{\doignore{ignore}}
\def\menu{\doignore{menu}}
\def\menu{\doignore{menu}}
\def\xml{\doignore{xml}}
\def\xml{\doignore{xml}}
 
 
% Ignore text until a line `@end #1', keeping track of nested conditionals.
% Ignore text until a line `@end #1', keeping track of nested conditionals.
%
%
% A count to remember the depth of nesting.
% A count to remember the depth of nesting.
\newcount\doignorecount
\newcount\doignorecount
 
 
\def\doignore#1{\begingroup
\def\doignore#1{\begingroup
  % Scan in ``verbatim'' mode:
  % Scan in ``verbatim'' mode:
  \obeylines
  \obeylines
  \catcode`\@ = \other
  \catcode`\@ = \other
  \catcode`\{ = \other
  \catcode`\{ = \other
  \catcode`\} = \other
  \catcode`\} = \other
  %
  %
  % Make sure that spaces turn into tokens that match what \doignoretext wants.
  % Make sure that spaces turn into tokens that match what \doignoretext wants.
  \spaceisspace
  \spaceisspace
  %
  %
  % Count number of #1's that we've seen.
  % Count number of #1's that we've seen.
  \doignorecount = 0
  \doignorecount = 0
  %
  %
  % Swallow text until we reach the matching `@end #1'.
  % Swallow text until we reach the matching `@end #1'.
  \dodoignore{#1}%
  \dodoignore{#1}%
}
}
 
 
{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  \obeylines %
  \obeylines %
  %
  %
  \gdef\dodoignore#1{%
  \gdef\dodoignore#1{%
    % #1 contains the command name as a string, e.g., `ifinfo'.
    % #1 contains the command name as a string, e.g., `ifinfo'.
    %
    %
    % Define a command to find the next `@end #1'.
    % Define a command to find the next `@end #1'.
    \long\def\doignoretext##1^^M@end #1{%
    \long\def\doignoretext##1^^M@end #1{%
      \doignoretextyyy##1^^M@#1\_STOP_}%
      \doignoretextyyy##1^^M@#1\_STOP_}%
    %
    %
    % And this command to find another #1 command, at the beginning of a
    % And this command to find another #1 command, at the beginning of a
    % line.  (Otherwise, we would consider a line `@c @ifset', for
    % line.  (Otherwise, we would consider a line `@c @ifset', for
    % example, to count as an @ifset for nesting.)
    % example, to count as an @ifset for nesting.)
    \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
    \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
    %
    %
    % And now expand that command.
    % And now expand that command.
    \doignoretext ^^M%
    \doignoretext ^^M%
  }%
  }%
}
}
 
 
\def\doignoreyyy#1{%
\def\doignoreyyy#1{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\empty                       % Nothing found.
  \ifx\temp\empty                       % Nothing found.
    \let\next\doignoretextzzz
    \let\next\doignoretextzzz
  \else                                 % Found a nested condition, ...
  \else                                 % Found a nested condition, ...
    \advance\doignorecount by 1
    \advance\doignorecount by 1
    \let\next\doignoretextyyy           % ..., look for another.
    \let\next\doignoretextyyy           % ..., look for another.
    % If we're here, #1 ends with ^^M\ifinfo (for example).
    % If we're here, #1 ends with ^^M\ifinfo (for example).
  \fi
  \fi
  \next #1% the token \_STOP_ is present just after this macro.
  \next #1% the token \_STOP_ is present just after this macro.
}
}
 
 
% We have to swallow the remaining "\_STOP_".
% We have to swallow the remaining "\_STOP_".
%
%
\def\doignoretextzzz#1{%
\def\doignoretextzzz#1{%
  \ifnum\doignorecount = 0      % We have just found the outermost @end.
  \ifnum\doignorecount = 0      % We have just found the outermost @end.
    \let\next\enddoignore
    \let\next\enddoignore
  \else                         % Still inside a nested condition.
  \else                         % Still inside a nested condition.
    \advance\doignorecount by -1
    \advance\doignorecount by -1
    \let\next\doignoretext      % Look for the next @end.
    \let\next\doignoretext      % Look for the next @end.
  \fi
  \fi
  \next
  \next
}
}
 
 
% Finish off ignored text.
% Finish off ignored text.
{ \obeylines%
{ \obeylines%
  % Ignore anything after the last `@end #1'; this matters in verbatim
  % Ignore anything after the last `@end #1'; this matters in verbatim
  % environments, where otherwise the newline after an ignored conditional
  % environments, where otherwise the newline after an ignored conditional
  % would result in a blank line in the output.
  % would result in a blank line in the output.
  \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
}
}
 
 
 
 
% @set VAR sets the variable VAR to an empty value.
% @set VAR sets the variable VAR to an empty value.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
%
%
% Since we want to separate VAR from REST-OF-LINE (which might be
% Since we want to separate VAR from REST-OF-LINE (which might be
% empty), we can't just use \parsearg; we have to insert a space of our
% empty), we can't just use \parsearg; we have to insert a space of our
% own to delimit the rest of the line, and then take it out again if we
% own to delimit the rest of the line, and then take it out again if we
% didn't need it.
% didn't need it.
% We rely on the fact that \parsearg sets \catcode`\ =10.
% We rely on the fact that \parsearg sets \catcode`\ =10.
%
%
\parseargdef\set{\setyyy#1 \endsetyyy}
\parseargdef\set{\setyyy#1 \endsetyyy}
\def\setyyy#1 #2\endsetyyy{%
\def\setyyy#1 #2\endsetyyy{%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable
    \def\temp{#2}%
    \def\temp{#2}%
    \edef\next{\gdef\makecsname{SET#1}}%
    \edef\next{\gdef\makecsname{SET#1}}%
    \ifx\temp\empty
    \ifx\temp\empty
      \next{}%
      \next{}%
    \else
    \else
      \setzzz#2\endsetzzz
      \setzzz#2\endsetzzz
    \fi
    \fi
  }%
  }%
}
}
% Remove the trailing space \setxxx inserted.
% Remove the trailing space \setxxx inserted.
\def\setzzz#1 \endsetzzz{\next{#1}}
\def\setzzz#1 \endsetzzz{\next{#1}}
 
 
% @clear VAR clears (i.e., unsets) the variable VAR.
% @clear VAR clears (i.e., unsets) the variable VAR.
%
%
\parseargdef\clear{%
\parseargdef\clear{%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable
    \global\expandafter\let\csname SET#1\endcsname=\relax
    \global\expandafter\let\csname SET#1\endcsname=\relax
  }%
  }%
}
}
 
 
% @value{foo} gets the text saved in variable foo.
% @value{foo} gets the text saved in variable foo.
\def\value{\begingroup\makevalueexpandable\valuexxx}
\def\value{\begingroup\makevalueexpandable\valuexxx}
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
{
{
  \catcode`\- = \active \catcode`\_ = \active
  \catcode`\- = \active \catcode`\_ = \active
  %
  %
  \gdef\makevalueexpandable{%
  \gdef\makevalueexpandable{%
    \let\value = \expandablevalue
    \let\value = \expandablevalue
    % We don't want these characters active, ...
    % We don't want these characters active, ...
    \catcode`\-=\other \catcode`\_=\other
    \catcode`\-=\other \catcode`\_=\other
    % ..., but we might end up with active ones in the argument if
    % ..., but we might end up with active ones in the argument if
    % we're called from @code, as @code{@value{foo-bar_}}, though.
    % we're called from @code, as @code{@value{foo-bar_}}, though.
    % So \let them to their normal equivalents.
    % So \let them to their normal equivalents.
    \let-\realdash \let_\normalunderscore
    \let-\realdash \let_\normalunderscore
  }
  }
}
}
 
 
% We have this subroutine so that we can handle at least some @value's
% We have this subroutine so that we can handle at least some @value's
% properly in indexes (we call \makevalueexpandable in \indexdummies).
% properly in indexes (we call \makevalueexpandable in \indexdummies).
% The command has to be fully expandable (if the variable is set), since
% The command has to be fully expandable (if the variable is set), since
% the result winds up in the index file.  This means that if the
% the result winds up in the index file.  This means that if the
% variable's value contains other Texinfo commands, it's almost certain
% variable's value contains other Texinfo commands, it's almost certain
% it will fail (although perhaps we could fix that with sufficient work
% it will fail (although perhaps we could fix that with sufficient work
% to do a one-level expansion on the result, instead of complete).
% to do a one-level expansion on the result, instead of complete).
%
%
\def\expandablevalue#1{%
\def\expandablevalue#1{%
  \expandafter\ifx\csname SET#1\endcsname\relax
  \expandafter\ifx\csname SET#1\endcsname\relax
    {[No value for ``#1'']}%
    {[No value for ``#1'']}%
    \message{Variable `#1', used in @value, is not set.}%
    \message{Variable `#1', used in @value, is not set.}%
  \else
  \else
    \csname SET#1\endcsname
    \csname SET#1\endcsname
  \fi
  \fi
}
}
 
 
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
% with @set.
%
%
% To get special treatment of `@end ifset,' call \makeond and the redefine.
% To get special treatment of `@end ifset,' call \makeond and the redefine.
%
%
\makecond{ifset}
\makecond{ifset}
\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
\def\doifset#1#2{%
\def\doifset#1#2{%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable
    \let\next=\empty
    \let\next=\empty
    \expandafter\ifx\csname SET#2\endcsname\relax
    \expandafter\ifx\csname SET#2\endcsname\relax
      #1% If not set, redefine \next.
      #1% If not set, redefine \next.
    \fi
    \fi
    \expandafter
    \expandafter
  }\next
  }\next
}
}
\def\ifsetfail{\doignore{ifset}}
\def\ifsetfail{\doignore{ifset}}
 
 
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
% defined with @set, or has been undefined with @clear.
%
%
% The `\else' inside the `\doifset' parameter is a trick to reuse the
% The `\else' inside the `\doifset' parameter is a trick to reuse the
% above code: if the variable is not set, do nothing, if it is set,
% above code: if the variable is not set, do nothing, if it is set,
% then redefine \next to \ifclearfail.
% then redefine \next to \ifclearfail.
%
%
\makecond{ifclear}
\makecond{ifclear}
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclearfail{\doignore{ifclear}}
\def\ifclearfail{\doignore{ifclear}}
 
 
% @dircategory CATEGORY  -- specify a category of the dir file
% @dircategory CATEGORY  -- specify a category of the dir file
% which this file should belong to.  Ignore this in TeX.
% which this file should belong to.  Ignore this in TeX.
\let\dircategory=\comment
\let\dircategory=\comment
 
 
% @defininfoenclose.
% @defininfoenclose.
\let\definfoenclose=\comment
\let\definfoenclose=\comment
 
 
 
 
\message{indexing,}
\message{indexing,}
% Index generation facilities
% Index generation facilities
 
 
% Define \newwrite to be identical to plain tex's \newwrite
% Define \newwrite to be identical to plain tex's \newwrite
% except not \outer, so it can be used within macros and \if's.
% except not \outer, so it can be used within macros and \if's.
\edef\newwrite{\makecsname{ptexnewwrite}}
\edef\newwrite{\makecsname{ptexnewwrite}}
 
 
% \newindex {foo} defines an index named foo.
% \newindex {foo} defines an index named foo.
% It automatically defines \fooindex such that
% It automatically defines \fooindex such that
% \fooindex ...rest of line... puts an entry in the index foo.
% \fooindex ...rest of line... puts an entry in the index foo.
% It also defines \fooindfile to be the number of the output channel for
% It also defines \fooindfile to be the number of the output channel for
% the file that accumulates this index.  The file's extension is foo.
% the file that accumulates this index.  The file's extension is foo.
% The name of an index should be no more than 2 characters long
% The name of an index should be no more than 2 characters long
% for the sake of vms.
% for the sake of vms.
%
%
\def\newindex#1{%
\def\newindex#1{%
  \iflinks
  \iflinks
    \expandafter\newwrite \csname#1indfile\endcsname
    \expandafter\newwrite \csname#1indfile\endcsname
    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  \fi
  \fi
  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
    \noexpand\doindex{#1}}
    \noexpand\doindex{#1}}
}
}
 
 
% @defindex foo  ==  \newindex{foo}
% @defindex foo  ==  \newindex{foo}
%
%
\def\defindex{\parsearg\newindex}
\def\defindex{\parsearg\newindex}
 
 
% Define @defcodeindex, like @defindex except put all entries in @code.
% Define @defcodeindex, like @defindex except put all entries in @code.
%
%
\def\defcodeindex{\parsearg\newcodeindex}
\def\defcodeindex{\parsearg\newcodeindex}
%
%
\def\newcodeindex#1{%
\def\newcodeindex#1{%
  \iflinks
  \iflinks
    \expandafter\newwrite \csname#1indfile\endcsname
    \expandafter\newwrite \csname#1indfile\endcsname
    \openout \csname#1indfile\endcsname \jobname.#1
    \openout \csname#1indfile\endcsname \jobname.#1
  \fi
  \fi
  \expandafter\xdef\csname#1index\endcsname{%
  \expandafter\xdef\csname#1index\endcsname{%
    \noexpand\docodeindex{#1}}%
    \noexpand\docodeindex{#1}}%
}
}
 
 
 
 
% @synindex foo bar    makes index foo feed into index bar.
% @synindex foo bar    makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
% Do this instead of @defindex foo if you don't want it as a separate index.
%
%
% @syncodeindex foo bar   similar, but put all entries made for index foo
% @syncodeindex foo bar   similar, but put all entries made for index foo
% inside @code.
% inside @code.
%
%
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
 
 
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
% #3 the target index (bar).
% #3 the target index (bar).
\def\dosynindex#1#2#3{%
\def\dosynindex#1#2#3{%
  % Only do \closeout if we haven't already done it, else we'll end up
  % Only do \closeout if we haven't already done it, else we'll end up
  % closing the target index.
  % closing the target index.
  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
  \expandafter \ifx\csname donesynindex#2\endcsname \relax
    % The \closeout helps reduce unnecessary open files; the limit on the
    % The \closeout helps reduce unnecessary open files; the limit on the
    % Acorn RISC OS is a mere 16 files.
    % Acorn RISC OS is a mere 16 files.
    \expandafter\closeout\csname#2indfile\endcsname
    \expandafter\closeout\csname#2indfile\endcsname
    \expandafter\let\csname\donesynindex#2\endcsname = 1
    \expandafter\let\csname donesynindex#2\endcsname = 1
  \fi
  \fi
  % redefine \fooindfile:
  % redefine \fooindfile:
  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  \expandafter\let\csname#2indfile\endcsname=\temp
  \expandafter\let\csname#2indfile\endcsname=\temp
  % redefine \fooindex:
  % redefine \fooindex:
  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
}
}
 
 
% Define \doindex, the driver for all \fooindex macros.
% Define \doindex, the driver for all \fooindex macros.
% Argument #1 is generated by the calling \fooindex macro,
% Argument #1 is generated by the calling \fooindex macro,
%  and it is "foo", the name of the index.
%  and it is "foo", the name of the index.
 
 
% \doindex just uses \parsearg; it calls \doind for the actual work.
% \doindex just uses \parsearg; it calls \doind for the actual work.
% This is because \doind is more useful to call from other macros.
% This is because \doind is more useful to call from other macros.
 
 
% There is also \dosubind {index}{topic}{subtopic}
% There is also \dosubind {index}{topic}{subtopic}
% which makes an entry in a two-level index such as the operation index.
% which makes an entry in a two-level index such as the operation index.
 
 
\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
\def\singleindexer #1{\doind{\indexname}{#1}}
\def\singleindexer #1{\doind{\indexname}{#1}}
 
 
% like the previous two, but they put @code around the argument.
% like the previous two, but they put @code around the argument.
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
 
 
% Take care of Texinfo commands that can appear in an index entry.
% Take care of Texinfo commands that can appear in an index entry.
% Since there are some commands we want to expand, and others we don't,
% Since there are some commands we want to expand, and others we don't,
% we have to laboriously prevent expansion for those that we don't.
% we have to laboriously prevent expansion for those that we don't.
%
%
\def\indexdummies{%
\def\indexdummies{%
  \escapechar = `\\     % use backslash in output files.
  \escapechar = `\\     % use backslash in output files.
  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  \def\ {\realbackslash\space }%
  \def\ {\realbackslash\space }%
  %
  %
  % Need these in case \tex is in effect and \{ is a \delimiter again.
  % Need these in case \tex is in effect and \{ is a \delimiter again.
  % But can't use \lbracecmd and \rbracecmd because texindex assumes
  % But can't use \lbracecmd and \rbracecmd because texindex assumes
  % braces and backslashes are used only as delimiters.
  % braces and backslashes are used only as delimiters.
  \let\{ = \mylbrace
  \let\{ = \mylbrace
  \let\} = \myrbrace
  \let\} = \myrbrace
  %
  %
  % I don't entirely understand this, but when an index entry is
  % I don't entirely understand this, but when an index entry is
  % generated from a macro call, the \endinput which \scanmacro inserts
  % generated from a macro call, the \endinput which \scanmacro inserts
  % causes processing to be prematurely terminated.  This is,
  % causes processing to be prematurely terminated.  This is,
  % apparently, because \indexsorttmp is fully expanded, and \endinput
  % apparently, because \indexsorttmp is fully expanded, and \endinput
  % is an expandable command.  The redefinition below makes \endinput
  % is an expandable command.  The redefinition below makes \endinput
  % disappear altogether for that purpose -- although logging shows that
  % disappear altogether for that purpose -- although logging shows that
  % processing continues to some further point.  On the other hand, it
  % processing continues to some further point.  On the other hand, it
  % seems \endinput does not hurt in the printed index arg, since that
  % seems \endinput does not hurt in the printed index arg, since that
  % is still getting written without apparent harm.
  % is still getting written without apparent harm.
  %
  %
  % Sample source (mac-idx3.tex, reported by Graham Percival to
  % Sample source (mac-idx3.tex, reported by Graham Percival to
  % help-texinfo, 22may06):
  % help-texinfo, 22may06):
  % @macro funindex {WORD}
  % @macro funindex {WORD}
  % @findex xyz
  % @findex xyz
  % @end macro
  % @end macro
  % ...
  % ...
  % @funindex commtest
  % @funindex commtest
  %
  %
  % The above is not enough to reproduce the bug, but it gives the flavor.
  % The above is not enough to reproduce the bug, but it gives the flavor.
  %
  %
  % Sample whatsit resulting:
  % Sample whatsit resulting:
  % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  %
  %
  % So:
  % So:
  \let\endinput = \empty
  \let\endinput = \empty
  %
  %
  % Do the redefinitions.
  % Do the redefinitions.
  \commondummies
  \commondummies
}
}
 
 
% For the aux and toc files, @ is the escape character.  So we want to
% For the aux and toc files, @ is the escape character.  So we want to
% redefine everything using @ as the escape character (instead of
% redefine everything using @ as the escape character (instead of
% \realbackslash, still used for index files).  When everything uses @,
% \realbackslash, still used for index files).  When everything uses @,
% this will be simpler.
% this will be simpler.
%
%
\def\atdummies{%
\def\atdummies{%
  \def\@{@@}%
  \def\@{@@}%
  \def\ {@ }%
  \def\ {@ }%
  \let\{ = \lbraceatcmd
  \let\{ = \lbraceatcmd
  \let\} = \rbraceatcmd
  \let\} = \rbraceatcmd
  %
  %
  % Do the redefinitions.
  % Do the redefinitions.
  \commondummies
  \commondummies
  \otherbackslash
  \otherbackslash
}
}
 
 
% Called from \indexdummies and \atdummies.
% Called from \indexdummies and \atdummies.
%
%
\def\commondummies{%
\def\commondummies{%
  %
  %
  % \definedummyword defines \#1 as \string\#1\space, thus effectively
  % \definedummyword defines \#1 as \string\#1\space, thus effectively
  % preventing its expansion.  This is used only for control% words,
  % preventing its expansion.  This is used only for control% words,
  % not control letters, because the \space would be incorrect for
  % not control letters, because the \space would be incorrect for
  % control characters, but is needed to separate the control word
  % control characters, but is needed to separate the control word
  % from whatever follows.
  % from whatever follows.
  %
  %
  % For control letters, we have \definedummyletter, which omits the
  % For control letters, we have \definedummyletter, which omits the
  % space.
  % space.
  %
  %
  % These can be used both for control words that take an argument and
  % These can be used both for control words that take an argument and
  % those that do not.  If it is followed by {arg} in the input, then
  % those that do not.  If it is followed by {arg} in the input, then
  % that will dutifully get written to the index (or wherever).
  % that will dutifully get written to the index (or wherever).
  %
  %
  \def\definedummyword  ##1{\def##1{\string##1\space}}%
  \def\definedummyword  ##1{\def##1{\string##1\space}}%
  \def\definedummyletter##1{\def##1{\string##1}}%
  \def\definedummyletter##1{\def##1{\string##1}}%
  \let\definedummyaccent\definedummyletter
  \let\definedummyaccent\definedummyletter
  %
  %
  \commondummiesnofonts
  \commondummiesnofonts
  %
  %
  \definedummyletter\_%
  \definedummyletter\_%
  %
  %
  % Non-English letters.
  % Non-English letters.
  \definedummyword\AA
  \definedummyword\AA
  \definedummyword\AE
  \definedummyword\AE
 
  \definedummyword\DH
  \definedummyword\L
  \definedummyword\L
  \definedummyword\OE
 
  \definedummyword\O
  \definedummyword\O
 
  \definedummyword\OE
 
  \definedummyword\TH
  \definedummyword\aa
  \definedummyword\aa
  \definedummyword\ae
  \definedummyword\ae
 
  \definedummyword\dh
 
  \definedummyword\exclamdown
  \definedummyword\l
  \definedummyword\l
  \definedummyword\oe
 
  \definedummyword\o
  \definedummyword\o
  \definedummyword\ss
  \definedummyword\oe
  \definedummyword\exclamdown
 
  \definedummyword\questiondown
 
  \definedummyword\ordf
  \definedummyword\ordf
  \definedummyword\ordm
  \definedummyword\ordm
 
  \definedummyword\questiondown
 
  \definedummyword\ss
 
  \definedummyword\th
  %
  %
  % Although these internal commands shouldn't show up, sometimes they do.
  % Although these internal commands shouldn't show up, sometimes they do.
  \definedummyword\bf
  \definedummyword\bf
  \definedummyword\gtr
  \definedummyword\gtr
  \definedummyword\hat
  \definedummyword\hat
  \definedummyword\less
  \definedummyword\less
  \definedummyword\sf
  \definedummyword\sf
  \definedummyword\sl
  \definedummyword\sl
  \definedummyword\tclose
  \definedummyword\tclose
  \definedummyword\tt
  \definedummyword\tt
  %
  %
  \definedummyword\LaTeX
  \definedummyword\LaTeX
  \definedummyword\TeX
  \definedummyword\TeX
  %
  %
  % Assorted special characters.
  % Assorted special characters.
  \definedummyword\bullet
  \definedummyword\bullet
  \definedummyword\comma
  \definedummyword\comma
  \definedummyword\copyright
  \definedummyword\copyright
  \definedummyword\registeredsymbol
  \definedummyword\registeredsymbol
  \definedummyword\dots
  \definedummyword\dots
  \definedummyword\enddots
  \definedummyword\enddots
  \definedummyword\equiv
  \definedummyword\equiv
  \definedummyword\error
  \definedummyword\error
  \definedummyword\euro
  \definedummyword\euro
  \definedummyword\guillemetleft
  \definedummyword\guillemetleft
  \definedummyword\guillemetright
  \definedummyword\guillemetright
  \definedummyword\guilsinglleft
  \definedummyword\guilsinglleft
  \definedummyword\guilsinglright
  \definedummyword\guilsinglright
  \definedummyword\expansion
  \definedummyword\expansion
  \definedummyword\minus
  \definedummyword\minus
 
  \definedummyword\ogonek
  \definedummyword\pounds
  \definedummyword\pounds
  \definedummyword\point
  \definedummyword\point
  \definedummyword\print
  \definedummyword\print
  \definedummyword\quotedblbase
  \definedummyword\quotedblbase
  \definedummyword\quotedblleft
  \definedummyword\quotedblleft
  \definedummyword\quotedblright
  \definedummyword\quotedblright
  \definedummyword\quoteleft
  \definedummyword\quoteleft
  \definedummyword\quoteright
  \definedummyword\quoteright
  \definedummyword\quotesinglbase
  \definedummyword\quotesinglbase
  \definedummyword\result
  \definedummyword\result
  \definedummyword\textdegree
  \definedummyword\textdegree
  %
  %
  % We want to disable all macros so that they are not expanded by \write.
  % We want to disable all macros so that they are not expanded by \write.
  \macrolist
  \macrolist
  %
  %
  \normalturnoffactive
  \normalturnoffactive
  %
  %
  % Handle some cases of @value -- where it does not contain any
  % Handle some cases of @value -- where it does not contain any
  % (non-fully-expandable) commands.
  % (non-fully-expandable) commands.
  \makevalueexpandable
  \makevalueexpandable
}
}
 
 
% \commondummiesnofonts: common to \commondummies and \indexnofonts.
% \commondummiesnofonts: common to \commondummies and \indexnofonts.
%
%
\def\commondummiesnofonts{%
\def\commondummiesnofonts{%
  % Control letters and accents.
  % Control letters and accents.
  \definedummyletter\!%
  \definedummyletter\!%
  \definedummyaccent\"%
  \definedummyaccent\"%
  \definedummyaccent\'%
  \definedummyaccent\'%
  \definedummyletter\*%
  \definedummyletter\*%
  \definedummyaccent\,%
  \definedummyaccent\,%
  \definedummyletter\.%
  \definedummyletter\.%
  \definedummyletter\/%
  \definedummyletter\/%
  \definedummyletter\:%
  \definedummyletter\:%
  \definedummyaccent\=%
  \definedummyaccent\=%
  \definedummyletter\?%
  \definedummyletter\?%
  \definedummyaccent\^%
  \definedummyaccent\^%
  \definedummyaccent\`%
  \definedummyaccent\`%
  \definedummyaccent\~%
  \definedummyaccent\~%
  \definedummyword\u
  \definedummyword\u
  \definedummyword\v
  \definedummyword\v
  \definedummyword\H
  \definedummyword\H
  \definedummyword\dotaccent
  \definedummyword\dotaccent
 
  \definedummyword\ogonek
  \definedummyword\ringaccent
  \definedummyword\ringaccent
  \definedummyword\tieaccent
  \definedummyword\tieaccent
  \definedummyword\ubaraccent
  \definedummyword\ubaraccent
  \definedummyword\udotaccent
  \definedummyword\udotaccent
  \definedummyword\dotless
  \definedummyword\dotless
  %
  %
  % Texinfo font commands.
  % Texinfo font commands.
  \definedummyword\b
  \definedummyword\b
  \definedummyword\i
  \definedummyword\i
  \definedummyword\r
  \definedummyword\r
  \definedummyword\sc
  \definedummyword\sc
  \definedummyword\t
  \definedummyword\t
  %
  %
  % Commands that take arguments.
  % Commands that take arguments.
  \definedummyword\acronym
  \definedummyword\acronym
  \definedummyword\cite
  \definedummyword\cite
  \definedummyword\code
  \definedummyword\code
  \definedummyword\command
  \definedummyword\command
  \definedummyword\dfn
  \definedummyword\dfn
 
  \definedummyword\email
  \definedummyword\emph
  \definedummyword\emph
  \definedummyword\env
  \definedummyword\env
  \definedummyword\file
  \definedummyword\file
  \definedummyword\kbd
  \definedummyword\kbd
  \definedummyword\key
  \definedummyword\key
  \definedummyword\math
  \definedummyword\math
  \definedummyword\option
  \definedummyword\option
  \definedummyword\pxref
  \definedummyword\pxref
  \definedummyword\ref
  \definedummyword\ref
  \definedummyword\samp
  \definedummyword\samp
  \definedummyword\strong
  \definedummyword\strong
  \definedummyword\tie
  \definedummyword\tie
  \definedummyword\uref
  \definedummyword\uref
  \definedummyword\url
  \definedummyword\url
  \definedummyword\var
  \definedummyword\var
  \definedummyword\verb
  \definedummyword\verb
  \definedummyword\w
  \definedummyword\w
  \definedummyword\xref
  \definedummyword\xref
}
}
 
 
% \indexnofonts is used when outputting the strings to sort the index
% \indexnofonts is used when outputting the strings to sort the index
% by, and when constructing control sequence names.  It eliminates all
% by, and when constructing control sequence names.  It eliminates all
% control sequences and just writes whatever the best ASCII sort string
% control sequences and just writes whatever the best ASCII sort string
% would be for a given command (usually its argument).
% would be for a given command (usually its argument).
%
%
\def\indexnofonts{%
\def\indexnofonts{%
  % Accent commands should become @asis.
  % Accent commands should become @asis.
  \def\definedummyaccent##1{\let##1\asis}%
  \def\definedummyaccent##1{\let##1\asis}%
  % We can just ignore other control letters.
  % We can just ignore other control letters.
  \def\definedummyletter##1{\let##1\empty}%
  \def\definedummyletter##1{\let##1\empty}%
  % Hopefully, all control words can become @asis.
  % Hopefully, all control words can become @asis.
  \let\definedummyword\definedummyaccent
  \let\definedummyword\definedummyaccent
  %
  %
  \commondummiesnofonts
  \commondummiesnofonts
  %
  %
  % Don't no-op \tt, since it isn't a user-level command
  % Don't no-op \tt, since it isn't a user-level command
  % and is used in the definitions of the active chars like <, >, |, etc.
  % and is used in the definitions of the active chars like <, >, |, etc.
  % Likewise with the other plain tex font commands.
  % Likewise with the other plain tex font commands.
  %\let\tt=\asis
  %\let\tt=\asis
  %
  %
  \def\ { }%
  \def\ { }%
  \def\@{@}%
  \def\@{@}%
  % how to handle braces?
  % how to handle braces?
  \def\_{\normalunderscore}%
  \def\_{\normalunderscore}%
  %
  %
  % Non-English letters.
  % Non-English letters.
  \def\AA{AA}%
  \def\AA{AA}%
  \def\AE{AE}%
  \def\AE{AE}%
 
  \def\DH{DZZ}%
  \def\L{L}%
  \def\L{L}%
  \def\OE{OE}%
  \def\OE{OE}%
  \def\O{O}%
  \def\O{O}%
 
  \def\TH{ZZZ}%
  \def\aa{aa}%
  \def\aa{aa}%
  \def\ae{ae}%
  \def\ae{ae}%
 
  \def\dh{dzz}%
 
  \def\exclamdown{!}%
  \def\l{l}%
  \def\l{l}%
  \def\oe{oe}%
  \def\oe{oe}%
  \def\o{o}%
 
  \def\ss{ss}%
 
  \def\exclamdown{!}%
 
  \def\questiondown{?}%
 
  \def\ordf{a}%
  \def\ordf{a}%
  \def\ordm{o}%
  \def\ordm{o}%
 
  \def\o{o}%
 
  \def\questiondown{?}%
 
  \def\ss{ss}%
 
  \def\th{zzz}%
  %
  %
  \def\LaTeX{LaTeX}%
  \def\LaTeX{LaTeX}%
  \def\TeX{TeX}%
  \def\TeX{TeX}%
  %
  %
  % Assorted special characters.
  % Assorted special characters.
  % (The following {} will end up in the sort string, but that's ok.)
  % (The following {} will end up in the sort string, but that's ok.)
  \def\bullet{bullet}%
  \def\bullet{bullet}%
  \def\comma{,}%
  \def\comma{,}%
  \def\copyright{copyright}%
  \def\copyright{copyright}%
  \def\registeredsymbol{R}%
 
  \def\dots{...}%
  \def\dots{...}%
  \def\enddots{...}%
  \def\enddots{...}%
  \def\equiv{==}%
  \def\equiv{==}%
  \def\error{error}%
  \def\error{error}%
  \def\euro{euro}%
  \def\euro{euro}%
 
  \def\expansion{==>}%
  \def\guillemetleft{<<}%
  \def\guillemetleft{<<}%
  \def\guillemetright{>>}%
  \def\guillemetright{>>}%
  \def\guilsinglleft{<}%
  \def\guilsinglleft{<}%
  \def\guilsinglright{>}%
  \def\guilsinglright{>}%
  \def\expansion{==>}%
 
  \def\minus{-}%
  \def\minus{-}%
  \def\pounds{pounds}%
 
  \def\point{.}%
  \def\point{.}%
 
  \def\pounds{pounds}%
  \def\print{-|}%
  \def\print{-|}%
  \def\quotedblbase{"}%
  \def\quotedblbase{"}%
  \def\quotedblleft{"}%
  \def\quotedblleft{"}%
  \def\quotedblright{"}%
  \def\quotedblright{"}%
  \def\quoteleft{`}%
  \def\quoteleft{`}%
  \def\quoteright{'}%
  \def\quoteright{'}%
  \def\quotesinglbase{,}%
  \def\quotesinglbase{,}%
 
  \def\registeredsymbol{R}%
  \def\result{=>}%
  \def\result{=>}%
  \def\textdegree{degrees}%
  \def\textdegree{o}%
  %
  %
  % We need to get rid of all macros, leaving only the arguments (if present).
  % We need to get rid of all macros, leaving only the arguments (if present).
  % Of course this is not nearly correct, but it is the best we can do for now.
  % Of course this is not nearly correct, but it is the best we can do for now.
  % makeinfo does not expand macros in the argument to @deffn, which ends up
  % makeinfo does not expand macros in the argument to @deffn, which ends up
  % writing an index entry, and texindex isn't prepared for an index sort entry
  % writing an index entry, and texindex isn't prepared for an index sort entry
  % that starts with \.
  % that starts with \.
  %
  %
  % Since macro invocations are followed by braces, we can just redefine them
  % Since macro invocations are followed by braces, we can just redefine them
  % to take a single TeX argument.  The case of a macro invocation that
  % to take a single TeX argument.  The case of a macro invocation that
  % goes to end-of-line is not handled.
  % goes to end-of-line is not handled.
  %
  %
  \macrolist
  \macrolist
}
}
 
 
\let\indexbackslash=0  %overridden during \printindex.
\let\indexbackslash=0  %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
 
% Most index entries go through here, but \dosubind is the general case.
% Most index entries go through here, but \dosubind is the general case.
% #1 is the index name, #2 is the entry text.
% #1 is the index name, #2 is the entry text.
\def\doind#1#2{\dosubind{#1}{#2}{}}
\def\doind#1#2{\dosubind{#1}{#2}{}}
 
 
% Workhorse for all \fooindexes.
% Workhorse for all \fooindexes.
% #1 is name of index, #2 is stuff to put there, #3 is subentry --
% #1 is name of index, #2 is stuff to put there, #3 is subentry --
% empty if called from \doind, as we usually are (the main exception
% empty if called from \doind, as we usually are (the main exception
% is with most defuns, which call us directly).
% is with most defuns, which call us directly).
%
%
\def\dosubind#1#2#3{%
\def\dosubind#1#2#3{%
  \iflinks
  \iflinks
  {%
  {%
    % Store the main index entry text (including the third arg).
    % Store the main index entry text (including the third arg).
    \toks0 = {#2}%
    \toks0 = {#2}%
    % If third arg is present, precede it with a space.
    % If third arg is present, precede it with a space.
    \def\thirdarg{#3}%
    \def\thirdarg{#3}%
    \ifx\thirdarg\empty \else
    \ifx\thirdarg\empty \else
      \toks0 = \expandafter{\the\toks0 \space #3}%
      \toks0 = \expandafter{\the\toks0 \space #3}%
    \fi
    \fi
    %
    %
    \edef\writeto{\csname#1indfile\endcsname}%
    \edef\writeto{\csname#1indfile\endcsname}%
    %
    %
    \safewhatsit\dosubindwrite
    \safewhatsit\dosubindwrite
  }%
  }%
  \fi
  \fi
}
}
 
 
% Write the entry in \toks0 to the index file:
% Write the entry in \toks0 to the index file:
%
%
\def\dosubindwrite{%
\def\dosubindwrite{%
  % Put the index entry in the margin if desired.
  % Put the index entry in the margin if desired.
  \ifx\SETmarginindex\relax\else
  \ifx\SETmarginindex\relax\else
    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  \fi
  \fi
  %
  %
  % Remember, we are within a group.
  % Remember, we are within a group.
  \indexdummies % Must do this here, since \bf, etc expand at this stage
  \indexdummies % Must do this here, since \bf, etc expand at this stage
  \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
      % so it will be output as is; and it will print as backslash.
      % so it will be output as is; and it will print as backslash.
  %
  %
  % Process the index entry with all font commands turned off, to
  % Process the index entry with all font commands turned off, to
  % get the string to sort by.
  % get the string to sort by.
  {\indexnofonts
  {\indexnofonts
   \edef\temp{\the\toks0}% need full expansion
   \edef\temp{\the\toks0}% need full expansion
   \xdef\indexsorttmp{\temp}%
   \xdef\indexsorttmp{\temp}%
  }%
  }%
  %
  %
  % Set up the complete index entry, with both the sort key and
  % Set up the complete index entry, with both the sort key and
  % the original text, including any font commands.  We write
  % the original text, including any font commands.  We write
  % three arguments to \entry to the .?? file (four in the
  % three arguments to \entry to the .?? file (four in the
  % subentry case), texindex reduces to two when writing the .??s
  % subentry case), texindex reduces to two when writing the .??s
  % sorted result.
  % sorted result.
  \edef\temp{%
  \edef\temp{%
    \write\writeto{%
    \write\writeto{%
      \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
      \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  }%
  }%
  \temp
  \temp
}
}
 
 
% Take care of unwanted page breaks/skips around a whatsit:
% Take care of unwanted page breaks/skips around a whatsit:
%
%
% If a skip is the last thing on the list now, preserve it
% If a skip is the last thing on the list now, preserve it
% by backing up by \lastskip, doing the \write, then inserting
% by backing up by \lastskip, doing the \write, then inserting
% the skip again.  Otherwise, the whatsit generated by the
% the skip again.  Otherwise, the whatsit generated by the
% \write or \pdfdest will make \lastskip zero.  The result is that
% \write or \pdfdest will make \lastskip zero.  The result is that
% sequences like this:
% sequences like this:
% @end defun
% @end defun
% @tindex whatever
% @tindex whatever
% @defun ...
% @defun ...
% will have extra space inserted, because the \medbreak in the
% will have extra space inserted, because the \medbreak in the
% start of the @defun won't see the skip inserted by the @end of
% start of the @defun won't see the skip inserted by the @end of
% the previous defun.
% the previous defun.
%
%
% But don't do any of this if we're not in vertical mode.  We
% But don't do any of this if we're not in vertical mode.  We
% don't want to do a \vskip and prematurely end a paragraph.
% don't want to do a \vskip and prematurely end a paragraph.
%
%
% Avoid page breaks due to these extra skips, too.
% Avoid page breaks due to these extra skips, too.
%
%
% But wait, there is a catch there:
% But wait, there is a catch there:
% We'll have to check whether \lastskip is zero skip.  \ifdim is not
% We'll have to check whether \lastskip is zero skip.  \ifdim is not
% sufficient for this purpose, as it ignores stretch and shrink parts
% sufficient for this purpose, as it ignores stretch and shrink parts
% of the skip.  The only way seems to be to check the textual
% of the skip.  The only way seems to be to check the textual
% representation of the skip.
% representation of the skip.
%
%
% The following is almost like \def\zeroskipmacro{0.0pt} except that
% The following is almost like \def\zeroskipmacro{0.0pt} except that
% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
%
%
\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
%
%
\newskip\whatsitskip
\newskip\whatsitskip
\newcount\whatsitpenalty
\newcount\whatsitpenalty
%
%
% ..., ready, GO:
% ..., ready, GO:
%
%
\def\safewhatsit#1{%
\def\safewhatsit#1{%
\ifhmode
\ifhmode
  #1%
  #1%
\else
\else
  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  \whatsitskip = \lastskip
  \whatsitskip = \lastskip
  \edef\lastskipmacro{\the\lastskip}%
  \edef\lastskipmacro{\the\lastskip}%
  \whatsitpenalty = \lastpenalty
  \whatsitpenalty = \lastpenalty
  %
  %
  % If \lastskip is nonzero, that means the last item was a
  % If \lastskip is nonzero, that means the last item was a
  % skip.  And since a skip is discardable, that means this
  % skip.  And since a skip is discardable, that means this
  % -\whatsitskip glue we're inserting is preceded by a
  % -\whatsitskip glue we're inserting is preceded by a
  % non-discardable item, therefore it is not a potential
  % non-discardable item, therefore it is not a potential
  % breakpoint, therefore no \nobreak needed.
  % breakpoint, therefore no \nobreak needed.
  \ifx\lastskipmacro\zeroskipmacro
  \ifx\lastskipmacro\zeroskipmacro
  \else
  \else
    \vskip-\whatsitskip
    \vskip-\whatsitskip
  \fi
  \fi
  %
  %
  #1%
  #1%
  %
  %
  \ifx\lastskipmacro\zeroskipmacro
  \ifx\lastskipmacro\zeroskipmacro
    % If \lastskip was zero, perhaps the last item was a penalty, and
    % If \lastskip was zero, perhaps the last item was a penalty, and
    % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
    % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
    % to re-insert the same penalty (values >10000 are used for various
    % to re-insert the same penalty (values >10000 are used for various
    % signals); since we just inserted a non-discardable item, any
    % signals); since we just inserted a non-discardable item, any
    % following glue (such as a \parskip) would be a breakpoint.  For example:
    % following glue (such as a \parskip) would be a breakpoint.  For example:
    %
    %
    %   @deffn deffn-whatever
    %   @deffn deffn-whatever
    %   @vindex index-whatever
    %   @vindex index-whatever
    %   Description.
    %   Description.
    % would allow a break between the index-whatever whatsit
    % would allow a break between the index-whatever whatsit
    % and the "Description." paragraph.
    % and the "Description." paragraph.
    \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
    \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  \else
  \else
    % On the other hand, if we had a nonzero \lastskip,
    % On the other hand, if we had a nonzero \lastskip,
    % this make-up glue would be preceded by a non-discardable item
    % this make-up glue would be preceded by a non-discardable item
    % (the whatsit from the \write), so we must insert a \nobreak.
    % (the whatsit from the \write), so we must insert a \nobreak.
    \nobreak\vskip\whatsitskip
    \nobreak\vskip\whatsitskip
  \fi
  \fi
\fi
\fi
}
}
 
 
% The index entry written in the file actually looks like
% The index entry written in the file actually looks like
%  \entry {sortstring}{page}{topic}
%  \entry {sortstring}{page}{topic}
% or
% or
%  \entry {sortstring}{page}{topic}{subtopic}
%  \entry {sortstring}{page}{topic}{subtopic}
% The texindex program reads in these files and writes files
% The texindex program reads in these files and writes files
% containing these kinds of lines:
% containing these kinds of lines:
%  \initial {c}
%  \initial {c}
%     before the first topic whose initial is c
%     before the first topic whose initial is c
%  \entry {topic}{pagelist}
%  \entry {topic}{pagelist}
%     for a topic that is used without subtopics
%     for a topic that is used without subtopics
%  \primary {topic}
%  \primary {topic}
%     for the beginning of a topic that is used with subtopics
%     for the beginning of a topic that is used with subtopics
%  \secondary {subtopic}{pagelist}
%  \secondary {subtopic}{pagelist}
%     for each subtopic.
%     for each subtopic.
 
 
% Define the user-accessible indexing commands
% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.
% @findex, @vindex, @kindex, @cindex.
 
 
\def\findex {\fnindex}
\def\findex {\fnindex}
\def\kindex {\kyindex}
\def\kindex {\kyindex}
\def\cindex {\cpindex}
\def\cindex {\cpindex}
\def\vindex {\vrindex}
\def\vindex {\vrindex}
\def\tindex {\tpindex}
\def\tindex {\tpindex}
\def\pindex {\pgindex}
\def\pindex {\pgindex}
 
 
\def\cindexsub {\begingroup\obeylines\cindexsub}
\def\cindexsub {\begingroup\obeylines\cindexsub}
{\obeylines %
{\obeylines %
\gdef\cindexsub "#1" #2^^M{\endgroup %
\gdef\cindexsub "#1" #2^^M{\endgroup %
\dosubind{cp}{#2}{#1}}}
\dosubind{cp}{#2}{#1}}}
 
 
% Define the macros used in formatting output of the sorted index material.
% Define the macros used in formatting output of the sorted index material.
 
 
% @printindex causes a particular index (the ??s file) to get printed.
% @printindex causes a particular index (the ??s file) to get printed.
% It does not print any chapter heading (usually an @unnumbered).
% It does not print any chapter heading (usually an @unnumbered).
%
%
\parseargdef\printindex{\begingroup
\parseargdef\printindex{\begingroup
  \dobreak \chapheadingskip{10000}%
  \dobreak \chapheadingskip{10000}%
  %
  %
  \smallfonts \rm
  \smallfonts \rm
  \tolerance = 9500
  \tolerance = 9500
  \plainfrenchspacing
  \plainfrenchspacing
  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  %
  %
  % See if the index file exists and is nonempty.
  % See if the index file exists and is nonempty.
  % Change catcode of @ here so that if the index file contains
  % Change catcode of @ here so that if the index file contains
  % \initial {@}
  % \initial {@}
  % as its first line, TeX doesn't complain about mismatched braces
  % as its first line, TeX doesn't complain about mismatched braces
  % (because it thinks @} is a control sequence).
  % (because it thinks @} is a control sequence).
  \catcode`\@ = 11
  \catcode`\@ = 11
  \openin 1 \jobname.#1s
  \openin 1 \jobname.#1s
  \ifeof 1
  \ifeof 1
    % \enddoublecolumns gets confused if there is no text in the index,
    % \enddoublecolumns gets confused if there is no text in the index,
    % and it loses the chapter title and the aux file entries for the
    % and it loses the chapter title and the aux file entries for the
    % index.  The easiest way to prevent this problem is to make sure
    % index.  The easiest way to prevent this problem is to make sure
    % there is some text.
    % there is some text.
    \putwordIndexNonexistent
    \putwordIndexNonexistent
  \else
  \else
    %
    %
    % If the index file exists but is empty, then \openin leaves \ifeof
    % If the index file exists but is empty, then \openin leaves \ifeof
    % false.  We have to make TeX try to read something from the file, so
    % false.  We have to make TeX try to read something from the file, so
    % it can discover if there is anything in it.
    % it can discover if there is anything in it.
    \read 1 to \temp
    \read 1 to \temp
    \ifeof 1
    \ifeof 1
      \putwordIndexIsEmpty
      \putwordIndexIsEmpty
    \else
    \else
      % Index files are almost Texinfo source, but we use \ as the escape
      % Index files are almost Texinfo source, but we use \ as the escape
      % character.  It would be better to use @, but that's too big a change
      % character.  It would be better to use @, but that's too big a change
      % to make right now.
      % to make right now.
      \def\indexbackslash{\backslashcurfont}%
      \def\indexbackslash{\backslashcurfont}%
      \catcode`\\ = 0
      \catcode`\\ = 0
      \escapechar = `\\
      \escapechar = `\\
      \begindoublecolumns
      \begindoublecolumns
      \input \jobname.#1s
      \input \jobname.#1s
      \enddoublecolumns
      \enddoublecolumns
    \fi
    \fi
  \fi
  \fi
  \closein 1
  \closein 1
\endgroup}
\endgroup}
 
 
% These macros are used by the sorted index file itself.
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
% Change them to control the appearance of the index.
 
 
\def\initial#1{{%
\def\initial#1{{%
  % Some minor font changes for the special characters.
  % Some minor font changes for the special characters.
  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  %
  %
  % Remove any glue we may have, we'll be inserting our own.
  % Remove any glue we may have, we'll be inserting our own.
  \removelastskip
  \removelastskip
  %
  %
  % We like breaks before the index initials, so insert a bonus.
  % We like breaks before the index initials, so insert a bonus.
  \nobreak
  \nobreak
  \vskip 0pt plus 3\baselineskip
  \vskip 0pt plus 3\baselineskip
  \penalty 0
  \penalty 0
  \vskip 0pt plus -3\baselineskip
  \vskip 0pt plus -3\baselineskip
  %
  %
  % Typeset the initial.  Making this add up to a whole number of
  % Typeset the initial.  Making this add up to a whole number of
  % baselineskips increases the chance of the dots lining up from column
  % baselineskips increases the chance of the dots lining up from column
  % to column.  It still won't often be perfect, because of the stretch
  % to column.  It still won't often be perfect, because of the stretch
  % we need before each entry, but it's better.
  % we need before each entry, but it's better.
  %
  %
  % No shrink because it confuses \balancecolumns.
  % No shrink because it confuses \balancecolumns.
  \vskip 1.67\baselineskip plus .5\baselineskip
  \vskip 1.67\baselineskip plus .5\baselineskip
  \leftline{\secbf #1}%
  \leftline{\secbf #1}%
  % Do our best not to break after the initial.
  % Do our best not to break after the initial.
  \nobreak
  \nobreak
  \vskip .33\baselineskip plus .1\baselineskip
  \vskip .33\baselineskip plus .1\baselineskip
}}
}}
 
 
% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
% then page number (#2) flushed to the right margin.  It is used for index
% then page number (#2) flushed to the right margin.  It is used for index
% and table of contents entries.  The paragraph is indented by \leftskip.
% and table of contents entries.  The paragraph is indented by \leftskip.
%
%
% A straightforward implementation would start like this:
% A straightforward implementation would start like this:
%       \def\entry#1#2{...
%       \def\entry#1#2{...
% But this frozes the catcodes in the argument, and can cause problems to
% But this freezes the catcodes in the argument, and can cause problems to
% @code, which sets - active.  This problem was fixed by a kludge---
% @code, which sets - active.  This problem was fixed by a kludge---
% ``-'' was active throughout whole index, but this isn't really right.
% ``-'' was active throughout whole index, but this isn't really right.
%
%
% The right solution is to prevent \entry from swallowing the whole text.
% The right solution is to prevent \entry from swallowing the whole text.
%                                 --kasal, 21nov03
%                                 --kasal, 21nov03
\def\entry{%
\def\entry{%
  \begingroup
  \begingroup
    %
    %
    % Start a new paragraph if necessary, so our assignments below can't
    % Start a new paragraph if necessary, so our assignments below can't
    % affect previous text.
    % affect previous text.
    \par
    \par
    %
    %
    % Do not fill out the last line with white space.
    % Do not fill out the last line with white space.
    \parfillskip = 0in
    \parfillskip = 0in
    %
    %
    % No extra space above this paragraph.
    % No extra space above this paragraph.
    \parskip = 0in
    \parskip = 0in
    %
    %
    % Do not prefer a separate line ending with a hyphen to fewer lines.
    % Do not prefer a separate line ending with a hyphen to fewer lines.
    \finalhyphendemerits = 0
    \finalhyphendemerits = 0
    %
    %
    % \hangindent is only relevant when the entry text and page number
    % \hangindent is only relevant when the entry text and page number
    % don't both fit on one line.  In that case, bob suggests starting the
    % don't both fit on one line.  In that case, bob suggests starting the
    % dots pretty far over on the line.  Unfortunately, a large
    % dots pretty far over on the line.  Unfortunately, a large
    % indentation looks wrong when the entry text itself is broken across
    % indentation looks wrong when the entry text itself is broken across
    % lines.  So we use a small indentation and put up with long leaders.
    % lines.  So we use a small indentation and put up with long leaders.
    %
    %
    % \hangafter is reset to 1 (which is the value we want) at the start
    % \hangafter is reset to 1 (which is the value we want) at the start
    % of each paragraph, so we need not do anything with that.
    % of each paragraph, so we need not do anything with that.
    \hangindent = 2em
    \hangindent = 2em
    %
    %
    % When the entry text needs to be broken, just fill out the first line
    % When the entry text needs to be broken, just fill out the first line
    % with blank space.
    % with blank space.
    \rightskip = 0pt plus1fil
    \rightskip = 0pt plus1fil
    %
    %
    % A bit of stretch before each entry for the benefit of balancing
    % A bit of stretch before each entry for the benefit of balancing
    % columns.
    % columns.
    \vskip 0pt plus1pt
    \vskip 0pt plus1pt
    %
    %
    % Swallow the left brace of the text (first parameter):
    % Swallow the left brace of the text (first parameter):
    \afterassignment\doentry
    \afterassignment\doentry
    \let\temp =
    \let\temp =
}
}
\def\doentry{%
\def\doentry{%
    \bgroup % Instead of the swallowed brace.
    \bgroup % Instead of the swallowed brace.
      \noindent
      \noindent
      \aftergroup\finishentry
      \aftergroup\finishentry
      % And now comes the text of the entry.
      % And now comes the text of the entry.
}
}
\def\finishentry#1{%
\def\finishentry#1{%
    % #1 is the page number.
    % #1 is the page number.
    %
    %
    % The following is kludged to not output a line of dots in the index if
    % The following is kludged to not output a line of dots in the index if
    % there are no page numbers.  The next person who breaks this will be
    % there are no page numbers.  The next person who breaks this will be
    % cursed by a Unix daemon.
    % cursed by a Unix daemon.
    \setbox\boxA = \hbox{#1}%
    \setbox\boxA = \hbox{#1}%
    \ifdim\wd\boxA = 0pt
    \ifdim\wd\boxA = 0pt
      \ %
      \ %
    \else
    \else
      %
      %
      % If we must, put the page number on a line of its own, and fill out
      % If we must, put the page number on a line of its own, and fill out
      % this line with blank space.  (The \hfil is overwhelmed with the
      % this line with blank space.  (The \hfil is overwhelmed with the
      % fill leaders glue in \indexdotfill if the page number does fit.)
      % fill leaders glue in \indexdotfill if the page number does fit.)
      \hfil\penalty50
      \hfil\penalty50
      \null\nobreak\indexdotfill % Have leaders before the page number.
      \null\nobreak\indexdotfill % Have leaders before the page number.
      %
      %
      % The `\ ' here is removed by the implicit \unskip that TeX does as
      % The `\ ' here is removed by the implicit \unskip that TeX does as
      % part of (the primitive) \par.  Without it, a spurious underfull
      % part of (the primitive) \par.  Without it, a spurious underfull
      % \hbox ensues.
      % \hbox ensues.
      \ifpdf
      \ifpdf
        \pdfgettoks#1.%
        \pdfgettoks#1.%
        \ \the\toksA
        \ \the\toksA
      \else
      \else
        \ #1%
        \ #1%
      \fi
      \fi
    \fi
    \fi
    \par
    \par
  \endgroup
  \endgroup
}
}
 
 
% Like plain.tex's \dotfill, except uses up at least 1 em.
% Like plain.tex's \dotfill, except uses up at least 1 em.
\def\indexdotfill{\cleaders
\def\indexdotfill{\cleaders
  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
 
 
\def\primary #1{\line{#1\hfil}}
\def\primary #1{\line{#1\hfil}}
 
 
\newskip\secondaryindent \secondaryindent=0.5cm
\newskip\secondaryindent \secondaryindent=0.5cm
\def\secondary#1#2{{%
\def\secondary#1#2{{%
  \parfillskip=0in
  \parfillskip=0in
  \parskip=0in
  \parskip=0in
  \hangindent=1in
  \hangindent=1in
  \hangafter=1
  \hangafter=1
  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  \ifpdf
  \ifpdf
    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  \else
  \else
    #2
    #2
  \fi
  \fi
  \par
  \par
}}
}}
 
 
% Define two-column mode, which we use to typeset indexes.
% Define two-column mode, which we use to typeset indexes.
% Adapted from the TeXbook, page 416, which is to say,
% Adapted from the TeXbook, page 416, which is to say,
% the manmac.tex format used to print the TeXbook itself.
% the manmac.tex format used to print the TeXbook itself.
\catcode`\@=11
\catcode`\@=11
 
 
\newbox\partialpage
\newbox\partialpage
\newdimen\doublecolumnhsize
\newdimen\doublecolumnhsize
 
 
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  % Grab any single-column material above us.
  % Grab any single-column material above us.
  \output = {%
  \output = {%
    %
    %
    % Here is a possibility not foreseen in manmac: if we accumulate a
    % Here is a possibility not foreseen in manmac: if we accumulate a
    % whole lot of material, we might end up calling this \output
    % whole lot of material, we might end up calling this \output
    % routine twice in a row (see the doublecol-lose test, which is
    % routine twice in a row (see the doublecol-lose test, which is
    % essentially a couple of indexes with @setchapternewpage off).  In
    % essentially a couple of indexes with @setchapternewpage off).  In
    % that case we just ship out what is in \partialpage with the normal
    % that case we just ship out what is in \partialpage with the normal
    % output routine.  Generally, \partialpage will be empty when this
    % output routine.  Generally, \partialpage will be empty when this
    % runs and this will be a no-op.  See the indexspread.tex test case.
    % runs and this will be a no-op.  See the indexspread.tex test case.
    \ifvoid\partialpage \else
    \ifvoid\partialpage \else
      \onepageout{\pagecontents\partialpage}%
      \onepageout{\pagecontents\partialpage}%
    \fi
    \fi
    %
    %
    \global\setbox\partialpage = \vbox{%
    \global\setbox\partialpage = \vbox{%
      % Unvbox the main output page.
      % Unvbox the main output page.
      \unvbox\PAGE
      \unvbox\PAGE
      \kern-\topskip \kern\baselineskip
      \kern-\topskip \kern\baselineskip
    }%
    }%
  }%
  }%
  \eject % run that output routine to set \partialpage
  \eject % run that output routine to set \partialpage
  %
  %
  % Use the double-column output routine for subsequent pages.
  % Use the double-column output routine for subsequent pages.
  \output = {\doublecolumnout}%
  \output = {\doublecolumnout}%
  %
  %
  % Change the page size parameters.  We could do this once outside this
  % Change the page size parameters.  We could do this once outside this
  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  % format, but then we repeat the same computation.  Repeating a couple
  % format, but then we repeat the same computation.  Repeating a couple
  % of assignments once per index is clearly meaningless for the
  % of assignments once per index is clearly meaningless for the
  % execution time, so we may as well do it in one place.
  % execution time, so we may as well do it in one place.
  %
  %
  % First we halve the line length, less a little for the gutter between
  % First we halve the line length, less a little for the gutter between
  % the columns.  We compute the gutter based on the line length, so it
  % the columns.  We compute the gutter based on the line length, so it
  % changes automatically with the paper format.  The magic constant
  % changes automatically with the paper format.  The magic constant
  % below is chosen so that the gutter has the same value (well, +-<1pt)
  % below is chosen so that the gutter has the same value (well, +-<1pt)
  % as it did when we hard-coded it.
  % as it did when we hard-coded it.
  %
  %
  % We put the result in a separate register, \doublecolumhsize, so we
  % We put the result in a separate register, \doublecolumhsize, so we
  % can restore it in \pagesofar, after \hsize itself has (potentially)
  % can restore it in \pagesofar, after \hsize itself has (potentially)
  % been clobbered.
  % been clobbered.
  %
  %
  \doublecolumnhsize = \hsize
  \doublecolumnhsize = \hsize
    \advance\doublecolumnhsize by -.04154\hsize
    \advance\doublecolumnhsize by -.04154\hsize
    \divide\doublecolumnhsize by 2
    \divide\doublecolumnhsize by 2
  \hsize = \doublecolumnhsize
  \hsize = \doublecolumnhsize
  %
  %
  % Double the \vsize as well.  (We don't need a separate register here,
  % Double the \vsize as well.  (We don't need a separate register here,
  % since nobody clobbers \vsize.)
  % since nobody clobbers \vsize.)
  \vsize = 2\vsize
  \vsize = 2\vsize
}
}
 
 
% The double-column output routine for all double-column pages except
% The double-column output routine for all double-column pages except
% the last.
% the last.
%
%
\def\doublecolumnout{%
\def\doublecolumnout{%
  \splittopskip=\topskip \splitmaxdepth=\maxdepth
  \splittopskip=\topskip \splitmaxdepth=\maxdepth
  % Get the available space for the double columns -- the normal
  % Get the available space for the double columns -- the normal
  % (undoubled) page height minus any material left over from the
  % (undoubled) page height minus any material left over from the
  % previous page.
  % previous page.
  \dimen@ = \vsize
  \dimen@ = \vsize
  \divide\dimen@ by 2
  \divide\dimen@ by 2
  \advance\dimen@ by -\ht\partialpage
  \advance\dimen@ by -\ht\partialpage
  %
  %
  % box0 will be the left-hand column, box2 the right.
  % box0 will be the left-hand column, box2 the right.
  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  \onepageout\pagesofar
  \onepageout\pagesofar
  \unvbox255
  \unvbox255
  \penalty\outputpenalty
  \penalty\outputpenalty
}
}
%
%
% Re-output the contents of the output page -- any previous material,
% Re-output the contents of the output page -- any previous material,
% followed by the two boxes we just split, in box0 and box2.
% followed by the two boxes we just split, in box0 and box2.
\def\pagesofar{%
\def\pagesofar{%
  \unvbox\partialpage
  \unvbox\partialpage
  %
  %
  \hsize = \doublecolumnhsize
  \hsize = \doublecolumnhsize
  \wd0=\hsize \wd2=\hsize
  \wd0=\hsize \wd2=\hsize
  \hbox to\pagewidth{\box0\hfil\box2}%
  \hbox to\pagewidth{\box0\hfil\box2}%
}
}
%
%
% All done with double columns.
% All done with double columns.
\def\enddoublecolumns{%
\def\enddoublecolumns{%
  % The following penalty ensures that the page builder is exercised
  % The following penalty ensures that the page builder is exercised
  % _before_ we change the output routine.  This is necessary in the
  % _before_ we change the output routine.  This is necessary in the
  % following situation:
  % following situation:
  %
  %
  % The last section of the index consists only of a single entry.
  % The last section of the index consists only of a single entry.
  % Before this section, \pagetotal is less than \pagegoal, so no
  % Before this section, \pagetotal is less than \pagegoal, so no
  % break occurs before the last section starts.  However, the last
  % break occurs before the last section starts.  However, the last
  % section, consisting of \initial and the single \entry, does not
  % section, consisting of \initial and the single \entry, does not
  % fit on the page and has to be broken off.  Without the following
  % fit on the page and has to be broken off.  Without the following
  % penalty the page builder will not be exercised until \eject
  % penalty the page builder will not be exercised until \eject
  % below, and by that time we'll already have changed the output
  % below, and by that time we'll already have changed the output
  % routine to the \balancecolumns version, so the next-to-last
  % routine to the \balancecolumns version, so the next-to-last
  % double-column page will be processed with \balancecolumns, which
  % double-column page will be processed with \balancecolumns, which
  % is wrong:  The two columns will go to the main vertical list, with
  % is wrong:  The two columns will go to the main vertical list, with
  % the broken-off section in the recent contributions.  As soon as
  % the broken-off section in the recent contributions.  As soon as
  % the output routine finishes, TeX starts reconsidering the page
  % the output routine finishes, TeX starts reconsidering the page
  % break.  The two columns and the broken-off section both fit on the
  % break.  The two columns and the broken-off section both fit on the
  % page, because the two columns now take up only half of the page
  % page, because the two columns now take up only half of the page
  % goal.  When TeX sees \eject from below which follows the final
  % goal.  When TeX sees \eject from below which follows the final
  % section, it invokes the new output routine that we've set after
  % section, it invokes the new output routine that we've set after
  % \balancecolumns below; \onepageout will try to fit the two columns
  % \balancecolumns below; \onepageout will try to fit the two columns
  % and the final section into the vbox of \pageheight (see
  % and the final section into the vbox of \pageheight (see
  % \pagebody), causing an overfull box.
  % \pagebody), causing an overfull box.
  %
  %
  % Note that glue won't work here, because glue does not exercise the
  % Note that glue won't work here, because glue does not exercise the
  % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  \penalty0
  \penalty0
  %
  %
  \output = {%
  \output = {%
    % Split the last of the double-column material.  Leave it on the
    % Split the last of the double-column material.  Leave it on the
    % current page, no automatic page break.
    % current page, no automatic page break.
    \balancecolumns
    \balancecolumns
    %
    %
    % If we end up splitting too much material for the current page,
    % If we end up splitting too much material for the current page,
    % though, there will be another page break right after this \output
    % though, there will be another page break right after this \output
    % invocation ends.  Having called \balancecolumns once, we do not
    % invocation ends.  Having called \balancecolumns once, we do not
    % want to call it again.  Therefore, reset \output to its normal
    % want to call it again.  Therefore, reset \output to its normal
    % definition right away.  (We hope \balancecolumns will never be
    % definition right away.  (We hope \balancecolumns will never be
    % called on to balance too much material, but if it is, this makes
    % called on to balance too much material, but if it is, this makes
    % the output somewhat more palatable.)
    % the output somewhat more palatable.)
    \global\output = {\onepageout{\pagecontents\PAGE}}%
    \global\output = {\onepageout{\pagecontents\PAGE}}%
  }%
  }%
  \eject
  \eject
  \endgroup % started in \begindoublecolumns
  \endgroup % started in \begindoublecolumns
  %
  %
  % \pagegoal was set to the doubled \vsize above, since we restarted
  % \pagegoal was set to the doubled \vsize above, since we restarted
  % the current page.  We're now back to normal single-column
  % the current page.  We're now back to normal single-column
  % typesetting, so reset \pagegoal to the normal \vsize (after the
  % typesetting, so reset \pagegoal to the normal \vsize (after the
  % \endgroup where \vsize got restored).
  % \endgroup where \vsize got restored).
  \pagegoal = \vsize
  \pagegoal = \vsize
}
}
%
%
% Called at the end of the double column material.
% Called at the end of the double column material.
\def\balancecolumns{%
\def\balancecolumns{%
  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  \dimen@ = \ht0
  \dimen@ = \ht0
  \advance\dimen@ by \topskip
  \advance\dimen@ by \topskip
  \advance\dimen@ by-\baselineskip
  \advance\dimen@ by-\baselineskip
  \divide\dimen@ by 2 % target to split to
  \divide\dimen@ by 2 % target to split to
  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  \splittopskip = \topskip
  \splittopskip = \topskip
  % Loop until we get a decent breakpoint.
  % Loop until we get a decent breakpoint.
  {%
  {%
    \vbadness = 10000
    \vbadness = 10000
    \loop
    \loop
      \global\setbox3 = \copy0
      \global\setbox3 = \copy0
      \global\setbox1 = \vsplit3 to \dimen@
      \global\setbox1 = \vsplit3 to \dimen@
    \ifdim\ht3>\dimen@
    \ifdim\ht3>\dimen@
      \global\advance\dimen@ by 1pt
      \global\advance\dimen@ by 1pt
    \repeat
    \repeat
  }%
  }%
  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  \setbox0=\vbox to\dimen@{\unvbox1}%
  \setbox0=\vbox to\dimen@{\unvbox1}%
  \setbox2=\vbox to\dimen@{\unvbox3}%
  \setbox2=\vbox to\dimen@{\unvbox3}%
  %
  %
  \pagesofar
  \pagesofar
}
}
\catcode`\@ = \other
\catcode`\@ = \other
 
 
 
 
\message{sectioning,}
\message{sectioning,}
% Chapters, sections, etc.
% Chapters, sections, etc.
 
 
% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
% sections so that we can refer to them unambiguously in the pdf
% sections so that we can refer to them unambiguously in the pdf
% outlines by their "section number".  We avoid collisions with chapter
% outlines by their "section number".  We avoid collisions with chapter
% numbers by starting them at 10000.  (If a document ever has 10000
% numbers by starting them at 10000.  (If a document ever has 10000
% chapters, we're in trouble anyway, I'm sure.)
% chapters, we're in trouble anyway, I'm sure.)
\newcount\unnumberedno \unnumberedno = 10000
\newcount\unnumberedno \unnumberedno = 10000
\newcount\chapno
\newcount\chapno
\newcount\secno        \secno=0
\newcount\secno        \secno=0
\newcount\subsecno     \subsecno=0
\newcount\subsecno     \subsecno=0
\newcount\subsubsecno  \subsubsecno=0
\newcount\subsubsecno  \subsubsecno=0
 
 
% This counter is funny since it counts through charcodes of letters A, B, ...
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno  \appendixno = `\@
\newcount\appendixno  \appendixno = `\@
%
%
% \def\appendixletter{\char\the\appendixno}
% \def\appendixletter{\char\the\appendixno}
% We do the following ugly conditional instead of the above simple
% We do the following ugly conditional instead of the above simple
% construct for the sake of pdftex, which needs the actual
% construct for the sake of pdftex, which needs the actual
% letter in the expansion, not just typeset.
% letter in the expansion, not just typeset.
%
%
\def\appendixletter{%
\def\appendixletter{%
  \ifnum\appendixno=`A A%
  \ifnum\appendixno=`A A%
  \else\ifnum\appendixno=`B B%
  \else\ifnum\appendixno=`B B%
  \else\ifnum\appendixno=`C C%
  \else\ifnum\appendixno=`C C%
  \else\ifnum\appendixno=`D D%
  \else\ifnum\appendixno=`D D%
  \else\ifnum\appendixno=`E E%
  \else\ifnum\appendixno=`E E%
  \else\ifnum\appendixno=`F F%
  \else\ifnum\appendixno=`F F%
  \else\ifnum\appendixno=`G G%
  \else\ifnum\appendixno=`G G%
  \else\ifnum\appendixno=`H H%
  \else\ifnum\appendixno=`H H%
  \else\ifnum\appendixno=`I I%
  \else\ifnum\appendixno=`I I%
  \else\ifnum\appendixno=`J J%
  \else\ifnum\appendixno=`J J%
  \else\ifnum\appendixno=`K K%
  \else\ifnum\appendixno=`K K%
  \else\ifnum\appendixno=`L L%
  \else\ifnum\appendixno=`L L%
  \else\ifnum\appendixno=`M M%
  \else\ifnum\appendixno=`M M%
  \else\ifnum\appendixno=`N N%
  \else\ifnum\appendixno=`N N%
  \else\ifnum\appendixno=`O O%
  \else\ifnum\appendixno=`O O%
  \else\ifnum\appendixno=`P P%
  \else\ifnum\appendixno=`P P%
  \else\ifnum\appendixno=`Q Q%
  \else\ifnum\appendixno=`Q Q%
  \else\ifnum\appendixno=`R R%
  \else\ifnum\appendixno=`R R%
  \else\ifnum\appendixno=`S S%
  \else\ifnum\appendixno=`S S%
  \else\ifnum\appendixno=`T T%
  \else\ifnum\appendixno=`T T%
  \else\ifnum\appendixno=`U U%
  \else\ifnum\appendixno=`U U%
  \else\ifnum\appendixno=`V V%
  \else\ifnum\appendixno=`V V%
  \else\ifnum\appendixno=`W W%
  \else\ifnum\appendixno=`W W%
  \else\ifnum\appendixno=`X X%
  \else\ifnum\appendixno=`X X%
  \else\ifnum\appendixno=`Y Y%
  \else\ifnum\appendixno=`Y Y%
  \else\ifnum\appendixno=`Z Z%
  \else\ifnum\appendixno=`Z Z%
  % The \the is necessary, despite appearances, because \appendixletter is
  % The \the is necessary, despite appearances, because \appendixletter is
  % expanded while writing the .toc file.  \char\appendixno is not
  % expanded while writing the .toc file.  \char\appendixno is not
  % expandable, thus it is written literally, thus all appendixes come out
  % expandable, thus it is written literally, thus all appendixes come out
  % with the same letter (or @) in the toc without it.
  % with the same letter (or @) in the toc without it.
  \else\char\the\appendixno
  \else\char\the\appendixno
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
 
 
% Each @chapter defines these (using marks) as the number+name, number
% Each @chapter defines these (using marks) as the number+name, number
% and name of the chapter.  Page headings and footings can use
% and name of the chapter.  Page headings and footings can use
% these.  @section does likewise.
% these.  @section does likewise.
\def\thischapter{}
\def\thischapter{}
\def\thischapternum{}
\def\thischapternum{}
\def\thischaptername{}
\def\thischaptername{}
\def\thissection{}
\def\thissection{}
\def\thissectionnum{}
\def\thissectionnum{}
\def\thissectionname{}
\def\thissectionname{}
 
 
\newcount\absseclevel % used to calculate proper heading level
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
 
 
% @raisesections: treat @section as chapter, @subsection as section, etc.
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
\def\raisesections{\global\advance\secbase by -1}
\let\up=\raisesections % original BFox name
\let\up=\raisesections % original BFox name
 
 
% @lowersections: treat @chapter as section, @section as subsection, etc.
% @lowersections: treat @chapter as section, @section as subsection, etc.
\def\lowersections{\global\advance\secbase by 1}
\def\lowersections{\global\advance\secbase by 1}
\let\down=\lowersections % original BFox name
\let\down=\lowersections % original BFox name
 
 
% we only have subsub.
% we only have subsub.
\chardef\maxseclevel = 3
\chardef\maxseclevel = 3
%
%
% A numbered section within an unnumbered changes to unnumbered too.
% A numbered section within an unnumbered changes to unnumbered too.
% To achive this, remember the "biggest" unnum. sec. we are currently in:
% To achive this, remember the "biggest" unnum. sec. we are currently in:
\chardef\unmlevel = \maxseclevel
\chardef\unmlevel = \maxseclevel
%
%
% Trace whether the current chapter is an appendix or not:
% Trace whether the current chapter is an appendix or not:
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
\def\chapheadtype{N}
\def\chapheadtype{N}
 
 
% Choose a heading macro
% Choose a heading macro
% #1 is heading type
% #1 is heading type
% #2 is heading level
% #2 is heading level
% #3 is text for heading
% #3 is text for heading
\def\genhead#1#2#3{%
\def\genhead#1#2#3{%
  % Compute the abs. sec. level:
  % Compute the abs. sec. level:
  \absseclevel=#2
  \absseclevel=#2
  \advance\absseclevel by \secbase
  \advance\absseclevel by \secbase
  % Make sure \absseclevel doesn't fall outside the range:
  % Make sure \absseclevel doesn't fall outside the range:
  \ifnum \absseclevel < 0
  \ifnum \absseclevel < 0
    \absseclevel = 0
    \absseclevel = 0
  \else
  \else
    \ifnum \absseclevel > 3
    \ifnum \absseclevel > 3
      \absseclevel = 3
      \absseclevel = 3
    \fi
    \fi
  \fi
  \fi
  % The heading type:
  % The heading type:
  \def\headtype{#1}%
  \def\headtype{#1}%
  \if \headtype U%
  \if \headtype U%
    \ifnum \absseclevel < \unmlevel
    \ifnum \absseclevel < \unmlevel
      \chardef\unmlevel = \absseclevel
      \chardef\unmlevel = \absseclevel
    \fi
    \fi
  \else
  \else
    % Check for appendix sections:
    % Check for appendix sections:
    \ifnum \absseclevel = 0
    \ifnum \absseclevel = 0
      \edef\chapheadtype{\headtype}%
      \edef\chapheadtype{\headtype}%
    \else
    \else
      \if \headtype A\if \chapheadtype N%
      \if \headtype A\if \chapheadtype N%
        \errmessage{@appendix... within a non-appendix chapter}%
        \errmessage{@appendix... within a non-appendix chapter}%
      \fi\fi
      \fi\fi
    \fi
    \fi
    % Check for numbered within unnumbered:
    % Check for numbered within unnumbered:
    \ifnum \absseclevel > \unmlevel
    \ifnum \absseclevel > \unmlevel
      \def\headtype{U}%
      \def\headtype{U}%
    \else
    \else
      \chardef\unmlevel = 3
      \chardef\unmlevel = 3
    \fi
    \fi
  \fi
  \fi
  % Now print the heading:
  % Now print the heading:
  \if \headtype U%
  \if \headtype U%
    \ifcase\absseclevel
    \ifcase\absseclevel
        \unnumberedzzz{#3}%
        \unnumberedzzz{#3}%
    \or \unnumberedseczzz{#3}%
    \or \unnumberedseczzz{#3}%
    \or \unnumberedsubseczzz{#3}%
    \or \unnumberedsubseczzz{#3}%
    \or \unnumberedsubsubseczzz{#3}%
    \or \unnumberedsubsubseczzz{#3}%
    \fi
    \fi
  \else
  \else
    \if \headtype A%
    \if \headtype A%
      \ifcase\absseclevel
      \ifcase\absseclevel
          \appendixzzz{#3}%
          \appendixzzz{#3}%
      \or \appendixsectionzzz{#3}%
      \or \appendixsectionzzz{#3}%
      \or \appendixsubseczzz{#3}%
      \or \appendixsubseczzz{#3}%
      \or \appendixsubsubseczzz{#3}%
      \or \appendixsubsubseczzz{#3}%
      \fi
      \fi
    \else
    \else
      \ifcase\absseclevel
      \ifcase\absseclevel
          \chapterzzz{#3}%
          \chapterzzz{#3}%
      \or \seczzz{#3}%
      \or \seczzz{#3}%
      \or \numberedsubseczzz{#3}%
      \or \numberedsubseczzz{#3}%
      \or \numberedsubsubseczzz{#3}%
      \or \numberedsubsubseczzz{#3}%
      \fi
      \fi
    \fi
    \fi
  \fi
  \fi
  \suppressfirstparagraphindent
  \suppressfirstparagraphindent
}
}
 
 
% an interface:
% an interface:
\def\numhead{\genhead N}
\def\numhead{\genhead N}
\def\apphead{\genhead A}
\def\apphead{\genhead A}
\def\unnmhead{\genhead U}
\def\unnmhead{\genhead U}
 
 
% @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
% @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
% all lower-level sectioning counters to zero.
% all lower-level sectioning counters to zero.
%
%
% Also set \chaplevelprefix, which we prepend to @float sequence numbers
% Also set \chaplevelprefix, which we prepend to @float sequence numbers
% (e.g., figures), q.v.  By default (before any chapter), that is empty.
% (e.g., figures), q.v.  By default (before any chapter), that is empty.
\let\chaplevelprefix = \empty
\let\chaplevelprefix = \empty
%
%
\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz#1{%
\def\chapterzzz#1{%
  % section resetting is \global in case the chapter is in a group, such
  % section resetting is \global in case the chapter is in a group, such
  % as an @include file.
  % as an @include file.
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
    \global\advance\chapno by 1
    \global\advance\chapno by 1
  %
  %
  % Used for \float.
  % Used for \float.
  \gdef\chaplevelprefix{\the\chapno.}%
  \gdef\chaplevelprefix{\the\chapno.}%
  \resetallfloatnos
  \resetallfloatnos
  %
  %
  \message{\putwordChapter\space \the\chapno}%
  % \putwordChapter can contain complex things in translations.
 
  \toks0=\expandafter{\putwordChapter}%
 
  \message{\the\toks0 \space \the\chapno}%
  %
  %
  % Write the actual heading.
  % Write the actual heading.
  \chapmacro{#1}{Ynumbered}{\the\chapno}%
  \chapmacro{#1}{Ynumbered}{\the\chapno}%
  %
  %
  % So @section and the like are numbered underneath this chapter.
  % So @section and the like are numbered underneath this chapter.
  \global\let\section = \numberedsec
  \global\let\section = \numberedsec
  \global\let\subsection = \numberedsubsec
  \global\let\subsection = \numberedsubsec
  \global\let\subsubsection = \numberedsubsubsec
  \global\let\subsubsection = \numberedsubsubsec
}
}
 
 
\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
 
%
\def\appendixzzz#1{%
\def\appendixzzz#1{%
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
    \global\advance\appendixno by 1
    \global\advance\appendixno by 1
  \gdef\chaplevelprefix{\appendixletter.}%
  \gdef\chaplevelprefix{\appendixletter.}%
  \resetallfloatnos
  \resetallfloatnos
  %
  %
  \def\appendixnum{\putwordAppendix\space \appendixletter}%
  % \putwordAppendix can contain complex things in translations.
  \message{\appendixnum}%
  \toks0=\expandafter{\putwordAppendix}%
 
  \message{\the\toks0 \space \appendixletter}%
  %
  %
  \chapmacro{#1}{Yappendix}{\appendixletter}%
  \chapmacro{#1}{Yappendix}{\appendixletter}%
  %
  %
  \global\let\section = \appendixsec
  \global\let\section = \appendixsec
  \global\let\subsection = \appendixsubsec
  \global\let\subsection = \appendixsubsec
  \global\let\subsubsection = \appendixsubsubsec
  \global\let\subsubsection = \appendixsubsubsec
}
}
 
 
\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
\def\unnumberedzzz#1{%
\def\unnumberedzzz#1{%
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
    \global\advance\unnumberedno by 1
    \global\advance\unnumberedno by 1
  %
  %
  % Since an unnumbered has no number, no prefix for figures.
  % Since an unnumbered has no number, no prefix for figures.
  \global\let\chaplevelprefix = \empty
  \global\let\chaplevelprefix = \empty
  \resetallfloatnos
  \resetallfloatnos
  %
  %
  % This used to be simply \message{#1}, but TeX fully expands the
  % This used to be simply \message{#1}, but TeX fully expands the
  % argument to \message.  Therefore, if #1 contained @-commands, TeX
  % argument to \message.  Therefore, if #1 contained @-commands, TeX
  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
  % expanded @cite (which turns out to cause errors because \cite is meant
  % expanded @cite (which turns out to cause errors because \cite is meant
  % to be executed, not expanded).
  % to be executed, not expanded).
  %
  %
  % Anyway, we don't want the fully-expanded definition of @cite to appear
  % Anyway, we don't want the fully-expanded definition of @cite to appear
  % as a result of the \message, we just want `@cite' itself.  We use
  % as a result of the \message, we just want `@cite' itself.  We use
  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  % simply yielding the contents of <toks register>.  (We also do this for
  % simply yielding the contents of <toks register>.  (We also do this for
  % the toc entries.)
  % the toc entries.)
  \toks0 = {#1}%
  \toks0 = {#1}%
  \message{(\the\toks0)}%
  \message{(\the\toks0)}%
  %
  %
  \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  %
  %
  \global\let\section = \unnumberedsec
  \global\let\section = \unnumberedsec
  \global\let\subsection = \unnumberedsubsec
  \global\let\subsection = \unnumberedsubsec
  \global\let\subsubsection = \unnumberedsubsubsec
  \global\let\subsubsection = \unnumberedsubsubsec
}
}
 
 
% @centerchap is like @unnumbered, but the heading is centered.
% @centerchap is like @unnumbered, but the heading is centered.
\outer\parseargdef\centerchap{%
\outer\parseargdef\centerchap{%
  % Well, we could do the following in a group, but that would break
  % Well, we could do the following in a group, but that would break
  % an assumption that \chapmacro is called at the outermost level.
  % an assumption that \chapmacro is called at the outermost level.
  % Thus we are safer this way:         --kasal, 24feb04
  % Thus we are safer this way:         --kasal, 24feb04
  \let\centerparametersmaybe = \centerparameters
  \let\centerparametersmaybe = \centerparameters
  \unnmhead0{#1}%
  \unnmhead0{#1}%
  \let\centerparametersmaybe = \relax
  \let\centerparametersmaybe = \relax
}
}
 
 
% @top is like @unnumbered.
% @top is like @unnumbered.
\let\top\unnumbered
\let\top\unnumbered
 
 
% Sections.
% Sections.
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\def\seczzz#1{%
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
}
}
 
 
\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
\def\appendixsectionzzz#1{%
\def\appendixsectionzzz#1{%
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
}
}
\let\appendixsec\appendixsection
\let\appendixsec\appendixsection
 
 
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
\def\unnumberedseczzz#1{%
\def\unnumberedseczzz#1{%
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
}
}
 
 
% Subsections.
% Subsections.
\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
\def\numberedsubseczzz#1{%
\def\numberedsubseczzz#1{%
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
}
}
 
 
\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
\def\appendixsubseczzz#1{%
\def\appendixsubseczzz#1{%
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \sectionheading{#1}{subsec}{Yappendix}%
  \sectionheading{#1}{subsec}{Yappendix}%
                 {\appendixletter.\the\secno.\the\subsecno}%
                 {\appendixletter.\the\secno.\the\subsecno}%
}
}
 
 
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
\def\unnumberedsubseczzz#1{%
\def\unnumberedsubseczzz#1{%
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \global\subsubsecno=0  \global\advance\subsecno by 1
  \sectionheading{#1}{subsec}{Ynothing}%
  \sectionheading{#1}{subsec}{Ynothing}%
                 {\the\unnumberedno.\the\secno.\the\subsecno}%
                 {\the\unnumberedno.\the\secno.\the\subsecno}%
}
}
 
 
% Subsubsections.
% Subsubsections.
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
\def\numberedsubsubseczzz#1{%
\def\numberedsubsubseczzz#1{%
  \global\advance\subsubsecno by 1
  \global\advance\subsubsecno by 1
  \sectionheading{#1}{subsubsec}{Ynumbered}%
  \sectionheading{#1}{subsubsec}{Ynumbered}%
                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
}
 
 
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
\def\appendixsubsubseczzz#1{%
\def\appendixsubsubseczzz#1{%
  \global\advance\subsubsecno by 1
  \global\advance\subsubsecno by 1
  \sectionheading{#1}{subsubsec}{Yappendix}%
  \sectionheading{#1}{subsubsec}{Yappendix}%
                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
}
}
 
 
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
\def\unnumberedsubsubseczzz#1{%
\def\unnumberedsubsubseczzz#1{%
  \global\advance\subsubsecno by 1
  \global\advance\subsubsecno by 1
  \sectionheading{#1}{subsubsec}{Ynothing}%
  \sectionheading{#1}{subsubsec}{Ynothing}%
                 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
                 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
}
 
 
% These macros control what the section commands do, according
% These macros control what the section commands do, according
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% Define them by default for a numbered chapter.
% Define them by default for a numbered chapter.
\let\section = \numberedsec
\let\section = \numberedsec
\let\subsection = \numberedsubsec
\let\subsection = \numberedsubsec
\let\subsubsection = \numberedsubsubsec
\let\subsubsection = \numberedsubsubsec
 
 
% Define @majorheading, @heading and @subheading
% Define @majorheading, @heading and @subheading
 
 
% NOTE on use of \vbox for chapter headings, section headings, and such:
% NOTE on use of \vbox for chapter headings, section headings, and such:
%       1) We use \vbox rather than the earlier \line to permit
%       1) We use \vbox rather than the earlier \line to permit
%          overlong headings to fold.
%          overlong headings to fold.
%       2) \hyphenpenalty is set to 10000 because hyphenation in a
%       2) \hyphenpenalty is set to 10000 because hyphenation in a
%          heading is obnoxious; this forbids it.
%          heading is obnoxious; this forbids it.
%       3) Likewise, headings look best if no \parindent is used, and
%       3) Likewise, headings look best if no \parindent is used, and
%          if justification is not attempted.  Hence \raggedright.
%          if justification is not attempted.  Hence \raggedright.
 
 
 
 
\def\majorheading{%
\def\majorheading{%
  {\advance\chapheadingskip by 10pt \chapbreak }%
  {\advance\chapheadingskip by 10pt \chapbreak }%
  \parsearg\chapheadingzzz
  \parsearg\chapheadingzzz
}
}
 
 
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{%
\def\chapheadingzzz#1{%
  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
                    \parindent=0pt\raggedright
                    \parindent=0pt\ptexraggedright
                    \rm #1\hfill}}%
                    \rmisbold #1\hfill}}%
  \bigskip \par\penalty 200\relax
  \bigskip \par\penalty 200\relax
  \suppressfirstparagraphindent
  \suppressfirstparagraphindent
}
}
 
 
% @heading, @subheading, @subsubheading.
% @heading, @subheading, @subsubheading.
\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  \suppressfirstparagraphindent}
  \suppressfirstparagraphindent}
\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  \suppressfirstparagraphindent}
  \suppressfirstparagraphindent}
\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  \suppressfirstparagraphindent}
  \suppressfirstparagraphindent}
 
 
% These macros generate a chapter, section, etc. heading only
% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.
% given all the information in convenient, parsed form.
 
 
%%% Args are the skip and penalty (usually negative)
%%% Args are the skip and penalty (usually negative)
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
 
 
%%% Define plain chapter starts, and page on/off switching for it
%%% Define plain chapter starts, and page on/off switching for it
% Parameter controlling skip before chapter headings (if needed)
% Parameter controlling skip before chapter headings (if needed)
 
 
\newskip\chapheadingskip
\newskip\chapheadingskip
 
 
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
\def\chappager{\par\vfill\supereject}
\def\chappager{\par\vfill\supereject}
% Because \domark is called before \chapoddpage, the filler page will
% Because \domark is called before \chapoddpage, the filler page will
% get the headings for the next chapter, which is wrong.  But we don't
% get the headings for the next chapter, which is wrong.  But we don't
% care -- we just disable all headings on the filler page.
% care -- we just disable all headings on the filler page.
\def\chapoddpage{%
\def\chapoddpage{%
  \chappager
  \chappager
  \ifodd\pageno \else
  \ifodd\pageno \else
    \begingroup
    \begingroup
      \evenheadline={\hfil}\evenfootline={\hfil}%
      \evenheadline={\hfil}\evenfootline={\hfil}%
      \oddheadline={\hfil}\oddfootline={\hfil}%
      \oddheadline={\hfil}\oddfootline={\hfil}%
      \hbox to 0pt{}%
      \hbox to 0pt{}%
      \chappager
      \chappager
    \endgroup
    \endgroup
  \fi
  \fi
}
}
 
 
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
 
 
\def\CHAPPAGoff{%
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
\global\let\pagealignmacro=\chappager}
 
 
\def\CHAPPAGon{%
\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
\global\let\pagealignmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}
\global\def\HEADINGSon{\HEADINGSsingle}}
 
 
\def\CHAPPAGodd{%
\def\CHAPPAGodd{%
\global\let\contentsalignmacro = \chapoddpage
\global\let\contentsalignmacro = \chapoddpage
\global\let\pchapsepmacro=\chapoddpage
\global\let\pchapsepmacro=\chapoddpage
\global\let\pagealignmacro=\chapoddpage
\global\let\pagealignmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}
\global\def\HEADINGSon{\HEADINGSdouble}}
 
 
\CHAPPAGon
\CHAPPAGon
 
 
% Chapter opening.
% Chapter opening.
%
%
% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
% Yappendix, Yomitfromtoc), #3 the chapter number.
% Yappendix, Yomitfromtoc), #3 the chapter number.
%
%
% To test against our argument.
% To test against our argument.
\def\Ynothingkeyword{Ynothing}
\def\Ynothingkeyword{Ynothing}
\def\Yomitfromtockeyword{Yomitfromtoc}
\def\Yomitfromtockeyword{Yomitfromtoc}
\def\Yappendixkeyword{Yappendix}
\def\Yappendixkeyword{Yappendix}
%
%
\def\chapmacro#1#2#3{%
\def\chapmacro#1#2#3{%
  % Insert the first mark before the heading break (see notes for \domark).
  % Insert the first mark before the heading break (see notes for \domark).
  \let\prevchapterdefs=\lastchapterdefs
  \let\prevchapterdefs=\lastchapterdefs
  \let\prevsectiondefs=\lastsectiondefs
  \let\prevsectiondefs=\lastsectiondefs
  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                        \gdef\thissection{}}%
                        \gdef\thissection{}}%
  %
  %
  \def\temptype{#2}%
  \def\temptype{#2}%
  \ifx\temptype\Ynothingkeyword
  \ifx\temptype\Ynothingkeyword
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                          \gdef\thischapter{\thischaptername}}%
                          \gdef\thischapter{\thischaptername}}%
  \else\ifx\temptype\Yomitfromtockeyword
  \else\ifx\temptype\Yomitfromtockeyword
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                          \gdef\thischapter{}}%
                          \gdef\thischapter{}}%
  \else\ifx\temptype\Yappendixkeyword
  \else\ifx\temptype\Yappendixkeyword
    \toks0={#1}%
    \toks0={#1}%
    \xdef\lastchapterdefs{%
    \xdef\lastchapterdefs{%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischapternum{\appendixletter}%
      \gdef\noexpand\thischapternum{\appendixletter}%
      \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum:
      % \noexpand\putwordAppendix avoids expanding indigestible
 
      % commands in some of the translations.
 
      \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
 
                                 \noexpand\thischapternum:
                                 \noexpand\thischaptername}%
                                 \noexpand\thischaptername}%
    }%
    }%
  \else
  \else
    \toks0={#1}%
    \toks0={#1}%
    \xdef\lastchapterdefs{%
    \xdef\lastchapterdefs{%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischapternum{\the\chapno}%
      \gdef\noexpand\thischapternum{\the\chapno}%
      \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum:
      % \noexpand\putwordChapter avoids expanding indigestible
 
      % commands in some of the translations.
 
      \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
 
                                 \noexpand\thischapternum:
                                 \noexpand\thischaptername}%
                                 \noexpand\thischaptername}%
    }%
    }%
  \fi\fi\fi
  \fi\fi\fi
  %
  %
  % Output the mark.  Pass it through \safewhatsit, to take care of
  % Output the mark.  Pass it through \safewhatsit, to take care of
  % the preceding space.
  % the preceding space.
  \safewhatsit\domark
  \safewhatsit\domark
  %
  %
  % Insert the chapter heading break.
  % Insert the chapter heading break.
  \pchapsepmacro
  \pchapsepmacro
  %
  %
  % Now the second mark, after the heading break.  No break points
  % Now the second mark, after the heading break.  No break points
  % between here and the heading.
  % between here and the heading.
  \let\prevchapterdefs=\lastchapterdefs
  \let\prevchapterdefs=\lastchapterdefs
  \let\prevsectiondefs=\lastsectiondefs
  \let\prevsectiondefs=\lastsectiondefs
  \domark
  \domark
  %
  %
  {%
  {%
    \chapfonts \rm
    \chapfonts \rmisbold
    %
    %
    % Have to define \lastsection before calling \donoderef, because the
    % Have to define \lastsection before calling \donoderef, because the
    % xref code eventually uses it.  On the other hand, it has to be called
    % xref code eventually uses it.  On the other hand, it has to be called
    % after \pchapsepmacro, or the headline will change too soon.
    % after \pchapsepmacro, or the headline will change too soon.
    \gdef\lastsection{#1}%
    \gdef\lastsection{#1}%
    %
    %
    % Only insert the separating space if we have a chapter/appendix
    % Only insert the separating space if we have a chapter/appendix
    % number, and don't print the unnumbered ``number''.
    % number, and don't print the unnumbered ``number''.
    \ifx\temptype\Ynothingkeyword
    \ifx\temptype\Ynothingkeyword
      \setbox0 = \hbox{}%
      \setbox0 = \hbox{}%
      \def\toctype{unnchap}%
      \def\toctype{unnchap}%
    \else\ifx\temptype\Yomitfromtockeyword
    \else\ifx\temptype\Yomitfromtockeyword
      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
      \def\toctype{omit}%
      \def\toctype{omit}%
    \else\ifx\temptype\Yappendixkeyword
    \else\ifx\temptype\Yappendixkeyword
      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
      \def\toctype{app}%
      \def\toctype{app}%
    \else
    \else
      \setbox0 = \hbox{#3\enspace}%
      \setbox0 = \hbox{#3\enspace}%
      \def\toctype{numchap}%
      \def\toctype{numchap}%
    \fi\fi\fi
    \fi\fi\fi
    %
    %
    % Write the toc entry for this chapter.  Must come before the
    % Write the toc entry for this chapter.  Must come before the
    % \donoderef, because we include the current node name in the toc
    % \donoderef, because we include the current node name in the toc
    % entry, and \donoderef resets it to empty.
    % entry, and \donoderef resets it to empty.
    \writetocentry{\toctype}{#1}{#3}%
    \writetocentry{\toctype}{#1}{#3}%
    %
    %
    % For pdftex, we have to write out the node definition (aka, make
    % For pdftex, we have to write out the node definition (aka, make
    % the pdfdest) after any page break, but before the actual text has
    % the pdfdest) after any page break, but before the actual text has
    % been typeset.  If the destination for the pdf outline is after the
    % been typeset.  If the destination for the pdf outline is after the
    % text, then jumping from the outline may wind up with the text not
    % text, then jumping from the outline may wind up with the text not
    % being visible, for instance under high magnification.
    % being visible, for instance under high magnification.
    \donoderef{#2}%
    \donoderef{#2}%
    %
    %
    % Typeset the actual heading.
    % Typeset the actual heading.
    \nobreak % Avoid page breaks at the interline glue.
    \nobreak % Avoid page breaks at the interline glue.
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
          \hangindent=\wd0 \centerparametersmaybe
          \hangindent=\wd0 \centerparametersmaybe
          \unhbox0 #1\par}%
          \unhbox0 #1\par}%
  }%
  }%
  \nobreak\bigskip % no page break after a chapter title
  \nobreak\bigskip % no page break after a chapter title
  \nobreak
  \nobreak
}
}
 
 
% @centerchap -- centered and unnumbered.
% @centerchap -- centered and unnumbered.
\let\centerparametersmaybe = \relax
\let\centerparametersmaybe = \relax
\def\centerparameters{%
\def\centerparameters{%
  \advance\rightskip by 3\rightskip
  \advance\rightskip by 3\rightskip
  \leftskip = \rightskip
  \leftskip = \rightskip
  \parfillskip = 0pt
  \parfillskip = 0pt
}
}
 
 
 
 
% I don't think this chapter style is supported any more, so I'm not
% I don't think this chapter style is supported any more, so I'm not
% updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
% updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
%
%
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
%
%
\def\unnchfopen #1{%
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
                       \parindent=0pt\raggedright
                       \parindent=0pt\ptexraggedright
                       \rm #1\hfill}}\bigskip \par\nobreak
                       \rmisbold #1\hfill}}\bigskip \par\nobreak
}
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
\def\chfopen #1#2{\chapoddpage {\chapfonts
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
\par\penalty 5000 %
\par\penalty 5000 %
}
}
\def\centerchfopen #1{%
\def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
                       \parindent=0pt
                       \parindent=0pt
                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
                       \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
}
}
\def\CHAPFopen{%
\def\CHAPFopen{%
  \global\let\chapmacro=\chfopen
  \global\let\chapmacro=\chfopen
  \global\let\centerchapmacro=\centerchfopen}
  \global\let\centerchapmacro=\centerchfopen}
 
 
 
 
% Section titles.  These macros combine the section number parts and
% Section titles.  These macros combine the section number parts and
% call the generic \sectionheading to do the printing.
% call the generic \sectionheading to do the printing.
%
%
\newskip\secheadingskip
\newskip\secheadingskip
\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
 
 
% Subsection titles.
% Subsection titles.
\newskip\subsecheadingskip
\newskip\subsecheadingskip
\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
 
 
% Subsubsection titles.
% Subsubsection titles.
\def\subsubsecheadingskip{\subsecheadingskip}
\def\subsubsecheadingskip{\subsecheadingskip}
\def\subsubsecheadingbreak{\subsecheadingbreak}
\def\subsubsecheadingbreak{\subsecheadingbreak}
 
 
 
 
% Print any size, any type, section title.
% Print any size, any type, section title.
%
%
% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
% section number.
% section number.
%
%
\def\seckeyword{sec}
\def\seckeyword{sec}
%
%
\def\sectionheading#1#2#3#4{%
\def\sectionheading#1#2#3#4{%
  {%
  {%
    % Switch to the right set of fonts.
    % Switch to the right set of fonts.
    \csname #2fonts\endcsname \rm
    \csname #2fonts\endcsname \rmisbold
    %
    %
    \def\sectionlevel{#2}%
    \def\sectionlevel{#2}%
    \def\temptype{#3}%
    \def\temptype{#3}%
    %
    %
    % Insert first mark before the heading break (see notes for \domark).
    % Insert first mark before the heading break (see notes for \domark).
    \let\prevsectiondefs=\lastsectiondefs
    \let\prevsectiondefs=\lastsectiondefs
    \ifx\temptype\Ynothingkeyword
    \ifx\temptype\Ynothingkeyword
      \ifx\sectionlevel\seckeyword
      \ifx\sectionlevel\seckeyword
        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
                              \gdef\thissection{\thissectionname}}%
                              \gdef\thissection{\thissectionname}}%
      \fi
      \fi
    \else\ifx\temptype\Yomitfromtockeyword
    \else\ifx\temptype\Yomitfromtockeyword
      % Don't redefine \thissection.
      % Don't redefine \thissection.
    \else\ifx\temptype\Yappendixkeyword
    \else\ifx\temptype\Yappendixkeyword
      \ifx\sectionlevel\seckeyword
      \ifx\sectionlevel\seckeyword
        \toks0={#1}%
        \toks0={#1}%
        \xdef\lastsectiondefs{%
        \xdef\lastsectiondefs{%
          \gdef\noexpand\thissectionname{\the\toks0}%
          \gdef\noexpand\thissectionname{\the\toks0}%
          \gdef\noexpand\thissectionnum{#4}%
          \gdef\noexpand\thissectionnum{#4}%
          \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
          % \noexpand\putwordSection avoids expanding indigestible
 
          % commands in some of the translations.
 
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
                                     \noexpand\thissectionnum:
                                     \noexpand\thissectionname}%
                                     \noexpand\thissectionname}%
        }%
        }%
      \fi
      \fi
    \else
    \else
      \ifx\sectionlevel\seckeyword
      \ifx\sectionlevel\seckeyword
        \toks0={#1}%
        \toks0={#1}%
        \xdef\lastsectiondefs{%
        \xdef\lastsectiondefs{%
          \gdef\noexpand\thissectionname{\the\toks0}%
          \gdef\noexpand\thissectionname{\the\toks0}%
          \gdef\noexpand\thissectionnum{#4}%
          \gdef\noexpand\thissectionnum{#4}%
          \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
          % \noexpand\putwordSection avoids expanding indigestible
 
          % commands in some of the translations.
 
          \gdef\noexpand\thissection{\noexpand\putwordSection{}
 
                                     \noexpand\thissectionnum:
                                     \noexpand\thissectionname}%
                                     \noexpand\thissectionname}%
        }%
        }%
      \fi
      \fi
    \fi\fi\fi
    \fi\fi\fi
    %
    %
 
    % Go into vertical mode.  Usually we'll already be there, but we
 
    % don't want the following whatsit to end up in a preceding paragraph
 
    % if the document didn't happen to have a blank line.
 
    \par
 
    %
    % Output the mark.  Pass it through \safewhatsit, to take care of
    % Output the mark.  Pass it through \safewhatsit, to take care of
    % the preceding space.
    % the preceding space.
    \safewhatsit\domark
    \safewhatsit\domark
    %
    %
    % Insert space above the heading.
    % Insert space above the heading.
    \csname #2headingbreak\endcsname
    \csname #2headingbreak\endcsname
    %
    %
    % Now the second mark, after the heading break.  No break points
    % Now the second mark, after the heading break.  No break points
    % between here and the heading.
    % between here and the heading.
    \let\prevsectiondefs=\lastsectiondefs
    \let\prevsectiondefs=\lastsectiondefs
    \domark
    \domark
    %
    %
    % Only insert the space after the number if we have a section number.
    % Only insert the space after the number if we have a section number.
    \ifx\temptype\Ynothingkeyword
    \ifx\temptype\Ynothingkeyword
      \setbox0 = \hbox{}%
      \setbox0 = \hbox{}%
      \def\toctype{unn}%
      \def\toctype{unn}%
      \gdef\lastsection{#1}%
      \gdef\lastsection{#1}%
    \else\ifx\temptype\Yomitfromtockeyword
    \else\ifx\temptype\Yomitfromtockeyword
      % for @headings -- no section number, don't include in toc,
      % for @headings -- no section number, don't include in toc,
      % and don't redefine \lastsection.
      % and don't redefine \lastsection.
      \setbox0 = \hbox{}%
      \setbox0 = \hbox{}%
      \def\toctype{omit}%
      \def\toctype{omit}%
      \let\sectionlevel=\empty
      \let\sectionlevel=\empty
    \else\ifx\temptype\Yappendixkeyword
    \else\ifx\temptype\Yappendixkeyword
      \setbox0 = \hbox{#4\enspace}%
      \setbox0 = \hbox{#4\enspace}%
      \def\toctype{app}%
      \def\toctype{app}%
      \gdef\lastsection{#1}%
      \gdef\lastsection{#1}%
    \else
    \else
      \setbox0 = \hbox{#4\enspace}%
      \setbox0 = \hbox{#4\enspace}%
      \def\toctype{num}%
      \def\toctype{num}%
      \gdef\lastsection{#1}%
      \gdef\lastsection{#1}%
    \fi\fi\fi
    \fi\fi\fi
    %
    %
    % Write the toc entry (before \donoderef).  See comments in \chapmacro.
    % Write the toc entry (before \donoderef).  See comments in \chapmacro.
    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
    %
    %
    % Write the node reference (= pdf destination for pdftex).
    % Write the node reference (= pdf destination for pdftex).
    % Again, see comments in \chapmacro.
    % Again, see comments in \chapmacro.
    \donoderef{#3}%
    \donoderef{#3}%
    %
    %
    % Interline glue will be inserted when the vbox is completed.
    % Interline glue will be inserted when the vbox is completed.
    % That glue will be a valid breakpoint for the page, since it'll be
    % That glue will be a valid breakpoint for the page, since it'll be
    % preceded by a whatsit (usually from the \donoderef, or from the
    % preceded by a whatsit (usually from the \donoderef, or from the
    % \writetocentry if there was no node).  We don't want to allow that
    % \writetocentry if there was no node).  We don't want to allow that
    % break, since then the whatsits could end up on page n while the
    % break, since then the whatsits could end up on page n while the
    % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
    % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
    \nobreak
    \nobreak
    %
    %
    % Output the actual section heading.
    % Output the actual section heading.
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
          \hangindent=\wd0  % zero if no section number
          \hangindent=\wd0  % zero if no section number
          \unhbox0 #1}%
          \unhbox0 #1}%
  }%
  }%
  % Add extra space after the heading -- half of whatever came above it.
  % Add extra space after the heading -- half of whatever came above it.
  % Don't allow stretch, though.
  % Don't allow stretch, though.
  \kern .5 \csname #2headingskip\endcsname
  \kern .5 \csname #2headingskip\endcsname
  %
  %
  % Do not let the kern be a potential breakpoint, as it would be if it
  % Do not let the kern be a potential breakpoint, as it would be if it
  % was followed by glue.
  % was followed by glue.
  \nobreak
  \nobreak
  %
  %
  % We'll almost certainly start a paragraph next, so don't let that
  % We'll almost certainly start a paragraph next, so don't let that
  % glue accumulate.  (Not a breakpoint because it's preceded by a
  % glue accumulate.  (Not a breakpoint because it's preceded by a
  % discardable item.)
  % discardable item.)
  \vskip-\parskip
  \vskip-\parskip
  %
  %
  % This is purely so the last item on the list is a known \penalty >
  % This is purely so the last item on the list is a known \penalty >
  % 10000.  This is so \startdefun can avoid allowing breakpoints after
  % 10000.  This is so \startdefun can avoid allowing breakpoints after
  % section headings.  Otherwise, it would insert a valid breakpoint between:
  % section headings.  Otherwise, it would insert a valid breakpoint between:
  %
  %
  %   @section sec-whatever
  %   @section sec-whatever
  %   @deffn def-whatever
  %   @deffn def-whatever
  \penalty 10001
  \penalty 10001
}
}
 
 
 
 
\message{toc,}
\message{toc,}
% Table of contents.
% Table of contents.
\newwrite\tocfile
\newwrite\tocfile
 
 
% Write an entry to the toc file, opening it if necessary.
% Write an entry to the toc file, opening it if necessary.
% Called from @chapter, etc.
% Called from @chapter, etc.
%
%
% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
% We append the current node name (if any) and page number as additional
% We append the current node name (if any) and page number as additional
% arguments for the \{chap,sec,...}entry macros which will eventually
% arguments for the \{chap,sec,...}entry macros which will eventually
% read this.  The node name is used in the pdf outlines as the
% read this.  The node name is used in the pdf outlines as the
% destination to jump to.
% destination to jump to.
%
%
% We open the .toc file for writing here instead of at @setfilename (or
% We open the .toc file for writing here instead of at @setfilename (or
% any other fixed time) so that @contents can be anywhere in the document.
% any other fixed time) so that @contents can be anywhere in the document.
% But if #1 is `omit', then we don't do anything.  This is used for the
% But if #1 is `omit', then we don't do anything.  This is used for the
% table of contents chapter openings themselves.
% table of contents chapter openings themselves.
%
%
\newif\iftocfileopened
\newif\iftocfileopened
\def\omitkeyword{omit}%
\def\omitkeyword{omit}%
%
%
\def\writetocentry#1#2#3{%
\def\writetocentry#1#2#3{%
  \edef\writetoctype{#1}%
  \edef\writetoctype{#1}%
  \ifx\writetoctype\omitkeyword \else
  \ifx\writetoctype\omitkeyword \else
    \iftocfileopened\else
    \iftocfileopened\else
      \immediate\openout\tocfile = \jobname.toc
      \immediate\openout\tocfile = \jobname.toc
      \global\tocfileopenedtrue
      \global\tocfileopenedtrue
    \fi
    \fi
    %
    %
    \iflinks
    \iflinks
      {\atdummies
      {\atdummies
       \edef\temp{%
       \edef\temp{%
         \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
         \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
       \temp
       \temp
      }%
      }%
    \fi
    \fi
  \fi
  \fi
  %
  %
  % Tell \shipout to create a pdf destination on each page, if we're
  % Tell \shipout to create a pdf destination on each page, if we're
  % writing pdf.  These are used in the table of contents.  We can't
  % writing pdf.  These are used in the table of contents.  We can't
  % just write one on every page because the title pages are numbered
  % just write one on every page because the title pages are numbered
  % 1 and 2 (the page numbers aren't printed), and so are the first
  % 1 and 2 (the page numbers aren't printed), and so are the first
  % two pages of the document.  Thus, we'd have two destinations named
  % two pages of the document.  Thus, we'd have two destinations named
  % `1', and two named `2'.
  % `1', and two named `2'.
  \ifpdf \global\pdfmakepagedesttrue \fi
  \ifpdf \global\pdfmakepagedesttrue \fi
}
}
 
 
 
 
% These characters do not print properly in the Computer Modern roman
% These characters do not print properly in the Computer Modern roman
% fonts, so we must take special care.  This is more or less redundant
% fonts, so we must take special care.  This is more or less redundant
% with the Texinfo input format setup at the end of this file.
% with the Texinfo input format setup at the end of this file.
%
%
\def\activecatcodes{%
\def\activecatcodes{%
  \catcode`\"=\active
  \catcode`\"=\active
  \catcode`\$=\active
  \catcode`\$=\active
  \catcode`\<=\active
  \catcode`\<=\active
  \catcode`\>=\active
  \catcode`\>=\active
  \catcode`\\=\active
  \catcode`\\=\active
  \catcode`\^=\active
  \catcode`\^=\active
  \catcode`\_=\active
  \catcode`\_=\active
  \catcode`\|=\active
  \catcode`\|=\active
  \catcode`\~=\active
  \catcode`\~=\active
}
}
 
 
 
 
% Read the toc file, which is essentially Texinfo input.
% Read the toc file, which is essentially Texinfo input.
\def\readtocfile{%
\def\readtocfile{%
  \setupdatafile
  \setupdatafile
  \activecatcodes
  \activecatcodes
  \input \tocreadfilename
  \input \tocreadfilename
}
}
 
 
\newskip\contentsrightmargin \contentsrightmargin=1in
\newskip\contentsrightmargin \contentsrightmargin=1in
\newcount\savepageno
\newcount\savepageno
\newcount\lastnegativepageno \lastnegativepageno = -1
\newcount\lastnegativepageno \lastnegativepageno = -1
 
 
% Prepare to read what we've written to \tocfile.
% Prepare to read what we've written to \tocfile.
%
%
\def\startcontents#1{%
\def\startcontents#1{%
  % If @setchapternewpage on, and @headings double, the contents should
  % If @setchapternewpage on, and @headings double, the contents should
  % start on an odd page, unlike chapters.  Thus, we maintain
  % start on an odd page, unlike chapters.  Thus, we maintain
  % \contentsalignmacro in parallel with \pagealignmacro.
  % \contentsalignmacro in parallel with \pagealignmacro.
  % From: Torbjorn Granlund <tege@matematik.su.se>
  % From: Torbjorn Granlund <tege@matematik.su.se>
  \contentsalignmacro
  \contentsalignmacro
  \immediate\closeout\tocfile
  \immediate\closeout\tocfile
  %
  %
  % Don't need to put `Contents' or `Short Contents' in the headline.
  % Don't need to put `Contents' or `Short Contents' in the headline.
  % It is abundantly clear what they are.
  % It is abundantly clear what they are.
  \chapmacro{#1}{Yomitfromtoc}{}%
  \chapmacro{#1}{Yomitfromtoc}{}%
  %
  %
  \savepageno = \pageno
  \savepageno = \pageno
  \begingroup                  % Set up to handle contents files properly.
  \begingroup                  % Set up to handle contents files properly.
    \raggedbottom              % Worry more about breakpoints than the bottom.
    \raggedbottom              % Worry more about breakpoints than the bottom.
    \advance\hsize by -\contentsrightmargin % Don't use the full line length.
    \advance\hsize by -\contentsrightmargin % Don't use the full line length.
    %
    %
    % Roman numerals for page numbers.
    % Roman numerals for page numbers.
    \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
    \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
}
 
 
% redefined for the two-volume lispref.  We always output on
% redefined for the two-volume lispref.  We always output on
% \jobname.toc even if this is redefined.
% \jobname.toc even if this is redefined.
%
%
\def\tocreadfilename{\jobname.toc}
\def\tocreadfilename{\jobname.toc}
 
 
% Normal (long) toc.
% Normal (long) toc.
%
%
\def\contents{%
\def\contents{%
  \startcontents{\putwordTOC}%
  \startcontents{\putwordTOC}%
    \openin 1 \tocreadfilename\space
    \openin 1 \tocreadfilename\space
    \ifeof 1 \else
    \ifeof 1 \else
      \readtocfile
      \readtocfile
    \fi
    \fi
    \vfill \eject
    \vfill \eject
    \contentsalignmacro % in case @setchapternewpage odd is in effect
    \contentsalignmacro % in case @setchapternewpage odd is in effect
    \ifeof 1 \else
    \ifeof 1 \else
      \pdfmakeoutlines
      \pdfmakeoutlines
    \fi
    \fi
    \closein 1
    \closein 1
  \endgroup
  \endgroup
  \lastnegativepageno = \pageno
  \lastnegativepageno = \pageno
  \global\pageno = \savepageno
  \global\pageno = \savepageno
}
}
 
 
% And just the chapters.
% And just the chapters.
\def\summarycontents{%
\def\summarycontents{%
  \startcontents{\putwordShortTOC}%
  \startcontents{\putwordShortTOC}%
    %
    %
    \let\numchapentry = \shortchapentry
    \let\numchapentry = \shortchapentry
    \let\appentry = \shortchapentry
    \let\appentry = \shortchapentry
    \let\unnchapentry = \shortunnchapentry
    \let\unnchapentry = \shortunnchapentry
    % We want a true roman here for the page numbers.
    % We want a true roman here for the page numbers.
    \secfonts
    \secfonts
    \let\rm=\shortcontrm \let\bf=\shortcontbf
    \let\rm=\shortcontrm \let\bf=\shortcontbf
    \let\sl=\shortcontsl \let\tt=\shortconttt
    \let\sl=\shortcontsl \let\tt=\shortconttt
    \rm
    \rm
    \hyphenpenalty = 10000
    \hyphenpenalty = 10000
    \advance\baselineskip by 1pt % Open it up a little.
    \advance\baselineskip by 1pt % Open it up a little.
    \def\numsecentry##1##2##3##4{}
    \def\numsecentry##1##2##3##4{}
    \let\appsecentry = \numsecentry
    \let\appsecentry = \numsecentry
    \let\unnsecentry = \numsecentry
    \let\unnsecentry = \numsecentry
    \let\numsubsecentry = \numsecentry
    \let\numsubsecentry = \numsecentry
    \let\appsubsecentry = \numsecentry
    \let\appsubsecentry = \numsecentry
    \let\unnsubsecentry = \numsecentry
    \let\unnsubsecentry = \numsecentry
    \let\numsubsubsecentry = \numsecentry
    \let\numsubsubsecentry = \numsecentry
    \let\appsubsubsecentry = \numsecentry
    \let\appsubsubsecentry = \numsecentry
    \let\unnsubsubsecentry = \numsecentry
    \let\unnsubsubsecentry = \numsecentry
    \openin 1 \tocreadfilename\space
    \openin 1 \tocreadfilename\space
    \ifeof 1 \else
    \ifeof 1 \else
      \readtocfile
      \readtocfile
    \fi
    \fi
    \closein 1
    \closein 1
    \vfill \eject
    \vfill \eject
    \contentsalignmacro % in case @setchapternewpage odd is in effect
    \contentsalignmacro % in case @setchapternewpage odd is in effect
  \endgroup
  \endgroup
  \lastnegativepageno = \pageno
  \lastnegativepageno = \pageno
  \global\pageno = \savepageno
  \global\pageno = \savepageno
}
}
\let\shortcontents = \summarycontents
\let\shortcontents = \summarycontents
 
 
% Typeset the label for a chapter or appendix for the short contents.
% Typeset the label for a chapter or appendix for the short contents.
% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
%
%
\def\shortchaplabel#1{%
\def\shortchaplabel#1{%
  % This space should be enough, since a single number is .5em, and the
  % This space should be enough, since a single number is .5em, and the
  % widest letter (M) is 1em, at least in the Computer Modern fonts.
  % widest letter (M) is 1em, at least in the Computer Modern fonts.
  % But use \hss just in case.
  % But use \hss just in case.
  % (This space doesn't include the extra space that gets added after
  % (This space doesn't include the extra space that gets added after
  % the label; that gets put in by \shortchapentry above.)
  % the label; that gets put in by \shortchapentry above.)
  %
  %
  % We'd like to right-justify chapter numbers, but that looks strange
  % We'd like to right-justify chapter numbers, but that looks strange
  % with appendix letters.  And right-justifying numbers and
  % with appendix letters.  And right-justifying numbers and
  % left-justifying letters looks strange when there is less than 10
  % left-justifying letters looks strange when there is less than 10
  % chapters.  Have to read the whole toc once to know how many chapters
  % chapters.  Have to read the whole toc once to know how many chapters
  % there are before deciding ...
  % there are before deciding ...
  \hbox to 1em{#1\hss}%
  \hbox to 1em{#1\hss}%
}
}
 
 
% These macros generate individual entries in the table of contents.
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The first argument is the chapter or section name.
% The last argument is the page number.
% The last argument is the page number.
% The arguments in between are the chapter number, section number, ...
% The arguments in between are the chapter number, section number, ...
 
 
% Chapters, in the main contents.
% Chapters, in the main contents.
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
%
%
% Chapters, in the short toc.
% Chapters, in the short toc.
% See comments in \dochapentry re vbox and related settings.
% See comments in \dochapentry re vbox and related settings.
\def\shortchapentry#1#2#3#4{%
\def\shortchapentry#1#2#3#4{%
  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
}
}
 
 
% Appendices, in the main contents.
% Appendices, in the main contents.
% Need the word Appendix, and a fixed-size box.
% Need the word Appendix, and a fixed-size box.
%
%
\def\appendixbox#1{%
\def\appendixbox#1{%
  % We use M since it's probably the widest letter.
  % We use M since it's probably the widest letter.
  \setbox0 = \hbox{\putwordAppendix{} M}%
  \setbox0 = \hbox{\putwordAppendix{} M}%
  \hbox to \wd0{\putwordAppendix{} #1\hss}}
  \hbox to \wd0{\putwordAppendix{} #1\hss}}
%
%
\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
 
 
% Unnumbered chapters.
% Unnumbered chapters.
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
 
 
% Sections.
% Sections.
\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
\let\appsecentry=\numsecentry
\let\appsecentry=\numsecentry
\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
 
 
% Subsections.
% Subsections.
\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
\let\appsubsecentry=\numsubsecentry
\let\appsubsecentry=\numsubsecentry
\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
 
 
% And subsubsections.
% And subsubsections.
\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
\let\appsubsubsecentry=\numsubsubsecentry
\let\appsubsubsecentry=\numsubsubsecentry
\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
 
 
% This parameter controls the indentation of the various levels.
% This parameter controls the indentation of the various levels.
% Same as \defaultparindent.
% Same as \defaultparindent.
\newdimen\tocindent \tocindent = 15pt
\newdimen\tocindent \tocindent = 15pt
 
 
% Now for the actual typesetting. In all these, #1 is the text and #2 is the
% Now for the actual typesetting. In all these, #1 is the text and #2 is the
% page number.
% page number.
%
%
% If the toc has to be broken over pages, we want it to be at chapters
% If the toc has to be broken over pages, we want it to be at chapters
% if at all possible; hence the \penalty.
% if at all possible; hence the \penalty.
\def\dochapentry#1#2{%
\def\dochapentry#1#2{%
   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
   \begingroup
   \begingroup
     \chapentryfonts
     \chapentryfonts
     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
   \endgroup
   \endgroup
   \nobreak\vskip .25\baselineskip plus.1\baselineskip
   \nobreak\vskip .25\baselineskip plus.1\baselineskip
}
}
 
 
\def\dosecentry#1#2{\begingroup
\def\dosecentry#1#2{\begingroup
  \secentryfonts \leftskip=\tocindent
  \secentryfonts \leftskip=\tocindent
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\endgroup}
 
 
\def\dosubsecentry#1#2{\begingroup
\def\dosubsecentry#1#2{\begingroup
  \subsecentryfonts \leftskip=2\tocindent
  \subsecentryfonts \leftskip=2\tocindent
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\endgroup}
 
 
\def\dosubsubsecentry#1#2{\begingroup
\def\dosubsubsecentry#1#2{\begingroup
  \subsubsecentryfonts \leftskip=3\tocindent
  \subsubsecentryfonts \leftskip=3\tocindent
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\endgroup}
 
 
% We use the same \entry macro as for the index entries.
% We use the same \entry macro as for the index entries.
\let\tocentry = \entry
\let\tocentry = \entry
 
 
% Space between chapter (or whatever) number and the title.
% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}
\def\labelspace{\hskip1em \relax}
 
 
\def\dopageno#1{{\rm #1}}
\def\dopageno#1{{\rm #1}}
\def\doshortpageno#1{{\rm #1}}
\def\doshortpageno#1{{\rm #1}}
 
 
\def\chapentryfonts{\secfonts \rm}
\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
\def\secentryfonts{\textfonts}
\def\subsecentryfonts{\textfonts}
\def\subsecentryfonts{\textfonts}
\def\subsubsecentryfonts{\textfonts}
\def\subsubsecentryfonts{\textfonts}
 
 
 
 
\message{environments,}
\message{environments,}
% @foo ... @end foo.
% @foo ... @end foo.
 
 
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
%
 
% Since these characters are used in examples, it should be an even number of
 
% \tt widths. Each \tt character is 1en, so two makes it 1em.
 
%
 
\def\point{$\star$}
 
\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
 
\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
 
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
 
\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
 
 
 
% The @error{} command.
 
% Adapted from the TeXbook's \boxit.
 
%
 
\newbox\errorbox
 
%
 
{\tentt \global\dimen0 = 3em}% Width of the box.
 
\dimen2 = .55pt % Thickness of rules
 
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
 
\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
 
%
 
\setbox\errorbox=\hbox to \dimen0{\hfil
 
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
 
   \advance\hsize by -2\dimen2 % Rules.
 
   \vbox{%
 
      \hrule height\dimen2
 
      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
 
         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
 
         \kern3pt\vrule width\dimen2}% Space to right.
 
      \hrule height\dimen2}
 
    \hfil}
 
%
 
\def\error{\leavevmode\lower.7ex\copy\errorbox}
 
 
 
% @tex ... @end tex    escapes into raw Tex temporarily.
% @tex ... @end tex    escapes into raw Tex temporarily.
% One exception: @ is still an escape character, so that @end tex works.
% One exception: @ is still an escape character, so that @end tex works.
% But \@ or @@ will get a plain tex @ character.
% But \@ or @@ will get a plain tex @ character.
 
 
\envdef\tex{%
\envdef\tex{%
 
  \setupmarkupstyle{tex}%
  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  \catcode `\%=14
  \catcode `\%=14
  \catcode `\+=\other
  \catcode `\+=\other
  \catcode `\"=\other
  \catcode `\"=\other
  \catcode `\|=\other
  \catcode `\|=\other
  \catcode `\<=\other
  \catcode `\<=\other
  \catcode `\>=\other
  \catcode `\>=\other
 
  \catcode`\`=\other
 
  \catcode`\'=\other
  \escapechar=`\\
  \escapechar=`\\
  %
  %
  \let\b=\ptexb
  \let\b=\ptexb
  \let\bullet=\ptexbullet
  \let\bullet=\ptexbullet
  \let\c=\ptexc
  \let\c=\ptexc
  \let\,=\ptexcomma
  \let\,=\ptexcomma
  \let\.=\ptexdot
  \let\.=\ptexdot
  \let\dots=\ptexdots
  \let\dots=\ptexdots
  \let\equiv=\ptexequiv
  \let\equiv=\ptexequiv
  \let\!=\ptexexclam
  \let\!=\ptexexclam
  \let\i=\ptexi
  \let\i=\ptexi
  \let\indent=\ptexindent
  \let\indent=\ptexindent
  \let\noindent=\ptexnoindent
  \let\noindent=\ptexnoindent
  \let\{=\ptexlbrace
  \let\{=\ptexlbrace
  \let\+=\tabalign
  \let\+=\tabalign
  \let\}=\ptexrbrace
  \let\}=\ptexrbrace
  \let\/=\ptexslash
  \let\/=\ptexslash
  \let\*=\ptexstar
  \let\*=\ptexstar
  \let\t=\ptext
  \let\t=\ptext
 
  \expandafter \let\csname top\endcsname=\ptextop  % outer
  \let\frenchspacing=\plainfrenchspacing
  \let\frenchspacing=\plainfrenchspacing
  %
  %
  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  \def\@{@}%
  \def\@{@}%
}
}
% There is no need to define \Etex.
% There is no need to define \Etex.
 
 
% Define @lisp ... @end lisp.
% Define @lisp ... @end lisp.
% @lisp environment forms a group so it can rebind things,
% @lisp environment forms a group so it can rebind things,
% including the definition of @end lisp (which normally is erroneous).
% including the definition of @end lisp (which normally is erroneous).
 
 
% Amount to narrow the margins by for @lisp.
% Amount to narrow the margins by for @lisp.
\newskip\lispnarrowing \lispnarrowing=0.4in
\newskip\lispnarrowing \lispnarrowing=0.4in
 
 
% This is the definition that ^^M gets inside @lisp, @example, and other
% This is the definition that ^^M gets inside @lisp, @example, and other
% such environments.  \null is better than a space, since it doesn't
% such environments.  \null is better than a space, since it doesn't
% have any width.
% have any width.
\def\lisppar{\null\endgraf}
\def\lisppar{\null\endgraf}
 
 
% This space is always present above and below environments.
% This space is always present above and below environments.
\newskip\envskipamount \envskipamount = 0pt
\newskip\envskipamount \envskipamount = 0pt
 
 
% Make spacing and below environment symmetrical.  We use \parskip here
% Make spacing and below environment symmetrical.  We use \parskip here
% to help in doing that, since in @example-like environments \parskip
% to help in doing that, since in @example-like environments \parskip
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
% start of the next paragraph will insert \parskip.
% start of the next paragraph will insert \parskip.
%
%
\def\aboveenvbreak{{%
\def\aboveenvbreak{{%
  % =10000 instead of <10000 because of a special case in \itemzzz and
  % =10000 instead of <10000 because of a special case in \itemzzz and
  % \sectionheading, q.v.
  % \sectionheading, q.v.
  \ifnum \lastpenalty=10000 \else
  \ifnum \lastpenalty=10000 \else
    \advance\envskipamount by \parskip
    \advance\envskipamount by \parskip
    \endgraf
    \endgraf
    \ifdim\lastskip<\envskipamount
    \ifdim\lastskip<\envskipamount
      \removelastskip
      \removelastskip
      % it's not a good place to break if the last penalty was \nobreak
      % it's not a good place to break if the last penalty was \nobreak
      % or better ...
      % or better ...
      \ifnum\lastpenalty<10000 \penalty-50 \fi
      \ifnum\lastpenalty<10000 \penalty-50 \fi
      \vskip\envskipamount
      \vskip\envskipamount
    \fi
    \fi
  \fi
  \fi
}}
}}
 
 
\let\afterenvbreak = \aboveenvbreak
\let\afterenvbreak = \aboveenvbreak
 
 
% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
% also clear it, so that its embedded environments do the narrowing again.
% also clear it, so that its embedded environments do the narrowing again.
\let\nonarrowing=\relax
\let\nonarrowing=\relax
 
 
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
% environment contents.
\font\circle=lcircle10
\font\circle=lcircle10
\newdimen\circthick
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\circthick=\fontdimen8\circle
\circthick=\fontdimen8\circle
%
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
\def\ctr{{\hskip 6pt\circle\char'010}}
\def\cbl{{\circle\char'012\hskip -6pt}}
\def\cbl{{\circle\char'012\hskip -6pt}}
\def\cbr{{\hskip 6pt\circle\char'011}}
\def\cbr{{\hskip 6pt\circle\char'011}}
\def\carttop{\hbox to \cartouter{\hskip\lskip
\def\carttop{\hbox to \cartouter{\hskip\lskip
        \ctl\leaders\hrule height\circthick\hfil\ctr
        \ctl\leaders\hrule height\circthick\hfil\ctr
        \hskip\rskip}}
        \hskip\rskip}}
\def\cartbot{\hbox to \cartouter{\hskip\lskip
\def\cartbot{\hbox to \cartouter{\hskip\lskip
        \cbl\leaders\hrule height\circthick\hfil\cbr
        \cbl\leaders\hrule height\circthick\hfil\cbr
        \hskip\rskip}}
        \hskip\rskip}}
%
%
\newskip\lskip\newskip\rskip
\newskip\lskip\newskip\rskip
 
 
\envdef\cartouche{%
\envdef\cartouche{%
  \ifhmode\par\fi  % can't be in the midst of a paragraph.
  \ifhmode\par\fi  % can't be in the midst of a paragraph.
  \startsavinginserts
  \startsavinginserts
  \lskip=\leftskip \rskip=\rightskip
  \lskip=\leftskip \rskip=\rightskip
  \leftskip=0pt\rightskip=0pt % we want these *outside*.
  \leftskip=0pt\rightskip=0pt % we want these *outside*.
  \cartinner=\hsize \advance\cartinner by-\lskip
  \cartinner=\hsize \advance\cartinner by-\lskip
  \advance\cartinner by-\rskip
  \advance\cartinner by-\rskip
  \cartouter=\hsize
  \cartouter=\hsize
  \advance\cartouter by 18.4pt  % allow for 3pt kerns on either
  \advance\cartouter by 18.4pt  % allow for 3pt kerns on either
                                % side, and for 6pt waste from
                                % side, and for 6pt waste from
                                % each corner char, and rule thickness
                                % each corner char, and rule thickness
  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  % Flag to tell @lisp, etc., not to narrow margin.
  % Flag to tell @lisp, etc., not to narrow margin.
  \let\nonarrowing = t%
  \let\nonarrowing = t%
  \vbox\bgroup
  \vbox\bgroup
      \baselineskip=0pt\parskip=0pt\lineskip=0pt
      \baselineskip=0pt\parskip=0pt\lineskip=0pt
      \carttop
      \carttop
      \hbox\bgroup
      \hbox\bgroup
          \hskip\lskip
          \hskip\lskip
          \vrule\kern3pt
          \vrule\kern3pt
          \vbox\bgroup
          \vbox\bgroup
              \kern3pt
              \kern3pt
              \hsize=\cartinner
              \hsize=\cartinner
              \baselineskip=\normbskip
              \baselineskip=\normbskip
              \lineskip=\normlskip
              \lineskip=\normlskip
              \parskip=\normpskip
              \parskip=\normpskip
              \vskip -\parskip
              \vskip -\parskip
              \comment % For explanation, see the end of \def\group.
              \comment % For explanation, see the end of \def\group.
}
}
\def\Ecartouche{%
\def\Ecartouche{%
              \ifhmode\par\fi
              \ifhmode\par\fi
              \kern3pt
              \kern3pt
          \egroup
          \egroup
          \kern3pt\vrule
          \kern3pt\vrule
          \hskip\rskip
          \hskip\rskip
      \egroup
      \egroup
      \cartbot
      \cartbot
  \egroup
  \egroup
  \checkinserts
  \checkinserts
}
}
 
 
 
 
% This macro is called at the beginning of all the @example variants,
% This macro is called at the beginning of all the @example variants,
% inside a group.
% inside a group.
 
\newdimen\nonfillparindent
\def\nonfillstart{%
\def\nonfillstart{%
  \aboveenvbreak
  \aboveenvbreak
  \hfuzz = 12pt % Don't be fussy
  \hfuzz = 12pt % Don't be fussy
  \sepspaces % Make spaces be word-separators rather than space tokens.
  \sepspaces % Make spaces be word-separators rather than space tokens.
  \let\par = \lisppar % don't ignore blank lines
  \let\par = \lisppar % don't ignore blank lines
  \obeylines % each line of input is a line of output
  \obeylines % each line of input is a line of output
  \parskip = 0pt
  \parskip = 0pt
 
  % Turn off paragraph indentation but redefine \indent to emulate
 
  % the normal \indent.
 
  \nonfillparindent=\parindent
  \parindent = 0pt
  \parindent = 0pt
 
  \let\indent\nonfillindent
 
  %
  \emergencystretch = 0pt % don't try to avoid overfull boxes
  \emergencystretch = 0pt % don't try to avoid overfull boxes
  \ifx\nonarrowing\relax
  \ifx\nonarrowing\relax
    \advance \leftskip by \lispnarrowing
    \advance \leftskip by \lispnarrowing
    \exdentamount=\lispnarrowing
    \exdentamount=\lispnarrowing
  \else
  \else
    \let\nonarrowing = \relax
    \let\nonarrowing = \relax
  \fi
  \fi
  \let\exdent=\nofillexdent
  \let\exdent=\nofillexdent
}
}
 
 
 
\begingroup
 
\obeyspaces
 
% We want to swallow spaces (but not other tokens) after the fake
 
% @indent in our nonfill-environments, where spaces are normally
 
% active and set to @tie, resulting in them not being ignored after
 
% @indent.
 
\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
 
\gdef\nonfillindentcheck{%
 
\ifx\temp %
 
\expandafter\nonfillindentgobble%
 
\else%
 
\leavevmode\nonfillindentbox%
 
\fi%
 
}%
 
\endgroup
 
\def\nonfillindentgobble#1{\nonfillindent}
 
\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
 
 
% If you want all examples etc. small: @set dispenvsize small.
% If you want all examples etc. small: @set dispenvsize small.
% If you want even small examples the full size: @set dispenvsize nosmall.
% If you want even small examples the full size: @set dispenvsize nosmall.
% This affects the following displayed environments:
% This affects the following displayed environments:
%    @example, @display, @format, @lisp
%    @example, @display, @format, @lisp
%
%
\def\smallword{small}
\def\smallword{small}
\def\nosmallword{nosmall}
\def\nosmallword{nosmall}
\let\SETdispenvsize\relax
\let\SETdispenvsize\relax
\def\setnormaldispenv{%
\def\setnormaldispenv{%
  \ifx\SETdispenvsize\smallword
  \ifx\SETdispenvsize\smallword
    % end paragraph for sake of leading, in case document has no blank
    % end paragraph for sake of leading, in case document has no blank
    % line.  This is redundant with what happens in \aboveenvbreak, but
    % line.  This is redundant with what happens in \aboveenvbreak, but
    % we need to do it before changing the fonts, and it's inconvenient
    % we need to do it before changing the fonts, and it's inconvenient
    % to change the fonts afterward.
    % to change the fonts afterward.
    \ifnum \lastpenalty=10000 \else \endgraf \fi
    \ifnum \lastpenalty=10000 \else \endgraf \fi
    \smallexamplefonts \rm
    \smallexamplefonts \rm
  \fi
  \fi
}
}
\def\setsmalldispenv{%
\def\setsmalldispenv{%
  \ifx\SETdispenvsize\nosmallword
  \ifx\SETdispenvsize\nosmallword
  \else
  \else
    \ifnum \lastpenalty=10000 \else \endgraf \fi
    \ifnum \lastpenalty=10000 \else \endgraf \fi
    \smallexamplefonts \rm
    \smallexamplefonts \rm
  \fi
  \fi
}
}
 
 
% We often define two environments, @foo and @smallfoo.
% We often define two environments, @foo and @smallfoo.
% Let's do it by one command:
% Let's do it by one command:
\def\makedispenv #1#2{
\def\makedispenv #1#2{
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
  \expandafter\let\csname E#1\endcsname \afterenvbreak
  \expandafter\let\csname E#1\endcsname \afterenvbreak
  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
}
}
 
 
% Define two synonyms:
% Define two synonyms:
\def\maketwodispenvs #1#2#3{
\def\maketwodispenvs #1#2#3{
  \makedispenv{#1}{#3}
  \makedispenv{#1}{#3}
  \makedispenv{#2}{#3}
  \makedispenv{#2}{#3}
}
}
 
 
% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
%
%
% @smallexample and @smalllisp: use smaller fonts.
% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
% Originally contributed by Pavel@xerox.
%
%
\maketwodispenvs {lisp}{example}{%
\maketwodispenvs {lisp}{example}{%
  \nonfillstart
  \nonfillstart
  \tt\quoteexpand
  \tt\setupmarkupstyle{example}%
  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  \gobble       % eat return
  \gobble       % eat return
}
}
% @display/@smalldisplay: same as @lisp except keep current font.
% @display/@smalldisplay: same as @lisp except keep current font.
%
%
\makedispenv {display}{%
\makedispenv {display}{%
  \nonfillstart
  \nonfillstart
  \gobble
  \gobble
}
}
 
 
% @format/@smallformat: same as @display except don't narrow margins.
% @format/@smallformat: same as @display except don't narrow margins.
%
%
\makedispenv{format}{%
\makedispenv{format}{%
  \let\nonarrowing = t%
  \let\nonarrowing = t%
  \nonfillstart
  \nonfillstart
  \gobble
  \gobble
}
}
 
 
% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
\envdef\flushleft{%
\envdef\flushleft{%
  \let\nonarrowing = t%
  \let\nonarrowing = t%
  \nonfillstart
  \nonfillstart
  \gobble
  \gobble
}
}
\let\Eflushleft = \afterenvbreak
\let\Eflushleft = \afterenvbreak
 
 
% @flushright.
% @flushright.
%
%
\envdef\flushright{%
\envdef\flushright{%
  \let\nonarrowing = t%
  \let\nonarrowing = t%
  \nonfillstart
  \nonfillstart
  \advance\leftskip by 0pt plus 1fill
  \advance\leftskip by 0pt plus 1fill
  \gobble
  \gobble
}
}
\let\Eflushright = \afterenvbreak
\let\Eflushright = \afterenvbreak
 
 
 
 
 
% @raggedright does more-or-less normal line breaking but no right
 
% justification.  From plain.tex.
 
\envdef\raggedright{%
 
  \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
 
}
 
\let\Eraggedright\par
 
 
 
\envdef\raggedleft{%
 
  \parindent=0pt \leftskip0pt plus2em
 
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
                  % badness reporting.
 
}
 
\let\Eraggedleft\par
 
 
 
\envdef\raggedcenter{%
 
  \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
 
  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
 
  \hbadness=10000 % Last line will usually be underfull, so turn off
 
                  % badness reporting.
 
}
 
\let\Eraggedcenter\par
 
 
 
 
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.  We keep \parskip nonzero in general, since
% and narrows the margins.  We keep \parskip nonzero in general, since
% we're doing normal filling.  So, when using \aboveenvbreak and
% we're doing normal filling.  So, when using \aboveenvbreak and
% \afterenvbreak, temporarily make \parskip 0.
% \afterenvbreak, temporarily make \parskip 0.
%
%
\envdef\quotation{%
\def\quotationstart{%
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  \parindent=0pt
  \parindent=0pt
  %
  %
  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  \ifx\nonarrowing\relax
  \ifx\nonarrowing\relax
    \advance\leftskip by \lispnarrowing
    \advance\leftskip by \lispnarrowing
    \advance\rightskip by \lispnarrowing
    \advance\rightskip by \lispnarrowing
    \exdentamount = \lispnarrowing
    \exdentamount = \lispnarrowing
  \else
  \else
    \let\nonarrowing = \relax
    \let\nonarrowing = \relax
  \fi
  \fi
  \parsearg\quotationlabel
  \parsearg\quotationlabel
}
}
 
 
 
\envdef\quotation{%
 
  \setnormaldispenv
 
  \quotationstart
 
}
 
 
 
\envdef\smallquotation{%
 
  \setsmalldispenv
 
  \quotationstart
 
}
 
\let\Esmallquotation = \Equotation
 
 
% We have retained a nonzero parskip for the environment, since we're
% We have retained a nonzero parskip for the environment, since we're
% doing normal filling.
% doing normal filling.
%
%
\def\Equotation{%
\def\Equotation{%
  \par
  \par
  \ifx\quotationauthor\undefined\else
  \ifx\quotationauthor\undefined\else
    % indent a bit.
    % indent a bit.
    \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
    \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  \fi
  \fi
  {\parskip=0pt \afterenvbreak}%
  {\parskip=0pt \afterenvbreak}%
}
}
 
 
% If we're given an argument, typeset it in bold with a colon after.
% If we're given an argument, typeset it in bold with a colon after.
\def\quotationlabel#1{%
\def\quotationlabel#1{%
  \def\temp{#1}%
  \def\temp{#1}%
  \ifx\temp\empty \else
  \ifx\temp\empty \else
    {\bf #1: }%
    {\bf #1: }%
  \fi
  \fi
}
}
 
 
 
 
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% If we want to allow any <char> as delimiter,
% If we want to allow any <char> as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
%
%
% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
%
%
% [Knuth] p.344; only we need to do the other characters Texinfo sets
% [Knuth] p.344; only we need to do the other characters Texinfo sets
% active too.  Otherwise, they get lost as the first character on a
% active too.  Otherwise, they get lost as the first character on a
% verbatim line.
% verbatim line.
\def\dospecials{%
\def\dospecials{%
  \do\ \do\\\do\{\do\}\do\$\do\&%
  \do\ \do\\\do\{\do\}\do\$\do\&%
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  \do\<\do\>\do\|\do\@\do+\do\"%
  \do\<\do\>\do\|\do\@\do+\do\"%
 
  % Don't do the quotes -- if we do, @set txicodequoteundirected and
 
  % @set txicodequotebacktick will not have effect on @verb and
 
  % @verbatim, and ?` and !` ligatures won't get disabled.
 
  %\do\`\do\'%
}
}
%
%
% [Knuth] p. 380
% [Knuth] p. 380
\def\uncatcodespecials{%
\def\uncatcodespecials{%
  \def\do##1{\catcode`##1=\other}\dospecials}
  \def\do##1{\catcode`##1=\other}\dospecials}
%
%
% [Knuth] pp. 380,381,391
 
% Disable Spanish ligatures ?` and !` of \tt font
 
\begingroup
 
  \catcode`\`=\active\gdef`{\relax\lq}
 
\endgroup
 
%
 
% Setup for the @verb command.
% Setup for the @verb command.
%
%
% Eight spaces for a tab
% Eight spaces for a tab
\begingroup
\begingroup
  \catcode`\^^I=\active
  \catcode`\^^I=\active
  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
\endgroup
\endgroup
%
%
\def\setupverb{%
\def\setupverb{%
  \tt  % easiest (and conventionally used) font for verbatim
  \tt  % easiest (and conventionally used) font for verbatim
  \def\par{\leavevmode\endgraf}%
  \def\par{\leavevmode\endgraf}%
  \catcode`\`=\active
  \setupmarkupstyle{verb}%
  \tabeightspaces
  \tabeightspaces
  % Respect line breaks,
  % Respect line breaks,
  % print special symbols as themselves, and
  % print special symbols as themselves, and
  % make each space count
  % make each space count
  % must do in this order:
  % must do in this order:
  \obeylines \uncatcodespecials \sepspaces
  \obeylines \uncatcodespecials \sepspaces
}
}
 
 
% Setup for the @verbatim environment
% Setup for the @verbatim environment
%
%
% Real tab expansion
% Real tab expansion
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
%
\def\starttabbox{\setbox0=\hbox\bgroup}
\def\starttabbox{\setbox0=\hbox\bgroup}
 
 
% Allow an option to not replace quotes with a regular directed right
 
% quote/apostrophe (char 0x27), but instead use the undirected quote
 
% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
 
% the default, but it works for pasting with more pdf viewers (at least
 
% evince), the lilypond developers report.  xpdf does work with the
 
% regular 0x27.
 
%
 
\def\codequoteright{%
 
  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
 
    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
 
      '%
 
    \else \char'15 \fi
 
  \else \char'15 \fi
 
}
 
%
 
% and a similar option for the left quote char vs. a grave accent.
 
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
 
% the code environments to do likewise.
 
%
 
\def\codequoteleft{%
 
  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
 
    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
 
      `%
 
    \else \char'22 \fi
 
  \else \char'22 \fi
 
}
 
%
%
\begingroup
\begingroup
  \catcode`\^^I=\active
  \catcode`\^^I=\active
  \gdef\tabexpand{%
  \gdef\tabexpand{%
    \catcode`\^^I=\active
    \catcode`\^^I=\active
    \def^^I{\leavevmode\egroup
    \def^^I{\leavevmode\egroup
      \dimen0=\wd0 % the width so far, or since the previous tab
      \dimen0=\wd0 % the width so far, or since the previous tab
      \divide\dimen0 by\tabw
      \divide\dimen0 by\tabw
      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
      \wd0=\dimen0 \box0 \starttabbox
      \wd0=\dimen0 \box0 \starttabbox
    }%
    }%
  }
  }
  \catcode`\'=\active
 
  \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
 
  %
 
  \catcode`\`=\active
 
  \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
 
  %
 
  \gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
 
\endgroup
\endgroup
 
 
% start the verbatim environment.
% start the verbatim environment.
\def\setupverbatim{%
\def\setupverbatim{%
  \let\nonarrowing = t%
  \let\nonarrowing = t%
  \nonfillstart
  \nonfillstart
  % Easiest (and conventionally used) font for verbatim
  % Easiest (and conventionally used) font for verbatim
  \tt
  \tt
  \def\par{\leavevmode\egroup\box0\endgraf}%
  \def\par{\leavevmode\egroup\box0\endgraf}%
  \catcode`\`=\active
 
  \tabexpand
  \tabexpand
  \quoteexpand
  \setupmarkupstyle{verbatim}%
  % Respect line breaks,
  % Respect line breaks,
  % print special symbols as themselves, and
  % print special symbols as themselves, and
  % make each space count
  % make each space count
  % must do in this order:
  % must do in this order:
  \obeylines \uncatcodespecials \sepspaces
  \obeylines \uncatcodespecials \sepspaces
  \everypar{\starttabbox}%
  \everypar{\starttabbox}%
}
}
 
 
% Do the @verb magic: verbatim text is quoted by unique
% Do the @verb magic: verbatim text is quoted by unique
% delimiter characters.  Before first delimiter expect a
% delimiter characters.  Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
% right brace, after last delimiter expect closing brace:
%
%
%    \def\doverb'{'<char>#1<char>'}'{#1}
%    \def\doverb'{'<char>#1<char>'}'{#1}
%
%
% [Knuth] p. 382; only eat outer {}
% [Knuth] p. 382; only eat outer {}
\begingroup
\begingroup
  \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
\endgroup
\endgroup
%
%
\def\verb{\begingroup\setupverb\doverb}
\def\verb{\begingroup\setupverb\doverb}
%
%
%
%
% Do the @verbatim magic: define the macro \doverbatim so that
% Do the @verbatim magic: define the macro \doverbatim so that
% the (first) argument ends when '@end verbatim' is reached, ie:
% the (first) argument ends when '@end verbatim' is reached, ie:
%
%
%     \def\doverbatim#1@end verbatim{#1}
%     \def\doverbatim#1@end verbatim{#1}
%
%
% For Texinfo it's a lot easier than for LaTeX,
% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'.
% we need not redefine '\', '{' and '}'.
%
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
% Inspired by LaTeX's verbatim command set [latex.ltx]
%
%
\begingroup
\begingroup
  \catcode`\ =\active
  \catcode`\ =\active
  \obeylines %
  \obeylines %
  % ignore everything up to the first ^^M, that's the newline at the end
  % ignore everything up to the first ^^M, that's the newline at the end
  % of the @verbatim input line itself.  Otherwise we get an extra blank
  % of the @verbatim input line itself.  Otherwise we get an extra blank
  % line in the output.
  % line in the output.
  \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  % We really want {...\end verbatim} in the body of the macro, but
  % We really want {...\end verbatim} in the body of the macro, but
  % without the active space; thus we have to use \xdef and \gobble.
  % without the active space; thus we have to use \xdef and \gobble.
\endgroup
\endgroup
%
%
\envdef\verbatim{%
\envdef\verbatim{%
    \setupverbatim\doverbatim
    \setupverbatim\doverbatim
}
}
\let\Everbatim = \afterenvbreak
\let\Everbatim = \afterenvbreak
 
 
 
 
% @verbatiminclude FILE - insert text of file in verbatim environment.
% @verbatiminclude FILE - insert text of file in verbatim environment.
%
%
\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
%
%
\def\doverbatiminclude#1{%
\def\doverbatiminclude#1{%
  {%
  {%
    \makevalueexpandable
    \makevalueexpandable
    \setupverbatim
    \setupverbatim
 
    \indexnofonts       % Allow `@@' and other weird things in file names.
    \input #1
    \input #1
    \afterenvbreak
    \afterenvbreak
  }%
  }%
}
}
 
 
% @copying ... @end copying.
% @copying ... @end copying.
% Save the text away for @insertcopying later.
% Save the text away for @insertcopying later.
%
%
% We save the uninterpreted tokens, rather than creating a box.
% We save the uninterpreted tokens, rather than creating a box.
% Saving the text in a box would be much easier, but then all the
% Saving the text in a box would be much easier, but then all the
% typesetting commands (@smallbook, font changes, etc.) have to be done
% typesetting commands (@smallbook, font changes, etc.) have to be done
% beforehand -- and a) we want @copying to be done first in the source
% beforehand -- and a) we want @copying to be done first in the source
% file; b) letting users define the frontmatter in as flexible order as
% file; b) letting users define the frontmatter in as flexible order as
% possible is very desirable.
% possible is very desirable.
%
%
\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
%
%
\def\insertcopying{%
\def\insertcopying{%
  \begingroup
  \begingroup
    \parindent = 0pt  % paragraph indentation looks wrong on title page
    \parindent = 0pt  % paragraph indentation looks wrong on title page
    \scanexp\copyingtext
    \scanexp\copyingtext
  \endgroup
  \endgroup
}
}
 
 
 
 
\message{defuns,}
\message{defuns,}
% @defun etc.
% @defun etc.
 
 
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
\newskip\defargsindent \defargsindent=50pt
\newskip\deflastargmargin \deflastargmargin=18pt
\newskip\deflastargmargin \deflastargmargin=18pt
\newcount\defunpenalty
\newcount\defunpenalty
 
 
% Start the processing of @deffn:
% Start the processing of @deffn:
\def\startdefun{%
\def\startdefun{%
  \ifnum\lastpenalty<10000
  \ifnum\lastpenalty<10000
    \medbreak
    \medbreak
    \defunpenalty=10003 % Will keep this @deffn together with the
    \defunpenalty=10003 % Will keep this @deffn together with the
                        % following @def command, see below.
                        % following @def command, see below.
  \else
  \else
    % If there are two @def commands in a row, we'll have a \nobreak,
    % If there are two @def commands in a row, we'll have a \nobreak,
    % which is there to keep the function description together with its
    % which is there to keep the function description together with its
    % header.  But if there's nothing but headers, we need to allow a
    % header.  But if there's nothing but headers, we need to allow a
    % break somewhere.  Check specifically for penalty 10002, inserted
    % break somewhere.  Check specifically for penalty 10002, inserted
    % by \printdefunline, instead of 10000, since the sectioning
    % by \printdefunline, instead of 10000, since the sectioning
    % commands also insert a nobreak penalty, and we don't want to allow
    % commands also insert a nobreak penalty, and we don't want to allow
    % a break between a section heading and a defun.
    % a break between a section heading and a defun.
    %
    %
    % As a minor refinement, we avoid "club" headers by signalling
    % As a minor refinement, we avoid "club" headers by signalling
    % with penalty of 10003 after the very first @deffn in the
    % with penalty of 10003 after the very first @deffn in the
    % sequence (see above), and penalty of 10002 after any following
    % sequence (see above), and penalty of 10002 after any following
    % @def command.
    % @def command.
    \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
    \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
    %
    %
    % Similarly, after a section heading, do not allow a break.
    % Similarly, after a section heading, do not allow a break.
    % But do insert the glue.
    % But do insert the glue.
    \medskip  % preceded by discardable penalty, so not a breakpoint
    \medskip  % preceded by discardable penalty, so not a breakpoint
  \fi
  \fi
  %
  %
  \parindent=0in
  \parindent=0in
  \advance\leftskip by \defbodyindent
  \advance\leftskip by \defbodyindent
  \exdentamount=\defbodyindent
  \exdentamount=\defbodyindent
}
}
 
 
\def\dodefunx#1{%
\def\dodefunx#1{%
  % First, check whether we are in the right environment:
  % First, check whether we are in the right environment:
  \checkenv#1%
  \checkenv#1%
  %
  %
  % As above, allow line break if we have multiple x headers in a row.
  % As above, allow line break if we have multiple x headers in a row.
  % It's not a great place, though.
  % It's not a great place, though.
  \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  %
  %
  % And now, it's time to reuse the body of the original defun:
  % And now, it's time to reuse the body of the original defun:
  \expandafter\gobbledefun#1%
  \expandafter\gobbledefun#1%
}
}
\def\gobbledefun#1\startdefun{}
\def\gobbledefun#1\startdefun{}
 
 
% \printdefunline \deffnheader{text}
% \printdefunline \deffnheader{text}
%
%
\def\printdefunline#1#2{%
\def\printdefunline#1#2{%
  \begingroup
  \begingroup
    % call \deffnheader:
    % call \deffnheader:
    #1#2 \endheader
    #1#2 \endheader
    % common ending:
    % common ending:
    \interlinepenalty = 10000
    \interlinepenalty = 10000
    \advance\rightskip by 0pt plus 1fil
    \advance\rightskip by 0pt plus 1fil
    \endgraf
    \endgraf
    \nobreak\vskip -\parskip
    \nobreak\vskip -\parskip
    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
    % Some of the @defun-type tags do not enable magic parentheses,
    % Some of the @defun-type tags do not enable magic parentheses,
    % rendering the following check redundant.  But we don't optimize.
    % rendering the following check redundant.  But we don't optimize.
    \checkparencounts
    \checkparencounts
  \endgroup
  \endgroup
}
}
 
 
\def\Edefun{\endgraf\medbreak}
\def\Edefun{\endgraf\medbreak}
 
 
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
% the only thing remainnig is to define \deffnheader.
% the only thing remaining is to define \deffnheader.
%
%
\def\makedefun#1{%
\def\makedefun#1{%
  \expandafter\let\csname E#1\endcsname = \Edefun
  \expandafter\let\csname E#1\endcsname = \Edefun
  \edef\temp{\noexpand\domakedefun
  \edef\temp{\noexpand\domakedefun
    \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
    \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  \temp
  \temp
}
}
 
 
% \domakedefun \deffn \deffnx \deffnheader
% \domakedefun \deffn \deffnx \deffnheader
%
%
% Define \deffn and \deffnx, without parameters.
% Define \deffn and \deffnx, without parameters.
% \deffnheader has to be defined explicitly.
% \deffnheader has to be defined explicitly.
%
%
\def\domakedefun#1#2#3{%
\def\domakedefun#1#2#3{%
  \envdef#1{%
  \envdef#1{%
    \startdefun
    \startdefun
    \parseargusing\activeparens{\printdefunline#3}%
    \parseargusing\activeparens{\printdefunline#3}%
  }%
  }%
  \def#2{\dodefunx#1}%
  \def#2{\dodefunx#1}%
  \def#3%
  \def#3%
}
}
 
 
%%% Untyped functions:
%%% Untyped functions:
 
 
% @deffn category name args
% @deffn category name args
\makedefun{deffn}{\deffngeneral{}}
\makedefun{deffn}{\deffngeneral{}}
 
 
% @deffn category class name args
% @deffn category class name args
\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
 
 
% \defopon {category on}class name args
% \defopon {category on}class name args
\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
 
 
% \deffngeneral {subind}category name args
% \deffngeneral {subind}category name args
%
%
\def\deffngeneral#1#2 #3 #4\endheader{%
\def\deffngeneral#1#2 #3 #4\endheader{%
  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  \dosubind{fn}{\code{#3}}{#1}%
  \dosubind{fn}{\code{#3}}{#1}%
  \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
}
 
 
%%% Typed functions:
%%% Typed functions:
 
 
% @deftypefn category type name args
% @deftypefn category type name args
\makedefun{deftypefn}{\deftypefngeneral{}}
\makedefun{deftypefn}{\deftypefngeneral{}}
 
 
% @deftypeop category class type name args
% @deftypeop category class type name args
\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
 
 
% \deftypeopon {category on}class type name args
% \deftypeopon {category on}class type name args
\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
 
 
% \deftypefngeneral {subind}category type name args
% \deftypefngeneral {subind}category type name args
%
%
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  \dosubind{fn}{\code{#4}}{#1}%
  \dosubind{fn}{\code{#4}}{#1}%
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
}
 
 
%%% Typed variables:
%%% Typed variables:
 
 
% @deftypevr category type var args
% @deftypevr category type var args
\makedefun{deftypevr}{\deftypecvgeneral{}}
\makedefun{deftypevr}{\deftypecvgeneral{}}
 
 
% @deftypecv category class type var args
% @deftypecv category class type var args
\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
 
 
% \deftypecvof {category of}class type var args
% \deftypecvof {category of}class type var args
\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
 
 
% \deftypecvgeneral {subind}category type var args
% \deftypecvgeneral {subind}category type var args
%
%
\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  \dosubind{vr}{\code{#4}}{#1}%
  \dosubind{vr}{\code{#4}}{#1}%
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
}
 
 
%%% Untyped variables:
%%% Untyped variables:
 
 
% @defvr category var args
% @defvr category var args
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
 
 
% @defcv category class var args
% @defcv category class var args
\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
 
 
% \defcvof {category of}class var args
% \defcvof {category of}class var args
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
 
 
%%% Type:
%%% Type:
% @deftp category name args
% @deftp category name args
\makedefun{deftp}#1 #2 #3\endheader{%
\makedefun{deftp}#1 #2 #3\endheader{%
  \doind{tp}{\code{#2}}%
  \doind{tp}{\code{#2}}%
  \defname{#1}{}{#2}\defunargs{#3\unskip}%
  \defname{#1}{}{#2}\defunargs{#3\unskip}%
}
}
 
 
% Remaining @defun-like shortcuts:
% Remaining @defun-like shortcuts:
\makedefun{defun}{\deffnheader{\putwordDeffunc} }
\makedefun{defun}{\deffnheader{\putwordDeffunc} }
\makedefun{defmac}{\deffnheader{\putwordDefmac} }
\makedefun{defmac}{\deffnheader{\putwordDefmac} }
\makedefun{defspec}{\deffnheader{\putwordDefspec} }
\makedefun{defspec}{\deffnheader{\putwordDefspec} }
\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
\makedefun{defvar}{\defvrheader{\putwordDefvar} }
\makedefun{defvar}{\defvrheader{\putwordDefvar} }
\makedefun{defopt}{\defvrheader{\putwordDefopt} }
\makedefun{defopt}{\defvrheader{\putwordDefopt} }
\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
\makedefun{defmethod}{\defopon\putwordMethodon}
\makedefun{defmethod}{\defopon\putwordMethodon}
\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
 
 
% \defname, which formats the name of the @def (not the args).
% \defname, which formats the name of the @def (not the args).
% #1 is the category, such as "Function".
% #1 is the category, such as "Function".
% #2 is the return type, if any.
% #2 is the return type, if any.
% #3 is the function name.
% #3 is the function name.
%
%
% We are followed by (but not passed) the arguments, if any.
% We are followed by (but not passed) the arguments, if any.
%
%
\def\defname#1#2#3{%
\def\defname#1#2#3{%
  % Get the values of \leftskip and \rightskip as they were outside the @def...
  % Get the values of \leftskip and \rightskip as they were outside the @def...
  \advance\leftskip by -\defbodyindent
  \advance\leftskip by -\defbodyindent
  %
  %
  % How we'll format the type name.  Putting it in brackets helps
  % How we'll format the type name.  Putting it in brackets helps
  % distinguish it from the body text that may end up on the next line
  % distinguish it from the body text that may end up on the next line
  % just below it.
  % just below it.
  \def\temp{#1}%
  \def\temp{#1}%
  \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  %
  %
  % Figure out line sizes for the paragraph shape.
  % Figure out line sizes for the paragraph shape.
  % The first line needs space for \box0; but if \rightskip is nonzero,
  % The first line needs space for \box0; but if \rightskip is nonzero,
  % we need only space for the part of \box0 which exceeds it:
  % we need only space for the part of \box0 which exceeds it:
  \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
  \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
  % The continuations:
  % The continuations:
  \dimen2=\hsize  \advance\dimen2 by -\defargsindent
  \dimen2=\hsize  \advance\dimen2 by -\defargsindent
  % (plain.tex says that \dimen1 should be used only as global.)
  % (plain.tex says that \dimen1 should be used only as global.)
  \parshape 2 0in \dimen0 \defargsindent \dimen2
  \parshape 2 0in \dimen0 \defargsindent \dimen2
  %
  %
  % Put the type name to the right margin.
  % Put the type name to the right margin.
  \noindent
  \noindent
  \hbox to 0pt{%
  \hbox to 0pt{%
    \hfil\box0 \kern-\hsize
    \hfil\box0 \kern-\hsize
    % \hsize has to be shortened this way:
    % \hsize has to be shortened this way:
    \kern\leftskip
    \kern\leftskip
    % Intentionally do not respect \rightskip, since we need the space.
    % Intentionally do not respect \rightskip, since we need the space.
  }%
  }%
  %
  %
  % Allow all lines to be underfull without complaint:
  % Allow all lines to be underfull without complaint:
  \tolerance=10000 \hbadness=10000
  \tolerance=10000 \hbadness=10000
  \exdentamount=\defbodyindent
  \exdentamount=\defbodyindent
  {%
  {%
    % defun fonts. We use typewriter by default (used to be bold) because:
    % defun fonts. We use typewriter by default (used to be bold) because:
    % . we're printing identifiers, they should be in tt in principle.
    % . we're printing identifiers, they should be in tt in principle.
    % . in languages with many accents, such as Czech or French, it's
    % . in languages with many accents, such as Czech or French, it's
    %   common to leave accents off identifiers.  The result looks ok in
    %   common to leave accents off identifiers.  The result looks ok in
    %   tt, but exceedingly strange in rm.
    %   tt, but exceedingly strange in rm.
    % . we don't want -- and --- to be treated as ligatures.
    % . we don't want -- and --- to be treated as ligatures.
    % . this still does not fix the ?` and !` ligatures, but so far no
    % . this still does not fix the ?` and !` ligatures, but so far no
    %   one has made identifiers using them :).
    %   one has made identifiers using them :).
    \df \tt
    \df \tt
    \def\temp{#2}% return value type
    \def\temp{#2}% return value type
    \ifx\temp\empty\else \tclose{\temp} \fi
    \ifx\temp\empty\else \tclose{\temp} \fi
    #3% output function name
    #3% output function name
  }%
  }%
  {\rm\enskip}% hskip 0.5 em of \tenrm
  {\rm\enskip}% hskip 0.5 em of \tenrm
  %
  %
  \boldbrax
  \boldbrax
  % arguments will be output next, if any.
  % arguments will be output next, if any.
}
}
 
 
% Print arguments in slanted roman (not ttsl), inconsistently with using
% Print arguments in slanted roman (not ttsl), inconsistently with using
% tt for the name.  This is because literal text is sometimes needed in
% tt for the name.  This is because literal text is sometimes needed in
% the argument list (groff manual), and ttsl and tt are not very
% the argument list (groff manual), and ttsl and tt are not very
% distinguishable.  Prevent hyphenation at `-' chars.
% distinguishable.  Prevent hyphenation at `-' chars.
%
%
\def\defunargs#1{%
\def\defunargs#1{%
  % use sl by default (not ttsl),
  % use sl by default (not ttsl),
  % tt for the names.
  % tt for the names.
  \df \sl \hyphenchar\font=0
  \df \sl \hyphenchar\font=0
  %
  %
  % On the other hand, if an argument has two dashes (for instance), we
  % On the other hand, if an argument has two dashes (for instance), we
  % want a way to get ttsl.  Let's try @var for that.
  % want a way to get ttsl.  Let's try @var for that.
  \let\var=\ttslanted
  \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  #1%
  #1%
  \sl\hyphenchar\font=45
  \sl\hyphenchar\font=45
}
}
 
 
% We want ()&[] to print specially on the defun line.
% We want ()&[] to print specially on the defun line.
%
%
\def\activeparens{%
\def\activeparens{%
  \catcode`\(=\active \catcode`\)=\active
  \catcode`\(=\active \catcode`\)=\active
  \catcode`\[=\active \catcode`\]=\active
  \catcode`\[=\active \catcode`\]=\active
  \catcode`\&=\active
  \catcode`\&=\active
}
}
 
 
% Make control sequences which act like normal parenthesis chars.
% Make control sequences which act like normal parenthesis chars.
\let\lparen = ( \let\rparen = )
\let\lparen = ( \let\rparen = )
 
 
% Be sure that we always have a definition for `(', etc.  For example,
% Be sure that we always have a definition for `(', etc.  For example,
% if the fn name has parens in it, \boldbrax will not be in effect yet,
% if the fn name has parens in it, \boldbrax will not be in effect yet,
% so TeX would otherwise complain about undefined control sequence.
% so TeX would otherwise complain about undefined control sequence.
{
{
  \activeparens
  \activeparens
  \global\let(=\lparen \global\let)=\rparen
  \global\let(=\lparen \global\let)=\rparen
  \global\let[=\lbrack \global\let]=\rbrack
  \global\let[=\lbrack \global\let]=\rbrack
  \global\let& = \&
  \global\let& = \&
 
 
  \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  \gdef\magicamp{\let&=\amprm}
  \gdef\magicamp{\let&=\amprm}
}
}
 
 
\newcount\parencount
\newcount\parencount
 
 
% If we encounter &foo, then turn on ()-hacking afterwards
% If we encounter &foo, then turn on ()-hacking afterwards
\newif\ifampseen
\newif\ifampseen
\def\amprm#1 {\ampseentrue{\bf\&#1 }}
\def\amprm#1 {\ampseentrue{\bf\&#1 }}
 
 
\def\parenfont{%
\def\parenfont{%
  \ifampseen
  \ifampseen
    % At the first level, print parens in roman,
    % At the first level, print parens in roman,
    % otherwise use the default font.
    % otherwise use the default font.
    \ifnum \parencount=1 \rm \fi
    \ifnum \parencount=1 \rm \fi
  \else
  \else
    % The \sf parens (in \boldbrax) actually are a little bolder than
    % The \sf parens (in \boldbrax) actually are a little bolder than
    % the contained text.  This is especially needed for [ and ] .
    % the contained text.  This is especially needed for [ and ] .
    \sf
    \sf
  \fi
  \fi
}
}
\def\infirstlevel#1{%
\def\infirstlevel#1{%
  \ifampseen
  \ifampseen
    \ifnum\parencount=1
    \ifnum\parencount=1
      #1%
      #1%
    \fi
    \fi
  \fi
  \fi
}
}
\def\bfafterword#1 {#1 \bf}
\def\bfafterword#1 {#1 \bf}
 
 
\def\opnr{%
\def\opnr{%
  \global\advance\parencount by 1
  \global\advance\parencount by 1
  {\parenfont(}%
  {\parenfont(}%
  \infirstlevel \bfafterword
  \infirstlevel \bfafterword
}
}
\def\clnr{%
\def\clnr{%
  {\parenfont)}%
  {\parenfont)}%
  \infirstlevel \sl
  \infirstlevel \sl
  \global\advance\parencount by -1
  \global\advance\parencount by -1
}
}
 
 
\newcount\brackcount
\newcount\brackcount
\def\lbrb{%
\def\lbrb{%
  \global\advance\brackcount by 1
  \global\advance\brackcount by 1
  {\bf[}%
  {\bf[}%
}
}
\def\rbrb{%
\def\rbrb{%
  {\bf]}%
  {\bf]}%
  \global\advance\brackcount by -1
  \global\advance\brackcount by -1
}
}
 
 
\def\checkparencounts{%
\def\checkparencounts{%
  \ifnum\parencount=0 \else \badparencount \fi
  \ifnum\parencount=0 \else \badparencount \fi
  \ifnum\brackcount=0 \else \badbrackcount \fi
  \ifnum\brackcount=0 \else \badbrackcount \fi
}
}
% these should not use \errmessage; the glibc manual, at least, actually
% these should not use \errmessage; the glibc manual, at least, actually
% has such constructs (when documenting function pointers).
% has such constructs (when documenting function pointers).
\def\badparencount{%
\def\badparencount{%
  \message{Warning: unbalanced parentheses in @def...}%
  \message{Warning: unbalanced parentheses in @def...}%
  \global\parencount=0
  \global\parencount=0
}
}
\def\badbrackcount{%
\def\badbrackcount{%
  \message{Warning: unbalanced square brackets in @def...}%
  \message{Warning: unbalanced square brackets in @def...}%
  \global\brackcount=0
  \global\brackcount=0
}
}
 
 
 
 
\message{macros,}
\message{macros,}
% @macro.
% @macro.
 
 
% To do this right we need a feature of e-TeX, \scantokens,
% To do this right we need a feature of e-TeX, \scantokens,
% which we arrange to emulate with a temporary file in ordinary TeX.
% which we arrange to emulate with a temporary file in ordinary TeX.
\ifx\eTeXversion\undefined
\ifx\eTeXversion\undefined
  \newwrite\macscribble
  \newwrite\macscribble
  \def\scantokens#1{%
  \def\scantokens#1{%
    \toks0={#1}%
    \toks0={#1}%
    \immediate\openout\macscribble=\jobname.tmp
    \immediate\openout\macscribble=\jobname.tmp
    \immediate\write\macscribble{\the\toks0}%
    \immediate\write\macscribble{\the\toks0}%
    \immediate\closeout\macscribble
    \immediate\closeout\macscribble
    \input \jobname.tmp
    \input \jobname.tmp
  }
  }
\fi
\fi
 
 
\def\scanmacro#1{%
\def\scanmacro#1{%
  \begingroup
  \begingroup
    \newlinechar`\^^M
    \newlinechar`\^^M
    \let\xeatspaces\eatspaces
    \let\xeatspaces\eatspaces
    % Undo catcode changes of \startcontents and \doprintindex
    % Undo catcode changes of \startcontents and \doprintindex
    % When called from @insertcopying or (short)caption, we need active
    % When called from @insertcopying or (short)caption, we need active
    % backslash to get it printed correctly.  Previously, we had
    % backslash to get it printed correctly.  Previously, we had
    % \catcode`\\=\other instead.  We'll see whether a problem appears
    % \catcode`\\=\other instead.  We'll see whether a problem appears
    % with macro expansion.                             --kasal, 19aug04
    % with macro expansion.                             --kasal, 19aug04
    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
    % ... and \example
    % ... and \example
    \spaceisspace
    \spaceisspace
    %
    %
    % Append \endinput to make sure that TeX does not see the ending newline.
    % Append \endinput to make sure that TeX does not see the ending newline.
    % I've verified that it is necessary both for e-TeX and for ordinary TeX
    % I've verified that it is necessary both for e-TeX and for ordinary TeX
    %                                                   --kasal, 29nov03
    %                                                   --kasal, 29nov03
    \scantokens{#1\endinput}%
    \scantokens{#1\endinput}%
  \endgroup
  \endgroup
}
}
 
 
\def\scanexp#1{%
\def\scanexp#1{%
  \edef\temp{\noexpand\scanmacro{#1}}%
  \edef\temp{\noexpand\scanmacro{#1}}%
  \temp
  \temp
}
}
 
 
\newcount\paramno   % Count of parameters
\newcount\paramno   % Count of parameters
\newtoks\macname    % Macro name
\newtoks\macname    % Macro name
\newif\ifrecursive  % Is it recursive?
\newif\ifrecursive  % Is it recursive?
 
 
% List of all defined macros in the form
% List of all defined macros in the form
%    \definedummyword\macro1\definedummyword\macro2...
%    \definedummyword\macro1\definedummyword\macro2...
% Currently is also contains all @aliases; the list can be split
% Currently is also contains all @aliases; the list can be split
% if there is a need.
% if there is a need.
\def\macrolist{}
\def\macrolist{}
 
 
% Add the macro to \macrolist
% Add the macro to \macrolist
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
\def\addtomacrolistxxx#1{%
\def\addtomacrolistxxx#1{%
     \toks0 = \expandafter{\macrolist\definedummyword#1}%
     \toks0 = \expandafter{\macrolist\definedummyword#1}%
     \xdef\macrolist{\the\toks0}%
     \xdef\macrolist{\the\toks0}%
}
}
 
 
% Utility routines.
% Utility routines.
% This does \let #1 = #2, with \csnames; that is,
% This does \let #1 = #2, with \csnames; that is,
%   \let \csname#1\endcsname = \csname#2\endcsname
%   \let \csname#1\endcsname = \csname#2\endcsname
% (except of course we have to play expansion games).
% (except of course we have to play expansion games).
%
%
\def\cslet#1#2{%
\def\cslet#1#2{%
  \expandafter\let
  \expandafter\let
  \csname#1\expandafter\endcsname
  \csname#1\expandafter\endcsname
  \csname#2\endcsname
  \csname#2\endcsname
}
}
 
 
% Trim leading and trailing spaces off a string.
% Trim leading and trailing spaces off a string.
% Concepts from aro-bend problem 15 (see CTAN).
% Concepts from aro-bend problem 15 (see CTAN).
{\catcode`\@=11
{\catcode`\@=11
\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
\def\unbrace#1{#1}
\def\unbrace#1{#1}
\unbrace{\gdef\trim@@@ #1 } #2@{#1}
\unbrace{\gdef\trim@@@ #1 } #2@{#1}
}
}
 
 
% Trim a single trailing ^^M off a string.
% Trim a single trailing ^^M off a string.
{\catcode`\^^M=\other \catcode`\Q=3%
{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}%
\gdef\eatcrb#1Q#2Q{#1}%
}
}
 
 
% Macro bodies are absorbed as an argument in a context where
% Macro bodies are absorbed as an argument in a context where
% all characters are catcode 10, 11 or 12, except \ which is active
% all characters are catcode 10, 11 or 12, except \ which is active
% (as in normal texinfo). It is necessary to change the definition of \.
% (as in normal texinfo). It is necessary to change the definition of \.
 
 
% Non-ASCII encodings make 8-bit characters active, so un-activate
% Non-ASCII encodings make 8-bit characters active, so un-activate
% them to avoid their expansion.  Must do this non-globally, to
% them to avoid their expansion.  Must do this non-globally, to
% confine the change to the current group.
% confine the change to the current group.
 
 
% It's necessary to have hard CRs when the macro is executed. This is
% It's necessary to have hard CRs when the macro is executed. This is
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
% body, and then making it the \newlinechar in \scanmacro.
% body, and then making it the \newlinechar in \scanmacro.
 
 
\def\scanctxt{%
\def\scanctxt{%
  \catcode`\"=\other
  \catcode`\"=\other
  \catcode`\+=\other
  \catcode`\+=\other
  \catcode`\<=\other
  \catcode`\<=\other
  \catcode`\>=\other
  \catcode`\>=\other
  \catcode`\@=\other
  \catcode`\@=\other
  \catcode`\^=\other
  \catcode`\^=\other
  \catcode`\_=\other
  \catcode`\_=\other
  \catcode`\|=\other
  \catcode`\|=\other
  \catcode`\~=\other
  \catcode`\~=\other
  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
}
}
 
 
\def\scanargctxt{%
\def\scanargctxt{%
  \scanctxt
  \scanctxt
  \catcode`\\=\other
  \catcode`\\=\other
  \catcode`\^^M=\other
  \catcode`\^^M=\other
}
}
 
 
\def\macrobodyctxt{%
\def\macrobodyctxt{%
  \scanctxt
  \scanctxt
  \catcode`\{=\other
  \catcode`\{=\other
  \catcode`\}=\other
  \catcode`\}=\other
  \catcode`\^^M=\other
  \catcode`\^^M=\other
  \usembodybackslash
  \usembodybackslash
}
}
 
 
\def\macroargctxt{%
\def\macroargctxt{%
  \scanctxt
  \scanctxt
  \catcode`\\=\other
  \catcode`\\=\other
}
}
 
 
% \mbodybackslash is the definition of \ in @macro bodies.
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
% It maps \foo\ => \csname macarg.foo\endcsname => #N
% where N is the macro parameter number.
% where N is the macro parameter number.
% We define \csname macarg.\endcsname to be \realbackslash, so
% We define \csname macarg.\endcsname to be \realbackslash, so
% \\ in macro replacement text gets you a backslash.
% \\ in macro replacement text gets you a backslash.
 
 
{\catcode`@=0 @catcode`@\=@active
{\catcode`@=0 @catcode`@\=@active
 @gdef@usembodybackslash{@let\=@mbodybackslash}
 @gdef@usembodybackslash{@let\=@mbodybackslash}
 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
}
}
\expandafter\def\csname macarg.\endcsname{\realbackslash}
\expandafter\def\csname macarg.\endcsname{\realbackslash}
 
 
\def\macro{\recursivefalse\parsearg\macroxxx}
\def\macro{\recursivefalse\parsearg\macroxxx}
\def\rmacro{\recursivetrue\parsearg\macroxxx}
\def\rmacro{\recursivetrue\parsearg\macroxxx}
 
 
\def\macroxxx#1{%
\def\macroxxx#1{%
  \getargs{#1}%           now \macname is the macname and \argl the arglist
  \getargs{#1}%           now \macname is the macname and \argl the arglist
  \ifx\argl\empty       % no arguments
  \ifx\argl\empty       % no arguments
     \paramno=0%
     \paramno=0%
  \else
  \else
     \expandafter\parsemargdef \argl;%
     \expandafter\parsemargdef \argl;%
  \fi
  \fi
  \if1\csname ismacro.\the\macname\endcsname
  \if1\csname ismacro.\the\macname\endcsname
     \message{Warning: redefining \the\macname}%
     \message{Warning: redefining \the\macname}%
  \else
  \else
     \expandafter\ifx\csname \the\macname\endcsname \relax
     \expandafter\ifx\csname \the\macname\endcsname \relax
     \else \errmessage{Macro name \the\macname\space already defined}\fi
     \else \errmessage{Macro name \the\macname\space already defined}\fi
     \global\cslet{macsave.\the\macname}{\the\macname}%
     \global\cslet{macsave.\the\macname}{\the\macname}%
     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
     \addtomacrolist{\the\macname}%
     \addtomacrolist{\the\macname}%
  \fi
  \fi
  \begingroup \macrobodyctxt
  \begingroup \macrobodyctxt
  \ifrecursive \expandafter\parsermacbody
  \ifrecursive \expandafter\parsermacbody
  \else \expandafter\parsemacbody
  \else \expandafter\parsemacbody
  \fi}
  \fi}
 
 
\parseargdef\unmacro{%
\parseargdef\unmacro{%
  \if1\csname ismacro.#1\endcsname
  \if1\csname ismacro.#1\endcsname
    \global\cslet{#1}{macsave.#1}%
    \global\cslet{#1}{macsave.#1}%
    \global\expandafter\let \csname ismacro.#1\endcsname=0%
    \global\expandafter\let \csname ismacro.#1\endcsname=0%
    % Remove the macro name from \macrolist:
    % Remove the macro name from \macrolist:
    \begingroup
    \begingroup
      \expandafter\let\csname#1\endcsname \relax
      \expandafter\let\csname#1\endcsname \relax
      \let\definedummyword\unmacrodo
      \let\definedummyword\unmacrodo
      \xdef\macrolist{\macrolist}%
      \xdef\macrolist{\macrolist}%
    \endgroup
    \endgroup
  \else
  \else
    \errmessage{Macro #1 not defined}%
    \errmessage{Macro #1 not defined}%
  \fi
  \fi
}
}
 
 
% Called by \do from \dounmacro on each macro.  The idea is to omit any
% Called by \do from \dounmacro on each macro.  The idea is to omit any
% macro definitions that have been changed to \relax.
% macro definitions that have been changed to \relax.
%
%
\def\unmacrodo#1{%
\def\unmacrodo#1{%
  \ifx #1\relax
  \ifx #1\relax
    % remove this
    % remove this
  \else
  \else
    \noexpand\definedummyword \noexpand#1%
    \noexpand\definedummyword \noexpand#1%
  \fi
  \fi
}
}
 
 
% This makes use of the obscure feature that if the last token of a
% This makes use of the obscure feature that if the last token of a
% <parameter list> is #, then the preceding argument is delimited by
% <parameter list> is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed.
% an opening brace, and that opening brace is not consumed.
\def\getargs#1{\getargsxxx#1{}}
\def\getargs#1{\getargsxxx#1{}}
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
\def\getmacname #1 #2\relax{\macname={#1}}
\def\getmacname #1 #2\relax{\macname={#1}}
\def\getmacargs#1{\def\argl{#1}}
\def\getmacargs#1{\def\argl{#1}}
 
 
% Parse the optional {params} list.  Set up \paramno and \paramlist
% Parse the optional {params} list.  Set up \paramno and \paramlist
% so \defmacro knows what to do.  Define \macarg.blah for each blah
% so \defmacro knows what to do.  Define \macarg.blah for each blah
% in the params list, to be ##N where N is the position in that list.
% in the params list, to be ##N where N is the position in that list.
% That gets used by \mbodybackslash (above).
% That gets used by \mbodybackslash (above).
 
 
% We need to get `macro parameter char #' into several definitions.
% We need to get `macro parameter char #' into several definitions.
% The technique used is stolen from LaTeX:  let \hash be something
% The technique used is stolen from LaTeX:  let \hash be something
% unexpandable, insert that wherever you need a #, and then redefine
% unexpandable, insert that wherever you need a #, and then redefine
% it to # just before using the token list produced.
% it to # just before using the token list produced.
%
%
% The same technique is used to protect \eatspaces till just before
% The same technique is used to protect \eatspaces till just before
% the macro is used.
% the macro is used.
 
 
\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
\def\parsemargdefxxx#1,{%
\def\parsemargdefxxx#1,{%
  \if#1;\let\next=\relax
  \if#1;\let\next=\relax
  \else \let\next=\parsemargdefxxx
  \else \let\next=\parsemargdefxxx
    \advance\paramno by 1%
    \advance\paramno by 1%
    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
        {\xeatspaces{\hash\the\paramno}}%
        {\xeatspaces{\hash\the\paramno}}%
    \edef\paramlist{\paramlist\hash\the\paramno,}%
    \edef\paramlist{\paramlist\hash\the\paramno,}%
  \fi\next}
  \fi\next}
 
 
% These two commands read recursive and nonrecursive macro bodies.
% These two commands read recursive and nonrecursive macro bodies.
% (They're different since rec and nonrec macros end differently.)
% (They're different since rec and nonrec macros end differently.)
 
 
\long\def\parsemacbody#1@end macro%
\long\def\parsemacbody#1@end macro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
\long\def\parsermacbody#1@end rmacro%
\long\def\parsermacbody#1@end rmacro%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
 
 
% This defines the macro itself. There are six cases: recursive and
% This defines the macro itself. There are six cases: recursive and
% nonrecursive macros of zero, one, and many arguments.
% nonrecursive macros of zero, one, and many arguments.
% Much magic with \expandafter here.
% Much magic with \expandafter here.
% \xdef is used so that macro definitions will survive the file
% \xdef is used so that macro definitions will survive the file
% they're defined in; @include reads the file inside a group.
% they're defined in; @include reads the file inside a group.
\def\defmacro{%
\def\defmacro{%
  \let\hash=##% convert placeholders to macro parameter chars
  \let\hash=##% convert placeholders to macro parameter chars
  \ifrecursive
  \ifrecursive
    \ifcase\paramno
    \ifcase\paramno
    % 0
    % 0
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
        \noexpand\scanmacro{\temp}}%
        \noexpand\scanmacro{\temp}}%
    \or % 1
    \or % 1
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
         \bgroup\noexpand\macroargctxt
         \bgroup\noexpand\macroargctxt
         \noexpand\braceorline
         \noexpand\braceorline
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
         \egroup\noexpand\scanmacro{\temp}}%
         \egroup\noexpand\scanmacro{\temp}}%
    \else % many
    \else % many
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
         \bgroup\noexpand\macroargctxt
         \bgroup\noexpand\macroargctxt
         \noexpand\csname\the\macname xx\endcsname}%
         \noexpand\csname\the\macname xx\endcsname}%
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
      \expandafter\expandafter
      \expandafter\expandafter
      \expandafter\xdef
      \expandafter\xdef
      \expandafter\expandafter
      \expandafter\expandafter
        \csname\the\macname xxx\endcsname
        \csname\the\macname xxx\endcsname
          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
    \fi
    \fi
  \else
  \else
    \ifcase\paramno
    \ifcase\paramno
    % 0
    % 0
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
        \noexpand\norecurse{\the\macname}%
        \noexpand\norecurse{\the\macname}%
        \noexpand\scanmacro{\temp}\egroup}%
        \noexpand\scanmacro{\temp}\egroup}%
    \or % 1
    \or % 1
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
         \bgroup\noexpand\macroargctxt
         \bgroup\noexpand\macroargctxt
         \noexpand\braceorline
         \noexpand\braceorline
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
        \egroup
        \egroup
        \noexpand\norecurse{\the\macname}%
        \noexpand\norecurse{\the\macname}%
        \noexpand\scanmacro{\temp}\egroup}%
        \noexpand\scanmacro{\temp}\egroup}%
    \else % many
    \else % many
      \expandafter\xdef\csname\the\macname\endcsname{%
      \expandafter\xdef\csname\the\macname\endcsname{%
         \bgroup\noexpand\macroargctxt
         \bgroup\noexpand\macroargctxt
         \expandafter\noexpand\csname\the\macname xx\endcsname}%
         \expandafter\noexpand\csname\the\macname xx\endcsname}%
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
      \expandafter\expandafter
      \expandafter\expandafter
      \expandafter\xdef
      \expandafter\xdef
      \expandafter\expandafter
      \expandafter\expandafter
      \csname\the\macname xxx\endcsname
      \csname\the\macname xxx\endcsname
      \paramlist{%
      \paramlist{%
          \egroup
          \egroup
          \noexpand\norecurse{\the\macname}%
          \noexpand\norecurse{\the\macname}%
          \noexpand\scanmacro{\temp}\egroup}%
          \noexpand\scanmacro{\temp}\egroup}%
    \fi
    \fi
  \fi}
  \fi}
 
 
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
 
 
% \braceorline decides whether the next nonwhitespace character is a
% \braceorline decides whether the next nonwhitespace character is a
% {.  If so it reads up to the closing }, if not, it reads the whole
% {.  If so it reads up to the closing }, if not, it reads the whole
% line.  Whatever was read is then fed to the next control sequence
% line.  Whatever was read is then fed to the next control sequence
% as an argument (by \parsebrace or \parsearg)
% as an argument (by \parsebrace or \parsearg)
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\def\braceorlinexxx{%
  \ifx\nchar\bgroup\else
  \ifx\nchar\bgroup\else
    \expandafter\parsearg
    \expandafter\parsearg
  \fi \macnamexxx}
  \fi \macnamexxx}
 
 
 
 
% @alias.
% @alias.
% We need some trickery to remove the optional spaces around the equal
% We need some trickery to remove the optional spaces around the equal
% sign.  Just make them active and then expand them all to nothing.
% sign.  Just make them active and then expand them all to nothing.
\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasyyy #1=#2\relax{%
\def\aliasyyy #1=#2\relax{%
  {%
  {%
    \expandafter\let\obeyedspace=\empty
    \expandafter\let\obeyedspace=\empty
    \addtomacrolist{#1}%
    \addtomacrolist{#1}%
    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  }%
  }%
  \next
  \next
}
}
 
 
 
 
\message{cross references,}
\message{cross references,}
 
 
\newwrite\auxfile
\newwrite\auxfile
\newif\ifhavexrefs    % True if xref values are known.
\newif\ifhavexrefs    % True if xref values are known.
\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
 
 
% @inforef is relatively simple.
% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  node \samp{\ignorespaces#1{}}}
  node \samp{\ignorespaces#1{}}}
 
 
% @node's only job in TeX is to define \lastnode, which is used in
% @node's only job in TeX is to define \lastnode, which is used in
% cross-references.  The @node line might or might not have commas, and
% cross-references.  The @node line might or might not have commas, and
% might or might not have spaces before the first comma, like:
% might or might not have spaces before the first comma, like:
% @node foo , bar , ...
% @node foo , bar , ...
% We don't want such trailing spaces in the node name.
% We don't want such trailing spaces in the node name.
%
%
\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
%
%
% also remove a trailing comma, in case of something like this:
% also remove a trailing comma, in case of something like this:
% @node Help-Cross,  ,  , Cross-refs
% @node Help-Cross,  ,  , Cross-refs
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
 
 
\let\nwnode=\node
\let\nwnode=\node
\let\lastnode=\empty
\let\lastnode=\empty
 
 
% Write a cross-reference definition for the current node.  #1 is the
% Write a cross-reference definition for the current node.  #1 is the
% type (Ynumbered, Yappendix, Ynothing).
% type (Ynumbered, Yappendix, Ynothing).
%
%
\def\donoderef#1{%
\def\donoderef#1{%
  \ifx\lastnode\empty\else
  \ifx\lastnode\empty\else
    \setref{\lastnode}{#1}%
    \setref{\lastnode}{#1}%
    \global\let\lastnode=\empty
    \global\let\lastnode=\empty
  \fi
  \fi
}
}
 
 
% @anchor{NAME} -- define xref target at arbitrary point.
% @anchor{NAME} -- define xref target at arbitrary point.
%
%
\newcount\savesfregister
\newcount\savesfregister
%
%
\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
 
 
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% anchor), which consists of three parts:
% anchor), which consists of three parts:
% 1) NAME-title - the current sectioning name taken from \lastsection,
% 1) NAME-title - the current sectioning name taken from \lastsection,
%                 or the anchor name.
%                 or the anchor name.
% 2) NAME-snt   - section number and type, passed as the SNT arg, or
% 2) NAME-snt   - section number and type, passed as the SNT arg, or
%                 empty for anchors.
%                 empty for anchors.
% 3) NAME-pg    - the page number.
% 3) NAME-pg    - the page number.
%
%
% This is called from \donoderef, \anchor, and \dofloat.  In the case of
% This is called from \donoderef, \anchor, and \dofloat.  In the case of
% floats, there is an additional part, which is not written here:
% floats, there is an additional part, which is not written here:
% 4) NAME-lof   - the text as it should appear in a @listoffloats.
% 4) NAME-lof   - the text as it should appear in a @listoffloats.
%
%
\def\setref#1#2{%
\def\setref#1#2{%
  \pdfmkdest{#1}%
  \pdfmkdest{#1}%
  \iflinks
  \iflinks
    {%
    {%
      \atdummies  % preserve commands, but don't expand them
      \atdummies  % preserve commands, but don't expand them
      \edef\writexrdef##1##2{%
      \edef\writexrdef##1##2{%
        \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
        \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
          ##1}{##2}}% these are parameters of \writexrdef
          ##1}{##2}}% these are parameters of \writexrdef
      }%
      }%
      \toks0 = \expandafter{\lastsection}%
      \toks0 = \expandafter{\lastsection}%
      \immediate \writexrdef{title}{\the\toks0 }%
      \immediate \writexrdef{title}{\the\toks0 }%
      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
    }%
    }%
  \fi
  \fi
}
}
 
 
% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
% node name, #4 the name of the Info file, #5 the name of the printed
% manual.  All but the node name can be omitted.
% manual.  All but the node name can be omitted.
%
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  \unsepspaces
  \unsepspaces
  \def\printedmanual{\ignorespaces #5}%
  \def\printedmanual{\ignorespaces #5}%
  \def\printedrefname{\ignorespaces #3}%
  \def\printedrefname{\ignorespaces #3}%
  \setbox1=\hbox{\printedmanual\unskip}%
  \setbox1=\hbox{\printedmanual\unskip}%
  \setbox0=\hbox{\printedrefname\unskip}%
  \setbox0=\hbox{\printedrefname\unskip}%
  \ifdim \wd0 = 0pt
  \ifdim \wd0 = 0pt
    % No printed node name was explicitly given.
    % No printed node name was explicitly given.
    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
      % Use the node name inside the square brackets.
      % Use the node name inside the square brackets.
      \def\printedrefname{\ignorespaces #1}%
      \def\printedrefname{\ignorespaces #1}%
    \else
    \else
      % Use the actual chapter/section title appear inside
      % Use the actual chapter/section title appear inside
      % the square brackets.  Use the real section title if we have it.
      % the square brackets.  Use the real section title if we have it.
      \ifdim \wd1 > 0pt
      \ifdim \wd1 > 0pt
        % It is in another manual, so we don't have it.
        % It is in another manual, so we don't have it.
        \def\printedrefname{\ignorespaces #1}%
        \def\printedrefname{\ignorespaces #1}%
      \else
      \else
        \ifhavexrefs
        \ifhavexrefs
          % We know the real title if we have the xref values.
          % We know the real title if we have the xref values.
          \def\printedrefname{\refx{#1-title}{}}%
          \def\printedrefname{\refx{#1-title}{}}%
        \else
        \else
          % Otherwise just copy the Info node name.
          % Otherwise just copy the Info node name.
          \def\printedrefname{\ignorespaces #1}%
          \def\printedrefname{\ignorespaces #1}%
        \fi%
        \fi%
      \fi
      \fi
    \fi
    \fi
  \fi
  \fi
  %
  %
  % Make link in pdf output.
  % Make link in pdf output.
  \ifpdf
  \ifpdf
    \leavevmode
 
    \getfilename{#4}%
 
    {\indexnofonts
    {\indexnofonts
     \turnoffactive
     \turnoffactive
 
     % This expands tokens, so do it after making catcode changes, so _
 
     % etc. don't get their TeX definitions.
 
     \getfilename{#4}%
 
     %
     % See comments at \activebackslashdouble.
     % See comments at \activebackslashdouble.
     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
      \backslashparens\pdfxrefdest}%
      \backslashparens\pdfxrefdest}%
     %
     %
     \ifnum\filenamelength>0
     \leavevmode
       \startlink attr{/Border [0 0 0]}%
       \startlink attr{/Border [0 0 0]}%
 
     \ifnum\filenamelength>0
         goto file{\the\filename.pdf} name{\pdfxrefdest}%
         goto file{\the\filename.pdf} name{\pdfxrefdest}%
     \else
     \else
       \startlink attr{/Border [0 0 0]}%
 
         goto name{\pdfmkpgn{\pdfxrefdest}}%
         goto name{\pdfmkpgn{\pdfxrefdest}}%
     \fi
     \fi
    }%
    }%
    \setcolor{\linkcolor}%
    \setcolor{\linkcolor}%
  \fi
  \fi
  %
  %
  % Float references are printed completely differently: "Figure 1.2"
  % Float references are printed completely differently: "Figure 1.2"
  % instead of "[somenode], p.3".  We distinguish them by the
  % instead of "[somenode], p.3".  We distinguish them by the
  % LABEL-title being set to a magic string.
  % LABEL-title being set to a magic string.
  {%
  {%
    % Have to otherify everything special to allow the \csname to
    % Have to otherify everything special to allow the \csname to
    % include an _ in the xref name, etc.
    % include an _ in the xref name, etc.
    \indexnofonts
    \indexnofonts
    \turnoffactive
    \turnoffactive
    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
      \csname XR#1-title\endcsname
      \csname XR#1-title\endcsname
  }%
  }%
  \iffloat\Xthisreftitle
  \iffloat\Xthisreftitle
    % If the user specified the print name (third arg) to the ref,
    % If the user specified the print name (third arg) to the ref,
    % print it instead of our usual "Figure 1.2".
    % print it instead of our usual "Figure 1.2".
    \ifdim\wd0 = 0pt
    \ifdim\wd0 = 0pt
      \refx{#1-snt}{}%
      \refx{#1-snt}{}%
    \else
    \else
      \printedrefname
      \printedrefname
    \fi
    \fi
    %
    %
    % if the user also gave the printed manual name (fifth arg), append
    % if the user also gave the printed manual name (fifth arg), append
    % "in MANUALNAME".
    % "in MANUALNAME".
    \ifdim \wd1 > 0pt
    \ifdim \wd1 > 0pt
      \space \putwordin{} \cite{\printedmanual}%
      \space \putwordin{} \cite{\printedmanual}%
    \fi
    \fi
  \else
  \else
    % node/anchor (non-float) references.
    % node/anchor (non-float) references.
    %
    %
    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
    % insert empty discretionaries after hyphens, which means that it will
    % insert empty discretionaries after hyphens, which means that it will
    % not find a line break at a hyphen in a node names.  Since some manuals
    % not find a line break at a hyphen in a node names.  Since some manuals
    % are best written with fairly long node names, containing hyphens, this
    % are best written with fairly long node names, containing hyphens, this
    % is a loss.  Therefore, we give the text of the node name again, so it
    % is a loss.  Therefore, we give the text of the node name again, so it
    % is as if TeX is seeing it for the first time.
    % is as if TeX is seeing it for the first time.
    \ifdim \wd1 > 0pt
    \ifdim \wd1 > 0pt
      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
    \else
    \else
      % _ (for example) has to be the character _ for the purposes of the
      % _ (for example) has to be the character _ for the purposes of the
      % control sequence corresponding to the node, but it has to expand
      % control sequence corresponding to the node, but it has to expand
      % into the usual \leavevmode...\vrule stuff for purposes of
      % into the usual \leavevmode...\vrule stuff for purposes of
      % printing. So we \turnoffactive for the \refx-snt, back on for the
      % printing. So we \turnoffactive for the \refx-snt, back on for the
      % printing, back off for the \refx-pg.
      % printing, back off for the \refx-pg.
      {\turnoffactive
      {\turnoffactive
       % Only output a following space if the -snt ref is nonempty; for
       % Only output a following space if the -snt ref is nonempty; for
       % @unnumbered and @anchor, it won't be.
       % @unnumbered and @anchor, it won't be.
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
      }%
      }%
      % output the `[mynode]' via a macro so it can be overridden.
      % output the `[mynode]' via a macro so it can be overridden.
      \xrefprintnodename\printedrefname
      \xrefprintnodename\printedrefname
      %
      %
      % But we always want a comma and a space:
      % But we always want a comma and a space:
      ,\space
      ,\space
      %
      %
      % output the `page 3'.
      % output the `page 3'.
      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
    \fi
    \fi
  \fi
  \fi
  \endlink
  \endlink
\endgroup}
\endgroup}
 
 
% This macro is called from \xrefX for the `[nodename]' part of xref
% This macro is called from \xrefX for the `[nodename]' part of xref
% output.  It's a separate macro only so it can be changed more easily,
% output.  It's a separate macro only so it can be changed more easily,
% since square brackets don't work well in some documents.  Particularly
% since square brackets don't work well in some documents.  Particularly
% one that Bob is working on :).
% one that Bob is working on :).
%
%
\def\xrefprintnodename#1{[#1]}
\def\xrefprintnodename#1{[#1]}
 
 
% Things referred to by \setref.
% Things referred to by \setref.
%
%
\def\Ynothing{}
\def\Ynothing{}
\def\Yomitfromtoc{}
\def\Yomitfromtoc{}
\def\Ynumbered{%
\def\Ynumbered{%
  \ifnum\secno=0
  \ifnum\secno=0
    \putwordChapter@tie \the\chapno
    \putwordChapter@tie \the\chapno
  \else \ifnum\subsecno=0
  \else \ifnum\subsecno=0
    \putwordSection@tie \the\chapno.\the\secno
    \putwordSection@tie \the\chapno.\the\secno
  \else \ifnum\subsubsecno=0
  \else \ifnum\subsubsecno=0
    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  \else
  \else
    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
    \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  \fi\fi\fi
  \fi\fi\fi
}
}
\def\Yappendix{%
\def\Yappendix{%
  \ifnum\secno=0
  \ifnum\secno=0
     \putwordAppendix@tie @char\the\appendixno{}%
     \putwordAppendix@tie @char\the\appendixno{}%
  \else \ifnum\subsecno=0
  \else \ifnum\subsecno=0
     \putwordSection@tie @char\the\appendixno.\the\secno
     \putwordSection@tie @char\the\appendixno.\the\secno
  \else \ifnum\subsubsecno=0
  \else \ifnum\subsubsecno=0
    \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
    \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  \else
  \else
    \putwordSection@tie
    \putwordSection@tie
      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  \fi\fi\fi
  \fi\fi\fi
}
}
 
 
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.
% If its value is nonempty, SUFFIX is output afterward.
%
%
\def\refx#1#2{%
\def\refx#1#2{%
  {%
  {%
    \indexnofonts
    \indexnofonts
    \otherbackslash
    \otherbackslash
    \expandafter\global\expandafter\let\expandafter\thisrefX
    \expandafter\global\expandafter\let\expandafter\thisrefX
      \csname XR#1\endcsname
      \csname XR#1\endcsname
  }%
  }%
  \ifx\thisrefX\relax
  \ifx\thisrefX\relax
    % If not defined, say something at least.
    % If not defined, say something at least.
    \angleleft un\-de\-fined\angleright
    \angleleft un\-de\-fined\angleright
    \iflinks
    \iflinks
      \ifhavexrefs
      \ifhavexrefs
        \message{\linenumber Undefined cross reference `#1'.}%
        \message{\linenumber Undefined cross reference `#1'.}%
      \else
      \else
        \ifwarnedxrefs\else
        \ifwarnedxrefs\else
          \global\warnedxrefstrue
          \global\warnedxrefstrue
          \message{Cross reference values unknown; you must run TeX again.}%
          \message{Cross reference values unknown; you must run TeX again.}%
        \fi
        \fi
      \fi
      \fi
    \fi
    \fi
  \else
  \else
    % It's defined, so just use it.
    % It's defined, so just use it.
    \thisrefX
    \thisrefX
  \fi
  \fi
  #2% Output the suffix in any case.
  #2% Output the suffix in any case.
}
}
 
 
% This is the macro invoked by entries in the aux file.  Usually it's
% This is the macro invoked by entries in the aux file.  Usually it's
% just a \def (we prepend XR to the control sequence name to avoid
% just a \def (we prepend XR to the control sequence name to avoid
% collisions).  But if this is a float type, we have more work to do.
% collisions).  But if this is a float type, we have more work to do.
%
%
\def\xrdef#1#2{%
\def\xrdef#1#2{%
  {% The node name might contain 8-bit characters, which in our current
  {% The node name might contain 8-bit characters, which in our current
   % implementation are changed to commands like @'e.  Don't let these
   % implementation are changed to commands like @'e.  Don't let these
   % mess up the control sequence name.
   % mess up the control sequence name.
    \indexnofonts
    \indexnofonts
    \turnoffactive
    \turnoffactive
    \xdef\safexrefname{#1}%
    \xdef\safexrefname{#1}%
  }%
  }%
  %
  %
  \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  %
  %
  % Was that xref control sequence that we just defined for a float?
  % Was that xref control sequence that we just defined for a float?
  \expandafter\iffloat\csname XR\safexrefname\endcsname
  \expandafter\iffloat\csname XR\safexrefname\endcsname
    % it was a float, and we have the (safe) float type in \iffloattype.
    % it was a float, and we have the (safe) float type in \iffloattype.
    \expandafter\let\expandafter\floatlist
    \expandafter\let\expandafter\floatlist
      \csname floatlist\iffloattype\endcsname
      \csname floatlist\iffloattype\endcsname
    %
    %
    % Is this the first time we've seen this float type?
    % Is this the first time we've seen this float type?
    \expandafter\ifx\floatlist\relax
    \expandafter\ifx\floatlist\relax
      \toks0 = {\do}% yes, so just \do
      \toks0 = {\do}% yes, so just \do
    \else
    \else
      % had it before, so preserve previous elements in list.
      % had it before, so preserve previous elements in list.
      \toks0 = \expandafter{\floatlist\do}%
      \toks0 = \expandafter{\floatlist\do}%
    \fi
    \fi
    %
    %
    % Remember this xref in the control sequence \floatlistFLOATTYPE,
    % Remember this xref in the control sequence \floatlistFLOATTYPE,
    % for later use in \listoffloats.
    % for later use in \listoffloats.
    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
      {\safexrefname}}%
      {\safexrefname}}%
  \fi
  \fi
}
}
 
 
% Read the last existing aux file, if any.  No error if none exists.
% Read the last existing aux file, if any.  No error if none exists.
%
%
\def\tryauxfile{%
\def\tryauxfile{%
  \openin 1 \jobname.aux
  \openin 1 \jobname.aux
  \ifeof 1 \else
  \ifeof 1 \else
    \readdatafile{aux}%
    \readdatafile{aux}%
    \global\havexrefstrue
    \global\havexrefstrue
  \fi
  \fi
  \closein 1
  \closein 1
}
}
 
 
\def\setupdatafile{%
\def\setupdatafile{%
  \catcode`\^^@=\other
  \catcode`\^^@=\other
  \catcode`\^^A=\other
  \catcode`\^^A=\other
  \catcode`\^^B=\other
  \catcode`\^^B=\other
  \catcode`\^^C=\other
  \catcode`\^^C=\other
  \catcode`\^^D=\other
  \catcode`\^^D=\other
  \catcode`\^^E=\other
  \catcode`\^^E=\other
  \catcode`\^^F=\other
  \catcode`\^^F=\other
  \catcode`\^^G=\other
  \catcode`\^^G=\other
  \catcode`\^^H=\other
  \catcode`\^^H=\other
  \catcode`\^^K=\other
  \catcode`\^^K=\other
  \catcode`\^^L=\other
  \catcode`\^^L=\other
  \catcode`\^^N=\other
  \catcode`\^^N=\other
  \catcode`\^^P=\other
  \catcode`\^^P=\other
  \catcode`\^^Q=\other
  \catcode`\^^Q=\other
  \catcode`\^^R=\other
  \catcode`\^^R=\other
  \catcode`\^^S=\other
  \catcode`\^^S=\other
  \catcode`\^^T=\other
  \catcode`\^^T=\other
  \catcode`\^^U=\other
  \catcode`\^^U=\other
  \catcode`\^^V=\other
  \catcode`\^^V=\other
  \catcode`\^^W=\other
  \catcode`\^^W=\other
  \catcode`\^^X=\other
  \catcode`\^^X=\other
  \catcode`\^^Z=\other
  \catcode`\^^Z=\other
  \catcode`\^^[=\other
  \catcode`\^^[=\other
  \catcode`\^^\=\other
  \catcode`\^^\=\other
  \catcode`\^^]=\other
  \catcode`\^^]=\other
  \catcode`\^^^=\other
  \catcode`\^^^=\other
  \catcode`\^^_=\other
  \catcode`\^^_=\other
  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
  % supported in the main text, it doesn't seem desirable.  Furthermore,
  % supported in the main text, it doesn't seem desirable.  Furthermore,
  % that is not enough: for node names that actually contain a ^
  % that is not enough: for node names that actually contain a ^
  % character, we would end up writing a line like this: 'xrdef {'hat
  % character, we would end up writing a line like this: 'xrdef {'hat
  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  % argument, and \hat is not an expandable control sequence.  It could
  % argument, and \hat is not an expandable control sequence.  It could
  % all be worked out, but why?  Either we support ^^ or we don't.
  % all be worked out, but why?  Either we support ^^ or we don't.
  %
  %
  % The other change necessary for this was to define \auxhat:
  % The other change necessary for this was to define \auxhat:
  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  % and then to call \auxhat in \setq.
  % and then to call \auxhat in \setq.
  %
  %
  \catcode`\^=\other
  \catcode`\^=\other
  %
  %
  % Special characters.  Should be turned off anyway, but...
  % Special characters.  Should be turned off anyway, but...
  \catcode`\~=\other
  \catcode`\~=\other
  \catcode`\[=\other
  \catcode`\[=\other
  \catcode`\]=\other
  \catcode`\]=\other
  \catcode`\"=\other
  \catcode`\"=\other
  \catcode`\_=\other
  \catcode`\_=\other
  \catcode`\|=\other
  \catcode`\|=\other
  \catcode`\<=\other
  \catcode`\<=\other
  \catcode`\>=\other
  \catcode`\>=\other
  \catcode`\$=\other
  \catcode`\$=\other
  \catcode`\#=\other
  \catcode`\#=\other
  \catcode`\&=\other
  \catcode`\&=\other
  \catcode`\%=\other
  \catcode`\%=\other
  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  %
  %
  % This is to support \ in node names and titles, since the \
  % This is to support \ in node names and titles, since the \
  % characters end up in a \csname.  It's easier than
  % characters end up in a \csname.  It's easier than
  % leaving it active and making its active definition an actual \
  % leaving it active and making its active definition an actual \
  % character.  What I don't understand is why it works in the *value*
  % character.  What I don't understand is why it works in the *value*
  % of the xrdef.  Seems like it should be a catcode12 \, and that
  % of the xrdef.  Seems like it should be a catcode12 \, and that
  % should not typeset properly.  But it works, so I'm moving on for
  % should not typeset properly.  But it works, so I'm moving on for
  % now.  --karl, 15jan04.
  % now.  --karl, 15jan04.
  \catcode`\\=\other
  \catcode`\\=\other
  %
  %
  % Make the characters 128-255 be printing characters.
  % Make the characters 128-255 be printing characters.
  {%
  {%
    \count1=128
    \count1=128
    \def\loop{%
    \def\loop{%
      \catcode\count1=\other
      \catcode\count1=\other
      \advance\count1 by 1
      \advance\count1 by 1
      \ifnum \count1<256 \loop \fi
      \ifnum \count1<256 \loop \fi
    }%
    }%
  }%
  }%
  %
  %
  % @ is our escape character in .aux files, and we need braces.
  % @ is our escape character in .aux files, and we need braces.
  \catcode`\{=1
  \catcode`\{=1
  \catcode`\}=2
  \catcode`\}=2
  \catcode`\@=0
  \catcode`\@=0
}
}
 
 
\def\readdatafile#1{%
\def\readdatafile#1{%
\begingroup
\begingroup
  \setupdatafile
  \setupdatafile
  \input\jobname.#1
  \input\jobname.#1
\endgroup}
\endgroup}
 
 
 
 
\message{insertions,}
\message{insertions,}
% including footnotes.
% including footnotes.
 
 
\newcount \footnoteno
\newcount \footnoteno
 
 
% The trailing space in the following definition for supereject is
% The trailing space in the following definition for supereject is
% vital for proper filling; pages come out unaligned when you do a
% vital for proper filling; pages come out unaligned when you do a
% pagealignmacro call if that space before the closing brace is
% pagealignmacro call if that space before the closing brace is
% removed. (Generally, numeric constants should always be followed by a
% removed. (Generally, numeric constants should always be followed by a
% space to prevent strange expansion errors.)
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
\def\supereject{\par\penalty -20000\footnoteno =0 }
 
 
% @footnotestyle is meaningful for info output only.
% @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment
\let\footnotestyle=\comment
 
 
{\catcode `\@=11
{\catcode `\@=11
%
%
% Auto-number footnotes.  Otherwise like plain.
% Auto-number footnotes.  Otherwise like plain.
\gdef\footnote{%
\gdef\footnote{%
  \let\indent=\ptexindent
  \let\indent=\ptexindent
  \let\noindent=\ptexnoindent
  \let\noindent=\ptexnoindent
  \global\advance\footnoteno by \@ne
  \global\advance\footnoteno by \@ne
  \edef\thisfootno{$^{\the\footnoteno}$}%
  \edef\thisfootno{$^{\the\footnoteno}$}%
  %
  %
  % In case the footnote comes at the end of a sentence, preserve the
  % In case the footnote comes at the end of a sentence, preserve the
  % extra spacing after we do the footnote number.
  % extra spacing after we do the footnote number.
  \let\@sf\empty
  \let\@sf\empty
  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  %
  %
  % Remove inadvertent blank space before typesetting the footnote number.
  % Remove inadvertent blank space before typesetting the footnote number.
  \unskip
  \unskip
  \thisfootno\@sf
  \thisfootno\@sf
  \dofootnote
  \dofootnote
}%
}%
 
 
% Don't bother with the trickery in plain.tex to not require the
% Don't bother with the trickery in plain.tex to not require the
% footnote text as a parameter.  Our footnotes don't need to be so general.
% footnote text as a parameter.  Our footnotes don't need to be so general.
%
%
% Oh yes, they do; otherwise, @ifset (and anything else that uses
% Oh yes, they do; otherwise, @ifset (and anything else that uses
% \parseargline) fails inside footnotes because the tokens are fixed when
% \parseargline) fails inside footnotes because the tokens are fixed when
% the footnote is read.  --karl, 16nov96.
% the footnote is read.  --karl, 16nov96.
%
%
\gdef\dofootnote{%
\gdef\dofootnote{%
  \insert\footins\bgroup
  \insert\footins\bgroup
  % We want to typeset this text as a normal paragraph, even if the
  % We want to typeset this text as a normal paragraph, even if the
  % footnote reference occurs in (for example) a display environment.
  % footnote reference occurs in (for example) a display environment.
  % So reset some parameters.
  % So reset some parameters.
  \hsize=\pagewidth
  \hsize=\pagewidth
  \interlinepenalty\interfootnotelinepenalty
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\ht\strutbox % top baseline for broken footnotes
  \splittopskip\ht\strutbox % top baseline for broken footnotes
  \splitmaxdepth\dp\strutbox
  \splitmaxdepth\dp\strutbox
  \floatingpenalty\@MM
  \floatingpenalty\@MM
  \leftskip\z@skip
  \leftskip\z@skip
  \rightskip\z@skip
  \rightskip\z@skip
  \spaceskip\z@skip
  \spaceskip\z@skip
  \xspaceskip\z@skip
  \xspaceskip\z@skip
  \parindent\defaultparindent
  \parindent\defaultparindent
  %
  %
  \smallfonts \rm
  \smallfonts \rm
  %
  %
  % Because we use hanging indentation in footnotes, a @noindent appears
  % Because we use hanging indentation in footnotes, a @noindent appears
  % to exdent this text, so make it be a no-op.  makeinfo does not use
  % to exdent this text, so make it be a no-op.  makeinfo does not use
  % hanging indentation so @noindent can still be needed within footnote
  % hanging indentation so @noindent can still be needed within footnote
  % text after an @example or the like (not that this is good style).
  % text after an @example or the like (not that this is good style).
  \let\noindent = \relax
  \let\noindent = \relax
  %
  %
  % Hang the footnote text off the number.  Use \everypar in case the
  % Hang the footnote text off the number.  Use \everypar in case the
  % footnote extends for more than one paragraph.
  % footnote extends for more than one paragraph.
  \everypar = {\hang}%
  \everypar = {\hang}%
  \textindent{\thisfootno}%
  \textindent{\thisfootno}%
  %
  %
  % Don't crash into the line above the footnote text.  Since this
  % Don't crash into the line above the footnote text.  Since this
  % expands into a box, it must come within the paragraph, lest it
  % expands into a box, it must come within the paragraph, lest it
  % provide a place where TeX can split the footnote.
  % provide a place where TeX can split the footnote.
  \footstrut
  \footstrut
  \futurelet\next\fo@t
  \futurelet\next\fo@t
}
}
}%end \catcode `\@=11
}%end \catcode `\@=11
 
 
% In case a @footnote appears in a vbox, save the footnote text and create
% In case a @footnote appears in a vbox, save the footnote text and create
% the real \insert just after the vbox finished.  Otherwise, the insertion
% the real \insert just after the vbox finished.  Otherwise, the insertion
% would be lost.
% would be lost.
% Similarily, if a @footnote appears inside an alignment, save the footnote
% Similarly, if a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is finished.
% text to a box and make the \insert when a row of the table is finished.
% And the same can be done for other insert classes.  --kasal, 16nov03.
% And the same can be done for other insert classes.  --kasal, 16nov03.
 
 
% Replace the \insert primitive by a cheating macro.
% Replace the \insert primitive by a cheating macro.
% Deeper inside, just make sure that the saved insertions are not spilled
% Deeper inside, just make sure that the saved insertions are not spilled
% out prematurely.
% out prematurely.
%
%
\def\startsavinginserts{%
\def\startsavinginserts{%
  \ifx \insert\ptexinsert
  \ifx \insert\ptexinsert
    \let\insert\saveinsert
    \let\insert\saveinsert
  \else
  \else
    \let\checkinserts\relax
    \let\checkinserts\relax
  \fi
  \fi
}
}
 
 
% This \insert replacement works for both \insert\footins{foo} and
% This \insert replacement works for both \insert\footins{foo} and
% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
%
%
\def\saveinsert#1{%
\def\saveinsert#1{%
  \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  \afterassignment\next
  \afterassignment\next
  % swallow the left brace
  % swallow the left brace
  \let\temp =
  \let\temp =
}
}
\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
 
 
\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
 
 
\def\placesaveins#1{%
\def\placesaveins#1{%
  \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
    {\box#1}%
    {\box#1}%
}
}
 
 
% eat @SAVE -- beware, all of them have catcode \other:
% eat @SAVE -- beware, all of them have catcode \other:
{
{
  \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
  \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
  \gdef\gobblesave @SAVE{}
  \gdef\gobblesave @SAVE{}
}
}
 
 
% initialization:
% initialization:
\def\newsaveins #1{%
\def\newsaveins #1{%
  \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  \next
  \next
}
}
\def\newsaveinsX #1{%
\def\newsaveinsX #1{%
  \csname newbox\endcsname #1%
  \csname newbox\endcsname #1%
  \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
    \checksaveins #1}%
    \checksaveins #1}%
}
}
 
 
% initialize:
% initialize:
\let\checkinserts\empty
\let\checkinserts\empty
\newsaveins\footins
\newsaveins\footins
\newsaveins\margin
\newsaveins\margin
 
 
 
 
% @image.  We use the macros from epsf.tex to support this.
% @image.  We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
% If epsf.tex is not installed and @image is used, we complain.
%
%
% Check for and read epsf.tex up front.  If we read it only at @image
% Check for and read epsf.tex up front.  If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
% undone and the next image would fail.
\openin 1 = epsf.tex
\openin 1 = epsf.tex
\ifeof 1 \else
\ifeof 1 \else
  % Do not bother showing banner with epsf.tex v2.7k (available in
  % Do not bother showing banner with epsf.tex v2.7k (available in
  % doc/epsf.tex and on ctan).
  % doc/epsf.tex and on ctan).
  \def\epsfannounce{\toks0 = }%
  \def\epsfannounce{\toks0 = }%
  \input epsf.tex
  \input epsf.tex
\fi
\fi
\closein 1
\closein 1
%
%
% We will only complain once about lack of epsf.tex.
% We will only complain once about lack of epsf.tex.
\newif\ifwarnednoepsf
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
\newhelp\noepsfhelp{epsf.tex must be installed for images to
  work.  It is also included in the Texinfo distribution, or you can get
  work.  It is also included in the Texinfo distribution, or you can get
  it from ftp://tug.org/tex/epsf.tex.}
  it from ftp://tug.org/tex/epsf.tex.}
%
%
\def\image#1{%
\def\image#1{%
  \ifx\epsfbox\undefined
  \ifx\epsfbox\undefined
    \ifwarnednoepsf \else
    \ifwarnednoepsf \else
      \errhelp = \noepsfhelp
      \errhelp = \noepsfhelp
      \errmessage{epsf.tex not found, images will be ignored}%
      \errmessage{epsf.tex not found, images will be ignored}%
      \global\warnednoepsftrue
      \global\warnednoepsftrue
    \fi
    \fi
  \else
  \else
    \imagexxx #1,,,,,\finish
    \imagexxx #1,,,,,\finish
  \fi
  \fi
}
}
%
%
% Arguments to @image:
% Arguments to @image:
% #1 is (mandatory) image filename; we tack on .eps extension.
% #1 is (mandatory) image filename; we tack on .eps extension.
% #2 is (optional) width, #3 is (optional) height.
% #2 is (optional) width, #3 is (optional) height.
% #4 is (ignored optional) html alt text.
% #4 is (ignored optional) html alt text.
% #5 is (ignored optional) extension.
% #5 is (ignored optional) extension.
% #6 is just the usual extra ignored arg for parsing this stuff.
% #6 is just the usual extra ignored arg for parsing this stuff.
\newif\ifimagevmode
\newif\ifimagevmode
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  \catcode`\^^M = 5     % in case we're inside an example
  \catcode`\^^M = 5     % in case we're inside an example
  \normalturnoffactive  % allow _ et al. in names
  \normalturnoffactive  % allow _ et al. in names
  % If the image is by itself, center it.
  % If the image is by itself, center it.
  \ifvmode
  \ifvmode
    \imagevmodetrue
    \imagevmodetrue
    \nobreak\bigskip
    \nobreak\medskip
    % Usually we'll have text after the image which will insert
    % Usually we'll have text after the image which will insert
    % \parskip glue, so insert it here too to equalize the space
    % \parskip glue, so insert it here too to equalize the space
    % above and below.
    % above and below.
    \nobreak\vskip\parskip
    \nobreak\vskip\parskip
    \nobreak
    \nobreak
    \line\bgroup
 
  \fi
  \fi
  %
  %
 
  % Leave vertical mode so that indentation from an enclosing
 
  % environment such as @quotation is respected.  On the other hand, if
 
  % it's at the top level, we don't want the normal paragraph indentation.
 
  \noindent
 
  %
  % Output the image.
  % Output the image.
  \ifpdf
  \ifpdf
    \dopdfimage{#1}{#2}{#3}%
    \dopdfimage{#1}{#2}{#3}%
  \else
  \else
    % \epsfbox itself resets \epsf?size at each figure.
    % \epsfbox itself resets \epsf?size at each figure.
    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
    \epsfbox{#1.eps}%
    \epsfbox{#1.eps}%
  \fi
  \fi
  %
  %
  \ifimagevmode \egroup \bigbreak \fi  % space after the image
  \ifimagevmode \medskip \fi  % space after the standalone image
\endgroup}
\endgroup}
 
 
 
 
% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
% etc.  We don't actually implement floating yet, we always include the
% etc.  We don't actually implement floating yet, we always include the
% float "here".  But it seemed the best name for the future.
% float "here".  But it seemed the best name for the future.
%
%
\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
 
 
% There may be a space before second and/or third parameter; delete it.
% There may be a space before second and/or third parameter; delete it.
\def\eatcommaspace#1, {#1,}
\def\eatcommaspace#1, {#1,}
 
 
% #1 is the optional FLOATTYPE, the text label for this float, typically
% #1 is the optional FLOATTYPE, the text label for this float, typically
% "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
% "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
% this float will not be numbered and cannot be referred to.
% this float will not be numbered and cannot be referred to.
%
%
% #2 is the optional xref label.  Also must be present for the float to
% #2 is the optional xref label.  Also must be present for the float to
% be referable.
% be referable.
%
%
% #3 is the optional positioning argument; for now, it is ignored.  It
% #3 is the optional positioning argument; for now, it is ignored.  It
% will somehow specify the positions allowed to float to (here, top, bottom).
% will somehow specify the positions allowed to float to (here, top, bottom).
%
%
% We keep a separate counter for each FLOATTYPE, which we reset at each
% We keep a separate counter for each FLOATTYPE, which we reset at each
% chapter-level command.
% chapter-level command.
\let\resetallfloatnos=\empty
\let\resetallfloatnos=\empty
%
%
\def\dofloat#1,#2,#3,#4\finish{%
\def\dofloat#1,#2,#3,#4\finish{%
  \let\thiscaption=\empty
  \let\thiscaption=\empty
  \let\thisshortcaption=\empty
  \let\thisshortcaption=\empty
  %
  %
  % don't lose footnotes inside @float.
  % don't lose footnotes inside @float.
  %
  %
  % BEWARE: when the floats start float, we have to issue warning whenever an
  % BEWARE: when the floats start float, we have to issue warning whenever an
  % insert appears inside a float which could possibly float. --kasal, 26may04
  % insert appears inside a float which could possibly float. --kasal, 26may04
  %
  %
  \startsavinginserts
  \startsavinginserts
  %
  %
  % We can't be used inside a paragraph.
  % We can't be used inside a paragraph.
  \par
  \par
  %
  %
  \vtop\bgroup
  \vtop\bgroup
    \def\floattype{#1}%
    \def\floattype{#1}%
    \def\floatlabel{#2}%
    \def\floatlabel{#2}%
    \def\floatloc{#3}% we do nothing with this yet.
    \def\floatloc{#3}% we do nothing with this yet.
    %
    %
    \ifx\floattype\empty
    \ifx\floattype\empty
      \let\safefloattype=\empty
      \let\safefloattype=\empty
    \else
    \else
      {%
      {%
        % the floattype might have accents or other special characters,
        % the floattype might have accents or other special characters,
        % but we need to use it in a control sequence name.
        % but we need to use it in a control sequence name.
        \indexnofonts
        \indexnofonts
        \turnoffactive
        \turnoffactive
        \xdef\safefloattype{\floattype}%
        \xdef\safefloattype{\floattype}%
      }%
      }%
    \fi
    \fi
    %
    %
    % If label is given but no type, we handle that as the empty type.
    % If label is given but no type, we handle that as the empty type.
    \ifx\floatlabel\empty \else
    \ifx\floatlabel\empty \else
      % We want each FLOATTYPE to be numbered separately (Figure 1,
      % We want each FLOATTYPE to be numbered separately (Figure 1,
      % Table 1, Figure 2, ...).  (And if no label, no number.)
      % Table 1, Figure 2, ...).  (And if no label, no number.)
      %
      %
      \expandafter\getfloatno\csname\safefloattype floatno\endcsname
      \expandafter\getfloatno\csname\safefloattype floatno\endcsname
      \global\advance\floatno by 1
      \global\advance\floatno by 1
      %
      %
      {%
      {%
        % This magic value for \lastsection is output by \setref as the
        % This magic value for \lastsection is output by \setref as the
        % XREFLABEL-title value.  \xrefX uses it to distinguish float
        % XREFLABEL-title value.  \xrefX uses it to distinguish float
        % labels (which have a completely different output format) from
        % labels (which have a completely different output format) from
        % node and anchor labels.  And \xrdef uses it to construct the
        % node and anchor labels.  And \xrdef uses it to construct the
        % lists of floats.
        % lists of floats.
        %
        %
        \edef\lastsection{\floatmagic=\safefloattype}%
        \edef\lastsection{\floatmagic=\safefloattype}%
        \setref{\floatlabel}{Yfloat}%
        \setref{\floatlabel}{Yfloat}%
      }%
      }%
    \fi
    \fi
    %
    %
    % start with \parskip glue, I guess.
    % start with \parskip glue, I guess.
    \vskip\parskip
    \vskip\parskip
    %
    %
    % Don't suppress indentation if a float happens to start a section.
    % Don't suppress indentation if a float happens to start a section.
    \restorefirstparagraphindent
    \restorefirstparagraphindent
}
}
 
 
% we have these possibilities:
% we have these possibilities:
% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
% @float Foo,lbl & no caption:    Foo 1.1
% @float Foo,lbl & no caption:    Foo 1.1
% @float Foo & @caption{Cap}:     Foo: Cap
% @float Foo & @caption{Cap}:     Foo: Cap
% @float Foo & no caption:        Foo
% @float Foo & no caption:        Foo
% @float ,lbl & Caption{Cap}:     1.1: Cap
% @float ,lbl & Caption{Cap}:     1.1: Cap
% @float ,lbl & no caption:       1.1
% @float ,lbl & no caption:       1.1
% @float & @caption{Cap}:         Cap
% @float & @caption{Cap}:         Cap
% @float & no caption:
% @float & no caption:
%
%
\def\Efloat{%
\def\Efloat{%
    \let\floatident = \empty
    \let\floatident = \empty
    %
    %
    % In all cases, if we have a float type, it comes first.
    % In all cases, if we have a float type, it comes first.
    \ifx\floattype\empty \else \def\floatident{\floattype}\fi
    \ifx\floattype\empty \else \def\floatident{\floattype}\fi
    %
    %
    % If we have an xref label, the number comes next.
    % If we have an xref label, the number comes next.
    \ifx\floatlabel\empty \else
    \ifx\floatlabel\empty \else
      \ifx\floattype\empty \else % if also had float type, need tie first.
      \ifx\floattype\empty \else % if also had float type, need tie first.
        \appendtomacro\floatident{\tie}%
        \appendtomacro\floatident{\tie}%
      \fi
      \fi
      % the number.
      % the number.
      \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
      \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
    \fi
    \fi
    %
    %
    % Start the printed caption with what we've constructed in
    % Start the printed caption with what we've constructed in
    % \floatident, but keep it separate; we need \floatident again.
    % \floatident, but keep it separate; we need \floatident again.
    \let\captionline = \floatident
    \let\captionline = \floatident
    %
    %
    \ifx\thiscaption\empty \else
    \ifx\thiscaption\empty \else
      \ifx\floatident\empty \else
      \ifx\floatident\empty \else
        \appendtomacro\captionline{: }% had ident, so need a colon between
        \appendtomacro\captionline{: }% had ident, so need a colon between
      \fi
      \fi
      %
      %
      % caption text.
      % caption text.
      \appendtomacro\captionline{\scanexp\thiscaption}%
      \appendtomacro\captionline{\scanexp\thiscaption}%
    \fi
    \fi
    %
    %
    % If we have anything to print, print it, with space before.
    % If we have anything to print, print it, with space before.
    % Eventually this needs to become an \insert.
    % Eventually this needs to become an \insert.
    \ifx\captionline\empty \else
    \ifx\captionline\empty \else
      \vskip.5\parskip
      \vskip.5\parskip
      \captionline
      \captionline
      %
      %
      % Space below caption.
      % Space below caption.
      \vskip\parskip
      \vskip\parskip
    \fi
    \fi
    %
    %
    % If have an xref label, write the list of floats info.  Do this
    % If have an xref label, write the list of floats info.  Do this
    % after the caption, to avoid chance of it being a breakpoint.
    % after the caption, to avoid chance of it being a breakpoint.
    \ifx\floatlabel\empty \else
    \ifx\floatlabel\empty \else
      % Write the text that goes in the lof to the aux file as
      % Write the text that goes in the lof to the aux file as
      % \floatlabel-lof.  Besides \floatident, we include the short
      % \floatlabel-lof.  Besides \floatident, we include the short
      % caption if specified, else the full caption if specified, else nothing.
      % caption if specified, else the full caption if specified, else nothing.
      {%
      {%
        \atdummies
        \atdummies
        %
        %
        % since we read the caption text in the macro world, where ^^M
        % since we read the caption text in the macro world, where ^^M
        % is turned into a normal character, we have to scan it back, so
        % is turned into a normal character, we have to scan it back, so
        % we don't write the literal three characters "^^M" into the aux file.
        % we don't write the literal three characters "^^M" into the aux file.
        \scanexp{%
        \scanexp{%
          \xdef\noexpand\gtemp{%
          \xdef\noexpand\gtemp{%
            \ifx\thisshortcaption\empty
            \ifx\thisshortcaption\empty
              \thiscaption
              \thiscaption
            \else
            \else
              \thisshortcaption
              \thisshortcaption
            \fi
            \fi
          }%
          }%
        }%
        }%
        \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
        \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
          \ifx\gtemp\empty \else : \gtemp \fi}}%
          \ifx\gtemp\empty \else : \gtemp \fi}}%
      }%
      }%
    \fi
    \fi
  \egroup  % end of \vtop
  \egroup  % end of \vtop
  %
  %
  % place the captured inserts
  % place the captured inserts
  %
  %
  % BEWARE: when the floats start floating, we have to issue warning
  % BEWARE: when the floats start floating, we have to issue warning
  % whenever an insert appears inside a float which could possibly
  % whenever an insert appears inside a float which could possibly
  % float. --kasal, 26may04
  % float. --kasal, 26may04
  %
  %
  \checkinserts
  \checkinserts
}
}
 
 
% Append the tokens #2 to the definition of macro #1, not expanding either.
% Append the tokens #2 to the definition of macro #1, not expanding either.
%
%
\def\appendtomacro#1#2{%
\def\appendtomacro#1#2{%
  \expandafter\def\expandafter#1\expandafter{#1#2}%
  \expandafter\def\expandafter#1\expandafter{#1#2}%
}
}
 
 
% @caption, @shortcaption
% @caption, @shortcaption
%
%
\def\caption{\docaption\thiscaption}
\def\caption{\docaption\thiscaption}
\def\shortcaption{\docaption\thisshortcaption}
\def\shortcaption{\docaption\thisshortcaption}
\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
\def\defcaption#1#2{\egroup \def#1{#2}}
\def\defcaption#1#2{\egroup \def#1{#2}}
 
 
% The parameter is the control sequence identifying the counter we are
% The parameter is the control sequence identifying the counter we are
% going to use.  Create it if it doesn't exist and assign it to \floatno.
% going to use.  Create it if it doesn't exist and assign it to \floatno.
\def\getfloatno#1{%
\def\getfloatno#1{%
  \ifx#1\relax
  \ifx#1\relax
      % Haven't seen this figure type before.
      % Haven't seen this figure type before.
      \csname newcount\endcsname #1%
      \csname newcount\endcsname #1%
      %
      %
      % Remember to reset this floatno at the next chap.
      % Remember to reset this floatno at the next chap.
      \expandafter\gdef\expandafter\resetallfloatnos
      \expandafter\gdef\expandafter\resetallfloatnos
        \expandafter{\resetallfloatnos #1=0 }%
        \expandafter{\resetallfloatnos #1=0 }%
  \fi
  \fi
  \let\floatno#1%
  \let\floatno#1%
}
}
 
 
% \setref calls this to get the XREFLABEL-snt value.  We want an @xref
% \setref calls this to get the XREFLABEL-snt value.  We want an @xref
% to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
% to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
% first read the @float command.
% first read the @float command.
%
%
\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
 
 
% Magic string used for the XREFLABEL-title value, so \xrefX can
% Magic string used for the XREFLABEL-title value, so \xrefX can
% distinguish floats from other xref types.
% distinguish floats from other xref types.
\def\floatmagic{!!float!!}
\def\floatmagic{!!float!!}
 
 
% #1 is the control sequence we are passed; we expand into a conditional
% #1 is the control sequence we are passed; we expand into a conditional
% which is true if #1 represents a float ref.  That is, the magic
% which is true if #1 represents a float ref.  That is, the magic
% \lastsection value which we \setref above.
% \lastsection value which we \setref above.
%
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
%
% #1 is (maybe) the \floatmagic string.  If so, #2 will be the
% #1 is (maybe) the \floatmagic string.  If so, #2 will be the
% (safe) float type for this float.  We set \iffloattype to #2.
% (safe) float type for this float.  We set \iffloattype to #2.
%
%
\def\doiffloat#1=#2=#3\finish{%
\def\doiffloat#1=#2=#3\finish{%
  \def\temp{#1}%
  \def\temp{#1}%
  \def\iffloattype{#2}%
  \def\iffloattype{#2}%
  \ifx\temp\floatmagic
  \ifx\temp\floatmagic
}
}
 
 
% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
%
%
\parseargdef\listoffloats{%
\parseargdef\listoffloats{%
  \def\floattype{#1}% floattype
  \def\floattype{#1}% floattype
  {%
  {%
    % the floattype might have accents or other special characters,
    % the floattype might have accents or other special characters,
    % but we need to use it in a control sequence name.
    % but we need to use it in a control sequence name.
    \indexnofonts
    \indexnofonts
    \turnoffactive
    \turnoffactive
    \xdef\safefloattype{\floattype}%
    \xdef\safefloattype{\floattype}%
  }%
  }%
  %
  %
  % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
    \ifhavexrefs
    \ifhavexrefs
      % if the user said @listoffloats foo but never @float foo.
      % if the user said @listoffloats foo but never @float foo.
      \message{\linenumber No `\safefloattype' floats to list.}%
      \message{\linenumber No `\safefloattype' floats to list.}%
    \fi
    \fi
  \else
  \else
    \begingroup
    \begingroup
      \leftskip=\tocindent  % indent these entries like a toc
      \leftskip=\tocindent  % indent these entries like a toc
      \let\do=\listoffloatsdo
      \let\do=\listoffloatsdo
      \csname floatlist\safefloattype\endcsname
      \csname floatlist\safefloattype\endcsname
    \endgroup
    \endgroup
  \fi
  \fi
}
}
 
 
% This is called on each entry in a list of floats.  We're passed the
% This is called on each entry in a list of floats.  We're passed the
% xref label, in the form LABEL-title, which is how we save it in the
% xref label, in the form LABEL-title, which is how we save it in the
% aux file.  We strip off the -title and look up \XRLABEL-lof, which
% aux file.  We strip off the -title and look up \XRLABEL-lof, which
% has the text we're supposed to typeset here.
% has the text we're supposed to typeset here.
%
%
% Figures without xref labels will not be included in the list (since
% Figures without xref labels will not be included in the list (since
% they won't appear in the aux file).
% they won't appear in the aux file).
%
%
\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
\def\listoffloatsdoentry#1-title\finish{{%
\def\listoffloatsdoentry#1-title\finish{{%
  % Can't fully expand XR#1-lof because it can contain anything.  Just
  % Can't fully expand XR#1-lof because it can contain anything.  Just
  % pass the control sequence.  On the other hand, XR#1-pg is just the
  % pass the control sequence.  On the other hand, XR#1-pg is just the
  % page number, and we want to fully expand that so we can get a link
  % page number, and we want to fully expand that so we can get a link
  % in pdf output.
  % in pdf output.
  \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  %
  %
  % use the same \entry macro we use to generate the TOC and index.
  % use the same \entry macro we use to generate the TOC and index.
  \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  \writeentry
  \writeentry
}}
}}
 
 
 
 
\message{localization,}
\message{localization,}
 
 
% @documentlanguage is usually given very early, just after
% For single-language documents, @documentlanguage is usually given very
% @setfilename.  If done too late, it may not override everything
% early, just after @documentencoding.  Single argument is the language
% properly.  Single argument is the language (de) or locale (de_DE)
% (de) or locale (de_DE) abbreviation.
% abbreviation.  It would be nice if we could set up a hyphenation file.
 
%
%
{
{
  \catcode`\_ = \active
  \catcode`\_ = \active
  \globaldefs=1
  \globaldefs=1
\parseargdef\documentlanguage{\begingroup
\parseargdef\documentlanguage{\begingroup
  \let_=\normalunderscore  % normal _ character for filenames
  \let_=\normalunderscore  % normal _ character for filenames
  \tex % read txi-??.tex file in plain TeX.
  \tex % read txi-??.tex file in plain TeX.
    % Read the file by the name they passed if it exists.
    % Read the file by the name they passed if it exists.
    \openin 1 txi-#1.tex
    \openin 1 txi-#1.tex
    \ifeof 1
    \ifeof 1
      \documentlanguagetrywithoutunderscore{#1_\finish}%
      \documentlanguagetrywithoutunderscore{#1_\finish}%
    \else
    \else
 
      \globaldefs = 1  % everything in the txi-LL files needs to persist
      \input txi-#1.tex
      \input txi-#1.tex
    \fi
    \fi
    \closein 1
    \closein 1
  \endgroup
  \endgroup % end raw TeX
\endgroup}
\endgroup}
}
 
%
%
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% try txi-de.tex.
% try txi-de.tex.
%
%
\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  \openin 1 txi-#1.tex
  \openin 1 txi-#1.tex
  \ifeof 1
  \ifeof 1
    \errhelp = \nolanghelp
    \errhelp = \nolanghelp
    \errmessage{Cannot read language file txi-#1.tex}%
    \errmessage{Cannot read language file txi-#1.tex}%
  \else
  \else
 
    \globaldefs = 1  % everything in the txi-LL files needs to persist
    \input txi-#1.tex
    \input txi-#1.tex
  \fi
  \fi
  \closein 1
  \closein 1
}
}
 
}% end of special _ catcode
%
%
\newhelp\nolanghelp{The given language definition file cannot be found or
\newhelp\nolanghelp{The given language definition file cannot be found or
is empty.  Maybe you need to install it?  In the current directory
is empty.  Maybe you need to install it?  Putting it in the current
should work if nowhere else does.}
directory should work if nowhere else does.}
 
 
 
% This macro is called from txi-??.tex files; the first argument is the
 
% \language name to set (without the "\lang@" prefix), the second and
 
% third args are \{left,right}hyphenmin.
 
%
 
% The language names to pass are determined when the format is built.
 
% See the etex.log file created at that time, e.g.,
 
% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
 
%
 
% With TeX Live 2008, etex now includes hyphenation patterns for all
 
% available languages.  This means we can support hyphenation in
 
% Texinfo, at least to some extent.  (This still doesn't solve the
 
% accented characters problem.)
 
%
 
\catcode`@=11
 
\def\txisetlanguage#1#2#3{%
 
  % do not set the language if the name is undefined in the current TeX.
 
  \expandafter\ifx\csname lang@#1\endcsname \relax
 
    \message{no patterns for #1}%
 
  \else
 
    \global\language = \csname lang@#1\endcsname
 
  \fi
 
  % but there is no harm in adjusting the hyphenmin values regardless.
 
  \global\lefthyphenmin = #2\relax
 
  \global\righthyphenmin = #3\relax
 
}
 
 
 
% Helpers for encodings.
% Set the catcode of characters 128 through 255 to the specified number.
% Set the catcode of characters 128 through 255 to the specified number.
%
%
\def\setnonasciicharscatcode#1{%
\def\setnonasciicharscatcode#1{%
   \count255=128
   \count255=128
   \loop\ifnum\count255<256
   \loop\ifnum\count255<256
      \global\catcode\count255=#1\relax
      \global\catcode\count255=#1\relax
      \advance\count255 by 1
      \advance\count255 by 1
   \repeat
   \repeat
}
}
 
 
\def\setnonasciicharscatcodenonglobal#1{%
\def\setnonasciicharscatcodenonglobal#1{%
   \count255=128
   \count255=128
   \loop\ifnum\count255<256
   \loop\ifnum\count255<256
      \catcode\count255=#1\relax
      \catcode\count255=#1\relax
      \advance\count255 by 1
      \advance\count255 by 1
   \repeat
   \repeat
}
}
 
 
% @documentencoding sets the definition of non-ASCII characters
% @documentencoding sets the definition of non-ASCII characters
% according to the specified encoding.
% according to the specified encoding.
%
%
\parseargdef\documentencoding{%
\parseargdef\documentencoding{%
  % Encoding being declared for the document.
  % Encoding being declared for the document.
  \def\declaredencoding{\csname #1.enc\endcsname}%
  \def\declaredencoding{\csname #1.enc\endcsname}%
  %
  %
  % Supported encodings: names converted to tokens in order to be able
  % Supported encodings: names converted to tokens in order to be able
  % to compare them with \ifx.
  % to compare them with \ifx.
  \def\ascii{\csname US-ASCII.enc\endcsname}%
  \def\ascii{\csname US-ASCII.enc\endcsname}%
  \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  \def\latone{\csname ISO-8859-1.enc\endcsname}%
  \def\latone{\csname ISO-8859-1.enc\endcsname}%
  \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  \def\utfeight{\csname UTF-8.enc\endcsname}%
  \def\utfeight{\csname UTF-8.enc\endcsname}%
  %
  %
  \ifx \declaredencoding \ascii
  \ifx \declaredencoding \ascii
     \asciichardefs
     \asciichardefs
  %
  %
  \else \ifx \declaredencoding \lattwo
  \else \ifx \declaredencoding \lattwo
     \setnonasciicharscatcode\active
     \setnonasciicharscatcode\active
     \lattwochardefs
     \lattwochardefs
  %
  %
  \else \ifx \declaredencoding \latone
  \else \ifx \declaredencoding \latone
     \setnonasciicharscatcode\active
     \setnonasciicharscatcode\active
     \latonechardefs
     \latonechardefs
  %
  %
  \else \ifx \declaredencoding \latnine
  \else \ifx \declaredencoding \latnine
     \setnonasciicharscatcode\active
     \setnonasciicharscatcode\active
     \latninechardefs
     \latninechardefs
  %
  %
  \else \ifx \declaredencoding \utfeight
  \else \ifx \declaredencoding \utfeight
     \setnonasciicharscatcode\active
     \setnonasciicharscatcode\active
     \utfeightchardefs
     \utfeightchardefs
  %
  %
  \else
  \else
    \message{Unknown document encoding #1, ignoring.}%
    \message{Unknown document encoding #1, ignoring.}%
  %
  %
  \fi % utfeight
  \fi % utfeight
  \fi % latnine
  \fi % latnine
  \fi % latone
  \fi % latone
  \fi % lattwo
  \fi % lattwo
  \fi % ascii
  \fi % ascii
}
}
 
 
% A message to be logged when using a character that isn't available
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
% the default font encoding (OT1).
%
%
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
 
 
% Take account of \c (plain) vs. \, (Texinfo) difference.
% Take account of \c (plain) vs. \, (Texinfo) difference.
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
 
 
% First, make active non-ASCII characters in order for them to be
% First, make active non-ASCII characters in order for them to be
% correctly categorized when TeX reads the replacement text of
% correctly categorized when TeX reads the replacement text of
% macros containing the character definitions.
% macros containing the character definitions.
\setnonasciicharscatcode\active
\setnonasciicharscatcode\active
%
%
% Latin1 (ISO-8859-1) character definitions.
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
\def\latonechardefs{%
  \gdef^^a0{~}
  \gdef^^a0{~}
  \gdef^^a1{\exclamdown}
  \gdef^^a1{\exclamdown}
  \gdef^^a2{\missingcharmsg{CENT SIGN}}
  \gdef^^a2{\missingcharmsg{CENT SIGN}}
  \gdef^^a3{{\pounds}}
  \gdef^^a3{{\pounds}}
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  \gdef^^a5{\missingcharmsg{YEN SIGN}}
  \gdef^^a5{\missingcharmsg{YEN SIGN}}
  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  \gdef^^a7{\S}
  \gdef^^a7{\S}
  \gdef^^a8{\"{}}
  \gdef^^a8{\"{}}
  \gdef^^a9{\copyright}
  \gdef^^a9{\copyright}
  \gdef^^aa{\ordf}
  \gdef^^aa{\ordf}
  \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
  \gdef^^ab{\guillemetleft}
  \gdef^^ac{$\lnot$}
  \gdef^^ac{$\lnot$}
  \gdef^^ad{\-}
  \gdef^^ad{\-}
  \gdef^^ae{\registeredsymbol}
  \gdef^^ae{\registeredsymbol}
  \gdef^^af{\={}}
  \gdef^^af{\={}}
  %
  %
  \gdef^^b0{\textdegree}
  \gdef^^b0{\textdegree}
  \gdef^^b1{$\pm$}
  \gdef^^b1{$\pm$}
  \gdef^^b2{$^2$}
  \gdef^^b2{$^2$}
  \gdef^^b3{$^3$}
  \gdef^^b3{$^3$}
  \gdef^^b4{\'{}}
  \gdef^^b4{\'{}}
  \gdef^^b5{$\mu$}
  \gdef^^b5{$\mu$}
  \gdef^^b6{\P}
  \gdef^^b6{\P}
  %
  %
  \gdef^^b7{$^.$}
  \gdef^^b7{$^.$}
  \gdef^^b8{\cedilla\ }
  \gdef^^b8{\cedilla\ }
  \gdef^^b9{$^1$}
  \gdef^^b9{$^1$}
  \gdef^^ba{\ordm}
  \gdef^^ba{\ordm}
  %
  %
  \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}}
  \gdef^^bb{\guilletright}
  \gdef^^bc{$1\over4$}
  \gdef^^bc{$1\over4$}
  \gdef^^bd{$1\over2$}
  \gdef^^bd{$1\over2$}
  \gdef^^be{$3\over4$}
  \gdef^^be{$3\over4$}
  \gdef^^bf{\questiondown}
  \gdef^^bf{\questiondown}
  %
  %
  \gdef^^c0{\`A}
  \gdef^^c0{\`A}
  \gdef^^c1{\'A}
  \gdef^^c1{\'A}
  \gdef^^c2{\^A}
  \gdef^^c2{\^A}
  \gdef^^c3{\~A}
  \gdef^^c3{\~A}
  \gdef^^c4{\"A}
  \gdef^^c4{\"A}
  \gdef^^c5{\ringaccent A}
  \gdef^^c5{\ringaccent A}
  \gdef^^c6{\AE}
  \gdef^^c6{\AE}
  \gdef^^c7{\cedilla C}
  \gdef^^c7{\cedilla C}
  \gdef^^c8{\`E}
  \gdef^^c8{\`E}
  \gdef^^c9{\'E}
  \gdef^^c9{\'E}
  \gdef^^ca{\^E}
  \gdef^^ca{\^E}
  \gdef^^cb{\"E}
  \gdef^^cb{\"E}
  \gdef^^cc{\`I}
  \gdef^^cc{\`I}
  \gdef^^cd{\'I}
  \gdef^^cd{\'I}
  \gdef^^ce{\^I}
  \gdef^^ce{\^I}
  \gdef^^cf{\"I}
  \gdef^^cf{\"I}
  %
  %
  \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}}
  \gdef^^d0{\DH}
  \gdef^^d1{\~N}
  \gdef^^d1{\~N}
  \gdef^^d2{\`O}
  \gdef^^d2{\`O}
  \gdef^^d3{\'O}
  \gdef^^d3{\'O}
  \gdef^^d4{\^O}
  \gdef^^d4{\^O}
  \gdef^^d5{\~O}
  \gdef^^d5{\~O}
  \gdef^^d6{\"O}
  \gdef^^d6{\"O}
  \gdef^^d7{$\times$}
  \gdef^^d7{$\times$}
  \gdef^^d8{\O}
  \gdef^^d8{\O}
  \gdef^^d9{\`U}
  \gdef^^d9{\`U}
  \gdef^^da{\'U}
  \gdef^^da{\'U}
  \gdef^^db{\^U}
  \gdef^^db{\^U}
  \gdef^^dc{\"U}
  \gdef^^dc{\"U}
  \gdef^^dd{\'Y}
  \gdef^^dd{\'Y}
  \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}}
  \gdef^^de{\TH}
  \gdef^^df{\ss}
  \gdef^^df{\ss}
  %
  %
  \gdef^^e0{\`a}
  \gdef^^e0{\`a}
  \gdef^^e1{\'a}
  \gdef^^e1{\'a}
  \gdef^^e2{\^a}
  \gdef^^e2{\^a}
  \gdef^^e3{\~a}
  \gdef^^e3{\~a}
  \gdef^^e4{\"a}
  \gdef^^e4{\"a}
  \gdef^^e5{\ringaccent a}
  \gdef^^e5{\ringaccent a}
  \gdef^^e6{\ae}
  \gdef^^e6{\ae}
  \gdef^^e7{\cedilla c}
  \gdef^^e7{\cedilla c}
  \gdef^^e8{\`e}
  \gdef^^e8{\`e}
  \gdef^^e9{\'e}
  \gdef^^e9{\'e}
  \gdef^^ea{\^e}
  \gdef^^ea{\^e}
  \gdef^^eb{\"e}
  \gdef^^eb{\"e}
  \gdef^^ec{\`{\dotless i}}
  \gdef^^ec{\`{\dotless i}}
  \gdef^^ed{\'{\dotless i}}
  \gdef^^ed{\'{\dotless i}}
  \gdef^^ee{\^{\dotless i}}
  \gdef^^ee{\^{\dotless i}}
  \gdef^^ef{\"{\dotless i}}
  \gdef^^ef{\"{\dotless i}}
  %
  %
  \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}}
  \gdef^^f0{\dh}
  \gdef^^f1{\~n}
  \gdef^^f1{\~n}
  \gdef^^f2{\`o}
  \gdef^^f2{\`o}
  \gdef^^f3{\'o}
  \gdef^^f3{\'o}
  \gdef^^f4{\^o}
  \gdef^^f4{\^o}
  \gdef^^f5{\~o}
  \gdef^^f5{\~o}
  \gdef^^f6{\"o}
  \gdef^^f6{\"o}
  \gdef^^f7{$\div$}
  \gdef^^f7{$\div$}
  \gdef^^f8{\o}
  \gdef^^f8{\o}
  \gdef^^f9{\`u}
  \gdef^^f9{\`u}
  \gdef^^fa{\'u}
  \gdef^^fa{\'u}
  \gdef^^fb{\^u}
  \gdef^^fb{\^u}
  \gdef^^fc{\"u}
  \gdef^^fc{\"u}
  \gdef^^fd{\'y}
  \gdef^^fd{\'y}
  \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}}
  \gdef^^fe{\th}
  \gdef^^ff{\"y}
  \gdef^^ff{\"y}
}
}
 
 
% Latin9 (ISO-8859-15) encoding character definitions.
% Latin9 (ISO-8859-15) encoding character definitions.
\def\latninechardefs{%
\def\latninechardefs{%
  % Encoding is almost identical to Latin1.
  % Encoding is almost identical to Latin1.
  \latonechardefs
  \latonechardefs
  %
  %
  \gdef^^a4{\euro}
  \gdef^^a4{\euro}
  \gdef^^a6{\v S}
  \gdef^^a6{\v S}
  \gdef^^a8{\v s}
  \gdef^^a8{\v s}
  \gdef^^b4{\v Z}
  \gdef^^b4{\v Z}
  \gdef^^b8{\v z}
  \gdef^^b8{\v z}
  \gdef^^bc{\OE}
  \gdef^^bc{\OE}
  \gdef^^bd{\oe}
  \gdef^^bd{\oe}
  \gdef^^be{\"Y}
  \gdef^^be{\"Y}
}
}
 
 
% Latin2 (ISO-8859-2) character definitions.
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
\def\lattwochardefs{%
  \gdef^^a0{~}
  \gdef^^a0{~}
  \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}}
  \gdef^^a1{\ogonek{A}}
  \gdef^^a2{\u{}}
  \gdef^^a2{\u{}}
  \gdef^^a3{\L}
  \gdef^^a3{\L}
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  \gdef^^a5{\v L}
  \gdef^^a5{\v L}
  \gdef^^a6{\'S}
  \gdef^^a6{\'S}
  \gdef^^a7{\S}
  \gdef^^a7{\S}
  \gdef^^a8{\"{}}
  \gdef^^a8{\"{}}
  \gdef^^a9{\v S}
  \gdef^^a9{\v S}
  \gdef^^aa{\cedilla S}
  \gdef^^aa{\cedilla S}
  \gdef^^ab{\v T}
  \gdef^^ab{\v T}
  \gdef^^ac{\'Z}
  \gdef^^ac{\'Z}
  \gdef^^ad{\-}
  \gdef^^ad{\-}
  \gdef^^ae{\v Z}
  \gdef^^ae{\v Z}
  \gdef^^af{\dotaccent Z}
  \gdef^^af{\dotaccent Z}
  %
  %
  \gdef^^b0{\textdegree}
  \gdef^^b0{\textdegree}
  \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}}
  \gdef^^b1{\ogonek{a}}
  \gdef^^b2{\missingcharmsg{OGONEK}}
  \gdef^^b2{\ogonek{ }}
  \gdef^^b3{\l}
  \gdef^^b3{\l}
  \gdef^^b4{\'{}}
  \gdef^^b4{\'{}}
  \gdef^^b5{\v l}
  \gdef^^b5{\v l}
  \gdef^^b6{\'s}
  \gdef^^b6{\'s}
  \gdef^^b7{\v{}}
  \gdef^^b7{\v{}}
  \gdef^^b8{\cedilla\ }
  \gdef^^b8{\cedilla\ }
  \gdef^^b9{\v s}
  \gdef^^b9{\v s}
  \gdef^^ba{\cedilla s}
  \gdef^^ba{\cedilla s}
  \gdef^^bb{\v t}
  \gdef^^bb{\v t}
  \gdef^^bc{\'z}
  \gdef^^bc{\'z}
  \gdef^^bd{\H{}}
  \gdef^^bd{\H{}}
  \gdef^^be{\v z}
  \gdef^^be{\v z}
  \gdef^^bf{\dotaccent z}
  \gdef^^bf{\dotaccent z}
  %
  %
  \gdef^^c0{\'R}
  \gdef^^c0{\'R}
  \gdef^^c1{\'A}
  \gdef^^c1{\'A}
  \gdef^^c2{\^A}
  \gdef^^c2{\^A}
  \gdef^^c3{\u A}
  \gdef^^c3{\u A}
  \gdef^^c4{\"A}
  \gdef^^c4{\"A}
  \gdef^^c5{\'L}
  \gdef^^c5{\'L}
  \gdef^^c6{\'C}
  \gdef^^c6{\'C}
  \gdef^^c7{\cedilla C}
  \gdef^^c7{\cedilla C}
  \gdef^^c8{\v C}
  \gdef^^c8{\v C}
  \gdef^^c9{\'E}
  \gdef^^c9{\'E}
  \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}}
  \gdef^^ca{\ogonek{E}}
  \gdef^^cb{\"E}
  \gdef^^cb{\"E}
  \gdef^^cc{\v E}
  \gdef^^cc{\v E}
  \gdef^^cd{\'I}
  \gdef^^cd{\'I}
  \gdef^^ce{\^I}
  \gdef^^ce{\^I}
  \gdef^^cf{\v D}
  \gdef^^cf{\v D}
  %
  %
  \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}}
  \gdef^^d0{\DH}
  \gdef^^d1{\'N}
  \gdef^^d1{\'N}
  \gdef^^d2{\v N}
  \gdef^^d2{\v N}
  \gdef^^d3{\'O}
  \gdef^^d3{\'O}
  \gdef^^d4{\^O}
  \gdef^^d4{\^O}
  \gdef^^d5{\H O}
  \gdef^^d5{\H O}
  \gdef^^d6{\"O}
  \gdef^^d6{\"O}
  \gdef^^d7{$\times$}
  \gdef^^d7{$\times$}
  \gdef^^d8{\v R}
  \gdef^^d8{\v R}
  \gdef^^d9{\ringaccent U}
  \gdef^^d9{\ringaccent U}
  \gdef^^da{\'U}
  \gdef^^da{\'U}
  \gdef^^db{\H U}
  \gdef^^db{\H U}
  \gdef^^dc{\"U}
  \gdef^^dc{\"U}
  \gdef^^dd{\'Y}
  \gdef^^dd{\'Y}
  \gdef^^de{\cedilla T}
  \gdef^^de{\cedilla T}
  \gdef^^df{\ss}
  \gdef^^df{\ss}
  %
  %
  \gdef^^e0{\'r}
  \gdef^^e0{\'r}
  \gdef^^e1{\'a}
  \gdef^^e1{\'a}
  \gdef^^e2{\^a}
  \gdef^^e2{\^a}
  \gdef^^e3{\u a}
  \gdef^^e3{\u a}
  \gdef^^e4{\"a}
  \gdef^^e4{\"a}
  \gdef^^e5{\'l}
  \gdef^^e5{\'l}
  \gdef^^e6{\'c}
  \gdef^^e6{\'c}
  \gdef^^e7{\cedilla c}
  \gdef^^e7{\cedilla c}
  \gdef^^e8{\v c}
  \gdef^^e8{\v c}
  \gdef^^e9{\'e}
  \gdef^^e9{\'e}
  \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}}
  \gdef^^ea{\ogonek{e}}
  \gdef^^eb{\"e}
  \gdef^^eb{\"e}
  \gdef^^ec{\v e}
  \gdef^^ec{\v e}
  \gdef^^ed{\'\i}
  \gdef^^ed{\'\i}
  \gdef^^ee{\^\i}
  \gdef^^ee{\^\i}
  \gdef^^ef{\v d}
  \gdef^^ef{\v d}
  %
  %
  \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}}
  \gdef^^f0{\dh}
  \gdef^^f1{\'n}
  \gdef^^f1{\'n}
  \gdef^^f2{\v n}
  \gdef^^f2{\v n}
  \gdef^^f3{\'o}
  \gdef^^f3{\'o}
  \gdef^^f4{\^o}
  \gdef^^f4{\^o}
  \gdef^^f5{\H o}
  \gdef^^f5{\H o}
  \gdef^^f6{\"o}
  \gdef^^f6{\"o}
  \gdef^^f7{$\div$}
  \gdef^^f7{$\div$}
  \gdef^^f8{\v r}
  \gdef^^f8{\v r}
  \gdef^^f9{\ringaccent u}
  \gdef^^f9{\ringaccent u}
  \gdef^^fa{\'u}
  \gdef^^fa{\'u}
  \gdef^^fb{\H u}
  \gdef^^fb{\H u}
  \gdef^^fc{\"u}
  \gdef^^fc{\"u}
  \gdef^^fd{\'y}
  \gdef^^fd{\'y}
  \gdef^^fe{\cedilla t}
  \gdef^^fe{\cedilla t}
  \gdef^^ff{\dotaccent{}}
  \gdef^^ff{\dotaccent{}}
}
}
 
 
% UTF-8 character definitions.
% UTF-8 character definitions.
%
%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
% changes for Texinfo conventions.  It is included here under the GPL by
% changes for Texinfo conventions.  It is included here under the GPL by
% permission from Frank Mittelbach and the LaTeX team.
% permission from Frank Mittelbach and the LaTeX team.
%
%
\newcount\countUTFx
\newcount\countUTFx
\newcount\countUTFy
\newcount\countUTFy
\newcount\countUTFz
\newcount\countUTFz
 
 
\gdef\UTFviiiTwoOctets#1#2{\expandafter
\gdef\UTFviiiTwoOctets#1#2{\expandafter
   \UTFviiiDefined\csname u8:#1\string #2\endcsname}
   \UTFviiiDefined\csname u8:#1\string #2\endcsname}
%
%
\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
   \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
   \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
%
%
\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
   \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
   \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
 
 
\gdef\UTFviiiDefined#1{%
\gdef\UTFviiiDefined#1{%
  \ifx #1\relax
  \ifx #1\relax
    \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
    \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  \else
  \else
    \expandafter #1%
    \expandafter #1%
  \fi
  \fi
}
}
 
 
\begingroup
\begingroup
  \catcode`\~13
  \catcode`\~13
  \catcode`\"12
  \catcode`\"12
 
 
  \def\UTFviiiLoop{%
  \def\UTFviiiLoop{%
    \global\catcode\countUTFx\active
    \global\catcode\countUTFx\active
    \uccode`\~\countUTFx
    \uccode`\~\countUTFx
    \uppercase\expandafter{\UTFviiiTmp}%
    \uppercase\expandafter{\UTFviiiTmp}%
    \advance\countUTFx by 1
    \advance\countUTFx by 1
    \ifnum\countUTFx < \countUTFy
    \ifnum\countUTFx < \countUTFy
      \expandafter\UTFviiiLoop
      \expandafter\UTFviiiLoop
    \fi}
    \fi}
 
 
  \countUTFx = "C2
  \countUTFx = "C2
  \countUTFy = "E0
  \countUTFy = "E0
  \def\UTFviiiTmp{%
  \def\UTFviiiTmp{%
    \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
    \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  \UTFviiiLoop
  \UTFviiiLoop
 
 
  \countUTFx = "E0
  \countUTFx = "E0
  \countUTFy = "F0
  \countUTFy = "F0
  \def\UTFviiiTmp{%
  \def\UTFviiiTmp{%
    \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
    \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  \UTFviiiLoop
  \UTFviiiLoop
 
 
  \countUTFx = "F0
  \countUTFx = "F0
  \countUTFy = "F4
  \countUTFy = "F4
  \def\UTFviiiTmp{%
  \def\UTFviiiTmp{%
    \xdef~{\noexpand\UTFviiiFourOctets\string~}}
    \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  \UTFviiiLoop
  \UTFviiiLoop
\endgroup
\endgroup
 
 
\begingroup
\begingroup
  \catcode`\"=12
  \catcode`\"=12
  \catcode`\<=12
  \catcode`\<=12
  \catcode`\.=12
  \catcode`\.=12
  \catcode`\,=12
  \catcode`\,=12
  \catcode`\;=12
  \catcode`\;=12
  \catcode`\!=12
  \catcode`\!=12
  \catcode`\~=13
  \catcode`\~=13
 
 
  \gdef\DeclareUnicodeCharacter#1#2{%
  \gdef\DeclareUnicodeCharacter#1#2{%
    \countUTFz = "#1\relax
    \countUTFz = "#1\relax
    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
    \begingroup
    \begingroup
      \parseXMLCharref
      \parseXMLCharref
      \def\UTFviiiTwoOctets##1##2{%
      \def\UTFviiiTwoOctets##1##2{%
        \csname u8:##1\string ##2\endcsname}%
        \csname u8:##1\string ##2\endcsname}%
      \def\UTFviiiThreeOctets##1##2##3{%
      \def\UTFviiiThreeOctets##1##2##3{%
        \csname u8:##1\string ##2\string ##3\endcsname}%
        \csname u8:##1\string ##2\string ##3\endcsname}%
      \def\UTFviiiFourOctets##1##2##3##4{%
      \def\UTFviiiFourOctets##1##2##3##4{%
        \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
        \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\expandafter
       \expandafter\expandafter\expandafter
       \expandafter\expandafter\expandafter
       \gdef\UTFviiiTmp{#2}%
       \gdef\UTFviiiTmp{#2}%
    \endgroup}
    \endgroup}
 
 
  \gdef\parseXMLCharref{%
  \gdef\parseXMLCharref{%
    \ifnum\countUTFz < "A0\relax
    \ifnum\countUTFz < "A0\relax
      \errhelp = \EMsimple
      \errhelp = \EMsimple
      \errmessage{Cannot define Unicode char value < 00A0}%
      \errmessage{Cannot define Unicode char value < 00A0}%
    \else\ifnum\countUTFz < "800\relax
    \else\ifnum\countUTFz < "800\relax
      \parseUTFviiiA,%
      \parseUTFviiiA,%
      \parseUTFviiiB C\UTFviiiTwoOctets.,%
      \parseUTFviiiB C\UTFviiiTwoOctets.,%
    \else\ifnum\countUTFz < "10000\relax
    \else\ifnum\countUTFz < "10000\relax
      \parseUTFviiiA;%
      \parseUTFviiiA;%
      \parseUTFviiiA,%
      \parseUTFviiiA,%
      \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
      \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
    \else
    \else
      \parseUTFviiiA;%
      \parseUTFviiiA;%
      \parseUTFviiiA,%
      \parseUTFviiiA,%
      \parseUTFviiiA!%
      \parseUTFviiiA!%
      \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
      \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
    \fi\fi\fi
    \fi\fi\fi
  }
  }
 
 
  \gdef\parseUTFviiiA#1{%
  \gdef\parseUTFviiiA#1{%
    \countUTFx = \countUTFz
    \countUTFx = \countUTFz
    \divide\countUTFz by 64
    \divide\countUTFz by 64
    \countUTFy = \countUTFz
    \countUTFy = \countUTFz
    \multiply\countUTFz by 64
    \multiply\countUTFz by 64
    \advance\countUTFx by -\countUTFz
    \advance\countUTFx by -\countUTFz
    \advance\countUTFx by 128
    \advance\countUTFx by 128
    \uccode `#1\countUTFx
    \uccode `#1\countUTFx
    \countUTFz = \countUTFy}
    \countUTFz = \countUTFy}
 
 
  \gdef\parseUTFviiiB#1#2#3#4{%
  \gdef\parseUTFviiiB#1#2#3#4{%
    \advance\countUTFz by "#10\relax
    \advance\countUTFz by "#10\relax
    \uccode `#3\countUTFz
    \uccode `#3\countUTFz
    \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
    \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
\endgroup
\endgroup
 
 
\def\utfeightchardefs{%
\def\utfeightchardefs{%
  \DeclareUnicodeCharacter{00A0}{\tie}
  \DeclareUnicodeCharacter{00A0}{\tie}
  \DeclareUnicodeCharacter{00A1}{\exclamdown}
  \DeclareUnicodeCharacter{00A1}{\exclamdown}
  \DeclareUnicodeCharacter{00A3}{\pounds}
  \DeclareUnicodeCharacter{00A3}{\pounds}
  \DeclareUnicodeCharacter{00A8}{\"{ }}
  \DeclareUnicodeCharacter{00A8}{\"{ }}
  \DeclareUnicodeCharacter{00A9}{\copyright}
  \DeclareUnicodeCharacter{00A9}{\copyright}
  \DeclareUnicodeCharacter{00AA}{\ordf}
  \DeclareUnicodeCharacter{00AA}{\ordf}
  \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  \DeclareUnicodeCharacter{00AD}{\-}
  \DeclareUnicodeCharacter{00AD}{\-}
  \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  \DeclareUnicodeCharacter{00AF}{\={ }}
  \DeclareUnicodeCharacter{00AF}{\={ }}
 
 
  \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  \DeclareUnicodeCharacter{00B4}{\'{ }}
  \DeclareUnicodeCharacter{00B4}{\'{ }}
  \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  \DeclareUnicodeCharacter{00BA}{\ordm}
  \DeclareUnicodeCharacter{00BA}{\ordm}
  \DeclareUnicodeCharacter{00BB}{\guillemetright}
  \DeclareUnicodeCharacter{00BB}{\guillemetright}
  \DeclareUnicodeCharacter{00BF}{\questiondown}
  \DeclareUnicodeCharacter{00BF}{\questiondown}
 
 
  \DeclareUnicodeCharacter{00C0}{\`A}
  \DeclareUnicodeCharacter{00C0}{\`A}
  \DeclareUnicodeCharacter{00C1}{\'A}
  \DeclareUnicodeCharacter{00C1}{\'A}
  \DeclareUnicodeCharacter{00C2}{\^A}
  \DeclareUnicodeCharacter{00C2}{\^A}
  \DeclareUnicodeCharacter{00C3}{\~A}
  \DeclareUnicodeCharacter{00C3}{\~A}
  \DeclareUnicodeCharacter{00C4}{\"A}
  \DeclareUnicodeCharacter{00C4}{\"A}
  \DeclareUnicodeCharacter{00C5}{\AA}
  \DeclareUnicodeCharacter{00C5}{\AA}
  \DeclareUnicodeCharacter{00C6}{\AE}
  \DeclareUnicodeCharacter{00C6}{\AE}
  \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  \DeclareUnicodeCharacter{00C8}{\`E}
  \DeclareUnicodeCharacter{00C8}{\`E}
  \DeclareUnicodeCharacter{00C9}{\'E}
  \DeclareUnicodeCharacter{00C9}{\'E}
  \DeclareUnicodeCharacter{00CA}{\^E}
  \DeclareUnicodeCharacter{00CA}{\^E}
  \DeclareUnicodeCharacter{00CB}{\"E}
  \DeclareUnicodeCharacter{00CB}{\"E}
  \DeclareUnicodeCharacter{00CC}{\`I}
  \DeclareUnicodeCharacter{00CC}{\`I}
  \DeclareUnicodeCharacter{00CD}{\'I}
  \DeclareUnicodeCharacter{00CD}{\'I}
  \DeclareUnicodeCharacter{00CE}{\^I}
  \DeclareUnicodeCharacter{00CE}{\^I}
  \DeclareUnicodeCharacter{00CF}{\"I}
  \DeclareUnicodeCharacter{00CF}{\"I}
 
 
 
  \DeclareUnicodeCharacter{00D0}{\DH}
  \DeclareUnicodeCharacter{00D1}{\~N}
  \DeclareUnicodeCharacter{00D1}{\~N}
  \DeclareUnicodeCharacter{00D2}{\`O}
  \DeclareUnicodeCharacter{00D2}{\`O}
  \DeclareUnicodeCharacter{00D3}{\'O}
  \DeclareUnicodeCharacter{00D3}{\'O}
  \DeclareUnicodeCharacter{00D4}{\^O}
  \DeclareUnicodeCharacter{00D4}{\^O}
  \DeclareUnicodeCharacter{00D5}{\~O}
  \DeclareUnicodeCharacter{00D5}{\~O}
  \DeclareUnicodeCharacter{00D6}{\"O}
  \DeclareUnicodeCharacter{00D6}{\"O}
  \DeclareUnicodeCharacter{00D8}{\O}
  \DeclareUnicodeCharacter{00D8}{\O}
  \DeclareUnicodeCharacter{00D9}{\`U}
  \DeclareUnicodeCharacter{00D9}{\`U}
  \DeclareUnicodeCharacter{00DA}{\'U}
  \DeclareUnicodeCharacter{00DA}{\'U}
  \DeclareUnicodeCharacter{00DB}{\^U}
  \DeclareUnicodeCharacter{00DB}{\^U}
  \DeclareUnicodeCharacter{00DC}{\"U}
  \DeclareUnicodeCharacter{00DC}{\"U}
  \DeclareUnicodeCharacter{00DD}{\'Y}
  \DeclareUnicodeCharacter{00DD}{\'Y}
 
  \DeclareUnicodeCharacter{00DE}{\TH}
  \DeclareUnicodeCharacter{00DF}{\ss}
  \DeclareUnicodeCharacter{00DF}{\ss}
 
 
  \DeclareUnicodeCharacter{00E0}{\`a}
  \DeclareUnicodeCharacter{00E0}{\`a}
  \DeclareUnicodeCharacter{00E1}{\'a}
  \DeclareUnicodeCharacter{00E1}{\'a}
  \DeclareUnicodeCharacter{00E2}{\^a}
  \DeclareUnicodeCharacter{00E2}{\^a}
  \DeclareUnicodeCharacter{00E3}{\~a}
  \DeclareUnicodeCharacter{00E3}{\~a}
  \DeclareUnicodeCharacter{00E4}{\"a}
  \DeclareUnicodeCharacter{00E4}{\"a}
  \DeclareUnicodeCharacter{00E5}{\aa}
  \DeclareUnicodeCharacter{00E5}{\aa}
  \DeclareUnicodeCharacter{00E6}{\ae}
  \DeclareUnicodeCharacter{00E6}{\ae}
  \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  \DeclareUnicodeCharacter{00E8}{\`e}
  \DeclareUnicodeCharacter{00E8}{\`e}
  \DeclareUnicodeCharacter{00E9}{\'e}
  \DeclareUnicodeCharacter{00E9}{\'e}
  \DeclareUnicodeCharacter{00EA}{\^e}
  \DeclareUnicodeCharacter{00EA}{\^e}
  \DeclareUnicodeCharacter{00EB}{\"e}
  \DeclareUnicodeCharacter{00EB}{\"e}
  \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
 
 
 
  \DeclareUnicodeCharacter{00F0}{\dh}
  \DeclareUnicodeCharacter{00F1}{\~n}
  \DeclareUnicodeCharacter{00F1}{\~n}
  \DeclareUnicodeCharacter{00F2}{\`o}
  \DeclareUnicodeCharacter{00F2}{\`o}
  \DeclareUnicodeCharacter{00F3}{\'o}
  \DeclareUnicodeCharacter{00F3}{\'o}
  \DeclareUnicodeCharacter{00F4}{\^o}
  \DeclareUnicodeCharacter{00F4}{\^o}
  \DeclareUnicodeCharacter{00F5}{\~o}
  \DeclareUnicodeCharacter{00F5}{\~o}
  \DeclareUnicodeCharacter{00F6}{\"o}
  \DeclareUnicodeCharacter{00F6}{\"o}
  \DeclareUnicodeCharacter{00F8}{\o}
  \DeclareUnicodeCharacter{00F8}{\o}
  \DeclareUnicodeCharacter{00F9}{\`u}
  \DeclareUnicodeCharacter{00F9}{\`u}
  \DeclareUnicodeCharacter{00FA}{\'u}
  \DeclareUnicodeCharacter{00FA}{\'u}
  \DeclareUnicodeCharacter{00FB}{\^u}
  \DeclareUnicodeCharacter{00FB}{\^u}
  \DeclareUnicodeCharacter{00FC}{\"u}
  \DeclareUnicodeCharacter{00FC}{\"u}
  \DeclareUnicodeCharacter{00FD}{\'y}
  \DeclareUnicodeCharacter{00FD}{\'y}
 
  \DeclareUnicodeCharacter{00FE}{\th}
  \DeclareUnicodeCharacter{00FF}{\"y}
  \DeclareUnicodeCharacter{00FF}{\"y}
 
 
  \DeclareUnicodeCharacter{0100}{\=A}
  \DeclareUnicodeCharacter{0100}{\=A}
  \DeclareUnicodeCharacter{0101}{\=a}
  \DeclareUnicodeCharacter{0101}{\=a}
  \DeclareUnicodeCharacter{0102}{\u{A}}
  \DeclareUnicodeCharacter{0102}{\u{A}}
  \DeclareUnicodeCharacter{0103}{\u{a}}
  \DeclareUnicodeCharacter{0103}{\u{a}}
 
  \DeclareUnicodeCharacter{0104}{\ogonek{A}}
 
  \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  \DeclareUnicodeCharacter{0106}{\'C}
  \DeclareUnicodeCharacter{0106}{\'C}
  \DeclareUnicodeCharacter{0107}{\'c}
  \DeclareUnicodeCharacter{0107}{\'c}
  \DeclareUnicodeCharacter{0108}{\^C}
  \DeclareUnicodeCharacter{0108}{\^C}
  \DeclareUnicodeCharacter{0109}{\^c}
  \DeclareUnicodeCharacter{0109}{\^c}
 
  \DeclareUnicodeCharacter{0118}{\ogonek{E}}
 
  \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  \DeclareUnicodeCharacter{010C}{\v{C}}
  \DeclareUnicodeCharacter{010C}{\v{C}}
  \DeclareUnicodeCharacter{010D}{\v{c}}
  \DeclareUnicodeCharacter{010D}{\v{c}}
  \DeclareUnicodeCharacter{010E}{\v{D}}
  \DeclareUnicodeCharacter{010E}{\v{D}}
 
 
  \DeclareUnicodeCharacter{0112}{\=E}
  \DeclareUnicodeCharacter{0112}{\=E}
  \DeclareUnicodeCharacter{0113}{\=e}
  \DeclareUnicodeCharacter{0113}{\=e}
  \DeclareUnicodeCharacter{0114}{\u{E}}
  \DeclareUnicodeCharacter{0114}{\u{E}}
  \DeclareUnicodeCharacter{0115}{\u{e}}
  \DeclareUnicodeCharacter{0115}{\u{e}}
  \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  \DeclareUnicodeCharacter{011A}{\v{E}}
  \DeclareUnicodeCharacter{011A}{\v{E}}
  \DeclareUnicodeCharacter{011B}{\v{e}}
  \DeclareUnicodeCharacter{011B}{\v{e}}
  \DeclareUnicodeCharacter{011C}{\^G}
  \DeclareUnicodeCharacter{011C}{\^G}
  \DeclareUnicodeCharacter{011D}{\^g}
  \DeclareUnicodeCharacter{011D}{\^g}
  \DeclareUnicodeCharacter{011E}{\u{G}}
  \DeclareUnicodeCharacter{011E}{\u{G}}
  \DeclareUnicodeCharacter{011F}{\u{g}}
  \DeclareUnicodeCharacter{011F}{\u{g}}
 
 
  \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  \DeclareUnicodeCharacter{0124}{\^H}
  \DeclareUnicodeCharacter{0124}{\^H}
  \DeclareUnicodeCharacter{0125}{\^h}
  \DeclareUnicodeCharacter{0125}{\^h}
  \DeclareUnicodeCharacter{0128}{\~I}
  \DeclareUnicodeCharacter{0128}{\~I}
  \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  \DeclareUnicodeCharacter{012A}{\=I}
  \DeclareUnicodeCharacter{012A}{\=I}
  \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  \DeclareUnicodeCharacter{012C}{\u{I}}
  \DeclareUnicodeCharacter{012C}{\u{I}}
  \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
 
 
  \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  \DeclareUnicodeCharacter{0131}{\dotless{i}}
  \DeclareUnicodeCharacter{0131}{\dotless{i}}
  \DeclareUnicodeCharacter{0132}{IJ}
  \DeclareUnicodeCharacter{0132}{IJ}
  \DeclareUnicodeCharacter{0133}{ij}
  \DeclareUnicodeCharacter{0133}{ij}
  \DeclareUnicodeCharacter{0134}{\^J}
  \DeclareUnicodeCharacter{0134}{\^J}
  \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  \DeclareUnicodeCharacter{0139}{\'L}
  \DeclareUnicodeCharacter{0139}{\'L}
  \DeclareUnicodeCharacter{013A}{\'l}
  \DeclareUnicodeCharacter{013A}{\'l}
 
 
  \DeclareUnicodeCharacter{0141}{\L}
  \DeclareUnicodeCharacter{0141}{\L}
  \DeclareUnicodeCharacter{0142}{\l}
  \DeclareUnicodeCharacter{0142}{\l}
  \DeclareUnicodeCharacter{0143}{\'N}
  \DeclareUnicodeCharacter{0143}{\'N}
  \DeclareUnicodeCharacter{0144}{\'n}
  \DeclareUnicodeCharacter{0144}{\'n}
  \DeclareUnicodeCharacter{0147}{\v{N}}
  \DeclareUnicodeCharacter{0147}{\v{N}}
  \DeclareUnicodeCharacter{0148}{\v{n}}
  \DeclareUnicodeCharacter{0148}{\v{n}}
  \DeclareUnicodeCharacter{014C}{\=O}
  \DeclareUnicodeCharacter{014C}{\=O}
  \DeclareUnicodeCharacter{014D}{\=o}
  \DeclareUnicodeCharacter{014D}{\=o}
  \DeclareUnicodeCharacter{014E}{\u{O}}
  \DeclareUnicodeCharacter{014E}{\u{O}}
  \DeclareUnicodeCharacter{014F}{\u{o}}
  \DeclareUnicodeCharacter{014F}{\u{o}}
 
 
  \DeclareUnicodeCharacter{0150}{\H{O}}
  \DeclareUnicodeCharacter{0150}{\H{O}}
  \DeclareUnicodeCharacter{0151}{\H{o}}
  \DeclareUnicodeCharacter{0151}{\H{o}}
  \DeclareUnicodeCharacter{0152}{\OE}
  \DeclareUnicodeCharacter{0152}{\OE}
  \DeclareUnicodeCharacter{0153}{\oe}
  \DeclareUnicodeCharacter{0153}{\oe}
  \DeclareUnicodeCharacter{0154}{\'R}
  \DeclareUnicodeCharacter{0154}{\'R}
  \DeclareUnicodeCharacter{0155}{\'r}
  \DeclareUnicodeCharacter{0155}{\'r}
  \DeclareUnicodeCharacter{0158}{\v{R}}
  \DeclareUnicodeCharacter{0158}{\v{R}}
  \DeclareUnicodeCharacter{0159}{\v{r}}
  \DeclareUnicodeCharacter{0159}{\v{r}}
  \DeclareUnicodeCharacter{015A}{\'S}
  \DeclareUnicodeCharacter{015A}{\'S}
  \DeclareUnicodeCharacter{015B}{\'s}
  \DeclareUnicodeCharacter{015B}{\'s}
  \DeclareUnicodeCharacter{015C}{\^S}
  \DeclareUnicodeCharacter{015C}{\^S}
  \DeclareUnicodeCharacter{015D}{\^s}
  \DeclareUnicodeCharacter{015D}{\^s}
  \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  \DeclareUnicodeCharacter{015F}{\cedilla{s}}
 
 
  \DeclareUnicodeCharacter{0160}{\v{S}}
  \DeclareUnicodeCharacter{0160}{\v{S}}
  \DeclareUnicodeCharacter{0161}{\v{s}}
  \DeclareUnicodeCharacter{0161}{\v{s}}
  \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  \DeclareUnicodeCharacter{0164}{\v{T}}
  \DeclareUnicodeCharacter{0164}{\v{T}}
 
 
  \DeclareUnicodeCharacter{0168}{\~U}
  \DeclareUnicodeCharacter{0168}{\~U}
  \DeclareUnicodeCharacter{0169}{\~u}
  \DeclareUnicodeCharacter{0169}{\~u}
  \DeclareUnicodeCharacter{016A}{\=U}
  \DeclareUnicodeCharacter{016A}{\=U}
  \DeclareUnicodeCharacter{016B}{\=u}
  \DeclareUnicodeCharacter{016B}{\=u}
  \DeclareUnicodeCharacter{016C}{\u{U}}
  \DeclareUnicodeCharacter{016C}{\u{U}}
  \DeclareUnicodeCharacter{016D}{\u{u}}
  \DeclareUnicodeCharacter{016D}{\u{u}}
  \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
 
 
  \DeclareUnicodeCharacter{0170}{\H{U}}
  \DeclareUnicodeCharacter{0170}{\H{U}}
  \DeclareUnicodeCharacter{0171}{\H{u}}
  \DeclareUnicodeCharacter{0171}{\H{u}}
  \DeclareUnicodeCharacter{0174}{\^W}
  \DeclareUnicodeCharacter{0174}{\^W}
  \DeclareUnicodeCharacter{0175}{\^w}
  \DeclareUnicodeCharacter{0175}{\^w}
  \DeclareUnicodeCharacter{0176}{\^Y}
  \DeclareUnicodeCharacter{0176}{\^Y}
  \DeclareUnicodeCharacter{0177}{\^y}
  \DeclareUnicodeCharacter{0177}{\^y}
  \DeclareUnicodeCharacter{0178}{\"Y}
  \DeclareUnicodeCharacter{0178}{\"Y}
  \DeclareUnicodeCharacter{0179}{\'Z}
  \DeclareUnicodeCharacter{0179}{\'Z}
  \DeclareUnicodeCharacter{017A}{\'z}
  \DeclareUnicodeCharacter{017A}{\'z}
  \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  \DeclareUnicodeCharacter{017D}{\v{Z}}
  \DeclareUnicodeCharacter{017D}{\v{Z}}
  \DeclareUnicodeCharacter{017E}{\v{z}}
  \DeclareUnicodeCharacter{017E}{\v{z}}
 
 
  \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  \DeclareUnicodeCharacter{01C5}{D\v{z}}
  \DeclareUnicodeCharacter{01C5}{D\v{z}}
  \DeclareUnicodeCharacter{01C6}{d\v{z}}
  \DeclareUnicodeCharacter{01C6}{d\v{z}}
  \DeclareUnicodeCharacter{01C7}{LJ}
  \DeclareUnicodeCharacter{01C7}{LJ}
  \DeclareUnicodeCharacter{01C8}{Lj}
  \DeclareUnicodeCharacter{01C8}{Lj}
  \DeclareUnicodeCharacter{01C9}{lj}
  \DeclareUnicodeCharacter{01C9}{lj}
  \DeclareUnicodeCharacter{01CA}{NJ}
  \DeclareUnicodeCharacter{01CA}{NJ}
  \DeclareUnicodeCharacter{01CB}{Nj}
  \DeclareUnicodeCharacter{01CB}{Nj}
  \DeclareUnicodeCharacter{01CC}{nj}
  \DeclareUnicodeCharacter{01CC}{nj}
  \DeclareUnicodeCharacter{01CD}{\v{A}}
  \DeclareUnicodeCharacter{01CD}{\v{A}}
  \DeclareUnicodeCharacter{01CE}{\v{a}}
  \DeclareUnicodeCharacter{01CE}{\v{a}}
  \DeclareUnicodeCharacter{01CF}{\v{I}}
  \DeclareUnicodeCharacter{01CF}{\v{I}}
 
 
  \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  \DeclareUnicodeCharacter{01D1}{\v{O}}
  \DeclareUnicodeCharacter{01D1}{\v{O}}
  \DeclareUnicodeCharacter{01D2}{\v{o}}
  \DeclareUnicodeCharacter{01D2}{\v{o}}
  \DeclareUnicodeCharacter{01D3}{\v{U}}
  \DeclareUnicodeCharacter{01D3}{\v{U}}
  \DeclareUnicodeCharacter{01D4}{\v{u}}
  \DeclareUnicodeCharacter{01D4}{\v{u}}
 
 
  \DeclareUnicodeCharacter{01E2}{\={\AE}}
  \DeclareUnicodeCharacter{01E2}{\={\AE}}
  \DeclareUnicodeCharacter{01E3}{\={\ae}}
  \DeclareUnicodeCharacter{01E3}{\={\ae}}
  \DeclareUnicodeCharacter{01E6}{\v{G}}
  \DeclareUnicodeCharacter{01E6}{\v{G}}
  \DeclareUnicodeCharacter{01E7}{\v{g}}
  \DeclareUnicodeCharacter{01E7}{\v{g}}
  \DeclareUnicodeCharacter{01E8}{\v{K}}
  \DeclareUnicodeCharacter{01E8}{\v{K}}
  \DeclareUnicodeCharacter{01E9}{\v{k}}
  \DeclareUnicodeCharacter{01E9}{\v{k}}
 
 
  \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  \DeclareUnicodeCharacter{01F1}{DZ}
  \DeclareUnicodeCharacter{01F1}{DZ}
  \DeclareUnicodeCharacter{01F2}{Dz}
  \DeclareUnicodeCharacter{01F2}{Dz}
  \DeclareUnicodeCharacter{01F3}{dz}
  \DeclareUnicodeCharacter{01F3}{dz}
  \DeclareUnicodeCharacter{01F4}{\'G}
  \DeclareUnicodeCharacter{01F4}{\'G}
  \DeclareUnicodeCharacter{01F5}{\'g}
  \DeclareUnicodeCharacter{01F5}{\'g}
  \DeclareUnicodeCharacter{01F8}{\`N}
  \DeclareUnicodeCharacter{01F8}{\`N}
  \DeclareUnicodeCharacter{01F9}{\`n}
  \DeclareUnicodeCharacter{01F9}{\`n}
  \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  \DeclareUnicodeCharacter{01FE}{\'{\O}}
  \DeclareUnicodeCharacter{01FE}{\'{\O}}
  \DeclareUnicodeCharacter{01FF}{\'{\o}}
  \DeclareUnicodeCharacter{01FF}{\'{\o}}
 
 
  \DeclareUnicodeCharacter{021E}{\v{H}}
  \DeclareUnicodeCharacter{021E}{\v{H}}
  \DeclareUnicodeCharacter{021F}{\v{h}}
  \DeclareUnicodeCharacter{021F}{\v{h}}
 
 
  \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
 
 
  \DeclareUnicodeCharacter{0232}{\=Y}
  \DeclareUnicodeCharacter{0232}{\=Y}
  \DeclareUnicodeCharacter{0233}{\=y}
  \DeclareUnicodeCharacter{0233}{\=y}
  \DeclareUnicodeCharacter{0237}{\dotless{j}}
  \DeclareUnicodeCharacter{0237}{\dotless{j}}
 
 
 
  \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
 
 
  \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
 
 
  \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
 
 
  \DeclareUnicodeCharacter{1E20}{\=G}
  \DeclareUnicodeCharacter{1E20}{\=G}
  \DeclareUnicodeCharacter{1E21}{\=g}
  \DeclareUnicodeCharacter{1E21}{\=g}
  \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  \DeclareUnicodeCharacter{1E26}{\"H}
  \DeclareUnicodeCharacter{1E26}{\"H}
  \DeclareUnicodeCharacter{1E27}{\"h}
  \DeclareUnicodeCharacter{1E27}{\"h}
 
 
  \DeclareUnicodeCharacter{1E30}{\'K}
  \DeclareUnicodeCharacter{1E30}{\'K}
  \DeclareUnicodeCharacter{1E31}{\'k}
  \DeclareUnicodeCharacter{1E31}{\'k}
  \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  \DeclareUnicodeCharacter{1E3E}{\'M}
  \DeclareUnicodeCharacter{1E3E}{\'M}
  \DeclareUnicodeCharacter{1E3F}{\'m}
  \DeclareUnicodeCharacter{1E3F}{\'m}
 
 
  \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
 
 
  \DeclareUnicodeCharacter{1E54}{\'P}
  \DeclareUnicodeCharacter{1E54}{\'P}
  \DeclareUnicodeCharacter{1E55}{\'p}
  \DeclareUnicodeCharacter{1E55}{\'p}
  \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
 
 
  \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
 
 
  \DeclareUnicodeCharacter{1E7C}{\~V}
  \DeclareUnicodeCharacter{1E7C}{\~V}
  \DeclareUnicodeCharacter{1E7D}{\~v}
  \DeclareUnicodeCharacter{1E7D}{\~v}
  \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
 
 
  \DeclareUnicodeCharacter{1E80}{\`W}
  \DeclareUnicodeCharacter{1E80}{\`W}
  \DeclareUnicodeCharacter{1E81}{\`w}
  \DeclareUnicodeCharacter{1E81}{\`w}
  \DeclareUnicodeCharacter{1E82}{\'W}
  \DeclareUnicodeCharacter{1E82}{\'W}
  \DeclareUnicodeCharacter{1E83}{\'w}
  \DeclareUnicodeCharacter{1E83}{\'w}
  \DeclareUnicodeCharacter{1E84}{\"W}
  \DeclareUnicodeCharacter{1E84}{\"W}
  \DeclareUnicodeCharacter{1E85}{\"w}
  \DeclareUnicodeCharacter{1E85}{\"w}
  \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  \DeclareUnicodeCharacter{1E8C}{\"X}
  \DeclareUnicodeCharacter{1E8C}{\"X}
  \DeclareUnicodeCharacter{1E8D}{\"x}
  \DeclareUnicodeCharacter{1E8D}{\"x}
  \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
 
 
  \DeclareUnicodeCharacter{1E90}{\^Z}
  \DeclareUnicodeCharacter{1E90}{\^Z}
  \DeclareUnicodeCharacter{1E91}{\^z}
  \DeclareUnicodeCharacter{1E91}{\^z}
  \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  \DeclareUnicodeCharacter{1E97}{\"t}
  \DeclareUnicodeCharacter{1E97}{\"t}
  \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
 
 
  \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
 
 
  \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  \DeclareUnicodeCharacter{1EBC}{\~E}
  \DeclareUnicodeCharacter{1EBC}{\~E}
  \DeclareUnicodeCharacter{1EBD}{\~e}
  \DeclareUnicodeCharacter{1EBD}{\~e}
 
 
  \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
 
 
  \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
 
 
  \DeclareUnicodeCharacter{1EF2}{\`Y}
  \DeclareUnicodeCharacter{1EF2}{\`Y}
  \DeclareUnicodeCharacter{1EF3}{\`y}
  \DeclareUnicodeCharacter{1EF3}{\`y}
  \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
 
 
  \DeclareUnicodeCharacter{1EF8}{\~Y}
  \DeclareUnicodeCharacter{1EF8}{\~Y}
  \DeclareUnicodeCharacter{1EF9}{\~y}
  \DeclareUnicodeCharacter{1EF9}{\~y}
 
 
  \DeclareUnicodeCharacter{2013}{--}
  \DeclareUnicodeCharacter{2013}{--}
  \DeclareUnicodeCharacter{2014}{---}
  \DeclareUnicodeCharacter{2014}{---}
  \DeclareUnicodeCharacter{2018}{\quoteleft}
  \DeclareUnicodeCharacter{2018}{\quoteleft}
  \DeclareUnicodeCharacter{2019}{\quoteright}
  \DeclareUnicodeCharacter{2019}{\quoteright}
  \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  \DeclareUnicodeCharacter{201C}{\quotedblleft}
  \DeclareUnicodeCharacter{201C}{\quotedblleft}
  \DeclareUnicodeCharacter{201D}{\quotedblright}
  \DeclareUnicodeCharacter{201D}{\quotedblright}
  \DeclareUnicodeCharacter{201E}{\quotedblbase}
  \DeclareUnicodeCharacter{201E}{\quotedblbase}
  \DeclareUnicodeCharacter{2022}{\bullet}
  \DeclareUnicodeCharacter{2022}{\bullet}
  \DeclareUnicodeCharacter{2026}{\dots}
  \DeclareUnicodeCharacter{2026}{\dots}
  \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  \DeclareUnicodeCharacter{203A}{\guilsinglright}
  \DeclareUnicodeCharacter{203A}{\guilsinglright}
  \DeclareUnicodeCharacter{20AC}{\euro}
  \DeclareUnicodeCharacter{20AC}{\euro}
 
 
  \DeclareUnicodeCharacter{2192}{\expansion}
  \DeclareUnicodeCharacter{2192}{\expansion}
  \DeclareUnicodeCharacter{21D2}{\result}
  \DeclareUnicodeCharacter{21D2}{\result}
 
 
  \DeclareUnicodeCharacter{2212}{\minus}
  \DeclareUnicodeCharacter{2212}{\minus}
  \DeclareUnicodeCharacter{2217}{\point}
  \DeclareUnicodeCharacter{2217}{\point}
  \DeclareUnicodeCharacter{2261}{\equiv}
  \DeclareUnicodeCharacter{2261}{\equiv}
}% end of \utfeightchardefs
}% end of \utfeightchardefs
 
 
 
 
% US-ASCII character definitions.
% US-ASCII character definitions.
\def\asciichardefs{% nothing need be done
\def\asciichardefs{% nothing need be done
   \relax
   \relax
}
}
 
 
% Make non-ASCII characters printable again for compatibility with
% Make non-ASCII characters printable again for compatibility with
% existing Texinfo documents that may use them, even without declaring a
% existing Texinfo documents that may use them, even without declaring a
% document encoding.
% document encoding.
%
%
\setnonasciicharscatcode \other
\setnonasciicharscatcode \other
 
 
 
 
\message{formatting,}
\message{formatting,}
 
 
\newdimen\defaultparindent \defaultparindent = 15pt
\newdimen\defaultparindent \defaultparindent = 15pt
 
 
\chapheadingskip = 15pt plus 4pt minus 2pt
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
 
 
% Prevent underfull vbox error messages.
% Prevent underfull vbox error messages.
\vbadness = 10000
\vbadness = 10000
 
 
% Don't be so finicky about underfull hboxes, either.
% Don't be so finicky about underfull hboxes, either.
\hbadness = 2000
\hbadness = 2000
 
 
% Following George Bush, get rid of widows and orphans.
% Following George Bush, get rid of widows and orphans.
\widowpenalty=10000
\widowpenalty=10000
\clubpenalty=10000
\clubpenalty=10000
 
 
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything.  We want the amount of
% using an old version of TeX, don't do anything.  We want the amount of
% stretch added to depend on the line length, hence the dependence on
% stretch added to depend on the line length, hence the dependence on
% \hsize.  We call this whenever the paper size is set.
% \hsize.  We call this whenever the paper size is set.
%
%
\def\setemergencystretch{%
\def\setemergencystretch{%
  \ifx\emergencystretch\thisisundefined
  \ifx\emergencystretch\thisisundefined
    % Allow us to assign to \emergencystretch anyway.
    % Allow us to assign to \emergencystretch anyway.
    \def\emergencystretch{\dimen0}%
    \def\emergencystretch{\dimen0}%
  \else
  \else
    \emergencystretch = .15\hsize
    \emergencystretch = .15\hsize
  \fi
  \fi
}
}
 
 
% Parameters in order: 1) textheight; 2) textwidth;
% Parameters in order: 1) textheight; 2) textwidth;
% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
% 7) physical page height; 8) physical page width.
% 7) physical page height; 8) physical page width.
%
%
% We also call \setleading{\textleading}, so the caller should define
% We also call \setleading{\textleading}, so the caller should define
% \textleading.  The caller should also set \parskip.
% \textleading.  The caller should also set \parskip.
%
%
\def\internalpagesizes#1#2#3#4#5#6#7#8{%
\def\internalpagesizes#1#2#3#4#5#6#7#8{%
  \voffset = #3\relax
  \voffset = #3\relax
  \topskip = #6\relax
  \topskip = #6\relax
  \splittopskip = \topskip
  \splittopskip = \topskip
  %
  %
  \vsize = #1\relax
  \vsize = #1\relax
  \advance\vsize by \topskip
  \advance\vsize by \topskip
  \outervsize = \vsize
  \outervsize = \vsize
  \advance\outervsize by 2\topandbottommargin
  \advance\outervsize by 2\topandbottommargin
  \pageheight = \vsize
  \pageheight = \vsize
  %
  %
  \hsize = #2\relax
  \hsize = #2\relax
  \outerhsize = \hsize
  \outerhsize = \hsize
  \advance\outerhsize by 0.5in
  \advance\outerhsize by 0.5in
  \pagewidth = \hsize
  \pagewidth = \hsize
  %
  %
  \normaloffset = #4\relax
  \normaloffset = #4\relax
  \bindingoffset = #5\relax
  \bindingoffset = #5\relax
  %
  %
  \ifpdf
  \ifpdf
    \pdfpageheight #7\relax
    \pdfpageheight #7\relax
    \pdfpagewidth #8\relax
    \pdfpagewidth #8\relax
    % if we don't reset these, they will remain at "1 true in" of
    % if we don't reset these, they will remain at "1 true in" of
    % whatever layout pdftex was dumped with.
    % whatever layout pdftex was dumped with.
    \pdfhorigin = 1 true in
    \pdfhorigin = 1 true in
    \pdfvorigin = 1 true in
    \pdfvorigin = 1 true in
  \fi
  \fi
  %
  %
  \setleading{\textleading}
  \setleading{\textleading}
  %
  %
  \parindent = \defaultparindent
  \parindent = \defaultparindent
  \setemergencystretch
  \setemergencystretch
}
}
 
 
% @letterpaper (the default).
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\def\letterpaper{{\globaldefs = 1
  \parskip = 3pt plus 2pt minus 1pt
  \parskip = 3pt plus 2pt minus 1pt
  \textleading = 13.2pt
  \textleading = 13.2pt
  %
  %
  % If page is nothing but text, make it come out even.
  % If page is nothing but text, make it come out even.
  \internalpagesizes{607.2pt}{6in}% that's 46 lines
  \internalpagesizes{607.2pt}{6in}% that's 46 lines
                    {\voffset}{.25in}%
                    {\voffset}{.25in}%
                    {\bindingoffset}{36pt}%
                    {\bindingoffset}{36pt}%
                    {11in}{8.5in}%
                    {11in}{8.5in}%
}}
}}
 
 
% Use @smallbook to reset parameters for 7x9.25 trim size.
% Use @smallbook to reset parameters for 7x9.25 trim size.
\def\smallbook{{\globaldefs = 1
\def\smallbook{{\globaldefs = 1
  \parskip = 2pt plus 1pt
  \parskip = 2pt plus 1pt
  \textleading = 12pt
  \textleading = 12pt
  %
  %
  \internalpagesizes{7.5in}{5in}%
  \internalpagesizes{7.5in}{5in}%
                    {-.2in}{0in}%
                    {-.2in}{0in}%
                    {\bindingoffset}{16pt}%
                    {\bindingoffset}{16pt}%
                    {9.25in}{7in}%
                    {9.25in}{7in}%
  %
  %
  \lispnarrowing = 0.3in
  \lispnarrowing = 0.3in
  \tolerance = 700
  \tolerance = 700
  \hfuzz = 1pt
  \hfuzz = 1pt
  \contentsrightmargin = 0pt
  \contentsrightmargin = 0pt
  \defbodyindent = .5cm
  \defbodyindent = .5cm
}}
}}
 
 
% Use @smallerbook to reset parameters for 6x9 trim size.
% Use @smallerbook to reset parameters for 6x9 trim size.
% (Just testing, parameters still in flux.)
% (Just testing, parameters still in flux.)
\def\smallerbook{{\globaldefs = 1
\def\smallerbook{{\globaldefs = 1
  \parskip = 1.5pt plus 1pt
  \parskip = 1.5pt plus 1pt
  \textleading = 12pt
  \textleading = 12pt
  %
  %
  \internalpagesizes{7.4in}{4.8in}%
  \internalpagesizes{7.4in}{4.8in}%
                    {-.2in}{-.4in}%
                    {-.2in}{-.4in}%
                    {0pt}{14pt}%
                    {0pt}{14pt}%
                    {9in}{6in}%
                    {9in}{6in}%
  %
  %
  \lispnarrowing = 0.25in
  \lispnarrowing = 0.25in
  \tolerance = 700
  \tolerance = 700
  \hfuzz = 1pt
  \hfuzz = 1pt
  \contentsrightmargin = 0pt
  \contentsrightmargin = 0pt
  \defbodyindent = .4cm
  \defbodyindent = .4cm
}}
}}
 
 
% Use @afourpaper to print on European A4 paper.
% Use @afourpaper to print on European A4 paper.
\def\afourpaper{{\globaldefs = 1
\def\afourpaper{{\globaldefs = 1
  \parskip = 3pt plus 2pt minus 1pt
  \parskip = 3pt plus 2pt minus 1pt
  \textleading = 13.2pt
  \textleading = 13.2pt
  %
  %
  % Double-side printing via postscript on Laserjet 4050
  % Double-side printing via postscript on Laserjet 4050
  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  % To change the settings for a different printer or situation, adjust
  % To change the settings for a different printer or situation, adjust
  % \normaloffset until the front-side and back-side texts align.  Then
  % \normaloffset until the front-side and back-side texts align.  Then
  % do the same for \bindingoffset.  You can set these for testing in
  % do the same for \bindingoffset.  You can set these for testing in
  % your texinfo source file like this:
  % your texinfo source file like this:
  % @tex
  % @tex
  % \global\normaloffset = -6mm
  % \global\normaloffset = -6mm
  % \global\bindingoffset = 10mm
  % \global\bindingoffset = 10mm
  % @end tex
  % @end tex
  \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  \internalpagesizes{673.2pt}{160mm}% that's 51 lines
                    {\voffset}{\hoffset}%
                    {\voffset}{\hoffset}%
                    {\bindingoffset}{44pt}%
                    {\bindingoffset}{44pt}%
                    {297mm}{210mm}%
                    {297mm}{210mm}%
  %
  %
  \tolerance = 700
  \tolerance = 700
  \hfuzz = 1pt
  \hfuzz = 1pt
  \contentsrightmargin = 0pt
  \contentsrightmargin = 0pt
  \defbodyindent = 5mm
  \defbodyindent = 5mm
}}
}}
 
 
% Use @afivepaper to print on European A5 paper.
% Use @afivepaper to print on European A5 paper.
% From romildo@urano.iceb.ufop.br, 2 July 2000.
% From romildo@urano.iceb.ufop.br, 2 July 2000.
% He also recommends making @example and @lisp be small.
% He also recommends making @example and @lisp be small.
\def\afivepaper{{\globaldefs = 1
\def\afivepaper{{\globaldefs = 1
  \parskip = 2pt plus 1pt minus 0.1pt
  \parskip = 2pt plus 1pt minus 0.1pt
  \textleading = 12.5pt
  \textleading = 12.5pt
  %
  %
  \internalpagesizes{160mm}{120mm}%
  \internalpagesizes{160mm}{120mm}%
                    {\voffset}{\hoffset}%
                    {\voffset}{\hoffset}%
                    {\bindingoffset}{8pt}%
                    {\bindingoffset}{8pt}%
                    {210mm}{148mm}%
                    {210mm}{148mm}%
  %
  %
  \lispnarrowing = 0.2in
  \lispnarrowing = 0.2in
  \tolerance = 800
  \tolerance = 800
  \hfuzz = 1.2pt
  \hfuzz = 1.2pt
  \contentsrightmargin = 0pt
  \contentsrightmargin = 0pt
  \defbodyindent = 2mm
  \defbodyindent = 2mm
  \tableindent = 12mm
  \tableindent = 12mm
}}
}}
 
 
% A specific text layout, 24x15cm overall, intended for A4 paper.
% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
\def\afourlatex{{\globaldefs = 1
  \afourpaper
  \afourpaper
  \internalpagesizes{237mm}{150mm}%
  \internalpagesizes{237mm}{150mm}%
                    {\voffset}{4.6mm}%
                    {\voffset}{4.6mm}%
                    {\bindingoffset}{7mm}%
                    {\bindingoffset}{7mm}%
                    {297mm}{210mm}%
                    {297mm}{210mm}%
  %
  %
  % Must explicitly reset to 0 because we call \afourpaper.
  % Must explicitly reset to 0 because we call \afourpaper.
  \globaldefs = 0
  \globaldefs = 0
}}
}}
 
 
% Use @afourwide to print on A4 paper in landscape format.
% Use @afourwide to print on A4 paper in landscape format.
\def\afourwide{{\globaldefs = 1
\def\afourwide{{\globaldefs = 1
  \afourpaper
  \afourpaper
  \internalpagesizes{241mm}{165mm}%
  \internalpagesizes{241mm}{165mm}%
                    {\voffset}{-2.95mm}%
                    {\voffset}{-2.95mm}%
                    {\bindingoffset}{7mm}%
                    {\bindingoffset}{7mm}%
                    {297mm}{210mm}%
                    {297mm}{210mm}%
  \globaldefs = 0
  \globaldefs = 0
}}
}}
 
 
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
% Perhaps we should allow setting the margins, \topskip, \parskip,
% Perhaps we should allow setting the margins, \topskip, \parskip,
% and/or leading, also. Or perhaps we should compute them somehow.
% and/or leading, also. Or perhaps we should compute them somehow.
%
%
\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
\def\pagesizesyyy#1,#2,#3\finish{{%
\def\pagesizesyyy#1,#2,#3\finish{{%
  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  \globaldefs = 1
  \globaldefs = 1
  %
  %
  \parskip = 3pt plus 2pt minus 1pt
  \parskip = 3pt plus 2pt minus 1pt
  \setleading{\textleading}%
  \setleading{\textleading}%
  %
  %
  \dimen0 = #1\relax
  \dimen0 = #1\relax
  \advance\dimen0 by \voffset
  \advance\dimen0 by \voffset
  %
  %
  \dimen2 = \hsize
  \dimen2 = \hsize
  \advance\dimen2 by \normaloffset
  \advance\dimen2 by \normaloffset
  %
  %
  \internalpagesizes{#1}{\hsize}%
  \internalpagesizes{#1}{\hsize}%
                    {\voffset}{\normaloffset}%
                    {\voffset}{\normaloffset}%
                    {\bindingoffset}{44pt}%
                    {\bindingoffset}{44pt}%
                    {\dimen0}{\dimen2}%
                    {\dimen0}{\dimen2}%
}}
}}
 
 
% Set default to letter.
% Set default to letter.
%
%
\letterpaper
\letterpaper
 
 
 
 
\message{and turning on texinfo input format.}
\message{and turning on texinfo input format.}
 
 
 
% DEL is a comment character, in case @c does not suffice.
 
\catcode`\^^? = 14
 
 
% Define macros to output various characters with catcode for normal text.
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
\catcode`\"=\other
\catcode`\~=\other
\catcode`\~=\other
\catcode`\^=\other
\catcode`\^=\other
\catcode`\_=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\|=\other
\catcode`\<=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\>=\other
\catcode`\+=\other
\catcode`\+=\other
\catcode`\$=\other
\catcode`\$=\other
\def\normaldoublequote{"}
\def\normaldoublequote{"}
\def\normaltilde{~}
\def\normaltilde{~}
\def\normalcaret{^}
\def\normalcaret{^}
\def\normalunderscore{_}
\def\normalunderscore{_}
\def\normalverticalbar{|}
\def\normalverticalbar{|}
\def\normalless{<}
\def\normalless{<}
\def\normalgreater{>}
\def\normalgreater{>}
\def\normalplus{+}
\def\normalplus{+}
\def\normaldollar{$}%$ font-lock fix
\def\normaldollar{$}%$ font-lock fix
 
 
% This macro is used to make a character print one way in \tt
% This macro is used to make a character print one way in \tt
% (where it can probably be output as-is), and another way in other fonts,
% (where it can probably be output as-is), and another way in other fonts,
% where something hairier probably needs to be done.
% where something hairier probably needs to be done.
%
%
% #1 is what to print if we are indeed using \tt; #2 is what to print
% #1 is what to print if we are indeed using \tt; #2 is what to print
% otherwise.  Since all the Computer Modern typewriter fonts have zero
% otherwise.  Since all the Computer Modern typewriter fonts have zero
% interword stretch (and shrink), and it is reasonable to expect all
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
% typewriter fonts to have this, we can check that font parameter.
%
%
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
 
 
% Same as above, but check for italic font.  Actually this also catches
% Same as above, but check for italic font.  Actually this also catches
% non-italic slanted fonts since it is impossible to distinguish them from
% non-italic slanted fonts since it is impossible to distinguish them from
% italic fonts.  But since this is only used by $ and it uses \sl anyway
% italic fonts.  But since this is only used by $ and it uses \sl anyway
% this is not a problem.
% this is not a problem.
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
 
 
% Turn off all special characters except @
% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
% (and those which the user can use as if they were ordinary).
% Most of these we simply print from the \tt font, but for some, we can
% Most of these we simply print from the \tt font, but for some, we can
% use math or other variants that look better in normal text.
% use math or other variants that look better in normal text.
 
 
\catcode`\"=\active
\catcode`\"=\active
\def\activedoublequote{{\tt\char34}}
\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\let"=\activedoublequote
\catcode`\~=\active
\catcode`\~=\active
\def~{{\tt\char126}}
\def~{{\tt\char126}}
\chardef\hat=`\^
\chardef\hat=`\^
\catcode`\^=\active
\catcode`\^=\active
\def^{{\tt \hat}}
\def^{{\tt \hat}}
 
 
\catcode`\_=\active
\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
\def_{\ifusingtt\normalunderscore\_}
\let\realunder=_
\let\realunder=_
% Subroutine for the previous macro.
% Subroutine for the previous macro.
\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
 
 
\catcode`\|=\active
\catcode`\|=\active
\def|{{\tt\char124}}
\def|{{\tt\char124}}
\chardef \less=`\<
\chardef \less=`\<
\catcode`\<=\active
\catcode`\<=\active
\def<{{\tt \less}}
\def<{{\tt \less}}
\chardef \gtr=`\>
\chardef \gtr=`\>
\catcode`\>=\active
\catcode`\>=\active
\def>{{\tt \gtr}}
\def>{{\tt \gtr}}
\catcode`\+=\active
\catcode`\+=\active
\def+{{\tt \char 43}}
\def+{{\tt \char 43}}
\catcode`\$=\active
\catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
 
 
% If a .fmt file is being used, characters that might appear in a file
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% name cannot be active until we have parsed the command line.
% So turn them off again, and have \everyjob (or @setfilename) turn them on.
% So turn them off again, and have \everyjob (or @setfilename) turn them on.
% \otherifyactive is called near the end of this file.
% \otherifyactive is called near the end of this file.
\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
 
 
% Used sometimes to turn off (effectively) the active characters even after
% Used sometimes to turn off (effectively) the active characters even after
% parsing them.
% parsing them.
\def\turnoffactive{%
\def\turnoffactive{%
  \normalturnoffactive
  \normalturnoffactive
  \otherbackslash
  \otherbackslash
}
}
 
 
\catcode`\@=0
\catcode`\@=0
 
 
% \backslashcurfont outputs one backslash character in current font,
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
\global\chardef\backslashcurfont=`\\
\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
 
 
% \realbackslash is an actual character `\' with catcode other, and
% \realbackslash is an actual character `\' with catcode other, and
% \doublebackslash is two of them (for the pdf outlines).
% \doublebackslash is two of them (for the pdf outlines).
{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
 
 
% In texinfo, backslash is an active character; it prints the backslash
% In texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
% in fixed width font.
\catcode`\\=\active
\catcode`\\=\active
@def@normalbackslash{{@tt@backslashcurfont}}
@def@normalbackslash{{@tt@backslashcurfont}}
% On startup, @fixbackslash assigns:
% On startup, @fixbackslash assigns:
%  @let \ = @normalbackslash
%  @let \ = @normalbackslash
 
 
% \rawbackslash defines an active \ to do \backslashcurfont.
% \rawbackslash defines an active \ to do \backslashcurfont.
% \otherbackslash defines an active \ to be a literal `\' character with
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other.
% catcode other.
@gdef@rawbackslash{@let\=@backslashcurfont}
@gdef@rawbackslash{@let\=@backslashcurfont}
@gdef@otherbackslash{@let\=@realbackslash}
@gdef@otherbackslash{@let\=@realbackslash}
 
 
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'.
% the literal character `\'.
%
%
@def@normalturnoffactive{%
@def@normalturnoffactive{%
  @let\=@normalbackslash
  @let\=@normalbackslash
  @let"=@normaldoublequote
  @let"=@normaldoublequote
  @let~=@normaltilde
  @let~=@normaltilde
  @let^=@normalcaret
  @let^=@normalcaret
  @let_=@normalunderscore
  @let_=@normalunderscore
  @let|=@normalverticalbar
  @let|=@normalverticalbar
  @let<=@normalless
  @let<=@normalless
  @let>=@normalgreater
  @let>=@normalgreater
  @let+=@normalplus
  @let+=@normalplus
  @let$=@normaldollar %$ font-lock fix
  @let$=@normaldollar %$ font-lock fix
 
  @markupsetuplqdefault
 
  @markupsetuprqdefault
  @unsepspaces
  @unsepspaces
}
}
 
 
% Make _ and + \other characters, temporarily.
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
% This is canceled by @fixbackslash.
@otherifyactive
@otherifyactive
 
 
% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% That is what \eatinput is for; after that, the `\' should revert to printing
% That is what \eatinput is for; after that, the `\' should revert to printing
% a backslash.
% a backslash.
%
%
@gdef@eatinput input texinfo{@fixbackslash}
@gdef@eatinput input texinfo{@fixbackslash}
@global@let\ = @eatinput
@global@let\ = @eatinput
 
 
% On the other hand, perhaps the file did not have a `\input texinfo'. Then
% On the other hand, perhaps the file did not have a `\input texinfo'. Then
% the first `\' in the file would cause an error. This macro tries to fix
% the first `\' in the file would cause an error. This macro tries to fix
% that, assuming it is called before the first `\' could plausibly occur.
% that, assuming it is called before the first `\' could plausibly occur.
% Also turn back on active characters that might appear in the input
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
% file name, in case not using a pre-dumped format.
%
%
@gdef@fixbackslash{%
@gdef@fixbackslash{%
  @ifx\@eatinput @let\ = @normalbackslash @fi
  @ifx\@eatinput @let\ = @normalbackslash @fi
  @catcode`+=@active
  @catcode`+=@active
  @catcode`@_=@active
  @catcode`@_=@active
}
}
 
 
% Say @foo, not \foo, in error messages.
% Say @foo, not \foo, in error messages.
@escapechar = `@@
@escapechar = `@@
 
 
% These look ok in all fonts, so just make them not special.
% These look ok in all fonts, so just make them not special.
@catcode`@& = @other
@catcode`@& = @other
@catcode`@# = @other
@catcode`@# = @other
@catcode`@% = @other
@catcode`@% = @other
 
 
 
@c Finally, make ` and ' active, so that txicodequoteundirected and
 
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
 
@c don't make ` and ' active, @code will not get them as active chars.
 
@c Do this last of all since we use ` in the previous @catcode assignments.
 
@catcode`@'=@active
 
@catcode`@`=@active
 
@markupsetuplqdefault
 
@markupsetuprqdefault
 
 
@c Local variables:
@c Local variables:
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
@c page-delimiter: "^\\\\message"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-end: "}"
@c time-stamp-end: "}"
@c End:
@c End:
 
 
@c vim:sw=2:
@c vim:sw=2:
 
 
@ignore
@ignore
   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
@end ignore
@end ignore
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.