Blame build-aux/texinfo.tex

Packit fc043f
% texinfo.tex -- TeX macros to handle Texinfo files.
Packit fc043f
%
Packit fc043f
% Load plain if necessary, i.e., if running under initex.
Packit fc043f
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
Packit fc043f
%
Packit fc043f
\def\texinfoversion{2007-05-03.09}
Packit fc043f
%
Packit fc043f
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
Packit fc043f
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
Packit fc043f
% 2007 Free Software Foundation, Inc.
Packit fc043f
%
Packit fc043f
% This texinfo.tex file is free software; you can redistribute it and/or
Packit fc043f
% modify it under the terms of the GNU General Public License as
Packit fc043f
% published by the Free Software Foundation; either version 3, or (at
Packit fc043f
% your option) any later version.
Packit fc043f
%
Packit fc043f
% This texinfo.tex file is distributed in the hope that it will be
Packit fc043f
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
Packit fc043f
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit fc043f
% General Public License for more details.
Packit fc043f
%
Packit fc043f
% You should have received a copy of the GNU General Public License
Packit fc043f
% along with this texinfo.tex file; see the file COPYING.  If not,
Packit fc043f
% see <https://www.gnu.org/licenses/>.
Packit fc043f
%
Packit fc043f
% As a special exception, when this file is read by TeX when processing
Packit fc043f
% a Texinfo source document, you may use the result without
Packit fc043f
% restriction.  (This has been our intent since Texinfo was invented.)
Packit fc043f
%
Packit fc043f
% Please try the latest version of texinfo.tex before submitting bug
Packit fc043f
% reports; you can get the latest version from:
Packit fc043f
%   https://www.gnu.org/software/texinfo/ (the Texinfo home page), or
Packit fc043f
%   ftp://tug.org/tex/texinfo.tex
Packit fc043f
%     (and all CTAN mirrors, see https://www.ctan.org).
Packit fc043f
% The texinfo.tex in any given distribution could well be out
Packit fc043f
% of date, so if that's what you're using, please check.
Packit fc043f
%
Packit fc043f
% Send bug reports to bug-texinfo@gnu.org.  Please include including a
Packit fc043f
% complete document in each bug report with which we can reproduce the
Packit fc043f
% problem.  Patches are, of course, greatly appreciated.
Packit fc043f
%
Packit fc043f
% To process a Texinfo manual with TeX, it's most reliable to use the
Packit fc043f
% texi2dvi shell script that comes with the distribution.  For a simple
Packit fc043f
% manual foo.texi, however, you can get away with this:
Packit fc043f
%   tex foo.texi
Packit fc043f
%   texindex foo.??
Packit fc043f
%   tex foo.texi
Packit fc043f
%   tex foo.texi
Packit fc043f
%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
Packit fc043f
% The extra TeX runs get the cross-reference information correct.
Packit fc043f
% Sometimes one run after texindex suffices, and sometimes you need more
Packit fc043f
% than two; texi2dvi does it as many times as necessary.
Packit fc043f
%
Packit fc043f
% It is possible to adapt texinfo.tex for other languages, to some
Packit fc043f
% extent.  You can get the existing language-specific files from the
Packit fc043f
% full Texinfo distribution.
Packit fc043f
%
Packit fc043f
% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
Packit fc043f
Packit fc043f
Packit fc043f
\message{Loading texinfo [version \texinfoversion]:}
Packit fc043f
Packit fc043f
% If in a .fmt file, print the version number
Packit fc043f
% and turn on active characters that we couldn't do earlier because
Packit fc043f
% they might have appeared in the input file name.
Packit fc043f
\everyjob{\message{[Texinfo version \texinfoversion]}%
Packit fc043f
  \catcode`+=\active \catcode`\_=\active}
Packit fc043f
Packit fc043f
Packit fc043f
\chardef\other=12
Packit fc043f
Packit fc043f
% We never want plain's \outer definition of \+ in Texinfo.
Packit fc043f
% For @tex, we can use \tabalign.
Packit fc043f
\let\+ = \relax
Packit fc043f
Packit fc043f
% Save some plain tex macros whose names we will redefine.
Packit fc043f
\let\ptexb=\b
Packit fc043f
\let\ptexbullet=\bullet
Packit fc043f
\let\ptexc=\c
Packit fc043f
\let\ptexcomma=\,
Packit fc043f
\let\ptexdot=\.
Packit fc043f
\let\ptexdots=\dots
Packit fc043f
\let\ptexend=\end
Packit fc043f
\let\ptexequiv=\equiv
Packit fc043f
\let\ptexexclam=\!
Packit fc043f
\let\ptexfootnote=\footnote
Packit fc043f
\let\ptexgtr=>
Packit fc043f
\let\ptexhat=^
Packit fc043f
\let\ptexi=\i
Packit fc043f
\let\ptexindent=\indent
Packit fc043f
\let\ptexinsert=\insert
Packit fc043f
\let\ptexlbrace=\{
Packit fc043f
\let\ptexless=<
Packit fc043f
\let\ptexnewwrite\newwrite
Packit fc043f
\let\ptexnoindent=\noindent
Packit fc043f
\let\ptexplus=+
Packit fc043f
\let\ptexrbrace=\}
Packit fc043f
\let\ptexslash=\/
Packit fc043f
\let\ptexstar=\*
Packit fc043f
\let\ptext=\t
Packit fc043f
Packit fc043f
% If this character appears in an error message or help string, it
Packit fc043f
% starts a new line in the output.
Packit fc043f
\newlinechar = `^^J
Packit fc043f
Packit fc043f
% Use TeX 3.0's \inputlineno to get the line number, for better error
Packit fc043f
% messages, but if we're using an old version of TeX, don't do anything.
Packit fc043f
%
Packit fc043f
\ifx\inputlineno\thisisundefined
Packit fc043f
  \let\linenumber = \empty % Pre-3.0.
Packit fc043f
\else
Packit fc043f
  \def\linenumber{l.\the\inputlineno:\space}
Packit fc043f
\fi
Packit fc043f
Packit fc043f
% Set up fixed words for English if not already set.
Packit fc043f
\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
Packit fc043f
\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
Packit fc043f
\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
Packit fc043f
\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
Packit fc043f
\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
Packit fc043f
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
Packit fc043f
\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
Packit fc043f
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
Packit fc043f
\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
Packit fc043f
\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
Packit fc043f
\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
Packit fc043f
\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
Packit fc043f
\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
Packit fc043f
\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
Packit fc043f
\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
Packit fc043f
\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
Packit fc043f
\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
Packit fc043f
\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
Packit fc043f
\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
Packit fc043f
%
Packit fc043f
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
Packit fc043f
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
Packit fc043f
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
Packit fc043f
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
Packit fc043f
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
Packit fc043f
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
Packit fc043f
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
Packit fc043f
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
Packit fc043f
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
Packit fc043f
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
Packit fc043f
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
Packit fc043f
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
Packit fc043f
%
Packit fc043f
\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
Packit fc043f
\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
Packit fc043f
\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
Packit fc043f
\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
Packit fc043f
\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
Packit fc043f
Packit fc043f
% Since the category of space is not known, we have to be careful.
Packit fc043f
\chardef\spacecat = 10
Packit fc043f
\def\spaceisspace{\catcode`\ =\spacecat}
Packit fc043f
Packit fc043f
% sometimes characters are active, so we need control sequences.
Packit fc043f
\chardef\colonChar = `\:
Packit fc043f
\chardef\commaChar = `\,
Packit fc043f
\chardef\dashChar  = `\-
Packit fc043f
\chardef\dotChar   = `\.
Packit fc043f
\chardef\exclamChar= `\!
Packit fc043f
\chardef\lquoteChar= `\`
Packit fc043f
\chardef\questChar = `\?
Packit fc043f
\chardef\rquoteChar= `\'
Packit fc043f
\chardef\semiChar  = `\;
Packit fc043f
\chardef\underChar = `\_
Packit fc043f
Packit fc043f
% Ignore a token.
Packit fc043f
%
Packit fc043f
\def\gobble#1{}
Packit fc043f
Packit fc043f
% The following is used inside several \edef's.
Packit fc043f
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
Packit fc043f
Packit fc043f
% Hyphenation fixes.
Packit fc043f
\hyphenation{
Packit fc043f
  Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
Packit fc043f
  ap-pen-dix bit-map bit-maps
Packit fc043f
  data-base data-bases eshell fall-ing half-way long-est man-u-script
Packit fc043f
  man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
Packit fc043f
  par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
Packit fc043f
  spell-ing spell-ings
Packit fc043f
  stand-alone strong-est time-stamp time-stamps which-ever white-space
Packit fc043f
  wide-spread wrap-around
Packit fc043f
}
Packit fc043f
Packit fc043f
% Margin to add to right of even pages, to left of odd pages.
Packit fc043f
\newdimen\bindingoffset
Packit fc043f
\newdimen\normaloffset
Packit fc043f
\newdimen\pagewidth \newdimen\pageheight
Packit fc043f
Packit fc043f
% For a final copy, take out the rectangles
Packit fc043f
% that mark overfull boxes (in case you have decided
Packit fc043f
% that the text looks ok even though it passes the margin).
Packit fc043f
%
Packit fc043f
\def\finalout{\overfullrule=0pt}
Packit fc043f
Packit fc043f
% @| inserts a changebar to the left of the current line.  It should
Packit fc043f
% surround any changed text.  This approach does *not* work if the
Packit fc043f
% change spans more than two lines of output.  To handle that, we would
Packit fc043f
% have adopt a much more difficult approach (putting marks into the main
Packit fc043f
% vertical list for the beginning and end of each change).
Packit fc043f
%
Packit fc043f
\def\|{%
Packit fc043f
  % \vadjust can only be used in horizontal mode.
Packit fc043f
  \leavevmode
Packit fc043f
  %
Packit fc043f
  % Append this vertical mode material after the current line in the output.
Packit fc043f
  \vadjust{%
Packit fc043f
    % We want to insert a rule with the height and depth of the current
Packit fc043f
    % leading; that is exactly what \strutbox is supposed to record.
Packit fc043f
    \vskip-\baselineskip
Packit fc043f
    %
Packit fc043f
    % \vadjust-items are inserted at the left edge of the type.  So
Packit fc043f
    % the \llap here moves out into the left-hand margin.
Packit fc043f
    \llap{%
Packit fc043f
      %
Packit fc043f
      % For a thicker or thinner bar, change the `1pt'.
Packit fc043f
      \vrule height\baselineskip width1pt
Packit fc043f
      %
Packit fc043f
      % This is the space between the bar and the text.
Packit fc043f
      \hskip 12pt
Packit fc043f
    }%
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
% Sometimes it is convenient to have everything in the transcript file
Packit fc043f
% and nothing on the terminal.  We don't just call \tracingall here,
Packit fc043f
% since that produces some useless output on the terminal.  We also make
Packit fc043f
% some effort to order the tracing commands to reduce output in the log
Packit fc043f
% file; cf. trace.sty in LaTeX.
Packit fc043f
%
Packit fc043f
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
Packit fc043f
\def\loggingall{%
Packit fc043f
  \tracingstats2
Packit fc043f
  \tracingpages1
Packit fc043f
  \tracinglostchars2  % 2 gives us more in etex
Packit fc043f
  \tracingparagraphs1
Packit fc043f
  \tracingoutput1
Packit fc043f
  \tracingmacros2
Packit fc043f
  \tracingrestores1
Packit fc043f
  \showboxbreadth\maxdimen \showboxdepth\maxdimen
Packit fc043f
  \ifx\eTeXversion\undefined\else % etex gives us more logging
Packit fc043f
    \tracingscantokens1
Packit fc043f
    \tracingifs1
Packit fc043f
    \tracinggroups1
Packit fc043f
    \tracingnesting2
Packit fc043f
    \tracingassigns1
Packit fc043f
  \fi
Packit fc043f
  \tracingcommands3  % 3 gives us more in etex
Packit fc043f
  \errorcontextlines16
Packit fc043f
}%
Packit fc043f
Packit fc043f
% add check for \lastpenalty to plain's definitions.  If the last thing
Packit fc043f
% we did was a \nobreak, we don't want to insert more space.
Packit fc043f
%
Packit fc043f
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
Packit fc043f
  \removelastskip\penalty-50\smallskip\fi\fi}
Packit fc043f
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
Packit fc043f
  \removelastskip\penalty-100\medskip\fi\fi}
Packit fc043f
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
Packit fc043f
  \removelastskip\penalty-200\bigskip\fi\fi}
Packit fc043f
Packit fc043f
% For @cropmarks command.
Packit fc043f
% Do @cropmarks to get crop marks.
Packit fc043f
%
Packit fc043f
\newif\ifcropmarks
Packit fc043f
\let\cropmarks = \cropmarkstrue
Packit fc043f
%
Packit fc043f
% Dimensions to add cropmarks at corners.
Packit fc043f
% Added by P. A. MacKay, 12 Nov. 1986
Packit fc043f
%
Packit fc043f
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
Packit fc043f
\newdimen\cornerlong  \cornerlong=1pc
Packit fc043f
\newdimen\cornerthick \cornerthick=.3pt
Packit fc043f
\newdimen\topandbottommargin \topandbottommargin=.75in
Packit fc043f
Packit fc043f
% Main output routine.
Packit fc043f
\chardef\PAGE = 255
Packit fc043f
\output = {\onepageout{\pagecontents\PAGE}}
Packit fc043f
Packit fc043f
\newbox\headlinebox
Packit fc043f
\newbox\footlinebox
Packit fc043f
Packit fc043f
% \onepageout takes a vbox as an argument.  Note that \pagecontents
Packit fc043f
% does insertions, but you have to call it yourself.
Packit fc043f
\def\onepageout#1{%
Packit fc043f
  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
Packit fc043f
  %
Packit fc043f
  \ifodd\pageno  \advance\hoffset by \bindingoffset
Packit fc043f
  \else \advance\hoffset by -\bindingoffset\fi
Packit fc043f
  %
Packit fc043f
  % Do this outside of the \shipout so @code etc. will be expanded in
Packit fc043f
  % the headline as they should be, not taken literally (outputting ''code).
Packit fc043f
  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
Packit fc043f
  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
Packit fc043f
  %
Packit fc043f
  {%
Packit fc043f
    % Have to do this stuff outside the \shipout because we want it to
Packit fc043f
    % take effect in \write's, yet the group defined by the \vbox ends
Packit fc043f
    % before the \shipout runs.
Packit fc043f
    %
Packit fc043f
    \indexdummies         % don't expand commands in the output.
Packit fc043f
    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
Packit fc043f
               % the page break happens to be in the middle of an example.
Packit fc043f
               % We don't want .vr (or whatever) entries like this:
Packit fc043f
               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
Packit fc043f
               % "\acronym" won't work when it's read back in;
Packit fc043f
               % it needs to be
Packit fc043f
               % {\code {{\tt \backslashcurfont }acronym}
Packit fc043f
    \shipout\vbox{%
Packit fc043f
      % Do this early so pdf references go to the beginning of the page.
Packit fc043f
      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
Packit fc043f
      %
Packit fc043f
      \ifcropmarks \vbox to \outervsize\bgroup
Packit fc043f
        \hsize = \outerhsize
Packit fc043f
        \vskip-\topandbottommargin
Packit fc043f
        \vtop to0pt{%
Packit fc043f
          \line{\ewtop\hfil\ewtop}%
Packit fc043f
          \nointerlineskip
Packit fc043f
          \line{%
Packit fc043f
            \vbox{\moveleft\cornerthick\nstop}%
Packit fc043f
            \hfill
Packit fc043f
            \vbox{\moveright\cornerthick\nstop}%
Packit fc043f
          }%
Packit fc043f
          \vss}%
Packit fc043f
        \vskip\topandbottommargin
Packit fc043f
        \line\bgroup
Packit fc043f
          \hfil % center the page within the outer (page) hsize.
Packit fc043f
          \ifodd\pageno\hskip\bindingoffset\fi
Packit fc043f
          \vbox\bgroup
Packit fc043f
      \fi
Packit fc043f
      %
Packit fc043f
      \unvbox\headlinebox
Packit fc043f
      \pagebody{#1}%
Packit fc043f
      \ifdim\ht\footlinebox > 0pt
Packit fc043f
        % Only leave this space if the footline is nonempty.
Packit fc043f
        % (We lessened \vsize for it in \oddfootingyyy.)
Packit fc043f
        % The \baselineskip=24pt in plain's \makefootline has no effect.
Packit fc043f
        \vskip 24pt
Packit fc043f
        \unvbox\footlinebox
Packit fc043f
      \fi
Packit fc043f
      %
Packit fc043f
      \ifcropmarks
Packit fc043f
          \egroup % end of \vbox\bgroup
Packit fc043f
        \hfil\egroup % end of (centering) \line\bgroup
Packit fc043f
        \vskip\topandbottommargin plus1fill minus1fill
Packit fc043f
        \boxmaxdepth = \cornerthick
Packit fc043f
        \vbox to0pt{\vss
Packit fc043f
          \line{%
Packit fc043f
            \vbox{\moveleft\cornerthick\nsbot}%
Packit fc043f
            \hfill
Packit fc043f
            \vbox{\moveright\cornerthick\nsbot}%
Packit fc043f
          }%
Packit fc043f
          \nointerlineskip
Packit fc043f
          \line{\ewbot\hfil\ewbot}%
Packit fc043f
        }%
Packit fc043f
      \egroup % \vbox from first cropmarks clause
Packit fc043f
      \fi
Packit fc043f
    }% end of \shipout\vbox
Packit fc043f
  }% end of group with \indexdummies
Packit fc043f
  \advancepageno
Packit fc043f
  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
Packit fc043f
}
Packit fc043f
Packit fc043f
\newinsert\margin \dimen\margin=\maxdimen
Packit fc043f
Packit fc043f
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
Packit fc043f
{\catcode`\@ =11
Packit fc043f
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
Packit fc043f
% marginal hacks, juha@viisa.uucp (Juha Takala)
Packit fc043f
\ifvoid\margin\else % marginal info is present
Packit fc043f
  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
Packit fc043f
\dimen@=\dp#1 \unvbox#1
Packit fc043f
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
Packit fc043f
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
Packit fc043f
}
Packit fc043f
Packit fc043f
% Here are the rules for the cropmarks.  Note that they are
Packit fc043f
% offset so that the space between them is truly \outerhsize or \outervsize
Packit fc043f
% (P. A. MacKay, 12 November, 1986)
Packit fc043f
%
Packit fc043f
\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
Packit fc043f
\def\nstop{\vbox
Packit fc043f
  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
Packit fc043f
\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
Packit fc043f
\def\nsbot{\vbox
Packit fc043f
  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
Packit fc043f
Packit fc043f
% Parse an argument, then pass it to #1.  The argument is the rest of
Packit fc043f
% the input line (except we remove a trailing comment).  #1 should be a
Packit fc043f
% macro which expects an ordinary undelimited TeX argument.
Packit fc043f
%
Packit fc043f
\def\parsearg{\parseargusing{}}
Packit fc043f
\def\parseargusing#1#2{%
Packit fc043f
  \def\argtorun{#2}%
Packit fc043f
  \begingroup
Packit fc043f
    \obeylines
Packit fc043f
    \spaceisspace
Packit fc043f
    #1%
Packit fc043f
    \parseargline\empty% Insert the \empty token, see \finishparsearg below.
Packit fc043f
}
Packit fc043f
Packit fc043f
{\obeylines %
Packit fc043f
  \gdef\parseargline#1^^M{%
Packit fc043f
    \endgroup % End of the group started in \parsearg.
Packit fc043f
    \argremovecomment #1\comment\ArgTerm%
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
% First remove any @comment, then any @c comment.
Packit fc043f
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
Packit fc043f
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
Packit fc043f
Packit fc043f
% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
Packit fc043f
%
Packit fc043f
% \argremovec might leave us with trailing space, e.g.,
Packit fc043f
%    @end itemize  @c foo
Packit fc043f
% This space token undergoes the same procedure and is eventually removed
Packit fc043f
% by \finishparsearg.
Packit fc043f
%
Packit fc043f
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
Packit fc043f
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
Packit fc043f
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
Packit fc043f
  \def\temp{#3}%
Packit fc043f
  \ifx\temp\empty
Packit fc043f
    % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
Packit fc043f
    \let\temp\finishparsearg
Packit fc043f
  \else
Packit fc043f
    \let\temp\argcheckspaces
Packit fc043f
  \fi
Packit fc043f
  % Put the space token in:
Packit fc043f
  \temp#1 #3\ArgTerm
Packit fc043f
}
Packit fc043f
Packit fc043f
% If a _delimited_ argument is enclosed in braces, they get stripped; so
Packit fc043f
% to get _exactly_ the rest of the line, we had to prevent such situation.
Packit fc043f
% We prepended an \empty token at the very beginning and we expand it now,
Packit fc043f
% just before passing the control to \argtorun.
Packit fc043f
% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
Packit fc043f
% either the null string, or it ends with \^^M---thus there is no danger
Packit fc043f
% that a pair of braces would be stripped.
Packit fc043f
%
Packit fc043f
% But first, we have to remove the trailing space token.
Packit fc043f
%
Packit fc043f
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
Packit fc043f
Packit fc043f
% \parseargdef\foo{...}
Packit fc043f
%	is roughly equivalent to
Packit fc043f
% \def\foo{\parsearg\Xfoo}
Packit fc043f
% \def\Xfoo#1{...}
Packit fc043f
%
Packit fc043f
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
Packit fc043f
% favourite TeX trick.  --kasal, 16nov03
Packit fc043f
Packit fc043f
\def\parseargdef#1{%
Packit fc043f
  \expandafter \doparseargdef \csname\string#1\endcsname #1%
Packit fc043f
}
Packit fc043f
\def\doparseargdef#1#2{%
Packit fc043f
  \def#2{\parsearg#1}%
Packit fc043f
  \def#1##1%
Packit fc043f
}
Packit fc043f
Packit fc043f
% Several utility definitions with active space:
Packit fc043f
{
Packit fc043f
  \obeyspaces
Packit fc043f
  \gdef\obeyedspace{ }
Packit fc043f
Packit fc043f
  % Make each space character in the input produce a normal interword
Packit fc043f
  % space in the output.  Don't allow a line break at this space, as this
Packit fc043f
  % is used only in environments like @example, where each line of input
Packit fc043f
  % should produce a line of output anyway.
Packit fc043f
  %
Packit fc043f
  \gdef\sepspaces{\obeyspaces\let =\tie}
Packit fc043f
Packit fc043f
  % If an index command is used in an @example environment, any spaces
Packit fc043f
  % therein should become regular spaces in the raw index file, not the
Packit fc043f
  % expansion of \tie (\leavevmode \penalty \@M \ ).
Packit fc043f
  \gdef\unsepspaces{\let =\space}
Packit fc043f
}
Packit fc043f
Packit fc043f
Packit fc043f
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
Packit fc043f
Packit fc043f
% Define the framework for environments in texinfo.tex.  It's used like this:
Packit fc043f
%
Packit fc043f
%   \envdef\foo{...}
Packit fc043f
%   \def\Efoo{...}
Packit fc043f
%
Packit fc043f
% It's the responsibility of \envdef to insert \begingroup before the
Packit fc043f
% actual body; @end closes the group after calling \Efoo.  \envdef also
Packit fc043f
% defines \thisenv, so the current environment is known; @end checks
Packit fc043f
% whether the environment name matches.  The \checkenv macro can also be
Packit fc043f
% used to check whether the current environment is the one expected.
Packit fc043f
%
Packit fc043f
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
Packit fc043f
% are not treated as enviroments; they don't open a group.  (The
Packit fc043f
% implementation of @end takes care not to call \endgroup in this
Packit fc043f
% special case.)
Packit fc043f
Packit fc043f
Packit fc043f
% At runtime, environments start with this:
Packit fc043f
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
Packit fc043f
% initialize
Packit fc043f
\let\thisenv\empty
Packit fc043f
Packit fc043f
% ... but they get defined via ``\envdef\foo{...}'':
Packit fc043f
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
Packit fc043f
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
Packit fc043f
Packit fc043f
% Check whether we're in the right environment:
Packit fc043f
\def\checkenv#1{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\thisenv\temp
Packit fc043f
  \else
Packit fc043f
    \badenverr
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% Evironment mismatch, #1 expected:
Packit fc043f
\def\badenverr{%
Packit fc043f
  \errhelp = \EMsimple
Packit fc043f
  \errmessage{This command can appear only \inenvironment\temp,
Packit fc043f
    not \inenvironment\thisenv}%
Packit fc043f
}
Packit fc043f
\def\inenvironment#1{%
Packit fc043f
  \ifx#1\empty
Packit fc043f
    out of any environment%
Packit fc043f
  \else
Packit fc043f
    in environment \expandafter\string#1%
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @end foo executes the definition of \Efoo.
Packit fc043f
% But first, it executes a specialized version of \checkenv
Packit fc043f
%
Packit fc043f
\parseargdef\end{%
Packit fc043f
  \if 1\csname iscond.#1\endcsname
Packit fc043f
  \else
Packit fc043f
    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
Packit fc043f
    \expandafter\checkenv\csname#1\endcsname
Packit fc043f
    \csname E#1\endcsname
Packit fc043f
    \endgroup
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
\newhelp\EMsimple{Press RETURN to continue.}
Packit fc043f
Packit fc043f
Packit fc043f
%% Simple single-character @ commands
Packit fc043f
Packit fc043f
% @@ prints an @
Packit fc043f
% Kludge this until the fonts are right (grr).
Packit fc043f
\def\@{{\tt\char64}}
Packit fc043f
Packit fc043f
% This is turned off because it was never documented
Packit fc043f
% and you can use @w{...} around a quote to suppress ligatures.
Packit fc043f
%% Define @` and @' to be the same as ` and '
Packit fc043f
%% but suppressing ligatures.
Packit fc043f
%\def\`{{`}}
Packit fc043f
%\def\'{{'}}
Packit fc043f
Packit fc043f
% Used to generate quoted braces.
Packit fc043f
\def\mylbrace {{\tt\char123}}
Packit fc043f
\def\myrbrace {{\tt\char125}}
Packit fc043f
\let\{=\mylbrace
Packit fc043f
\let\}=\myrbrace
Packit fc043f
\begingroup
Packit fc043f
  % Definitions to produce \{ and \} commands for indices,
Packit fc043f
  % and @{ and @} for the aux/toc files.
Packit fc043f
  \catcode`\{ = \other \catcode`\} = \other
Packit fc043f
  \catcode`\[ = 1 \catcode`\] = 2
Packit fc043f
  \catcode`\! = 0 \catcode`\\ = \other
Packit fc043f
  !gdef!lbracecmd[\{]%
Packit fc043f
  !gdef!rbracecmd[\}]%
Packit fc043f
  !gdef!lbraceatcmd[@{]%
Packit fc043f
  !gdef!rbraceatcmd[@}]%
Packit fc043f
!endgroup
Packit fc043f
Packit fc043f
% @comma{} to avoid , parsing problems.
Packit fc043f
\let\comma = ,
Packit fc043f
Packit fc043f
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
Packit fc043f
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
Packit fc043f
\let\, = \c
Packit fc043f
\let\dotaccent = \.
Packit fc043f
\def\ringaccent#1{{\accent23 #1}}
Packit fc043f
\let\tieaccent = \t
Packit fc043f
\let\ubaraccent = \b
Packit fc043f
\let\udotaccent = \d
Packit fc043f
Packit fc043f
% Other special characters: @questiondown @exclamdown @ordf @ordm
Packit fc043f
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
Packit fc043f
\def\questiondown{?`}
Packit fc043f
\def\exclamdown{!`}
Packit fc043f
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
Packit fc043f
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
Packit fc043f
Packit fc043f
% Dotless i and dotless j, used for accents.
Packit fc043f
\def\imacro{i}
Packit fc043f
\def\jmacro{j}
Packit fc043f
\def\dotless#1{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\temp\imacro \ptexi
Packit fc043f
  \else\ifx\temp\jmacro \j
Packit fc043f
  \else \errmessage{@dotless can be used only with i or j}%
Packit fc043f
  \fi\fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% The \TeX{} logo, as in plain, but resetting the spacing so that a
Packit fc043f
% period following counts as ending a sentence.  (Idea found in latex.)
Packit fc043f
%
Packit fc043f
\edef\TeX{\TeX \spacefactor=1000 }
Packit fc043f
Packit fc043f
% @LaTeX{} logo.  Not quite the same results as the definition in
Packit fc043f
% latex.ltx, since we use a different font for the raised A; it's most
Packit fc043f
% convenient for us to use an explicitly smaller font, rather than using
Packit fc043f
% the \scriptstyle font (since we don't reset \scriptstyle and
Packit fc043f
% \scriptscriptstyle).
Packit fc043f
%
Packit fc043f
\def\LaTeX{%
Packit fc043f
  L\kern-.36em
Packit fc043f
  {\setbox0=\hbox{T}%
Packit fc043f
   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
Packit fc043f
  \kern-.15em
Packit fc043f
  \TeX
Packit fc043f
}
Packit fc043f
Packit fc043f
% Be sure we're in horizontal mode when doing a tie, since we make space
Packit fc043f
% equivalent to this in @example-like environments. Otherwise, a space
Packit fc043f
% at the beginning of a line will start with \penalty -- and
Packit fc043f
% since \penalty is valid in vertical mode, we'd end up putting the
Packit fc043f
% penalty on the vertical list instead of in the new paragraph.
Packit fc043f
{\catcode`@ = 11
Packit fc043f
 % Avoid using \@M directly, because that causes trouble
Packit fc043f
 % if the definition is written into an index file.
Packit fc043f
 \global\let\tiepenalty = \@M
Packit fc043f
 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
Packit fc043f
}
Packit fc043f
Packit fc043f
% @: forces normal size whitespace following.
Packit fc043f
\def\:{\spacefactor=1000 }
Packit fc043f
Packit fc043f
% @* forces a line break.
Packit fc043f
\def\*{\hfil\break\hbox{}\ignorespaces}
Packit fc043f
Packit fc043f
% @/ allows a line break.
Packit fc043f
\let\/=\allowbreak
Packit fc043f
Packit fc043f
% @. is an end-of-sentence period.
Packit fc043f
\def\.{.\spacefactor=\endofsentencespacefactor\space}
Packit fc043f
Packit fc043f
% @! is an end-of-sentence bang.
Packit fc043f
\def\!{!\spacefactor=\endofsentencespacefactor\space}
Packit fc043f
Packit fc043f
% @? is an end-of-sentence query.
Packit fc043f
\def\?{?\spacefactor=\endofsentencespacefactor\space}
Packit fc043f
Packit fc043f
% @frenchspacing on|off  says whether to put extra space after punctuation.
Packit fc043f
%
Packit fc043f
\def\onword{on}
Packit fc043f
\def\offword{off}
Packit fc043f
%
Packit fc043f
\parseargdef\frenchspacing{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\temp\onword \plainfrenchspacing
Packit fc043f
  \else\ifx\temp\offword \plainnonfrenchspacing
Packit fc043f
  \else
Packit fc043f
    \errhelp = \EMsimple
Packit fc043f
    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
Packit fc043f
  \fi\fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @w prevents a word break.  Without the \leavevmode, @w at the
Packit fc043f
% beginning of a paragraph, when TeX is still in vertical mode, would
Packit fc043f
% produce a whole line of output instead of starting the paragraph.
Packit fc043f
\def\w#1{\leavevmode\hbox{#1}}
Packit fc043f
Packit fc043f
% @group ... @end group forces ... to be all on one page, by enclosing
Packit fc043f
% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
Packit fc043f
% to keep its height that of a normal line.  According to the rules for
Packit fc043f
% \topskip (p.114 of the TeXbook), the glue inserted is
Packit fc043f
% max (\topskip - \ht (first item), 0).  If that height is large,
Packit fc043f
% therefore, no glue is inserted, and the space between the headline and
Packit fc043f
% the text is small, which looks bad.
Packit fc043f
%
Packit fc043f
% Another complication is that the group might be very large.  This can
Packit fc043f
% cause the glue on the previous page to be unduly stretched, because it
Packit fc043f
% does not have much material.  In this case, it's better to add an
Packit fc043f
% explicit \vfill so that the extra space is at the bottom.  The
Packit fc043f
% threshold for doing this is if the group is more than \vfilllimit
Packit fc043f
% percent of a page (\vfilllimit can be changed inside of @tex).
Packit fc043f
%
Packit fc043f
\newbox\groupbox
Packit fc043f
\def\vfilllimit{0.7}
Packit fc043f
%
Packit fc043f
\envdef\group{%
Packit fc043f
  \ifnum\catcode`\^^M=\active \else
Packit fc043f
    \errhelp = \groupinvalidhelp
Packit fc043f
    \errmessage{@group invalid in context where filling is enabled}%
Packit fc043f
  \fi
Packit fc043f
  \startsavinginserts
Packit fc043f
  %
Packit fc043f
  \setbox\groupbox = \vtop\bgroup
Packit fc043f
    % Do @comment since we are called inside an environment such as
Packit fc043f
    % @example, where each end-of-line in the input causes an
Packit fc043f
    % end-of-line in the output.  We don't want the end-of-line after
Packit fc043f
    % the `@group' to put extra space in the output.  Since @group
Packit fc043f
    % should appear on a line by itself (according to the Texinfo
Packit fc043f
    % manual), we don't worry about eating any user text.
Packit fc043f
    \comment
Packit fc043f
}
Packit fc043f
%
Packit fc043f
% The \vtop produces a box with normal height and large depth; thus, TeX puts
Packit fc043f
% \baselineskip glue before it, and (when the next line of text is done)
Packit fc043f
% \lineskip glue after it.  Thus, space below is not quite equal to space
Packit fc043f
% above.  But it's pretty close.
Packit fc043f
\def\Egroup{%
Packit fc043f
    % To get correct interline space between the last line of the group
Packit fc043f
    % and the first line afterwards, we have to propagate \prevdepth.
Packit fc043f
    \endgraf % Not \par, as it may have been set to \lisppar.
Packit fc043f
    \global\dimen1 = \prevdepth
Packit fc043f
  \egroup           % End the \vtop.
Packit fc043f
  % \dimen0 is the vertical size of the group's box.
Packit fc043f
  \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
Packit fc043f
  % \dimen2 is how much space is left on the page (more or less).
Packit fc043f
  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
Packit fc043f
  % if the group doesn't fit on the current page, and it's a big big
Packit fc043f
  % group, force a page break.
Packit fc043f
  \ifdim \dimen0 > \dimen2
Packit fc043f
    \ifdim \pagetotal < \vfilllimit\pageheight
Packit fc043f
      \page
Packit fc043f
    \fi
Packit fc043f
  \fi
Packit fc043f
  \box\groupbox
Packit fc043f
  \prevdepth = \dimen1
Packit fc043f
  \checkinserts
Packit fc043f
}
Packit fc043f
%
Packit fc043f
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
Packit fc043f
% message, so this ends up printing `@group can only ...'.
Packit fc043f
%
Packit fc043f
\newhelp\groupinvalidhelp{%
Packit fc043f
group can only be used in environments such as @example,^^J%
Packit fc043f
where each line of input produces a line of output.}
Packit fc043f
Packit fc043f
% @need space-in-mils
Packit fc043f
% forces a page break if there is not space-in-mils remaining.
Packit fc043f
Packit fc043f
\newdimen\mil  \mil=0.001in
Packit fc043f
Packit fc043f
% Old definition--didn't work.
Packit fc043f
%\parseargdef\need{\par %
Packit fc043f
%% This method tries to make TeX break the page naturally
Packit fc043f
%% if the depth of the box does not fit.
Packit fc043f
%{\baselineskip=0pt%
Packit fc043f
%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
Packit fc043f
%\prevdepth=-1000pt
Packit fc043f
%}}
Packit fc043f
Packit fc043f
\parseargdef\need{%
Packit fc043f
  % Ensure vertical mode, so we don't make a big box in the middle of a
Packit fc043f
  % paragraph.
Packit fc043f
  \par
Packit fc043f
  %
Packit fc043f
  % If the @need value is less than one line space, it's useless.
Packit fc043f
  \dimen0 = #1\mil
Packit fc043f
  \dimen2 = \ht\strutbox
Packit fc043f
  \advance\dimen2 by \dp\strutbox
Packit fc043f
  \ifdim\dimen0 > \dimen2
Packit fc043f
    %
Packit fc043f
    % Do a \strut just to make the height of this box be normal, so the
Packit fc043f
    % normal leading is inserted relative to the preceding line.
Packit fc043f
    % And a page break here is fine.
Packit fc043f
    \vtop to #1\mil{\strut\vfil}%
Packit fc043f
    %
Packit fc043f
    % TeX does not even consider page breaks if a penalty added to the
Packit fc043f
    % main vertical list is 10000 or more.  But in order to see if the
Packit fc043f
    % empty box we just added fits on the page, we must make it consider
Packit fc043f
    % page breaks.  On the other hand, we don't want to actually break the
Packit fc043f
    % page after the empty box.  So we use a penalty of 9999.
Packit fc043f
    %
Packit fc043f
    % There is an extremely small chance that TeX will actually break the
Packit fc043f
    % page at this \penalty, if there are no other feasible breakpoints in
Packit fc043f
    % sight.  (If the user is using lots of big @group commands, which
Packit fc043f
    % almost-but-not-quite fill up a page, TeX will have a hard time doing
Packit fc043f
    % good page breaking, for example.)  However, I could not construct an
Packit fc043f
    % example where a page broke at this \penalty; if it happens in a real
Packit fc043f
    % document, then we can reconsider our strategy.
Packit fc043f
    \penalty9999
Packit fc043f
    %
Packit fc043f
    % Back up by the size of the box, whether we did a page break or not.
Packit fc043f
    \kern -#1\mil
Packit fc043f
    %
Packit fc043f
    % Do not allow a page break right after this kern.
Packit fc043f
    \nobreak
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @br   forces paragraph break (and is undocumented).
Packit fc043f
Packit fc043f
\let\br = \par
Packit fc043f
Packit fc043f
% @page forces the start of a new page.
Packit fc043f
%
Packit fc043f
\def\page{\par\vfill\supereject}
Packit fc043f
Packit fc043f
% @exdent text....
Packit fc043f
% outputs text on separate line in roman font, starting at standard page margin
Packit fc043f
Packit fc043f
% This records the amount of indent in the innermost environment.
Packit fc043f
% That's how much \exdent should take out.
Packit fc043f
\newskip\exdentamount
Packit fc043f
Packit fc043f
% This defn is used inside fill environments such as @defun.
Packit fc043f
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
Packit fc043f
Packit fc043f
% This defn is used inside nofill environments such as @example.
Packit fc043f
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
Packit fc043f
  \leftline{\hskip\leftskip{\rm#1}}}}
Packit fc043f
Packit fc043f
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
Packit fc043f
% paragraph.  For more general purposes, use the \margin insertion
Packit fc043f
% class.  WHICH is `l' or `r'.
Packit fc043f
%
Packit fc043f
\newskip\inmarginspacing \inmarginspacing=1cm
Packit fc043f
\def\strutdepth{\dp\strutbox}
Packit fc043f
%
Packit fc043f
\def\doinmargin#1#2{\strut\vadjust{%
Packit fc043f
  \nobreak
Packit fc043f
  \kern-\strutdepth
Packit fc043f
  \vtop to \strutdepth{%
Packit fc043f
    \baselineskip=\strutdepth
Packit fc043f
    \vss
Packit fc043f
    % if you have multiple lines of stuff to put here, you'll need to
Packit fc043f
    % make the vbox yourself of the appropriate size.
Packit fc043f
    \ifx#1l%
Packit fc043f
      \llap{\ignorespaces #2\hskip\inmarginspacing}%
Packit fc043f
    \else
Packit fc043f
      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
Packit fc043f
    \fi
Packit fc043f
    \null
Packit fc043f
  }%
Packit fc043f
}}
Packit fc043f
\def\inleftmargin{\doinmargin l}
Packit fc043f
\def\inrightmargin{\doinmargin r}
Packit fc043f
%
Packit fc043f
% @inmargin{TEXT [, RIGHT-TEXT]}
Packit fc043f
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
Packit fc043f
% else use TEXT for both).
Packit fc043f
%
Packit fc043f
\def\inmargin#1{\parseinmargin #1,,\finish}
Packit fc043f
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
Packit fc043f
  \setbox0 = \hbox{\ignorespaces #2}%
Packit fc043f
  \ifdim\wd0 > 0pt
Packit fc043f
    \def\lefttext{#1}%  have both texts
Packit fc043f
    \def\righttext{#2}%
Packit fc043f
  \else
Packit fc043f
    \def\lefttext{#1}%  have only one text
Packit fc043f
    \def\righttext{#1}%
Packit fc043f
  \fi
Packit fc043f
  %
Packit fc043f
  \ifodd\pageno
Packit fc043f
    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
Packit fc043f
  \else
Packit fc043f
    \def\temp{\inleftmargin\lefttext}%
Packit fc043f
  \fi
Packit fc043f
  \temp
Packit fc043f
}
Packit fc043f
Packit fc043f
% @include file    insert text of that file as input.
Packit fc043f
%
Packit fc043f
\def\include{\parseargusing\filenamecatcodes\includezzz}
Packit fc043f
\def\includezzz#1{%
Packit fc043f
  \pushthisfilestack
Packit fc043f
  \def\thisfile{#1}%
Packit fc043f
  {%
Packit fc043f
    \makevalueexpandable
Packit fc043f
    \def\temp{\input #1 }%
Packit fc043f
    \expandafter
Packit fc043f
  }\temp
Packit fc043f
  \popthisfilestack
Packit fc043f
}
Packit fc043f
\def\filenamecatcodes{%
Packit fc043f
  \catcode`\\=\other
Packit fc043f
  \catcode`~=\other
Packit fc043f
  \catcode`^=\other
Packit fc043f
  \catcode`_=\other
Packit fc043f
  \catcode`|=\other
Packit fc043f
  \catcode`<=\other
Packit fc043f
  \catcode`>=\other
Packit fc043f
  \catcode`+=\other
Packit fc043f
  \catcode`-=\other
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\pushthisfilestack{%
Packit fc043f
  \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
Packit fc043f
}
Packit fc043f
\def\pushthisfilestackX{%
Packit fc043f
  \expandafter\pushthisfilestackY\thisfile\StackTerm
Packit fc043f
}
Packit fc043f
\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
Packit fc043f
  \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\popthisfilestack{\errthisfilestackempty}
Packit fc043f
\def\errthisfilestackempty{\errmessage{Internal error:
Packit fc043f
  the stack of filenames is empty.}}
Packit fc043f
Packit fc043f
\def\thisfile{}
Packit fc043f
Packit fc043f
% @center line
Packit fc043f
% outputs that line, centered.
Packit fc043f
%
Packit fc043f
\parseargdef\center{%
Packit fc043f
  \ifhmode
Packit fc043f
    \let\next\centerH
Packit fc043f
  \else
Packit fc043f
    \let\next\centerV
Packit fc043f
  \fi
Packit fc043f
  \next{\hfil \ignorespaces#1\unskip \hfil}%
Packit fc043f
}
Packit fc043f
\def\centerH#1{%
Packit fc043f
  {%
Packit fc043f
    \hfil\break
Packit fc043f
    \advance\hsize by -\leftskip
Packit fc043f
    \advance\hsize by -\rightskip
Packit fc043f
    \line{#1}%
Packit fc043f
    \break
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
Packit fc043f
Packit fc043f
% @sp n   outputs n lines of vertical space
Packit fc043f
Packit fc043f
\parseargdef\sp{\vskip #1\baselineskip}
Packit fc043f
Packit fc043f
% @comment ...line which is ignored...
Packit fc043f
% @c is the same as @comment
Packit fc043f
% @ignore ... @end ignore  is another way to write a comment
Packit fc043f
Packit fc043f
\def\comment{\begingroup \catcode`\^^M=\other%
Packit fc043f
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
Packit fc043f
\commentxxx}
Packit fc043f
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
Packit fc043f
Packit fc043f
\let\c=\comment
Packit fc043f
Packit fc043f
% @paragraphindent NCHARS
Packit fc043f
% We'll use ems for NCHARS, close enough.
Packit fc043f
% NCHARS can also be the word `asis' or `none'.
Packit fc043f
% We cannot feasibly implement @paragraphindent asis, though.
Packit fc043f
%
Packit fc043f
\def\asisword{asis} % no translation, these are keywords
Packit fc043f
\def\noneword{none}
Packit fc043f
%
Packit fc043f
\parseargdef\paragraphindent{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\temp\asisword
Packit fc043f
  \else
Packit fc043f
    \ifx\temp\noneword
Packit fc043f
      \defaultparindent = 0pt
Packit fc043f
    \else
Packit fc043f
      \defaultparindent = #1em
Packit fc043f
    \fi
Packit fc043f
  \fi
Packit fc043f
  \parindent = \defaultparindent
Packit fc043f
}
Packit fc043f
Packit fc043f
% @exampleindent NCHARS
Packit fc043f
% We'll use ems for NCHARS like @paragraphindent.
Packit fc043f
% It seems @exampleindent asis isn't necessary, but
Packit fc043f
% I preserve it to make it similar to @paragraphindent.
Packit fc043f
\parseargdef\exampleindent{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\temp\asisword
Packit fc043f
  \else
Packit fc043f
    \ifx\temp\noneword
Packit fc043f
      \lispnarrowing = 0pt
Packit fc043f
    \else
Packit fc043f
      \lispnarrowing = #1em
Packit fc043f
    \fi
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @firstparagraphindent WORD
Packit fc043f
% If WORD is `none', then suppress indentation of the first paragraph
Packit fc043f
% after a section heading.  If WORD is `insert', then do indent at such
Packit fc043f
% paragraphs.
Packit fc043f
%
Packit fc043f
% The paragraph indentation is suppressed or not by calling
Packit fc043f
% \suppressfirstparagraphindent, which the sectioning commands do.
Packit fc043f
% We switch the definition of this back and forth according to WORD.
Packit fc043f
% By default, we suppress indentation.
Packit fc043f
%
Packit fc043f
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
Packit fc043f
\def\insertword{insert}
Packit fc043f
%
Packit fc043f
\parseargdef\firstparagraphindent{%
Packit fc043f
  \def\temp{#1}%
Packit fc043f
  \ifx\temp\noneword
Packit fc043f
    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
Packit fc043f
  \else\ifx\temp\insertword
Packit fc043f
    \let\suppressfirstparagraphindent = \relax
Packit fc043f
  \else
Packit fc043f
    \errhelp = \EMsimple
Packit fc043f
    \errmessage{Unknown @firstparagraphindent option `\temp'}%
Packit fc043f
  \fi\fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% Here is how we actually suppress indentation.  Redefine \everypar to
Packit fc043f
% \kern backwards by \parindent, and then reset itself to empty.
Packit fc043f
%
Packit fc043f
% We also make \indent itself not actually do anything until the next
Packit fc043f
% paragraph.
Packit fc043f
%
Packit fc043f
\gdef\dosuppressfirstparagraphindent{%
Packit fc043f
  \gdef\indent{%
Packit fc043f
    \restorefirstparagraphindent
Packit fc043f
    \indent
Packit fc043f
  }%
Packit fc043f
  \gdef\noindent{%
Packit fc043f
    \restorefirstparagraphindent
Packit fc043f
    \noindent
Packit fc043f
  }%
Packit fc043f
  \global\everypar = {%
Packit fc043f
    \kern -\parindent
Packit fc043f
    \restorefirstparagraphindent
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
\gdef\restorefirstparagraphindent{%
Packit fc043f
  \global \let \indent = \ptexindent
Packit fc043f
  \global \let \noindent = \ptexnoindent
Packit fc043f
  \global \everypar = {}%
Packit fc043f
}
Packit fc043f
Packit fc043f
Packit fc043f
% @asis just yields its argument.  Used with @table, for example.
Packit fc043f
%
Packit fc043f
\def\asis#1{#1}
Packit fc043f
Packit fc043f
% @math outputs its argument in math mode.
Packit fc043f
%
Packit fc043f
% One complication: _ usually means subscripts, but it could also mean
Packit fc043f
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
Packit fc043f
% _ active, and distinguish by seeing if the current family is \slfam,
Packit fc043f
% which is what @var uses.
Packit fc043f
{
Packit fc043f
  \catcode`\_ = \active
Packit fc043f
  \gdef\mathunderscore{%
Packit fc043f
    \catcode`\_=\active
Packit fc043f
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
Packit fc043f
  }
Packit fc043f
}
Packit fc043f
% Another complication: we want \\ (and @\) to output a \ character.
Packit fc043f
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
Packit fc043f
% this is not advertised and we don't care.  Texinfo does not
Packit fc043f
% otherwise define @\.
Packit fc043f
%
Packit fc043f
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
Packit fc043f
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
Packit fc043f
%
Packit fc043f
\def\math{%
Packit fc043f
  \tex
Packit fc043f
  \mathunderscore
Packit fc043f
  \let\\ = \mathbackslash
Packit fc043f
  \mathactive
Packit fc043f
  $\finishmath
Packit fc043f
}
Packit fc043f
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
Packit fc043f
Packit fc043f
% Some active characters (such as <) are spaced differently in math.
Packit fc043f
% We have to reset their definitions in case the @math was an argument
Packit fc043f
% to a command which sets the catcodes (such as @item or @section).
Packit fc043f
%
Packit fc043f
{
Packit fc043f
  \catcode`^ = \active
Packit fc043f
  \catcode`< = \active
Packit fc043f
  \catcode`> = \active
Packit fc043f
  \catcode`+ = \active
Packit fc043f
  \gdef\mathactive{%
Packit fc043f
    \let^ = \ptexhat
Packit fc043f
    \let< = \ptexless
Packit fc043f
    \let> = \ptexgtr
Packit fc043f
    \let+ = \ptexplus
Packit fc043f
  }
Packit fc043f
}
Packit fc043f
Packit fc043f
% @bullet and @minus need the same treatment as @math, just above.
Packit fc043f
\def\bullet{$\ptexbullet$}
Packit fc043f
\def\minus{$-$}
Packit fc043f
Packit fc043f
% @dots{} outputs an ellipsis using the current font.
Packit fc043f
% We do .5em per period so that it has the same spacing in the cm
Packit fc043f
% typewriter fonts as three actual period characters; on the other hand,
Packit fc043f
% in other typewriter fonts three periods are wider than 1.5em.  So do
Packit fc043f
% whichever is larger.
Packit fc043f
%
Packit fc043f
\def\dots{%
Packit fc043f
  \leavevmode
Packit fc043f
  \setbox0=\hbox{...}% get width of three periods
Packit fc043f
  \ifdim\wd0 > 1.5em
Packit fc043f
    \dimen0 = \wd0
Packit fc043f
  \else
Packit fc043f
    \dimen0 = 1.5em
Packit fc043f
  \fi
Packit fc043f
  \hbox to \dimen0{%
Packit fc043f
    \hskip 0pt plus.25fil
Packit fc043f
    .\hskip 0pt plus1fil
Packit fc043f
    .\hskip 0pt plus1fil
Packit fc043f
    .\hskip 0pt plus.5fil
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
% @enddots{} is an end-of-sentence ellipsis.
Packit fc043f
%
Packit fc043f
\def\enddots{%
Packit fc043f
  \dots
Packit fc043f
  \spacefactor=\endofsentencespacefactor
Packit fc043f
}
Packit fc043f
Packit fc043f
% @comma{} is so commas can be inserted into text without messing up
Packit fc043f
% Texinfo's parsing.
Packit fc043f
%
Packit fc043f
\let\comma = ,
Packit fc043f
Packit fc043f
% @refill is a no-op.
Packit fc043f
\let\refill=\relax
Packit fc043f
Packit fc043f
% If working on a large document in chapters, it is convenient to
Packit fc043f
% be able to disable indexing, cross-referencing, and contents, for test runs.
Packit fc043f
% This is done with @novalidate (before @setfilename).
Packit fc043f
%
Packit fc043f
\newif\iflinks \linkstrue % by default we want the aux files.
Packit fc043f
\let\novalidate = \linksfalse
Packit fc043f
Packit fc043f
% @setfilename is done at the beginning of every texinfo file.
Packit fc043f
% So open here the files we need to have open while reading the input.
Packit fc043f
% This makes it possible to make a .fmt file for texinfo.
Packit fc043f
\def\setfilename{%
Packit fc043f
   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
Packit fc043f
   \iflinks
Packit fc043f
     \tryauxfile
Packit fc043f
     % Open the new aux file.  TeX will close it automatically at exit.
Packit fc043f
     \immediate\openout\auxfile=\jobname.aux
Packit fc043f
   \fi % \openindices needs to do some work in any case.
Packit fc043f
   \openindices
Packit fc043f
   \let\setfilename=\comment % Ignore extra @setfilename cmds.
Packit fc043f
   %
Packit fc043f
   % If texinfo.cnf is present on the system, read it.
Packit fc043f
   % Useful for site-wide @afourpaper, etc.
Packit fc043f
   \openin 1 texinfo.cnf
Packit fc043f
   \ifeof 1 \else \input texinfo.cnf \fi
Packit fc043f
   \closein 1
Packit fc043f
   %
Packit fc043f
   \comment % Ignore the actual filename.
Packit fc043f
}
Packit fc043f
Packit fc043f
% Called from \setfilename.
Packit fc043f
%
Packit fc043f
\def\openindices{%
Packit fc043f
  \newindex{cp}%
Packit fc043f
  \newcodeindex{fn}%
Packit fc043f
  \newcodeindex{vr}%
Packit fc043f
  \newcodeindex{tp}%
Packit fc043f
  \newcodeindex{ky}%
Packit fc043f
  \newcodeindex{pg}%
Packit fc043f
}
Packit fc043f
Packit fc043f
% @bye.
Packit fc043f
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
Packit fc043f
Packit fc043f
Packit fc043f
\message{pdf,}
Packit fc043f
% adobe `portable' document format
Packit fc043f
\newcount\tempnum
Packit fc043f
\newcount\lnkcount
Packit fc043f
\newtoks\filename
Packit fc043f
\newcount\filenamelength
Packit fc043f
\newcount\pgn
Packit fc043f
\newtoks\toksA
Packit fc043f
\newtoks\toksB
Packit fc043f
\newtoks\toksC
Packit fc043f
\newtoks\toksD
Packit fc043f
\newbox\boxA
Packit fc043f
\newcount\countA
Packit fc043f
\newif\ifpdf
Packit fc043f
\newif\ifpdfmakepagedest
Packit fc043f
Packit fc043f
% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
Packit fc043f
% can be set).  So we test for \relax and 0 as well as \undefined,
Packit fc043f
% borrowed from ifpdf.sty.
Packit fc043f
\ifx\pdfoutput\undefined
Packit fc043f
\else
Packit fc043f
  \ifx\pdfoutput\relax
Packit fc043f
  \else
Packit fc043f
    \ifcase\pdfoutput
Packit fc043f
    \else
Packit fc043f
      \pdftrue
Packit fc043f
    \fi
Packit fc043f
  \fi
Packit fc043f
\fi
Packit fc043f
Packit fc043f
% PDF uses PostScript string constants for the names of xref targets,
Packit fc043f
% for display in the outlines, and in other places.  Thus, we have to
Packit fc043f
% double any backslashes.  Otherwise, a name like "\node" will be
Packit fc043f
% interpreted as a newline (\n), followed by o, d, e.  Not good.
Packit fc043f
% https://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
Packit fc043f
% (and related messages, the final outcome is that it is up to the TeX
Packit fc043f
% user to double the backslashes and otherwise make the string valid, so
Packit fc043f
% that's what we do).
Packit fc043f
Packit fc043f
% double active backslashes.
Packit fc043f
%
Packit fc043f
{\catcode`\@=0 \catcode`\\=\active
Packit fc043f
 @gdef@activebackslashdouble{%
Packit fc043f
   @catcode`@\=@active
Packit fc043f
   @let\=@doublebackslash}
Packit fc043f
}
Packit fc043f
Packit fc043f
% To handle parens, we must adopt a different approach, since parens are
Packit fc043f
% not active characters.  hyperref.dtx (which has the same problem as
Packit fc043f
% us) handles it with this amazing macro to replace tokens, with minor
Packit fc043f
% changes for Texinfo.  It is included here under the GPL by permission
Packit fc043f
% from the author, Heiko Oberdiek.
Packit fc043f
%
Packit fc043f
% #1 is the tokens to replace.
Packit fc043f
% #2 is the replacement.
Packit fc043f
% #3 is the control sequence with the string.
Packit fc043f
%
Packit fc043f
\def\HyPsdSubst#1#2#3{%
Packit fc043f
  \def\HyPsdReplace##1#1##2\END{%
Packit fc043f
    ##1%
Packit fc043f
    \ifx\\##2\\%
Packit fc043f
    \else
Packit fc043f
      #2%
Packit fc043f
      \HyReturnAfterFi{%
Packit fc043f
        \HyPsdReplace##2\END
Packit fc043f
      }%
Packit fc043f
    \fi
Packit fc043f
  }%
Packit fc043f
  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
Packit fc043f
}
Packit fc043f
\long\def\HyReturnAfterFi#1\fi{\fi#1}
Packit fc043f
Packit fc043f
% #1 is a control sequence in which to do the replacements.
Packit fc043f
\def\backslashparens#1{%
Packit fc043f
  \xdef#1{#1}% redefine it as its expansion; the definition is simply
Packit fc043f
             % \lastnode when called from \setref -> \pdfmkdest.
Packit fc043f
  \HyPsdSubst{(}{\realbackslash(}{#1}%
Packit fc043f
  \HyPsdSubst{)}{\realbackslash)}{#1}%
Packit fc043f
}
Packit fc043f
Packit fc043f
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
Packit fc043f
with PDF output, and none of those formats could be found.  (.eps cannot
Packit fc043f
be supported due to the design of the PDF format; use regular TeX (DVI
Packit fc043f
output) for that.)}
Packit fc043f
Packit fc043f
\ifpdf
Packit fc043f
  \input pdfcolor
Packit fc043f
  \pdfcatalog{/PageMode /UseOutlines}
Packit fc043f
  %
Packit fc043f
  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
Packit fc043f
  \def\dopdfimage#1#2#3{%
Packit fc043f
    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
Packit fc043f
    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
Packit fc043f
    %
Packit fc043f
    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
Packit fc043f
    % others).  Let's try in that order.
Packit fc043f
    \let\pdfimgext=\empty
Packit fc043f
    \begingroup
Packit fc043f
      \openin 1 #1.png \ifeof 1
Packit fc043f
        \openin 1 #1.jpg \ifeof 1
Packit fc043f
          \openin 1 #1.jpeg \ifeof 1
Packit fc043f
            \openin 1 #1.JPG \ifeof 1
Packit fc043f
              \openin 1 #1.pdf \ifeof 1
Packit fc043f
                \errhelp = \nopdfimagehelp
Packit fc043f
                \errmessage{Could not find image file #1 for pdf}%
Packit fc043f
              \else \gdef\pdfimgext{pdf}%
Packit fc043f
              \fi
Packit fc043f
            \else \gdef\pdfimgext{JPG}%
Packit fc043f
            \fi
Packit fc043f
          \else \gdef\pdfimgext{jpeg}%
Packit fc043f
          \fi
Packit fc043f
        \else \gdef\pdfimgext{jpg}%
Packit fc043f
        \fi
Packit fc043f
      \else \gdef\pdfimgext{png}%
Packit fc043f
      \fi
Packit fc043f
      \closein 1
Packit fc043f
    \endgroup
Packit fc043f
    %
Packit fc043f
    % without \immediate, pdftex seg faults when the same image is
Packit fc043f
    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
Packit fc043f
    \ifnum\pdftexversion < 14
Packit fc043f
      \immediate\pdfimage
Packit fc043f
    \else
Packit fc043f
      \immediate\pdfximage
Packit fc043f
    \fi
Packit fc043f
      \ifdim \wd0 >0pt width \imagewidth \fi
Packit fc043f
      \ifdim \wd2 >0pt height \imageheight \fi
Packit fc043f
      \ifnum\pdftexversion<13
Packit fc043f
         #1.\pdfimgext
Packit fc043f
       \else
Packit fc043f
         {#1.\pdfimgext}%
Packit fc043f
       \fi
Packit fc043f
    \ifnum\pdftexversion < 14 \else
Packit fc043f
      \pdfrefximage \pdflastximage
Packit fc043f
    \fi}
Packit fc043f
  %
Packit fc043f
  \def\pdfmkdest#1{{%
Packit fc043f
    % We have to set dummies so commands such as @code, and characters
Packit fc043f
    % such as \, aren't expanded when present in a section title.
Packit fc043f
    \indexnofonts
Packit fc043f
    \turnoffactive
Packit fc043f
    \activebackslashdouble
Packit fc043f
    \makevalueexpandable
Packit fc043f
    \def\pdfdestname{#1}%
Packit fc043f
    \backslashparens\pdfdestname
Packit fc043f
    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
Packit fc043f
  }}
Packit fc043f
  %
Packit fc043f
  % used to mark target names; must be expandable.
Packit fc043f
  \def\pdfmkpgn#1{#1}
Packit fc043f
  %
Packit fc043f
  % by default, use a color that is dark enough to print on paper as
Packit fc043f
  % nearly black, but still distinguishable for online viewing.
Packit fc043f
  % (Defined in pdfcolor.tex.)
Packit fc043f
  \let\urlcolor = \BrickRed
Packit fc043f
  \let\linkcolor = \BrickRed
Packit fc043f
  \def\endlink{\Black\pdfendlink}
Packit fc043f
  %
Packit fc043f
  % Adding outlines to PDF; macros for calculating structure of outlines
Packit fc043f
  % come from Petr Olsak
Packit fc043f
  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
Packit fc043f
    \else \csname#1\endcsname \fi}
Packit fc043f
  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
Packit fc043f
    \advance\tempnum by 1
Packit fc043f
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
Packit fc043f
  %
Packit fc043f
  % #1 is the section text, which is what will be displayed in the
Packit fc043f
  % outline by the pdf viewer.  #2 is the pdf expression for the number
Packit fc043f
  % of subentries (or empty, for subsubsections).  #3 is the node text,
Packit fc043f
  % which might be empty if this toc entry had no corresponding node.
Packit fc043f
  % #4 is the page number
Packit fc043f
  %
Packit fc043f
  \def\dopdfoutline#1#2#3#4{%
Packit fc043f
    % Generate a link to the node text if that exists; else, use the
Packit fc043f
    % page number.  We could generate a destination for the section
Packit fc043f
    % text in the case where a section has no node, but it doesn't
Packit fc043f
    % seem worth the trouble, since most documents are normally structured.
Packit fc043f
    \def\pdfoutlinedest{#3}%
Packit fc043f
    \ifx\pdfoutlinedest\empty
Packit fc043f
      \def\pdfoutlinedest{#4}%
Packit fc043f
    \else
Packit fc043f
      % Doubled backslashes in the name.
Packit fc043f
      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
Packit fc043f
       \backslashparens\pdfoutlinedest}%
Packit fc043f
    \fi
Packit fc043f
    %
Packit fc043f
    % Also double the backslashes in the display string.
Packit fc043f
    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
Packit fc043f
     \backslashparens\pdfoutlinetext}%
Packit fc043f
    %
Packit fc043f
    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
Packit fc043f
  }
Packit fc043f
  %
Packit fc043f
  \def\pdfmakeoutlines{%
Packit fc043f
    \begingroup
Packit fc043f
      % Thanh's hack / proper braces in bookmarks
Packit fc043f
      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
Packit fc043f
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
Packit fc043f
      %
Packit fc043f
      % Read toc silently, to get counts of subentries for \pdfoutline.
Packit fc043f
      \def\numchapentry##1##2##3##4{%
Packit fc043f
	\def\thischapnum{##2}%
Packit fc043f
	\def\thissecnum{0}%
Packit fc043f
	\def\thissubsecnum{0}%
Packit fc043f
      }%
Packit fc043f
      \def\numsecentry##1##2##3##4{%
Packit fc043f
	\advancenumber{chap\thischapnum}%
Packit fc043f
	\def\thissecnum{##2}%
Packit fc043f
	\def\thissubsecnum{0}%
Packit fc043f
      }%
Packit fc043f
      \def\numsubsecentry##1##2##3##4{%
Packit fc043f
	\advancenumber{sec\thissecnum}%
Packit fc043f
	\def\thissubsecnum{##2}%
Packit fc043f
      }%
Packit fc043f
      \def\numsubsubsecentry##1##2##3##4{%
Packit fc043f
	\advancenumber{subsec\thissubsecnum}%
Packit fc043f
      }%
Packit fc043f
      \def\thischapnum{0}%
Packit fc043f
      \def\thissecnum{0}%
Packit fc043f
      \def\thissubsecnum{0}%
Packit fc043f
      %
Packit fc043f
      % use \def rather than \let here because we redefine \chapentry et
Packit fc043f
      % al. a second time, below.
Packit fc043f
      \def\appentry{\numchapentry}%
Packit fc043f
      \def\appsecentry{\numsecentry}%
Packit fc043f
      \def\appsubsecentry{\numsubsecentry}%
Packit fc043f
      \def\appsubsubsecentry{\numsubsubsecentry}%
Packit fc043f
      \def\unnchapentry{\numchapentry}%
Packit fc043f
      \def\unnsecentry{\numsecentry}%
Packit fc043f
      \def\unnsubsecentry{\numsubsecentry}%
Packit fc043f
      \def\unnsubsubsecentry{\numsubsubsecentry}%
Packit fc043f
      \readdatafile{toc}%
Packit fc043f
      %
Packit fc043f
      % Read toc second time, this time actually producing the outlines.
Packit fc043f
      % The `-' means take the \expnumber as the absolute number of
Packit fc043f
      % subentries, which we calculated on our first read of the .toc above.
Packit fc043f
      %
Packit fc043f
      % We use the node names as the destinations.
Packit fc043f
      \def\numchapentry##1##2##3##4{%
Packit fc043f
        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
Packit fc043f
      \def\numsecentry##1##2##3##4{%
Packit fc043f
        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
Packit fc043f
      \def\numsubsecentry##1##2##3##4{%
Packit fc043f
        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
Packit fc043f
      \def\numsubsubsecentry##1##2##3##4{% count is always zero
Packit fc043f
        \dopdfoutline{##1}{}{##3}{##4}}%
Packit fc043f
      %
Packit fc043f
      % PDF outlines are displayed using system fonts, instead of
Packit fc043f
      % document fonts.  Therefore we cannot use special characters,
Packit fc043f
      % since the encoding is unknown.  For example, the eogonek from
Packit fc043f
      % Latin 2 (0xea) gets translated to a | character.  Info from
Packit fc043f
      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
Packit fc043f
      %
Packit fc043f
      % xx to do this right, we have to translate 8-bit characters to
Packit fc043f
      % their "best" equivalent, based on the @documentencoding.  Right
Packit fc043f
      % now, I guess we'll just let the pdf reader have its way.
Packit fc043f
      \indexnofonts
Packit fc043f
      \setupdatafile
Packit fc043f
      \catcode`\\=\active \otherbackslash
Packit fc043f
      \input \jobname.toc
Packit fc043f
    \endgroup
Packit fc043f
  }
Packit fc043f
  %
Packit fc043f
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
Packit fc043f
    \ifx\PP\D\let\nextsp\relax
Packit fc043f
    \else\let\nextsp\skipspaces
Packit fc043f
      \ifx\p\space\else\addtokens{\filename}{\PP}%
Packit fc043f
        \advance\filenamelength by 1
Packit fc043f
      \fi
Packit fc043f
    \fi
Packit fc043f
    \nextsp}
Packit fc043f
  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
Packit fc043f
  \ifnum\pdftexversion < 14
Packit fc043f
    \let \startlink \pdfannotlink
Packit fc043f
  \else
Packit fc043f
    \let \startlink \pdfstartlink
Packit fc043f
  \fi
Packit fc043f
  % make a live url in pdf output.
Packit fc043f
  \def\pdfurl#1{%
Packit fc043f
    \begingroup
Packit fc043f
      % it seems we really need yet another set of dummies; have not
Packit fc043f
      % tried to figure out what each command should do in the context
Packit fc043f
      % of @url.  for now, just make @/ a no-op, that's the only one
Packit fc043f
      % people have actually reported a problem with.
Packit fc043f
      %
Packit fc043f
      \normalturnoffactive
Packit fc043f
      \def\@{@}%
Packit fc043f
      \let\/=\empty
Packit fc043f
      \makevalueexpandable
Packit fc043f
      \leavevmode\urlcolor
Packit fc043f
      \startlink attr{/Border [0 0 0]}%
Packit fc043f
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
Packit fc043f
    \endgroup}
Packit fc043f
  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
Packit fc043f
  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
Packit fc043f
  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
Packit fc043f
  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
Packit fc043f
  \def\maketoks{%
Packit fc043f
    \expandafter\poptoks\the\toksA|ENDTOKS|\relax
Packit fc043f
    \ifx\first0\adn0
Packit fc043f
    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
Packit fc043f
    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
Packit fc043f
    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
Packit fc043f
    \else
Packit fc043f
      \ifnum0=\countA\else\makelink\fi
Packit fc043f
      \ifx\first.\let\next=\done\else
Packit fc043f
        \let\next=\maketoks
Packit fc043f
        \addtokens{\toksB}{\the\toksD}
Packit fc043f
        \ifx\first,\addtokens{\toksB}{\space}\fi
Packit fc043f
      \fi
Packit fc043f
    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
Packit fc043f
    \next}
Packit fc043f
  \def\makelink{\addtokens{\toksB}%
Packit fc043f
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
Packit fc043f
  \def\pdflink#1{%
Packit fc043f
    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
Packit fc043f
    \linkcolor #1\endlink}
Packit fc043f
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
Packit fc043f
\else
Packit fc043f
  \let\pdfmkdest = \gobble
Packit fc043f
  \let\pdfurl = \gobble
Packit fc043f
  \let\endlink = \relax
Packit fc043f
  \let\linkcolor = \relax
Packit fc043f
  \let\pdfmakeoutlines = \relax
Packit fc043f
\fi  % \ifx\pdfoutput
Packit fc043f
Packit fc043f
Packit fc043f
\message{fonts,}
Packit fc043f
Packit fc043f
% Change the current font style to #1, remembering it in \curfontstyle.
Packit fc043f
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
Packit fc043f
% italics, not bold italics.
Packit fc043f
%
Packit fc043f
\def\setfontstyle#1{%
Packit fc043f
  \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
Packit fc043f
  \csname ten#1\endcsname  % change the current font
Packit fc043f
}
Packit fc043f
Packit fc043f
% Select #1 fonts with the current style.
Packit fc043f
%
Packit fc043f
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
Packit fc043f
Packit fc043f
\def\rm{\fam=0 \setfontstyle{rm}}
Packit fc043f
\def\it{\fam=\itfam \setfontstyle{it}}
Packit fc043f
\def\sl{\fam=\slfam \setfontstyle{sl}}
Packit fc043f
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
Packit fc043f
\def\tt{\fam=\ttfam \setfontstyle{tt}}
Packit fc043f
Packit fc043f
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
Packit fc043f
% So we set up a \sf.
Packit fc043f
\newfam\sffam
Packit fc043f
\def\sf{\fam=\sffam \setfontstyle{sf}}
Packit fc043f
\let\li = \sf % Sometimes we call it \li, not \sf.
Packit fc043f
Packit fc043f
% We don't need math for this font style.
Packit fc043f
\def\ttsl{\setfontstyle{ttsl}}
Packit fc043f
Packit fc043f
Packit fc043f
% Default leading.
Packit fc043f
\newdimen\textleading  \textleading = 13.2pt
Packit fc043f
Packit fc043f
% Set the baselineskip to #1, and the lineskip and strut size
Packit fc043f
% correspondingly.  There is no deep meaning behind these magic numbers
Packit fc043f
% used as factors; they just match (closely enough) what Knuth defined.
Packit fc043f
%
Packit fc043f
\def\lineskipfactor{.08333}
Packit fc043f
\def\strutheightpercent{.70833}
Packit fc043f
\def\strutdepthpercent {.29167}
Packit fc043f
%
Packit fc043f
\def\setleading#1{%
Packit fc043f
  \normalbaselineskip = #1\relax
Packit fc043f
  \normallineskip = \lineskipfactor\normalbaselineskip
Packit fc043f
  \normalbaselines
Packit fc043f
  \setbox\strutbox =\hbox{%
Packit fc043f
    \vrule width0pt height\strutheightpercent\baselineskip
Packit fc043f
                    depth \strutdepthpercent \baselineskip
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
%
Packit fc043f
% PDF CMaps.  See also LaTeX's t1.cmap.
Packit fc043f
%
Packit fc043f
% \cmapOT1
Packit fc043f
\ifpdf
Packit fc043f
  \begingroup
Packit fc043f
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
Packit fc043f
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
Packit fc043f
%%DocumentNeededResources: ProcSet (CIDInit)
Packit fc043f
%%IncludeResource: ProcSet (CIDInit)
Packit fc043f
%%BeginResource: CMap (TeX-OT1-0)
Packit fc043f
%%Title: (TeX-OT1-0 TeX OT1 0)
Packit fc043f
%%Version: 1.000
Packit fc043f
%%EndComments
Packit fc043f
/CIDInit /ProcSet findresource begin
Packit fc043f
12 dict begin
Packit fc043f
begincmap
Packit fc043f
/CIDSystemInfo
Packit fc043f
<< /Registry (TeX)
Packit fc043f
/Ordering (OT1)
Packit fc043f
/Supplement 0
Packit fc043f
>> def
Packit fc043f
/CMapName /TeX-OT1-0 def
Packit fc043f
/CMapType 2 def
Packit fc043f
1 begincodespacerange
Packit fc043f
<00> <7F>
Packit fc043f
endcodespacerange
Packit fc043f
8 beginbfrange
Packit fc043f
<00> <01> <0393>
Packit fc043f
<09> <0A> <03A8>
Packit fc043f
<23> <26> <0023>
Packit fc043f
<28> <3B> <0028>
Packit fc043f
<3F> <5B> <003F>
Packit fc043f
<5D> <5E> <005D>
Packit fc043f
<61> <7A> <0061>
Packit fc043f
<7B> <7C> <2013>
Packit fc043f
endbfrange
Packit fc043f
40 beginbfchar
Packit fc043f
<02> <0398>
Packit fc043f
<03> <039B>
Packit fc043f
<04> <039E>
Packit fc043f
<05> <03A0>
Packit fc043f
<06> <03A3>
Packit fc043f
<07> <03D2>
Packit fc043f
<08> <03A6>
Packit fc043f
<0B> <00660066>
Packit fc043f
<0C> <00660069>
Packit fc043f
<0D> <0066006C>
Packit fc043f
<0E> <006600660069>
Packit fc043f
<0F> <00660066006C>
Packit fc043f
<10> <0131>
Packit fc043f
<11> <0237>
Packit fc043f
<12> <0060>
Packit fc043f
<13> <00B4>
Packit fc043f
<14> <02C7>
Packit fc043f
<15> <02D8>
Packit fc043f
<16> <00AF>
Packit fc043f
<17> <02DA>
Packit fc043f
<18> <00B8>
Packit fc043f
<19> <00DF>
Packit fc043f
<1A> <00E6>
Packit fc043f
<1B> <0153>
Packit fc043f
<1C> <00F8>
Packit fc043f
<1D> <00C6>
Packit fc043f
<1E> <0152>
Packit fc043f
<1F> <00D8>
Packit fc043f
<21> <0021>
Packit fc043f
<22> <201D>
Packit fc043f
<27> <2019>
Packit fc043f
<3C> <00A1>
Packit fc043f
<3D> <003D>
Packit fc043f
<3E> <00BF>
Packit fc043f
<5C> <201C>
Packit fc043f
<5F> <02D9>
Packit fc043f
<60> <2018>
Packit fc043f
<7D> <02DD>
Packit fc043f
<7E> <007E>
Packit fc043f
<7F> <00A8>
Packit fc043f
endbfchar
Packit fc043f
endcmap
Packit fc043f
CMapName currentdict /CMap defineresource pop
Packit fc043f
end
Packit fc043f
end
Packit fc043f
%%EndResource
Packit fc043f
%%EOF
Packit fc043f
    }\endgroup
Packit fc043f
  \expandafter\edef\csname cmapOT1\endcsname#1{%
Packit fc043f
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
Packit fc043f
  }%
Packit fc043f
%
Packit fc043f
% \cmapOT1IT
Packit fc043f
  \begingroup
Packit fc043f
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
Packit fc043f
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
Packit fc043f
%%DocumentNeededResources: ProcSet (CIDInit)
Packit fc043f
%%IncludeResource: ProcSet (CIDInit)
Packit fc043f
%%BeginResource: CMap (TeX-OT1IT-0)
Packit fc043f
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
Packit fc043f
%%Version: 1.000
Packit fc043f
%%EndComments
Packit fc043f
/CIDInit /ProcSet findresource begin
Packit fc043f
12 dict begin
Packit fc043f
begincmap
Packit fc043f
/CIDSystemInfo
Packit fc043f
<< /Registry (TeX)
Packit fc043f
/Ordering (OT1IT)
Packit fc043f
/Supplement 0
Packit fc043f
>> def
Packit fc043f
/CMapName /TeX-OT1IT-0 def
Packit fc043f
/CMapType 2 def
Packit fc043f
1 begincodespacerange
Packit fc043f
<00> <7F>
Packit fc043f
endcodespacerange
Packit fc043f
8 beginbfrange
Packit fc043f
<00> <01> <0393>
Packit fc043f
<09> <0A> <03A8>
Packit fc043f
<25> <26> <0025>
Packit fc043f
<28> <3B> <0028>
Packit fc043f
<3F> <5B> <003F>
Packit fc043f
<5D> <5E> <005D>
Packit fc043f
<61> <7A> <0061>
Packit fc043f
<7B> <7C> <2013>
Packit fc043f
endbfrange
Packit fc043f
42 beginbfchar
Packit fc043f
<02> <0398>
Packit fc043f
<03> <039B>
Packit fc043f
<04> <039E>
Packit fc043f
<05> <03A0>
Packit fc043f
<06> <03A3>
Packit fc043f
<07> <03D2>
Packit fc043f
<08> <03A6>
Packit fc043f
<0B> <00660066>
Packit fc043f
<0C> <00660069>
Packit fc043f
<0D> <0066006C>
Packit fc043f
<0E> <006600660069>
Packit fc043f
<0F> <00660066006C>
Packit fc043f
<10> <0131>
Packit fc043f
<11> <0237>
Packit fc043f
<12> <0060>
Packit fc043f
<13> <00B4>
Packit fc043f
<14> <02C7>
Packit fc043f
<15> <02D8>
Packit fc043f
<16> <00AF>
Packit fc043f
<17> <02DA>
Packit fc043f
<18> <00B8>
Packit fc043f
<19> <00DF>
Packit fc043f
<1A> <00E6>
Packit fc043f
<1B> <0153>
Packit fc043f
<1C> <00F8>
Packit fc043f
<1D> <00C6>
Packit fc043f
<1E> <0152>
Packit fc043f
<1F> <00D8>
Packit fc043f
<21> <0021>
Packit fc043f
<22> <201D>
Packit fc043f
<23> <0023>
Packit fc043f
<24> <00A3>
Packit fc043f
<27> <2019>
Packit fc043f
<3C> <00A1>
Packit fc043f
<3D> <003D>
Packit fc043f
<3E> <00BF>
Packit fc043f
<5C> <201C>
Packit fc043f
<5F> <02D9>
Packit fc043f
<60> <2018>
Packit fc043f
<7D> <02DD>
Packit fc043f
<7E> <007E>
Packit fc043f
<7F> <00A8>
Packit fc043f
endbfchar
Packit fc043f
endcmap
Packit fc043f
CMapName currentdict /CMap defineresource pop
Packit fc043f
end
Packit fc043f
end
Packit fc043f
%%EndResource
Packit fc043f
%%EOF
Packit fc043f
    }\endgroup
Packit fc043f
  \expandafter\edef\csname cmapOT1IT\endcsname#1{%
Packit fc043f
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
Packit fc043f
  }%
Packit fc043f
%
Packit fc043f
% \cmapOT1TT
Packit fc043f
  \begingroup
Packit fc043f
    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
Packit fc043f
    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
Packit fc043f
%%DocumentNeededResources: ProcSet (CIDInit)
Packit fc043f
%%IncludeResource: ProcSet (CIDInit)
Packit fc043f
%%BeginResource: CMap (TeX-OT1TT-0)
Packit fc043f
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
Packit fc043f
%%Version: 1.000
Packit fc043f
%%EndComments
Packit fc043f
/CIDInit /ProcSet findresource begin
Packit fc043f
12 dict begin
Packit fc043f
begincmap
Packit fc043f
/CIDSystemInfo
Packit fc043f
<< /Registry (TeX)
Packit fc043f
/Ordering (OT1TT)
Packit fc043f
/Supplement 0
Packit fc043f
>> def
Packit fc043f
/CMapName /TeX-OT1TT-0 def
Packit fc043f
/CMapType 2 def
Packit fc043f
1 begincodespacerange
Packit fc043f
<00> <7F>
Packit fc043f
endcodespacerange
Packit fc043f
5 beginbfrange
Packit fc043f
<00> <01> <0393>
Packit fc043f
<09> <0A> <03A8>
Packit fc043f
<21> <26> <0021>
Packit fc043f
<28> <5F> <0028>
Packit fc043f
<61> <7E> <0061>
Packit fc043f
endbfrange
Packit fc043f
32 beginbfchar
Packit fc043f
<02> <0398>
Packit fc043f
<03> <039B>
Packit fc043f
<04> <039E>
Packit fc043f
<05> <03A0>
Packit fc043f
<06> <03A3>
Packit fc043f
<07> <03D2>
Packit fc043f
<08> <03A6>
Packit fc043f
<0B> <2191>
Packit fc043f
<0C> <2193>
Packit fc043f
<0D> <0027>
Packit fc043f
<0E> <00A1>
Packit fc043f
<0F> <00BF>
Packit fc043f
<10> <0131>
Packit fc043f
<11> <0237>
Packit fc043f
<12> <0060>
Packit fc043f
<13> <00B4>
Packit fc043f
<14> <02C7>
Packit fc043f
<15> <02D8>
Packit fc043f
<16> <00AF>
Packit fc043f
<17> <02DA>
Packit fc043f
<18> <00B8>
Packit fc043f
<19> <00DF>
Packit fc043f
<1A> <00E6>
Packit fc043f
<1B> <0153>
Packit fc043f
<1C> <00F8>
Packit fc043f
<1D> <00C6>
Packit fc043f
<1E> <0152>
Packit fc043f
<1F> <00D8>
Packit fc043f
<20> <2423>
Packit fc043f
<27> <2019>
Packit fc043f
<60> <2018>
Packit fc043f
<7F> <00A8>
Packit fc043f
endbfchar
Packit fc043f
endcmap
Packit fc043f
CMapName currentdict /CMap defineresource pop
Packit fc043f
end
Packit fc043f
end
Packit fc043f
%%EndResource
Packit fc043f
%%EOF
Packit fc043f
    }\endgroup
Packit fc043f
  \expandafter\edef\csname cmapOT1TT\endcsname#1{%
Packit fc043f
    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
Packit fc043f
  }%
Packit fc043f
\else
Packit fc043f
  \expandafter\let\csname cmapOT1\endcsname\gobble
Packit fc043f
  \expandafter\let\csname cmapOT1IT\endcsname\gobble
Packit fc043f
  \expandafter\let\csname cmapOT1TT\endcsname\gobble
Packit fc043f
\fi
Packit fc043f
Packit fc043f
Packit fc043f
% Set the font macro #1 to the font named #2, adding on the
Packit fc043f
% specified font prefix (normally `cm').
Packit fc043f
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
Packit fc043f
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
Packit fc043f
% empty to omit).
Packit fc043f
\def\setfont#1#2#3#4#5{%
Packit fc043f
  \font#1=\fontprefix#2#3 scaled #4
Packit fc043f
  \csname cmap#5\endcsname#1%
Packit fc043f
}
Packit fc043f
% This is what gets called when #5 of \setfont is empty.
Packit fc043f
\let\cmap\gobble
Packit fc043f
Packit fc043f
Packit fc043f
% Use cm as the default font prefix.
Packit fc043f
% To specify the font prefix, you must define \fontprefix
Packit fc043f
% before you read in texinfo.tex.
Packit fc043f
\ifx\fontprefix\undefined
Packit fc043f
\def\fontprefix{cm}
Packit fc043f
\fi
Packit fc043f
% Support font families that don't use the same naming scheme as CM.
Packit fc043f
\def\rmshape{r}
Packit fc043f
\def\rmbshape{bx}               %where the normal face is bold
Packit fc043f
\def\bfshape{b}
Packit fc043f
\def\bxshape{bx}
Packit fc043f
\def\ttshape{tt}
Packit fc043f
\def\ttbshape{tt}
Packit fc043f
\def\ttslshape{sltt}
Packit fc043f
\def\itshape{ti}
Packit fc043f
\def\itbshape{bxti}
Packit fc043f
\def\slshape{sl}
Packit fc043f
\def\slbshape{bxsl}
Packit fc043f
\def\sfshape{ss}
Packit fc043f
\def\sfbshape{ss}
Packit fc043f
\def\scshape{csc}
Packit fc043f
\def\scbshape{csc}
Packit fc043f
Packit fc043f
% Definitions for a main text size of 11pt.  This is the default in
Packit fc043f
% Texinfo.
Packit fc043f
%
Packit fc043f
\def\definetextfontsizexi{%
Packit fc043f
% Text fonts (11.2pt, magstep1).
Packit fc043f
\def\textnominalsize{11pt}
Packit fc043f
\edef\mainmagstep{\magstephalf}
Packit fc043f
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
Packit fc043f
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
Packit fc043f
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
Packit fc043f
\font\texti=cmmi10 scaled \mainmagstep
Packit fc043f
\font\textsy=cmsy10 scaled \mainmagstep
Packit fc043f
Packit fc043f
% A few fonts for @defun names and args.
Packit fc043f
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
Packit fc043f
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
Packit fc043f
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
Packit fc043f
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
Packit fc043f
Packit fc043f
% Fonts for indices, footnotes, small examples (9pt).
Packit fc043f
\def\smallnominalsize{9pt}
Packit fc043f
\setfont\smallrm\rmshape{9}{1000}{OT1}
Packit fc043f
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
Packit fc043f
\setfont\smallbf\bfshape{10}{900}{OT1}
Packit fc043f
\setfont\smallit\itshape{9}{1000}{OT1IT}
Packit fc043f
\setfont\smallsl\slshape{9}{1000}{OT1}
Packit fc043f
\setfont\smallsf\sfshape{9}{1000}{OT1}
Packit fc043f
\setfont\smallsc\scshape{10}{900}{OT1}
Packit fc043f
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
Packit fc043f
\font\smalli=cmmi9
Packit fc043f
\font\smallsy=cmsy9
Packit fc043f
Packit fc043f
% Fonts for small examples (8pt).
Packit fc043f
\def\smallernominalsize{8pt}
Packit fc043f
\setfont\smallerrm\rmshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
Packit fc043f
\setfont\smallerbf\bfshape{10}{800}{OT1}
Packit fc043f
\setfont\smallerit\itshape{8}{1000}{OT1IT}
Packit fc043f
\setfont\smallersl\slshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallersf\sfshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallersc\scshape{10}{800}{OT1}
Packit fc043f
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
Packit fc043f
\font\smalleri=cmmi8
Packit fc043f
\font\smallersy=cmsy8
Packit fc043f
Packit fc043f
% Fonts for title page (20.4pt):
Packit fc043f
\def\titlenominalsize{20pt}
Packit fc043f
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
Packit fc043f
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
Packit fc043f
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
Packit fc043f
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
Packit fc043f
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
Packit fc043f
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
Packit fc043f
\let\titlebf=\titlerm
Packit fc043f
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
Packit fc043f
\font\titlei=cmmi12 scaled \magstep3
Packit fc043f
\font\titlesy=cmsy10 scaled \magstep4
Packit fc043f
\def\authorrm{\secrm}
Packit fc043f
\def\authortt{\sectt}
Packit fc043f
Packit fc043f
% Chapter (and unnumbered) fonts (17.28pt).
Packit fc043f
\def\chapnominalsize{17pt}
Packit fc043f
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
Packit fc043f
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
Packit fc043f
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
Packit fc043f
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
Packit fc043f
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
Packit fc043f
\setfont\chapsf\sfbshape{17}{1000}{OT1}
Packit fc043f
\let\chapbf=\chaprm
Packit fc043f
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
Packit fc043f
\font\chapi=cmmi12 scaled \magstep2
Packit fc043f
\font\chapsy=cmsy10 scaled \magstep3
Packit fc043f
Packit fc043f
% Section fonts (14.4pt).
Packit fc043f
\def\secnominalsize{14pt}
Packit fc043f
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
Packit fc043f
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
Packit fc043f
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
Packit fc043f
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
Packit fc043f
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
Packit fc043f
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
Packit fc043f
\let\secbf\secrm
Packit fc043f
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
Packit fc043f
\font\seci=cmmi12 scaled \magstep1
Packit fc043f
\font\secsy=cmsy10 scaled \magstep2
Packit fc043f
Packit fc043f
% Subsection fonts (13.15pt).
Packit fc043f
\def\ssecnominalsize{13pt}
Packit fc043f
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
Packit fc043f
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
Packit fc043f
\setfont\ssecsl\slbshape{10}{1315}{OT1}
Packit fc043f
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
Packit fc043f
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
Packit fc043f
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
Packit fc043f
\let\ssecbf\ssecrm
Packit fc043f
\setfont\ssecsc\scbshape{10}{1315}{OT1}
Packit fc043f
\font\sseci=cmmi12 scaled \magstephalf
Packit fc043f
\font\ssecsy=cmsy10 scaled 1315
Packit fc043f
Packit fc043f
% Reduced fonts for @acro in text (10pt).
Packit fc043f
\def\reducednominalsize{10pt}
Packit fc043f
\setfont\reducedrm\rmshape{10}{1000}{OT1}
Packit fc043f
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
Packit fc043f
\setfont\reducedbf\bfshape{10}{1000}{OT1}
Packit fc043f
\setfont\reducedit\itshape{10}{1000}{OT1IT}
Packit fc043f
\setfont\reducedsl\slshape{10}{1000}{OT1}
Packit fc043f
\setfont\reducedsf\sfshape{10}{1000}{OT1}
Packit fc043f
\setfont\reducedsc\scshape{10}{1000}{OT1}
Packit fc043f
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
Packit fc043f
\font\reducedi=cmmi10
Packit fc043f
\font\reducedsy=cmsy10
Packit fc043f
Packit fc043f
% reset the current fonts
Packit fc043f
\textfonts
Packit fc043f
\rm
Packit fc043f
} % end of 11pt text font size definitions
Packit fc043f
Packit fc043f
Packit fc043f
% Definitions to make the main text be 10pt Computer Modern, with
Packit fc043f
% section, chapter, etc., sizes following suit.  This is for the GNU
Packit fc043f
% Press printing of the Emacs 22 manual.  Maybe other manuals in the
Packit fc043f
% future.  Used with @smallbook, which sets the leading to 12pt.
Packit fc043f
%
Packit fc043f
\def\definetextfontsizex{%
Packit fc043f
% Text fonts (10pt).
Packit fc043f
\def\textnominalsize{10pt}
Packit fc043f
\edef\mainmagstep{1000}
Packit fc043f
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
Packit fc043f
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
Packit fc043f
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
Packit fc043f
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
Packit fc043f
\font\texti=cmmi10 scaled \mainmagstep
Packit fc043f
\font\textsy=cmsy10 scaled \mainmagstep
Packit fc043f
Packit fc043f
% A few fonts for @defun names and args.
Packit fc043f
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
Packit fc043f
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
Packit fc043f
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
Packit fc043f
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
Packit fc043f
Packit fc043f
% Fonts for indices, footnotes, small examples (9pt).
Packit fc043f
\def\smallnominalsize{9pt}
Packit fc043f
\setfont\smallrm\rmshape{9}{1000}{OT1}
Packit fc043f
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
Packit fc043f
\setfont\smallbf\bfshape{10}{900}{OT1}
Packit fc043f
\setfont\smallit\itshape{9}{1000}{OT1IT}
Packit fc043f
\setfont\smallsl\slshape{9}{1000}{OT1}
Packit fc043f
\setfont\smallsf\sfshape{9}{1000}{OT1}
Packit fc043f
\setfont\smallsc\scshape{10}{900}{OT1}
Packit fc043f
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
Packit fc043f
\font\smalli=cmmi9
Packit fc043f
\font\smallsy=cmsy9
Packit fc043f
Packit fc043f
% Fonts for small examples (8pt).
Packit fc043f
\def\smallernominalsize{8pt}
Packit fc043f
\setfont\smallerrm\rmshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
Packit fc043f
\setfont\smallerbf\bfshape{10}{800}{OT1}
Packit fc043f
\setfont\smallerit\itshape{8}{1000}{OT1IT}
Packit fc043f
\setfont\smallersl\slshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallersf\sfshape{8}{1000}{OT1}
Packit fc043f
\setfont\smallersc\scshape{10}{800}{OT1}
Packit fc043f
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
Packit fc043f
\font\smalleri=cmmi8
Packit fc043f
\font\smallersy=cmsy8
Packit fc043f
Packit fc043f
% Fonts for title page (20.4pt):
Packit fc043f
\def\titlenominalsize{20pt}
Packit fc043f
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
Packit fc043f
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
Packit fc043f
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
Packit fc043f
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
Packit fc043f
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
Packit fc043f
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
Packit fc043f
\let\titlebf=\titlerm
Packit fc043f
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
Packit fc043f
\font\titlei=cmmi12 scaled \magstep3
Packit fc043f
\font\titlesy=cmsy10 scaled \magstep4
Packit fc043f
\def\authorrm{\secrm}
Packit fc043f
\def\authortt{\sectt}
Packit fc043f
Packit fc043f
% Chapter fonts (14.4pt).
Packit fc043f
\def\chapnominalsize{14pt}
Packit fc043f
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
Packit fc043f
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
Packit fc043f
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
Packit fc043f
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
Packit fc043f
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
Packit fc043f
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
Packit fc043f
\let\chapbf\chaprm
Packit fc043f
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
Packit fc043f
\font\chapi=cmmi12 scaled \magstep1
Packit fc043f
\font\chapsy=cmsy10 scaled \magstep2
Packit fc043f
Packit fc043f
% Section fonts (12pt).
Packit fc043f
\def\secnominalsize{12pt}
Packit fc043f
\setfont\secrm\rmbshape{12}{1000}{OT1}
Packit fc043f
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
Packit fc043f
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
Packit fc043f
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
Packit fc043f
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
Packit fc043f
\setfont\secsf\sfbshape{12}{1000}{OT1}
Packit fc043f
\let\secbf\secrm
Packit fc043f
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
Packit fc043f
\font\seci=cmmi12
Packit fc043f
\font\secsy=cmsy10 scaled \magstep1
Packit fc043f
Packit fc043f
% Subsection fonts (10pt).
Packit fc043f
\def\ssecnominalsize{10pt}
Packit fc043f
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
Packit fc043f
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
Packit fc043f
\setfont\ssecsl\slbshape{10}{1000}{OT1}
Packit fc043f
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
Packit fc043f
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
Packit fc043f
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
Packit fc043f
\let\ssecbf\ssecrm
Packit fc043f
\setfont\ssecsc\scbshape{10}{1000}{OT1}
Packit fc043f
\font\sseci=cmmi10
Packit fc043f
\font\ssecsy=cmsy10
Packit fc043f
Packit fc043f
% Reduced fonts for @acro in text (9pt).
Packit fc043f
\def\reducednominalsize{9pt}
Packit fc043f
\setfont\reducedrm\rmshape{9}{1000}{OT1}
Packit fc043f
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
Packit fc043f
\setfont\reducedbf\bfshape{10}{900}{OT1}
Packit fc043f
\setfont\reducedit\itshape{9}{1000}{OT1IT}
Packit fc043f
\setfont\reducedsl\slshape{9}{1000}{OT1}
Packit fc043f
\setfont\reducedsf\sfshape{9}{1000}{OT1}
Packit fc043f
\setfont\reducedsc\scshape{10}{900}{OT1}
Packit fc043f
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
Packit fc043f
\font\reducedi=cmmi9
Packit fc043f
\font\reducedsy=cmsy9
Packit fc043f
Packit fc043f
% reduce space between paragraphs
Packit fc043f
\divide\parskip by 2
Packit fc043f
Packit fc043f
% reset the current fonts
Packit fc043f
\textfonts
Packit fc043f
\rm
Packit fc043f
} % end of 10pt text font size definitions
Packit fc043f
Packit fc043f
Packit fc043f
% We provide the user-level command
Packit fc043f
%   @fonttextsize 10
Packit fc043f
% (or 11) to redefine the text font size.  pt is assumed.
Packit fc043f
%
Packit fc043f
\def\xword{10}
Packit fc043f
\def\xiword{11}
Packit fc043f
%
Packit fc043f
\parseargdef\fonttextsize{%
Packit fc043f
  \def\textsizearg{#1}%
Packit fc043f
  \wlog{doing @fonttextsize \textsizearg}%
Packit fc043f
  %
Packit fc043f
  % Set \globaldefs so that documents can use this inside @tex, since
Packit fc043f
  % makeinfo 4.8 does not support it, but we need it nonetheless.
Packit fc043f
  %
Packit fc043f
 \begingroup \globaldefs=1
Packit fc043f
  \ifx\textsizearg\xword \definetextfontsizex
Packit fc043f
  \else \ifx\textsizearg\xiword \definetextfontsizexi
Packit fc043f
  \else
Packit fc043f
    \errhelp=\EMsimple
Packit fc043f
    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
Packit fc043f
  \fi\fi
Packit fc043f
 \endgroup
Packit fc043f
}
Packit fc043f
Packit fc043f
Packit fc043f
% In order for the font changes to affect most math symbols and letters,
Packit fc043f
% we have to define the \textfont of the standard families.  Since
Packit fc043f
% texinfo doesn't allow for producing subscripts and superscripts except
Packit fc043f
% in the main text, we don't bother to reset \scriptfont and
Packit fc043f
% \scriptscriptfont (which would also require loading a lot more fonts).
Packit fc043f
%
Packit fc043f
\def\resetmathfonts{%
Packit fc043f
  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
Packit fc043f
  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
Packit fc043f
  \textfont\ttfam=\tentt \textfont\sffam=\tensf
Packit fc043f
}
Packit fc043f
Packit fc043f
% The font-changing commands redefine the meanings of \tenSTYLE, instead
Packit fc043f
% of just \STYLE.  We do this because \STYLE needs to also set the
Packit fc043f
% current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
Packit fc043f
% \tenSTYLE to set the current font.
Packit fc043f
%
Packit fc043f
% Each font-changing command also sets the names \lsize (one size lower)
Packit fc043f
% and \lllsize (three sizes lower).  These relative commands are used in
Packit fc043f
% the LaTeX logo and acronyms.
Packit fc043f
%
Packit fc043f
% This all needs generalizing, badly.
Packit fc043f
%
Packit fc043f
\def\textfonts{%
Packit fc043f
  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
Packit fc043f
  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
Packit fc043f
  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
Packit fc043f
  \let\tenttsl=\textttsl
Packit fc043f
  \def\curfontsize{text}%
Packit fc043f
  \def\lsize{reduced}\def\lllsize{smaller}%
Packit fc043f
  \resetmathfonts \setleading{\textleading}}
Packit fc043f
\def\titlefonts{%
Packit fc043f
  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
Packit fc043f
  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
Packit fc043f
  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
Packit fc043f
  \let\tenttsl=\titlettsl
Packit fc043f
  \def\curfontsize{title}%
Packit fc043f
  \def\lsize{chap}\def\lllsize{subsec}%
Packit fc043f
  \resetmathfonts \setleading{25pt}}
Packit fc043f
\def\titlefont#1{{\titlefonts\rm #1}}
Packit fc043f
\def\chapfonts{%
Packit fc043f
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
Packit fc043f
  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
Packit fc043f
  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
Packit fc043f
  \let\tenttsl=\chapttsl
Packit fc043f
  \def\curfontsize{chap}%
Packit fc043f
  \def\lsize{sec}\def\lllsize{text}%
Packit fc043f
  \resetmathfonts \setleading{19pt}}
Packit fc043f
\def\secfonts{%
Packit fc043f
  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
Packit fc043f
  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
Packit fc043f
  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
Packit fc043f
  \let\tenttsl=\secttsl
Packit fc043f
  \def\curfontsize{sec}%
Packit fc043f
  \def\lsize{subsec}\def\lllsize{reduced}%
Packit fc043f
  \resetmathfonts \setleading{16pt}}
Packit fc043f
\def\subsecfonts{%
Packit fc043f
  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
Packit fc043f
  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
Packit fc043f
  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
Packit fc043f
  \let\tenttsl=\ssecttsl
Packit fc043f
  \def\curfontsize{ssec}%
Packit fc043f
  \def\lsize{text}\def\lllsize{small}%
Packit fc043f
  \resetmathfonts \setleading{15pt}}
Packit fc043f
\let\subsubsecfonts = \subsecfonts
Packit fc043f
\def\reducedfonts{%
Packit fc043f
  \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
Packit fc043f
  \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
Packit fc043f
  \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
Packit fc043f
  \let\tenttsl=\reducedttsl
Packit fc043f
  \def\curfontsize{reduced}%
Packit fc043f
  \def\lsize{small}\def\lllsize{smaller}%
Packit fc043f
  \resetmathfonts \setleading{10.5pt}}
Packit fc043f
\def\smallfonts{%
Packit fc043f
  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
Packit fc043f
  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
Packit fc043f
  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
Packit fc043f
  \let\tenttsl=\smallttsl
Packit fc043f
  \def\curfontsize{small}%
Packit fc043f
  \def\lsize{smaller}\def\lllsize{smaller}%
Packit fc043f
  \resetmathfonts \setleading{10.5pt}}
Packit fc043f
\def\smallerfonts{%
Packit fc043f
  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
Packit fc043f
  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
Packit fc043f
  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
Packit fc043f
  \let\tenttsl=\smallerttsl
Packit fc043f
  \def\curfontsize{smaller}%
Packit fc043f
  \def\lsize{smaller}\def\lllsize{smaller}%
Packit fc043f
  \resetmathfonts \setleading{9.5pt}}
Packit fc043f
Packit fc043f
% Set the fonts to use with the @small... environments.
Packit fc043f
\let\smallexamplefonts = \smallfonts
Packit fc043f
Packit fc043f
% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
Packit fc043f
% can fit this many characters:
Packit fc043f
%   8.5x11=86   smallbook=72  a4=90  a5=69
Packit fc043f
% If we use \scriptfonts (8pt), then we can fit this many characters:
Packit fc043f
%   8.5x11=90+  smallbook=80  a4=90+  a5=77
Packit fc043f
% For me, subjectively, the few extra characters that fit aren't worth
Packit fc043f
% the additional smallness of 8pt.  So I'm making the default 9pt.
Packit fc043f
%
Packit fc043f
% By the way, for comparison, here's what fits with @example (10pt):
Packit fc043f
%   8.5x11=71  smallbook=60  a4=75  a5=58
Packit fc043f
%
Packit fc043f
% I wish the USA used A4 paper.
Packit fc043f
% --karl, 24jan03.
Packit fc043f
Packit fc043f
Packit fc043f
% Set up the default fonts, so we can use them for creating boxes.
Packit fc043f
%
Packit fc043f
\definetextfontsizexi
Packit fc043f
Packit fc043f
% Define these so they can be easily changed for other fonts.
Packit fc043f
\def\angleleft{$\langle$}
Packit fc043f
\def\angleright{$\rangle$}
Packit fc043f
Packit fc043f
% Count depth in font-changes, for error checks
Packit fc043f
\newcount\fontdepth \fontdepth=0
Packit fc043f
Packit fc043f
% Fonts for short table of contents.
Packit fc043f
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
Packit fc043f
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
Packit fc043f
\setfont\shortcontsl\slshape{12}{1000}{OT1}
Packit fc043f
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
Packit fc043f
Packit fc043f
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
Packit fc043f
%% serif) and @ii for TeX italic
Packit fc043f
Packit fc043f
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
Packit fc043f
% unless the following character is such as not to need one.
Packit fc043f
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
Packit fc043f
                    \ptexslash\fi\fi\fi}
Packit fc043f
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
Packit fc043f
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
Packit fc043f
Packit fc043f
% like \smartslanted except unconditionally uses \ttsl.
Packit fc043f
% @var is set to this for defun arguments.
Packit fc043f
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
Packit fc043f
Packit fc043f
% like \smartslanted except unconditionally use \sl.  We never want
Packit fc043f
% ttsl for book titles, do we?
Packit fc043f
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
Packit fc043f
Packit fc043f
\let\i=\smartitalic
Packit fc043f
\let\slanted=\smartslanted
Packit fc043f
\let\var=\smartslanted
Packit fc043f
\let\dfn=\smartslanted
Packit fc043f
\let\emph=\smartitalic
Packit fc043f
Packit fc043f
% @b, explicit bold.
Packit fc043f
\def\b#1{{\bf #1}}
Packit fc043f
\let\strong=\b
Packit fc043f
Packit fc043f
% @sansserif, explicit sans.
Packit fc043f
\def\sansserif#1{{\sf #1}}
Packit fc043f
Packit fc043f
% We can't just use \exhyphenpenalty, because that only has effect at
Packit fc043f
% the end of a paragraph.  Restore normal hyphenation at the end of the
Packit fc043f
% group within which \nohyphenation is presumably called.
Packit fc043f
%
Packit fc043f
\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
Packit fc043f
\def\restorehyphenation{\hyphenchar\font = `- }
Packit fc043f
Packit fc043f
% Set sfcode to normal for the chars that usually have another value.
Packit fc043f
% Can't use plain's \frenchspacing because it uses the `\x notation, and
Packit fc043f
% sometimes \x has an active definition that messes things up.
Packit fc043f
%
Packit fc043f
\catcode`@=11
Packit fc043f
  \def\plainfrenchspacing{%
Packit fc043f
    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
Packit fc043f
    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
Packit fc043f
    \def\endofsentencespacefactor{1000}% for @. and friends
Packit fc043f
  }
Packit fc043f
  \def\plainnonfrenchspacing{%
Packit fc043f
    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
Packit fc043f
    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
Packit fc043f
    \def\endofsentencespacefactor{3000}% for @. and friends
Packit fc043f
  }
Packit fc043f
\catcode`@=\other
Packit fc043f
\def\endofsentencespacefactor{3000}% default
Packit fc043f
Packit fc043f
\def\t#1{%
Packit fc043f
  {\tt \rawbackslash \plainfrenchspacing #1}%
Packit fc043f
  \null
Packit fc043f
}
Packit fc043f
\def\samp#1{`\tclose{#1}'\null}
Packit fc043f
\setfont\keyrm\rmshape{8}{1000}{OT1}
Packit fc043f
\font\keysy=cmsy9
Packit fc043f
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
Packit fc043f
  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
Packit fc043f
    \vbox{\hrule\kern-0.4pt
Packit fc043f
     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
Packit fc043f
    \kern-0.4pt\hrule}%
Packit fc043f
  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
Packit fc043f
\def\key #1{{\nohyphenation \uppercase{#1}}\null}
Packit fc043f
% The old definition, with no lozenge:
Packit fc043f
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
Packit fc043f
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
Packit fc043f
Packit fc043f
% @file, @option are the same as @samp.
Packit fc043f
\let\file=\samp
Packit fc043f
\let\option=\samp
Packit fc043f
Packit fc043f
% @code is a modification of @t,
Packit fc043f
% which makes spaces the same size as normal in the surrounding text.
Packit fc043f
\def\tclose#1{%
Packit fc043f
  {%
Packit fc043f
    % Change normal interword space to be same as for the current font.
Packit fc043f
    \spaceskip = \fontdimen2\font
Packit fc043f
    %
Packit fc043f
    % Switch to typewriter.
Packit fc043f
    \tt
Packit fc043f
    %
Packit fc043f
    % But `\ ' produces the large typewriter interword space.
Packit fc043f
    \def\ {{\spaceskip = 0pt{} }}%
Packit fc043f
    %
Packit fc043f
    % Turn off hyphenation.
Packit fc043f
    \nohyphenation
Packit fc043f
    %
Packit fc043f
    \rawbackslash
Packit fc043f
    \plainfrenchspacing
Packit fc043f
    #1%
Packit fc043f
  }%
Packit fc043f
  \null
Packit fc043f
}
Packit fc043f
Packit fc043f
% We *must* turn on hyphenation at `-' and `_' in @code.
Packit fc043f
% Otherwise, it is too hard to avoid overfull hboxes
Packit fc043f
% in the Emacs manual, the Library manual, etc.
Packit fc043f
Packit fc043f
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
Packit fc043f
% both hyphenation at - and hyphenation within words.
Packit fc043f
% We must therefore turn them both off (\tclose does that)
Packit fc043f
% and arrange explicitly to hyphenate at a dash.
Packit fc043f
%  -- rms.
Packit fc043f
{
Packit fc043f
  \catcode`\-=\active \catcode`\_=\active
Packit fc043f
  \catcode`\'=\active \catcode`\`=\active
Packit fc043f
  %
Packit fc043f
  \global\def\code{\begingroup
Packit fc043f
    \catcode\rquoteChar=\active \catcode\lquoteChar=\active
Packit fc043f
    \let'\codequoteright \let`\codequoteleft
Packit fc043f
    %
Packit fc043f
    \catcode\dashChar=\active  \catcode\underChar=\active
Packit fc043f
    \ifallowcodebreaks
Packit fc043f
     \let-\codedash
Packit fc043f
     \let_\codeunder
Packit fc043f
    \else
Packit fc043f
     \let-\realdash
Packit fc043f
     \let_\realunder
Packit fc043f
    \fi
Packit fc043f
    \codex
Packit fc043f
  }
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\realdash{-}
Packit fc043f
\def\codedash{-\discretionary{}{}{}}
Packit fc043f
\def\codeunder{%
Packit fc043f
  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
Packit fc043f
  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
Packit fc043f
  % will therefore expand the active definition of _, which is us
Packit fc043f
  % (inside @code that is), therefore an endless loop.
Packit fc043f
  \ifusingtt{\ifmmode
Packit fc043f
               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
Packit fc043f
             \else\normalunderscore \fi
Packit fc043f
             \discretionary{}{}{}}%
Packit fc043f
            {\_}%
Packit fc043f
}
Packit fc043f
\def\codex #1{\tclose{#1}\endgroup}
Packit fc043f
Packit fc043f
% An additional complication: the above will allow breaks after, e.g.,
Packit fc043f
% each of the four underscores in __typeof__.  This is undesirable in
Packit fc043f
% some manuals, especially if they don't have long identifiers in
Packit fc043f
% general.  @allowcodebreaks provides a way to control this.
Packit fc043f
%
Packit fc043f
\newif\ifallowcodebreaks  \allowcodebreakstrue
Packit fc043f
Packit fc043f
\def\keywordtrue{true}
Packit fc043f
\def\keywordfalse{false}
Packit fc043f
Packit fc043f
\parseargdef\allowcodebreaks{%
Packit fc043f
  \def\txiarg{#1}%
Packit fc043f
  \ifx\txiarg\keywordtrue
Packit fc043f
    \allowcodebreakstrue
Packit fc043f
  \else\ifx\txiarg\keywordfalse
Packit fc043f
    \allowcodebreaksfalse
Packit fc043f
  \else
Packit fc043f
    \errhelp = \EMsimple
Packit fc043f
    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
Packit fc043f
  \fi\fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @kbd is like @code, except that if the argument is just one @key command,
Packit fc043f
% then @kbd has no effect.
Packit fc043f
Packit fc043f
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
Packit fc043f
%   `example' (@kbd uses ttsl only inside of @example and friends),
Packit fc043f
%   or `code' (@kbd uses normal tty font always).
Packit fc043f
\parseargdef\kbdinputstyle{%
Packit fc043f
  \def\txiarg{#1}%
Packit fc043f
  \ifx\txiarg\worddistinct
Packit fc043f
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
Packit fc043f
  \else\ifx\txiarg\wordexample
Packit fc043f
    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
Packit fc043f
  \else\ifx\txiarg\wordcode
Packit fc043f
    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
Packit fc043f
  \else
Packit fc043f
    \errhelp = \EMsimple
Packit fc043f
    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
Packit fc043f
  \fi\fi\fi
Packit fc043f
}
Packit fc043f
\def\worddistinct{distinct}
Packit fc043f
\def\wordexample{example}
Packit fc043f
\def\wordcode{code}
Packit fc043f
Packit fc043f
% Default is `distinct.'
Packit fc043f
\kbdinputstyle distinct
Packit fc043f
Packit fc043f
\def\xkey{\key}
Packit fc043f
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
Packit fc043f
\ifx\one\xkey\ifx\threex\three \key{#2}%
Packit fc043f
\else{\tclose{\kbdfont\look}}\fi
Packit fc043f
\else{\tclose{\kbdfont\look}}\fi}
Packit fc043f
Packit fc043f
% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
Packit fc043f
\let\indicateurl=\code
Packit fc043f
\let\env=\code
Packit fc043f
\let\command=\code
Packit fc043f
Packit fc043f
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
Packit fc043f
% second argument specifying the text to display and an optional third
Packit fc043f
% arg as text to display instead of (rather than in addition to) the url
Packit fc043f
% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
Packit fc043f
% a hypertex \special here.
Packit fc043f
%
Packit fc043f
\def\uref#1{\douref #1,,,\finish}
Packit fc043f
\def\douref#1,#2,#3,#4\finish{\begingroup
Packit fc043f
  \unsepspaces
Packit fc043f
  \pdfurl{#1}%
Packit fc043f
  \setbox0 = \hbox{\ignorespaces #3}%
Packit fc043f
  \ifdim\wd0 > 0pt
Packit fc043f
    \unhbox0 % third arg given, show only that
Packit fc043f
  \else
Packit fc043f
    \setbox0 = \hbox{\ignorespaces #2}%
Packit fc043f
    \ifdim\wd0 > 0pt
Packit fc043f
      \ifpdf
Packit fc043f
        \unhbox0             % PDF: 2nd arg given, show only it
Packit fc043f
      \else
Packit fc043f
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
Packit fc043f
      \fi
Packit fc043f
    \else
Packit fc043f
      \code{#1}% only url given, so show it
Packit fc043f
    \fi
Packit fc043f
  \fi
Packit fc043f
  \endlink
Packit fc043f
\endgroup}
Packit fc043f
Packit fc043f
% @url synonym for @uref, since that's how everyone uses it.
Packit fc043f
%
Packit fc043f
\let\url=\uref
Packit fc043f
Packit fc043f
% rms does not like angle brackets --karl, 17may97.
Packit fc043f
% So now @email is just like @uref, unless we are pdf.
Packit fc043f
%
Packit fc043f
%\def\email#1{\angleleft{\tt #1}\angleright}
Packit fc043f
\ifpdf
Packit fc043f
  \def\email#1{\doemail#1,,\finish}
Packit fc043f
  \def\doemail#1,#2,#3\finish{\begingroup
Packit fc043f
    \unsepspaces
Packit fc043f
    \pdfurl{mailto:#1}%
Packit fc043f
    \setbox0 = \hbox{\ignorespaces #2}%
Packit fc043f
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
Packit fc043f
    \endlink
Packit fc043f
  \endgroup}
Packit fc043f
\else
Packit fc043f
  \let\email=\uref
Packit fc043f
\fi
Packit fc043f
Packit fc043f
% Check if we are currently using a typewriter font.  Since all the
Packit fc043f
% Computer Modern typewriter fonts have zero interword stretch (and
Packit fc043f
% shrink), and it is reasonable to expect all typewriter fonts to have
Packit fc043f
% this property, we can check that font parameter.
Packit fc043f
%
Packit fc043f
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
Packit fc043f
Packit fc043f
% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
Packit fc043f
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
Packit fc043f
%
Packit fc043f
\def\dmn#1{\thinspace #1}
Packit fc043f
Packit fc043f
\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
Packit fc043f
Packit fc043f
% @l was never documented to mean ``switch to the Lisp font'',
Packit fc043f
% and it is not used as such in any manual I can find.  We need it for
Packit fc043f
% Polish suppressed-l.  --karl, 22sep96.
Packit fc043f
%\def\l#1{{\li #1}\null}
Packit fc043f
Packit fc043f
% Explicit font changes: @r, @sc, undocumented @ii.
Packit fc043f
\def\r#1{{\rm #1}}              % roman font
Packit fc043f
\def\sc#1{{\smallcaps#1}}       % smallcaps font
Packit fc043f
\def\ii#1{{\it #1}}             % italic font
Packit fc043f
Packit fc043f
% @acronym for "FBI", "NATO", and the like.
Packit fc043f
% We print this one point size smaller, since it's intended for
Packit fc043f
% all-uppercase.
Packit fc043f
%
Packit fc043f
\def\acronym#1{\doacronym #1,,\finish}
Packit fc043f
\def\doacronym#1,#2,#3\finish{%
Packit fc043f
  {\selectfonts\lsize #1}%
Packit fc043f
  \def\temp{#2}%
Packit fc043f
  \ifx\temp\empty \else
Packit fc043f
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @abbr for "Comput. J." and the like.
Packit fc043f
% No font change, but don't do end-of-sentence spacing.
Packit fc043f
%
Packit fc043f
\def\abbr#1{\doabbr #1,,\finish}
Packit fc043f
\def\doabbr#1,#2,#3\finish{%
Packit fc043f
  {\plainfrenchspacing #1}%
Packit fc043f
  \def\temp{#2}%
Packit fc043f
  \ifx\temp\empty \else
Packit fc043f
    \space ({\unsepspaces \ignorespaces \temp \unskip})%
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
Packit fc043f
%
Packit fc043f
\def\pounds{{\it\$}}
Packit fc043f
Packit fc043f
% @euro{} comes from a separate font, depending on the current style.
Packit fc043f
% We use the free feym* fonts from the eurosym package by Henrik
Packit fc043f
% Theiling, which support regular, slanted, bold and bold slanted (and
Packit fc043f
% "outlined" (blackboard board, sort of) versions, which we don't need).
Packit fc043f
% It is available from https://www.ctan.org/tex-archive/fonts/eurosym.
Packit fc043f
%
Packit fc043f
% Although only regular is the truly official Euro symbol, we ignore
Packit fc043f
% that.  The Euro is designed to be slightly taller than the regular
Packit fc043f
% font height.
Packit fc043f
%
Packit fc043f
% feymr - regular
Packit fc043f
% feymo - slanted
Packit fc043f
% feybr - bold
Packit fc043f
% feybo - bold slanted
Packit fc043f
%
Packit fc043f
% There is no good (free) typewriter version, to my knowledge.
Packit fc043f
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
Packit fc043f
% Hmm.
Packit fc043f
%
Packit fc043f
% Also doesn't work in math.  Do we need to do math with euro symbols?
Packit fc043f
% Hope not.
Packit fc043f
%
Packit fc043f
%
Packit fc043f
\def\euro{{\eurofont e}}
Packit fc043f
\def\eurofont{%
Packit fc043f
  % We set the font at each command, rather than predefining it in
Packit fc043f
  % \textfonts and the other font-switching commands, so that
Packit fc043f
  % installations which never need the symbol don't have to have the
Packit fc043f
  % font installed.
Packit fc043f
  %
Packit fc043f
  % There is only one designed size (nominal 10pt), so we always scale
Packit fc043f
  % that to the current nominal size.
Packit fc043f
  %
Packit fc043f
  % By the way, simply using "at 1em" works for cmr10 and the like, but
Packit fc043f
  % does not work for cmbx10 and other extended/shrunken fonts.
Packit fc043f
  %
Packit fc043f
  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
Packit fc043f
  %
Packit fc043f
  \ifx\curfontstyle\bfstylename
Packit fc043f
    % bold:
Packit fc043f
    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
Packit fc043f
  \else
Packit fc043f
    % regular:
Packit fc043f
    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
Packit fc043f
  \fi
Packit fc043f
  \thiseurofont
Packit fc043f
}
Packit fc043f
Packit fc043f
% @registeredsymbol - R in a circle.  The font for the R should really
Packit fc043f
% be smaller yet, but lllsize is the best we can do for now.
Packit fc043f
% Adapted from the plain.tex definition of \copyright.
Packit fc043f
%
Packit fc043f
\def\registeredsymbol{%
Packit fc043f
  $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
Packit fc043f
               \hfil\crcr\Orb}}%
Packit fc043f
    }$%
Packit fc043f
}
Packit fc043f
Packit fc043f
% @textdegree - the normal degrees sign.
Packit fc043f
%
Packit fc043f
\def\textdegree{$^\circ$}
Packit fc043f
Packit fc043f
% Laurent Siebenmann reports \Orb undefined with:
Packit fc043f
%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
Packit fc043f
% so we'll define it if necessary.
Packit fc043f
%
Packit fc043f
\ifx\Orb\undefined
Packit fc043f
\def\Orb{\mathhexbox20D}
Packit fc043f
\fi
Packit fc043f
Packit fc043f
Packit fc043f
\message{page headings,}
Packit fc043f
Packit fc043f
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
Packit fc043f
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
Packit fc043f
Packit fc043f
% First the title page.  Must do @settitle before @titlepage.
Packit fc043f
\newif\ifseenauthor
Packit fc043f
\newif\iffinishedtitlepage
Packit fc043f
Packit fc043f
% Do an implicit @contents or @shortcontents after @end titlepage if the
Packit fc043f
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
Packit fc043f
%
Packit fc043f
\newif\ifsetcontentsaftertitlepage
Packit fc043f
 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
Packit fc043f
\newif\ifsetshortcontentsaftertitlepage
Packit fc043f
 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
Packit fc043f
Packit fc043f
\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
Packit fc043f
        \endgroup\page\hbox{}\page}
Packit fc043f
Packit fc043f
\envdef\titlepage{%
Packit fc043f
  % Open one extra group, as we want to close it in the middle of \Etitlepage.
Packit fc043f
  \begingroup
Packit fc043f
    \parindent=0pt \textfonts
Packit fc043f
    % Leave some space at the very top of the page.
Packit fc043f
    \vglue\titlepagetopglue
Packit fc043f
    % No rule at page bottom unless we print one at the top with @title.
Packit fc043f
    \finishedtitlepagetrue
Packit fc043f
    %
Packit fc043f
    % Most title ``pages'' are actually two pages long, with space
Packit fc043f
    % at the top of the second.  We don't want the ragged left on the second.
Packit fc043f
    \let\oldpage = \page
Packit fc043f
    \def\page{%
Packit fc043f
      \iffinishedtitlepage\else
Packit fc043f
	 \finishtitlepage
Packit fc043f
      \fi
Packit fc043f
      \let\page = \oldpage
Packit fc043f
      \page
Packit fc043f
      \null
Packit fc043f
    }%
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\Etitlepage{%
Packit fc043f
    \iffinishedtitlepage\else
Packit fc043f
	\finishtitlepage
Packit fc043f
    \fi
Packit fc043f
    % It is important to do the page break before ending the group,
Packit fc043f
    % because the headline and footline are only empty inside the group.
Packit fc043f
    % If we use the new definition of \page, we always get a blank page
Packit fc043f
    % after the title page, which we certainly don't want.
Packit fc043f
    \oldpage
Packit fc043f
  \endgroup
Packit fc043f
  %
Packit fc043f
  % Need this before the \...aftertitlepage checks so that if they are
Packit fc043f
  % in effect the toc pages will come out with page numbers.
Packit fc043f
  \HEADINGSon
Packit fc043f
  %
Packit fc043f
  % If they want short, they certainly want long too.
Packit fc043f
  \ifsetshortcontentsaftertitlepage
Packit fc043f
    \shortcontents
Packit fc043f
    \contents
Packit fc043f
    \global\let\shortcontents = \relax
Packit fc043f
    \global\let\contents = \relax
Packit fc043f
  \fi
Packit fc043f
  %
Packit fc043f
  \ifsetcontentsaftertitlepage
Packit fc043f
    \contents
Packit fc043f
    \global\let\contents = \relax
Packit fc043f
    \global\let\shortcontents = \relax
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\finishtitlepage{%
Packit fc043f
  \vskip4pt \hrule height 2pt width \hsize
Packit fc043f
  \vskip\titlepagebottomglue
Packit fc043f
  \finishedtitlepagetrue
Packit fc043f
}
Packit fc043f
Packit fc043f
%%% Macros to be used within @titlepage:
Packit fc043f
Packit fc043f
\let\subtitlerm=\tenrm
Packit fc043f
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
Packit fc043f
Packit fc043f
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
Packit fc043f
		\let\tt=\authortt}
Packit fc043f
Packit fc043f
\parseargdef\title{%
Packit fc043f
  \checkenv\titlepage
Packit fc043f
  \leftline{\titlefonts\rm #1}
Packit fc043f
  % print a rule at the page bottom also.
Packit fc043f
  \finishedtitlepagefalse
Packit fc043f
  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
Packit fc043f
}
Packit fc043f
Packit fc043f
\parseargdef\subtitle{%
Packit fc043f
  \checkenv\titlepage
Packit fc043f
  {\subtitlefont \rightline{#1}}%
Packit fc043f
}
Packit fc043f
Packit fc043f
% @author should come last, but may come many times.
Packit fc043f
% It can also be used inside @quotation.
Packit fc043f
%
Packit fc043f
\parseargdef\author{%
Packit fc043f
  \def\temp{\quotation}%
Packit fc043f
  \ifx\thisenv\temp
Packit fc043f
    \def\quotationauthor{#1}% printed in \Equotation.
Packit fc043f
  \else
Packit fc043f
    \checkenv\titlepage
Packit fc043f
    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
Packit fc043f
    {\authorfont \leftline{#1}}%
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
Packit fc043f
%%% Set up page headings and footings.
Packit fc043f
Packit fc043f
\let\thispage=\folio
Packit fc043f
Packit fc043f
\newtoks\evenheadline    % headline on even pages
Packit fc043f
\newtoks\oddheadline     % headline on odd pages
Packit fc043f
\newtoks\evenfootline    % footline on even pages
Packit fc043f
\newtoks\oddfootline     % footline on odd pages
Packit fc043f
Packit fc043f
% Now make TeX use those variables
Packit fc043f
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
Packit fc043f
                            \else \the\evenheadline \fi}}
Packit fc043f
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
Packit fc043f
                            \else \the\evenfootline \fi}\HEADINGShook}
Packit fc043f
\let\HEADINGShook=\relax
Packit fc043f
Packit fc043f
% Commands to set those variables.
Packit fc043f
% For example, this is what  @headings on  does
Packit fc043f
% @evenheading @thistitle|@thispage|@thischapter
Packit fc043f
% @oddheading @thischapter|@thispage|@thistitle
Packit fc043f
% @evenfooting @thisfile||
Packit fc043f
% @oddfooting ||@thisfile
Packit fc043f
Packit fc043f
Packit fc043f
\def\evenheading{\parsearg\evenheadingxxx}
Packit fc043f
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
Packit fc043f
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
Packit fc043f
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
Packit fc043f
Packit fc043f
\def\oddheading{\parsearg\oddheadingxxx}
Packit fc043f
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
Packit fc043f
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
Packit fc043f
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
Packit fc043f
Packit fc043f
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
Packit fc043f
Packit fc043f
\def\evenfooting{\parsearg\evenfootingxxx}
Packit fc043f
\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
Packit fc043f
\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
Packit fc043f
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
Packit fc043f
Packit fc043f
\def\oddfooting{\parsearg\oddfootingxxx}
Packit fc043f
\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
Packit fc043f
\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
Packit fc043f
  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
Packit fc043f
  %
Packit fc043f
  % Leave some space for the footline.  Hopefully ok to assume
Packit fc043f
  % @evenfooting will not be used by itself.
Packit fc043f
  \global\advance\pageheight by -12pt
Packit fc043f
  \global\advance\vsize by -12pt
Packit fc043f
}
Packit fc043f
Packit fc043f
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
Packit fc043f
Packit fc043f
Packit fc043f
% @headings double      turns headings on for double-sided printing.
Packit fc043f
% @headings single      turns headings on for single-sided printing.
Packit fc043f
% @headings off         turns them off.
Packit fc043f
% @headings on          same as @headings double, retained for compatibility.
Packit fc043f
% @headings after       turns on double-sided headings after this page.
Packit fc043f
% @headings doubleafter turns on double-sided headings after this page.
Packit fc043f
% @headings singleafter turns on single-sided headings after this page.
Packit fc043f
% By default, they are off at the start of a document,
Packit fc043f
% and turned `on' after @end titlepage.
Packit fc043f
Packit fc043f
\def\headings #1 {\csname HEADINGS#1\endcsname}
Packit fc043f
Packit fc043f
\def\HEADINGSoff{%
Packit fc043f
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
Packit fc043f
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
Packit fc043f
\HEADINGSoff
Packit fc043f
% When we turn headings on, set the page number to 1.
Packit fc043f
% For double-sided printing, put current file name in lower left corner,
Packit fc043f
% chapter name on inside top of right hand pages, document
Packit fc043f
% title on inside top of left hand pages, and page numbers on outside top
Packit fc043f
% edge of all pages.
Packit fc043f
\def\HEADINGSdouble{%
Packit fc043f
\global\pageno=1
Packit fc043f
\global\evenfootline={\hfil}
Packit fc043f
\global\oddfootline={\hfil}
Packit fc043f
\global\evenheadline={\line{\folio\hfil\thistitle}}
Packit fc043f
\global\oddheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\let\contentsalignmacro = \chapoddpage
Packit fc043f
}
Packit fc043f
\let\contentsalignmacro = \chappager
Packit fc043f
Packit fc043f
% For single-sided printing, chapter title goes across top left of page,
Packit fc043f
% page number on top right.
Packit fc043f
\def\HEADINGSsingle{%
Packit fc043f
\global\pageno=1
Packit fc043f
\global\evenfootline={\hfil}
Packit fc043f
\global\oddfootline={\hfil}
Packit fc043f
\global\evenheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\oddheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\let\contentsalignmacro = \chappager
Packit fc043f
}
Packit fc043f
\def\HEADINGSon{\HEADINGSdouble}
Packit fc043f
Packit fc043f
\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
Packit fc043f
\let\HEADINGSdoubleafter=\HEADINGSafter
Packit fc043f
\def\HEADINGSdoublex{%
Packit fc043f
\global\evenfootline={\hfil}
Packit fc043f
\global\oddfootline={\hfil}
Packit fc043f
\global\evenheadline={\line{\folio\hfil\thistitle}}
Packit fc043f
\global\oddheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\let\contentsalignmacro = \chapoddpage
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
Packit fc043f
\def\HEADINGSsinglex{%
Packit fc043f
\global\evenfootline={\hfil}
Packit fc043f
\global\oddfootline={\hfil}
Packit fc043f
\global\evenheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\oddheadline={\line{\thischapter\hfil\folio}}
Packit fc043f
\global\let\contentsalignmacro = \chappager
Packit fc043f
}
Packit fc043f
Packit fc043f
% Subroutines used in generating headings
Packit fc043f
% This produces Day Month Year style of output.
Packit fc043f
% Only define if not already defined, in case a txi-??.tex file has set
Packit fc043f
% up a different format (e.g., txi-cs.tex does this).
Packit fc043f
\ifx\today\undefined
Packit fc043f
\def\today{%
Packit fc043f
  \number\day\space
Packit fc043f
  \ifcase\month
Packit fc043f
  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
Packit fc043f
  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
Packit fc043f
  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
Packit fc043f
  \fi
Packit fc043f
  \space\number\year}
Packit fc043f
\fi
Packit fc043f
Packit fc043f
% @settitle line...  specifies the title of the document, for headings.
Packit fc043f
% It generates no output of its own.
Packit fc043f
\def\thistitle{\putwordNoTitle}
Packit fc043f
\def\settitle{\parsearg{\gdef\thistitle}}
Packit fc043f
Packit fc043f
Packit fc043f
\message{tables,}
Packit fc043f
% Tables -- @table, @ftable, @vtable, @item(x).
Packit fc043f
Packit fc043f
% default indentation of table text
Packit fc043f
\newdimen\tableindent \tableindent=.8in
Packit fc043f
% default indentation of @itemize and @enumerate text
Packit fc043f
\newdimen\itemindent  \itemindent=.3in
Packit fc043f
% margin between end of table item and start of table text.
Packit fc043f
\newdimen\itemmargin  \itemmargin=.1in
Packit fc043f
Packit fc043f
% used internally for \itemindent minus \itemmargin
Packit fc043f
\newdimen\itemmax
Packit fc043f
Packit fc043f
% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
Packit fc043f
% these defs.
Packit fc043f
% They also define \itemindex
Packit fc043f
% to index the item name in whatever manner is desired (perhaps none).
Packit fc043f
Packit fc043f
\newif\ifitemxneedsnegativevskip
Packit fc043f
Packit fc043f
\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
Packit fc043f
Packit fc043f
\def\internalBitem{\smallbreak \parsearg\itemzzz}
Packit fc043f
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
Packit fc043f
Packit fc043f
\def\itemzzz #1{\begingroup %
Packit fc043f
  \advance\hsize by -\rightskip
Packit fc043f
  \advance\hsize by -\tableindent
Packit fc043f
  \setbox0=\hbox{\itemindicate{#1}}%
Packit fc043f
  \itemindex{#1}%
Packit fc043f
  \nobreak % This prevents a break before @itemx.
Packit fc043f
  %
Packit fc043f
  % If the item text does not fit in the space we have, put it on a line
Packit fc043f
  % by itself, and do not allow a page break either before or after that
Packit fc043f
  % line.  We do not start a paragraph here because then if the next
Packit fc043f
  % command is, e.g., @kindex, the whatsit would get put into the
Packit fc043f
  % horizontal list on a line by itself, resulting in extra blank space.
Packit fc043f
  \ifdim \wd0>\itemmax
Packit fc043f
    %
Packit fc043f
    % Make this a paragraph so we get the \parskip glue and wrapping,
Packit fc043f
    % but leave it ragged-right.
Packit fc043f
    \begingroup
Packit fc043f
      \advance\leftskip by-\tableindent
Packit fc043f
      \advance\hsize by\tableindent
Packit fc043f
      \advance\rightskip by0pt plus1fil
Packit fc043f
      \leavevmode\unhbox0\par
Packit fc043f
    \endgroup
Packit fc043f
    %
Packit fc043f
    % We're going to be starting a paragraph, but we don't want the
Packit fc043f
    % \parskip glue -- logically it's part of the @item we just started.
Packit fc043f
    \nobreak \vskip-\parskip
Packit fc043f
    %
Packit fc043f
    % Stop a page break at the \parskip glue coming up.  However, if
Packit fc043f
    % what follows is an environment such as @example, there will be no
Packit fc043f
    % \parskip glue; then the negative vskip we just inserted would
Packit fc043f
    % cause the example and the item to crash together.  So we use this
Packit fc043f
    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
Packit fc043f
    % \parskip glue after all.  Section titles are handled this way also.
Packit fc043f
    %
Packit fc043f
    \penalty 10001
Packit fc043f
    \endgroup
Packit fc043f
    \itemxneedsnegativevskipfalse
Packit fc043f
  \else
Packit fc043f
    % The item text fits into the space.  Start a paragraph, so that the
Packit fc043f
    % following text (if any) will end up on the same line.
Packit fc043f
    \noindent
Packit fc043f
    % Do this with kerns and \unhbox so that if there is a footnote in
Packit fc043f
    % the item text, it can migrate to the main vertical list and
Packit fc043f
    % eventually be printed.
Packit fc043f
    \nobreak\kern-\tableindent
Packit fc043f
    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
Packit fc043f
    \unhbox0
Packit fc043f
    \nobreak\kern\dimen0
Packit fc043f
    \endgroup
Packit fc043f
    \itemxneedsnegativevskiptrue
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
\def\item{\errmessage{@item while not in a list environment}}
Packit fc043f
\def\itemx{\errmessage{@itemx while not in a list environment}}
Packit fc043f
Packit fc043f
% @table, @ftable, @vtable.
Packit fc043f
\envdef\table{%
Packit fc043f
  \let\itemindex\gobble
Packit fc043f
  \tablecheck{table}%
Packit fc043f
}
Packit fc043f
\envdef\ftable{%
Packit fc043f
  \def\itemindex ##1{\doind {fn}{\code{##1}}}%
Packit fc043f
  \tablecheck{ftable}%
Packit fc043f
}
Packit fc043f
\envdef\vtable{%
Packit fc043f
  \def\itemindex ##1{\doind {vr}{\code{##1}}}%
Packit fc043f
  \tablecheck{vtable}%
Packit fc043f
}
Packit fc043f
\def\tablecheck#1{%
Packit fc043f
  \ifnum \the\catcode`\^^M=\active
Packit fc043f
    \endgroup
Packit fc043f
    \errmessage{This command won't work in this context; perhaps the problem is
Packit fc043f
      that we are \inenvironment\thisenv}%
Packit fc043f
    \def\next{\doignore{#1}}%
Packit fc043f
  \else
Packit fc043f
    \let\next\tablex
Packit fc043f
  \fi
Packit fc043f
  \next
Packit fc043f
}
Packit fc043f
\def\tablex#1{%
Packit fc043f
  \def\itemindicate{#1}%
Packit fc043f
  \parsearg\tabley
Packit fc043f
}
Packit fc043f
\def\tabley#1{%
Packit fc043f
  {%
Packit fc043f
    \makevalueexpandable
Packit fc043f
    \edef\temp{\noexpand\tablez #1\space\space\space}%
Packit fc043f
    \expandafter
Packit fc043f
  }\temp \endtablez
Packit fc043f
}
Packit fc043f
\def\tablez #1 #2 #3 #4\endtablez{%
Packit fc043f
  \aboveenvbreak
Packit fc043f
  \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
Packit fc043f
  \ifnum 0#2>0 \tableindent=#2\mil \fi
Packit fc043f
  \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
Packit fc043f
  \itemmax=\tableindent
Packit fc043f
  \advance \itemmax by -\itemmargin
Packit fc043f
  \advance \leftskip by \tableindent
Packit fc043f
  \exdentamount=\tableindent
Packit fc043f
  \parindent = 0pt
Packit fc043f
  \parskip = \smallskipamount
Packit fc043f
  \ifdim \parskip=0pt \parskip=2pt \fi
Packit fc043f
  \let\item = \internalBitem
Packit fc043f
  \let\itemx = \internalBitemx
Packit fc043f
}
Packit fc043f
\def\Etable{\endgraf\afterenvbreak}
Packit fc043f
\let\Eftable\Etable
Packit fc043f
\let\Evtable\Etable
Packit fc043f
\let\Eitemize\Etable
Packit fc043f
\let\Eenumerate\Etable
Packit fc043f
Packit fc043f
% This is the counter used by @enumerate, which is really @itemize
Packit fc043f
Packit fc043f
\newcount \itemno
Packit fc043f
Packit fc043f
\envdef\itemize{\parsearg\doitemize}
Packit fc043f
Packit fc043f
\def\doitemize#1{%
Packit fc043f
  \aboveenvbreak
Packit fc043f
  \itemmax=\itemindent
Packit fc043f
  \advance\itemmax by -\itemmargin
Packit fc043f
  \advance\leftskip by \itemindent
Packit fc043f
  \exdentamount=\itemindent
Packit fc043f
  \parindent=0pt
Packit fc043f
  \parskip=\smallskipamount
Packit fc043f
  \ifdim\parskip=0pt \parskip=2pt \fi
Packit fc043f
  \def\itemcontents{#1}%
Packit fc043f
  % @itemize with no arg is equivalent to @itemize @bullet.
Packit fc043f
  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
Packit fc043f
  \let\item=\itemizeitem
Packit fc043f
}
Packit fc043f
Packit fc043f
% Definition of @item while inside @itemize and @enumerate.
Packit fc043f
%
Packit fc043f
\def\itemizeitem{%
Packit fc043f
  \advance\itemno by 1  % for enumerations
Packit fc043f
  {\let\par=\endgraf \smallbreak}% reasonable place to break
Packit fc043f
  {%
Packit fc043f
   % If the document has an @itemize directly after a section title, a
Packit fc043f
   % \nobreak will be last on the list, and \sectionheading will have
Packit fc043f
   % done a \vskip-\parskip.  In that case, we don't want to zero
Packit fc043f
   % parskip, or the item text will crash with the heading.  On the
Packit fc043f
   % other hand, when there is normal text preceding the item (as there
Packit fc043f
   % usually is), we do want to zero parskip, or there would be too much
Packit fc043f
   % space.  In that case, we won't have a \nobreak before.  At least
Packit fc043f
   % that's the theory.
Packit fc043f
   \ifnum\lastpenalty<10000 \parskip=0in \fi
Packit fc043f
   \noindent
Packit fc043f
   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
Packit fc043f
   \vadjust{\penalty 1200}}% not good to break after first line of item.
Packit fc043f
  \flushcr
Packit fc043f
}
Packit fc043f
Packit fc043f
% \splitoff TOKENS\endmark defines \first to be the first token in
Packit fc043f
% TOKENS, and \rest to be the remainder.
Packit fc043f
%
Packit fc043f
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
Packit fc043f
Packit fc043f
% Allow an optional argument of an uppercase letter, lowercase letter,
Packit fc043f
% or number, to specify the first label in the enumerated list.  No
Packit fc043f
% argument is the same as `1'.
Packit fc043f
%
Packit fc043f
\envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
Packit fc043f
\def\enumeratey #1 #2\endenumeratey{%
Packit fc043f
  % If we were given no argument, pretend we were given `1'.
Packit fc043f
  \def\thearg{#1}%
Packit fc043f
  \ifx\thearg\empty \def\thearg{1}\fi
Packit fc043f
  %
Packit fc043f
  % Detect if the argument is a single token.  If so, it might be a
Packit fc043f
  % letter.  Otherwise, the only valid thing it can be is a number.
Packit fc043f
  % (We will always have one token, because of the test we just made.
Packit fc043f
  % This is a good thing, since \splitoff doesn't work given nothing at
Packit fc043f
  % all -- the first parameter is undelimited.)
Packit fc043f
  \expandafter\splitoff\thearg\endmark
Packit fc043f
  \ifx\rest\empty
Packit fc043f
    % Only one token in the argument.  It could still be anything.
Packit fc043f
    % A ``lowercase letter'' is one whose \lccode is nonzero.
Packit fc043f
    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
Packit fc043f
    %   not equal to itself.
Packit fc043f
    % Otherwise, we assume it's a number.
Packit fc043f
    %
Packit fc043f
    % We need the \relax at the end of the \ifnum lines to stop TeX from
Packit fc043f
    % continuing to look for a <number>.
Packit fc043f
    %
Packit fc043f
    \ifnum\lccode\expandafter`\thearg=0\relax
Packit fc043f
      \numericenumerate % a number (we hope)
Packit fc043f
    \else
Packit fc043f
      % It's a letter.
Packit fc043f
      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
Packit fc043f
        \lowercaseenumerate % lowercase letter
Packit fc043f
      \else
Packit fc043f
        \uppercaseenumerate % uppercase letter
Packit fc043f
      \fi
Packit fc043f
    \fi
Packit fc043f
  \else
Packit fc043f
    % Multiple tokens in the argument.  We hope it's a number.
Packit fc043f
    \numericenumerate
Packit fc043f
  \fi
Packit fc043f
}
Packit fc043f
Packit fc043f
% An @enumerate whose labels are integers.  The starting integer is
Packit fc043f
% given in \thearg.
Packit fc043f
%
Packit fc043f
\def\numericenumerate{%
Packit fc043f
  \itemno = \thearg
Packit fc043f
  \startenumeration{\the\itemno}%
Packit fc043f
}
Packit fc043f
Packit fc043f
% The starting (lowercase) letter is in \thearg.
Packit fc043f
\def\lowercaseenumerate{%
Packit fc043f
  \itemno = \expandafter`\thearg
Packit fc043f
  \startenumeration{%
Packit fc043f
    % Be sure we're not beyond the end of the alphabet.
Packit fc043f
    \ifnum\itemno=0
Packit fc043f
      \errmessage{No more lowercase letters in @enumerate; get a bigger
Packit fc043f
                  alphabet}%
Packit fc043f
    \fi
Packit fc043f
    \char\lccode\itemno
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
% The starting (uppercase) letter is in \thearg.
Packit fc043f
\def\uppercaseenumerate{%
Packit fc043f
  \itemno = \expandafter`\thearg
Packit fc043f
  \startenumeration{%
Packit fc043f
    % Be sure we're not beyond the end of the alphabet.
Packit fc043f
    \ifnum\itemno=0
Packit fc043f
      \errmessage{No more uppercase letters in @enumerate; get a bigger
Packit fc043f
                  alphabet}
Packit fc043f
    \fi
Packit fc043f
    \char\uccode\itemno
Packit fc043f
  }%
Packit fc043f
}
Packit fc043f
Packit fc043f
% Call \doitemize, adding a period to the first argument and supplying the
Packit fc043f
% common last two arguments.  Also subtract one from the initial value in
Packit fc043f
% \itemno, since @item increments \itemno.
Packit fc043f
%
Packit fc043f
\def\startenumeration#1{%
Packit fc043f
  \advance\itemno by -1
Packit fc043f
  \doitemize{#1.}\flushcr
Packit fc043f
}
Packit fc043f
Packit fc043f
% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
Packit fc043f
% to @enumerate.
Packit fc043f
%
Packit fc043f
\def\alphaenumerate{\enumerate{a}}
Packit fc043f
\def\capsenumerate{\enumerate{A}}
Packit fc043f
\def\Ealphaenumerate{\Eenumerate}
Packit fc043f
\def\Ecapsenumerate{\Eenumerate}
Packit fc043f
Packit fc043f
Packit fc043f
% @multitable macros
Packit fc043f
% Amy Hendrickson, 8/18/94, 3/6/96
Packit fc043f
%
Packit fc043f
% @multitable ... @end multitable will make as many columns as desired.
Packit fc043f
% Contents of each column will wrap at width given in preamble.  Width
Packit fc043f
% can be specified either with sample text given in a template line,
Packit fc043f
% or in percent of \hsize, the current width of text on page.
Packit fc043f
Packit fc043f
% Table can continue over pages but will only break between lines.
Packit fc043f
Packit fc043f
% To make preamble:
Packit fc043f
%
Packit fc043f
% Either define widths of columns in terms of percent of \hsize:
Packit fc043f
%   @multitable @columnfractions .25 .3 .45
Packit fc043f
%   @item ...
Packit fc043f
%
Packit fc043f
%   Numbers following @columnfractions are the percent of the total
Packit fc043f
%   current hsize to be used for each column. You may use as many
Packit fc043f
%   columns as desired.
Packit fc043f
Packit fc043f
Packit fc043f
% Or use a template:
Packit fc043f
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
Packit fc043f
%   @item ...
Packit fc043f
%   using the widest term desired in each column.
Packit fc043f
Packit fc043f
% Each new table line starts with @item, each subsequent new column
Packit fc043f
% starts with @tab. Empty columns may be produced by supplying @tab's
Packit fc043f
% with nothing between them for as many times as empty columns are needed,
Packit fc043f
% ie, @tab@tab@tab will produce two empty columns.
Packit fc043f
Packit fc043f
% @item, @tab do not need to be on their own lines, but it will not hurt
Packit fc043f
% if they are.
Packit fc043f
Packit fc043f
% Sample multitable:
Packit fc043f
Packit fc043f
%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
Packit fc043f
%   @item first col stuff @tab second col stuff @tab third col
Packit fc043f
%   @item
Packit fc043f
%   first col stuff
Packit fc043f
%   @tab
Packit fc043f
%   second col stuff
Packit fc043f
%   @tab
Packit fc043f
%   third col
Packit fc043f
%   @item first col stuff @tab second col stuff
Packit fc043f
%   @tab Many paragraphs of text may be used in any column.
Packit fc043f
%
Packit fc043f
%         They will wrap at the width determined by the template.
Packit fc043f
%   @item@tab@tab This will be in third column.
Packit fc043f
%   @end multitable
Packit fc043f
Packit fc043f
% Default dimensions may be reset by user.
Packit fc043f
% @multitableparskip is vertical space between paragraphs in table.
Packit fc043f
% @multitableparindent is paragraph indent in table.
Packit fc043f
% @multitablecolmargin is horizontal space to be left between columns.
Packit fc043f
% @multitablelinespace is space to leave between table items, baseline
Packit fc043f
%                                                            to baseline.
Packit fc043f
%   0pt means it depends on current normal line spacing.
Packit fc043f
%
Packit fc043f
\newskip\multitableparskip
Packit fc043f
\newskip\multitableparindent
Packit fc043f
\newdimen\multitablecolspace
Packit fc043f
\newskip\multitablelinespace
Packit fc043f
\multitableparskip=0pt
Packit fc043f
\multitableparindent=6pt
Packit fc043f
\multitablecolspace=12pt
Packit fc043f
\multitablelinespace=0pt
Packit fc043f
Packit fc043f
% Macros used to set up halign preamble:
Packit fc043f
%
Packit fc043f
\let\endsetuptable\relax
Packit fc043f
\def\xendsetuptable{\endsetuptable}
Packit fc043f
\let\columnfractions\relax
Packit fc043f
\def\xcolumnfractions{\columnfractions}
Packit fc043f
\newif\ifsetpercent
Packit fc043f
Packit fc043f
% #1 is the @columnfraction, usually a decimal number like .5, but might
Packit fc043f
% be just 1.  We just use it, whatever it is.
Packit fc043f
%
Packit fc043f
\def\pickupwholefraction#1 {%
Packit fc043f
  \global\advance\colcount by 1
Packit fc043f
  \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
Packit fc043f
  \setuptable
Packit fc043f
}
Packit fc043f
Packit fc043f
\newcount\colcount
Packit fc043f
\def\setuptable#1{%
Packit fc043f
  \def\firstarg{#1}%
Packit fc043f
  \ifx\firstarg\xendsetuptable
Packit fc043f
    \let\go = \relax
Packit fc043f
  \else
Packit fc043f
    \ifx\firstarg\xcolumnfractions
Packit fc043f
      \global\setpercenttrue
Packit fc043f
    \else
Packit fc043f
      \ifsetpercent
Packit fc043f
         \let\go\pickupwholefraction
Packit fc043f
      \else
Packit fc043f
         \global\advance\colcount by 1
Packit fc043f
         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
Packit fc043f
                   % separator; typically that is always in the input, anyway.
Packit fc043f
         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
Packit fc043f
      \fi
Packit fc043f
    \fi
Packit fc043f
    \ifx\go\pickupwholefraction
Packit fc043f
      % Put the argument back for the \pickupwholefraction call, so
Packit fc043f
      % we'll always have a period there to be parsed.
Packit fc043f
      \def\go{\pickupwholefraction#1}%
Packit fc043f
    \else
Packit fc043f
      \let\go = \setuptable
Packit fc043f
    \fi%
Packit fc043f
  \fi
Packit fc043f
  \go
Packit fc043f
}
Packit fc043f
Packit fc043f
% multitable-only commands.
Packit fc043f
%
Packit fc043f
% @headitem starts a heading row, which we typeset in bold.
Packit fc043f