<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>texinfo.tex</title>
<style type="text/css">
.enscript-comment { font-style: italic; color: rgb(178,34,34); }
.enscript-function-name { font-weight: bold; color: rgb(0,0,255); }
.enscript-variable-name { font-weight: bold; color: rgb(184,134,11); }
.enscript-keyword { font-weight: bold; color: rgb(160,32,240); }
.enscript-reference { font-weight: bold; color: rgb(95,158,160); }
.enscript-string { font-weight: bold; color: rgb(188,143,143); }
.enscript-builtin { font-weight: bold; color: rgb(218,112,214); }
.enscript-type { font-weight: bold; color: rgb(34,139,34); }
.enscript-highlight { text-decoration: underline; color: 0; }
</style>
</head>
<body id="top">
<h1 style="margin:8px;" id="f1">texinfo.tex&nbsp;&nbsp;&nbsp;<span style="font-weight: normal; font-size: 0.5em;">[<a href="texinfo.tex">plain text</a>]</span></h1>
<hr/>
<div></div>
<pre>
<span class="enscript-comment">% texinfo.tex -- TeX macros to handle Texinfo files.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Load plain if necessary, i.e., if running under initex.
</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> fmtname<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\input</span> plain<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\texinfoversion</span>{2003-02-03.16}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
</span><span class="enscript-comment">% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% This texinfo.tex file is free software; you can redistribute it and/or
</span><span class="enscript-comment">% modify it under the terms of the GNU General Public License as
</span><span class="enscript-comment">% published by the Free Software Foundation; either version 2, or (at
</span><span class="enscript-comment">% your option) any later version.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% This texinfo.tex file is distributed in the hope that it will be
</span><span class="enscript-comment">% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
</span><span class="enscript-comment">% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
</span><span class="enscript-comment">% General Public License for more details.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% You should have received a copy of the GNU General Public License
</span><span class="enscript-comment">% along with this texinfo.tex file; see the file COPYING.  If not, write
</span><span class="enscript-comment">% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
</span><span class="enscript-comment">% Boston, MA 02111-1307, USA.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% In other words, you are welcome to use, share and improve this program.
</span><span class="enscript-comment">% You are forbidden to forbid anyone else to use, share and improve
</span><span class="enscript-comment">% what you give them.   Help stamp out software-hoarding!
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Please try the latest version of texinfo.tex before submitting bug
</span><span class="enscript-comment">% reports; you can get the latest version from:
</span><span class="enscript-comment">%   <a href="ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex">ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex</a>
</span><span class="enscript-comment">%     (and all GNU mirrors, see <a href="http://www.gnu.org/order/ftp.html">http://www.gnu.org/order/ftp.html</a>)
</span><span class="enscript-comment">%   <a href="ftp://tug.org/tex/texinfo.tex">ftp://tug.org/tex/texinfo.tex</a>
</span><span class="enscript-comment">%     (and all CTAN mirrors, see <a href="http://www.ctan.org">http://www.ctan.org</a>),
</span><span class="enscript-comment">%   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% The GNU Texinfo home page is <a href="http://www.gnu.org/software/texinfo.">http://www.gnu.org/software/texinfo.</a>
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% The texinfo.tex in any given Texinfo distribution could well be out
</span><span class="enscript-comment">% of date, so if that's what you're using, please check.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% Send bug reports to <a href="mailto:bug-texinfo@gnu.org">bug-texinfo@gnu.org</a>.  Please include including a
</span><span class="enscript-comment">% complete document in each bug report with which we can reproduce the
</span><span class="enscript-comment">% problem.  Patches are, of course, greatly appreciated.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% To process a Texinfo manual with TeX, it's most reliable to use the
</span><span class="enscript-comment">% texi2dvi shell script that comes with the distribution.  For a simple
</span><span class="enscript-comment">% manual foo.texi, however, you can get away with this:
</span><span class="enscript-comment">%   tex foo.texi
</span><span class="enscript-comment">%   texindex foo.??
</span><span class="enscript-comment">%   tex foo.texi
</span><span class="enscript-comment">%   tex foo.texi
</span><span class="enscript-comment">%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
</span><span class="enscript-comment">% The extra TeX runs get the cross-reference information correct.
</span><span class="enscript-comment">% Sometimes one run after texindex suffices, and sometimes you need more
</span><span class="enscript-comment">% than two; texi2dvi does it as many times as necessary.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% It is possible to adapt texinfo.tex for other languages, to some
</span><span class="enscript-comment">% extent.  You can get the existing language-specific files from the
</span><span class="enscript-comment">% full Texinfo distribution.
</span>
<span class="enscript-keyword">\message</span>{Loading texinfo [version <span class="enscript-keyword">\texinfoversion</span>]:}

<span class="enscript-comment">% If in a .fmt file, print the version number
</span><span class="enscript-comment">% and turn on active characters that we couldn't do earlier because
</span><span class="enscript-comment">% they might have appeared in the input file name.
</span><span class="enscript-keyword">\everyjob</span>{<span class="enscript-keyword">\message</span>{[Texinfo version <span class="enscript-keyword">\texinfoversion</span>]}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\active</span>}

<span class="enscript-keyword">\message</span>{Basics,}
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\other</span>=12

<span class="enscript-comment">% We never want plain's outer \+ definition in Texinfo.
</span><span class="enscript-comment">% For @tex, we can use \tabalign.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\+</span> = <span class="enscript-keyword">\relax</span>

<span class="enscript-comment">% Save some parts of plain tex whose names we will redefine.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexb</span>=<span class="enscript-keyword">\b</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexbullet</span>=<span class="enscript-keyword">\bullet</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexc</span>=<span class="enscript-keyword">\c</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexcomma</span>=<span class="enscript-keyword">\,</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexdot</span>=<span class="enscript-keyword">\.</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexdots</span>=<span class="enscript-keyword">\dots</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexend</span>=<span class="enscript-keyword">\end</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexequiv</span>=<span class="enscript-keyword">\equiv</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexexclam</span>=<span class="enscript-keyword">\!</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexgtr</span>=&gt;
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexhat</span>=^
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexi</span>=<span class="enscript-keyword">\i</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexlbrace</span>=<span class="enscript-keyword">\{</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexless</span>=&lt;
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexplus</span>=+
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexrbrace</span>=<span class="enscript-keyword">\}</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexstar</span>=<span class="enscript-keyword">\*</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptext</span>=<span class="enscript-keyword">\t</span>

<span class="enscript-comment">% If this character appears in an error message or help string, it
</span><span class="enscript-comment">% starts a new line in the output.
</span><span class="enscript-keyword">\newlinechar</span> = `^^J

<span class="enscript-comment">% Set up fixed words for English if not already set.
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordAppendix</span><span class="enscript-keyword">\undefined</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordAppendix</span>{Appendix}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordChapter</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordChapter</span>{Chapter}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordfile</span><span class="enscript-keyword">\undefined</span>      <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordfile</span>{file}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordin</span><span class="enscript-keyword">\undefined</span>        <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordin</span>{in}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordIndexIsEmpty</span><span class="enscript-keyword">\undefined</span>     <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordIndexIsEmpty</span>{(Index is empty)}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordIndexNonexistent</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordIndexNonexistent</span>{(Index is nonexistent)}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordInfo</span><span class="enscript-keyword">\undefined</span>      <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordInfo</span>{Info}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordInstanceVariableof</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordInstanceVariableof</span>{Instance Variable of}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMethodon</span><span class="enscript-keyword">\undefined</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMethodon</span>{Method on}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordNoTitle</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordNoTitle</span>{No Title}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordof</span><span class="enscript-keyword">\undefined</span>        <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordof</span>{of}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\undefined</span>        <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordon</span>{on}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordpage</span><span class="enscript-keyword">\undefined</span>      <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordpage</span>{page}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordsection</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordsection</span>{section}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordSection</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordSection</span>{Section}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordsee</span><span class="enscript-keyword">\undefined</span>       <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordsee</span>{see}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordSee</span><span class="enscript-keyword">\undefined</span>       <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordSee</span>{See}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordShortTOC</span><span class="enscript-keyword">\undefined</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordShortTOC</span>{Short Contents}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordTOC</span><span class="enscript-keyword">\undefined</span>       <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordTOC</span>{Table of Contents}<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMJan</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMJan</span>{January}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMFeb</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMFeb</span>{February}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMMar</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMMar</span>{March}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMApr</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMApr</span>{April}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMMay</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMMay</span>{May}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMJun</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMJun</span>{June}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMJul</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMJul</span>{July}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMAug</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMAug</span>{August}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMSep</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMSep</span>{September}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMOct</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMOct</span>{October}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMNov</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMNov</span>{November}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordMDec</span><span class="enscript-keyword">\undefined</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordMDec</span>{December}<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDefmac</span><span class="enscript-keyword">\undefined</span>    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDefmac</span>{Macro}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDefspec</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDefspec</span>{Special Form}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDefvar</span><span class="enscript-keyword">\undefined</span>    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDefvar</span>{Variable}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDefopt</span><span class="enscript-keyword">\undefined</span>    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDefopt</span>{User Option}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDeftypevar</span><span class="enscript-keyword">\undefined</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDeftypevar</span>{Variable}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDeffunc</span><span class="enscript-keyword">\undefined</span>   <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDeffunc</span>{Function}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\putwordDeftypefun</span><span class="enscript-keyword">\undefined</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\putwordDeftypefun</span>{Function}<span class="enscript-keyword">\fi</span>

<span class="enscript-comment">% In some macros, we cannot use the `\? notation---the left quote is
</span><span class="enscript-comment">% in some cases the escape char.
</span><span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\colonChar</span> = `<span class="enscript-keyword">\:</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\commaChar</span> = `<span class="enscript-keyword">\,</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\dotChar</span>   = `<span class="enscript-keyword">\.</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\equalChar</span> = `<span class="enscript-keyword">\=</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\exclamChar</span>= `<span class="enscript-keyword">\!</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\questChar</span> = `<span class="enscript-keyword">\?</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\semiChar</span>  = `<span class="enscript-keyword">\;</span>
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\spaceChar</span> = `<span class="enscript-keyword">\ </span><span class="enscript-comment">%
</span><span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\underChar</span> = `<span class="enscript-keyword">\_</span>

<span class="enscript-comment">% Ignore a token.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\gobble</span>#1{}

<span class="enscript-comment">% True if #1 is the empty string, i.e., called like `\ifempty{}'.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifempty</span>#1{<span class="enscript-keyword">\ifemptyx</span> #1<span class="enscript-keyword">\emptymarkA</span><span class="enscript-keyword">\emptymarkB</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifemptyx</span>#1#2<span class="enscript-keyword">\emptymarkB</span>{<span class="enscript-keyword">\ifx</span> #1<span class="enscript-keyword">\emptymarkA</span>}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% Hyphenation fixes.
</span><span class="enscript-keyword">\hyphenation</span>{ap-pen-dix}
<span class="enscript-keyword">\hyphenation</span>{mini-buf-fer mini-buf-fers}
<span class="enscript-keyword">\hyphenation</span>{eshell}
<span class="enscript-keyword">\hyphenation</span>{white-space}

<span class="enscript-comment">% Margin to add to right of even pages, to left of odd pages.
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\bindingoffset</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\normaloffset</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\pagewidth</span> <span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\pageheight</span>

<span class="enscript-comment">% Sometimes it is convenient to have everything in the transcript file
</span><span class="enscript-comment">% and nothing on the terminal.  We don't just call \tracingall here,
</span><span class="enscript-comment">% since that produces some useless output on the terminal.  We also make
</span><span class="enscript-comment">% some effort to order the tracing commands to reduce output in the log
</span><span class="enscript-comment">% file; cf. trace.sty in LaTeX.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\gloggingall</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\globaldefs</span> = 1 <span class="enscript-keyword">\loggingall</span> <span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\loggingall</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tracingstats</span>2
  <span class="enscript-keyword">\tracingpages</span>1
  <span class="enscript-keyword">\tracinglostchars</span>2  <span class="enscript-comment">% 2 gives us more in etex
</span>  <span class="enscript-keyword">\tracingparagraphs</span>1
  <span class="enscript-keyword">\tracingoutput</span>1
  <span class="enscript-keyword">\tracingmacros</span>2
  <span class="enscript-keyword">\tracingrestores</span>1
  <span class="enscript-keyword">\showboxbreadth</span><span class="enscript-keyword">\maxdimen</span> <span class="enscript-keyword">\showboxdepth</span><span class="enscript-keyword">\maxdimen</span>
  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\eTeXversion</span><span class="enscript-keyword">\undefined</span><span class="enscript-keyword">\else</span> <span class="enscript-comment">% etex gives us more logging
</span>    <span class="enscript-keyword">\tracingscantokens</span>1
    <span class="enscript-keyword">\tracingifs</span>1
    <span class="enscript-keyword">\tracinggroups</span>1
    <span class="enscript-keyword">\tracingnesting</span>2
    <span class="enscript-keyword">\tracingassigns</span>1
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\tracingcommands</span>3  <span class="enscript-comment">% 3 gives us more in etex
</span>  <span class="enscript-keyword">\errorcontextlines</span><span class="enscript-keyword">\maxdimen</span>
}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% add check for \lastpenalty to plain's definitions.  If the last thing
</span><span class="enscript-comment">% we did was a \nobreak, we don't want to insert more space.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smallbreak</span>{<span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>&lt;10000<span class="enscript-keyword">\par</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span>&lt;<span class="enscript-keyword">\smallskipamount</span>
  <span class="enscript-keyword">\removelastskip</span><span class="enscript-keyword">\penalty</span>-50<span class="enscript-keyword">\smallskip</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\medbreak</span>{<span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>&lt;10000<span class="enscript-keyword">\par</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span>&lt;<span class="enscript-keyword">\medskipamount</span>
  <span class="enscript-keyword">\removelastskip</span><span class="enscript-keyword">\penalty</span>-100<span class="enscript-keyword">\medskip</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\bigbreak</span>{<span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>&lt;10000<span class="enscript-keyword">\par</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span>&lt;<span class="enscript-keyword">\bigskipamount</span>
  <span class="enscript-keyword">\removelastskip</span><span class="enscript-keyword">\penalty</span>-200<span class="enscript-keyword">\bigskip</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% For @cropmarks command.
</span><span class="enscript-comment">% Do @cropmarks to get crop marks.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifcropmarks</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\cropmarks</span> = <span class="enscript-keyword">\cropmarkstrue</span>
<span class="enscript-comment">%
</span><span class="enscript-comment">% Dimensions to add cropmarks at corners.
</span><span class="enscript-comment">% Added by P. A. MacKay, 12 Nov. 1986
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\outerhsize</span> <span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\outervsize</span> <span class="enscript-comment">% set by the paper size routines
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\cornerlong</span>  <span class="enscript-keyword">\cornerlong</span>=1pc
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\cornerthick</span> <span class="enscript-keyword">\cornerthick</span>=.3pt
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\topandbottommargin</span> <span class="enscript-keyword">\topandbottommargin</span>=.75in

<span class="enscript-comment">% Main output routine.
</span><span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\PAGE</span> = 255
<span class="enscript-keyword">\output</span> = {<span class="enscript-keyword">\onepageout</span>{<span class="enscript-keyword">\pagecontents</span><span class="enscript-keyword">\PAGE</span>}}

<span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\headlinebox</span>
<span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\footlinebox</span>

<span class="enscript-comment">% \onepageout takes a vbox as an argument.  Note that \pagecontents
</span><span class="enscript-comment">% does insertions, but you have to call it yourself.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\onepageout</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifcropmarks</span> <span class="enscript-keyword">\hoffset</span>=0pt <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\hoffset</span>=<span class="enscript-keyword">\normaloffset</span> <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span>  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hoffset</span> by <span class="enscript-keyword">\bindingoffset</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hoffset</span> by -<span class="enscript-keyword">\bindingoffset</span><span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do this outside of the \shipout so @code etc. will be expanded in
</span>  <span class="enscript-comment">% the headline as they should be, not taken literally (outputting ''code).
</span>  <span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\headlinebox</span> = <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\hsize</span>=<span class="enscript-keyword">\pagewidth</span> <span class="enscript-keyword">\makeheadline</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\footlinebox</span> = <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\hsize</span>=<span class="enscript-keyword">\pagewidth</span> <span class="enscript-keyword">\makefootline</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Have to do this stuff outside the \shipout because we want it to
</span>    <span class="enscript-comment">% take effect in \write's, yet the group defined by the \vbox ends
</span>    <span class="enscript-comment">% before the \shipout runs.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\escapechar</span> = `<span class="enscript-keyword">\\</span>     <span class="enscript-comment">% use backslash in output files.
</span>    <span class="enscript-keyword">\indexdummies</span>         <span class="enscript-comment">% don't expand commands in the output.
</span>    <span class="enscript-keyword">\normalturnoffactive</span>  <span class="enscript-comment">% \ in index entries must not stay \, e.g., if
</span>                   <span class="enscript-comment">% the page break happens to be in the middle of an example.
</span>    <span class="enscript-keyword">\shipout</span><span class="enscript-keyword">\vbox</span>{<span class="enscript-comment">%
</span>      <span class="enscript-comment">% Do this early so pdf references go to the beginning of the page.
</span>      <span class="enscript-keyword">\ifpdfmakepagedest</span> <span class="enscript-keyword">\pdfmkdest</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\pageno</span>} <span class="enscript-keyword">\fi</span>
      <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\ifcropmarks</span> <span class="enscript-keyword">\vbox</span> to <span class="enscript-keyword">\outervsize</span><span class="enscript-keyword">\bgroup</span>
        <span class="enscript-keyword">\hsize</span> = <span class="enscript-keyword">\outerhsize</span>
        <span class="enscript-keyword">\vskip</span>-<span class="enscript-keyword">\topandbottommargin</span>
        <span class="enscript-keyword">\vtop</span> to0pt{<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\ewtop</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\ewtop</span>}<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\nointerlineskip</span>
          <span class="enscript-keyword">\line</span>{<span class="enscript-comment">%
</span>            <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\moveleft</span><span class="enscript-keyword">\cornerthick</span><span class="enscript-keyword">\nstop</span>}<span class="enscript-comment">%
</span>            <span class="enscript-keyword">\hfill</span>
            <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\moveright</span><span class="enscript-keyword">\cornerthick</span><span class="enscript-keyword">\nstop</span>}<span class="enscript-comment">%
</span>          }<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\vss</span>}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\topandbottommargin</span>
        <span class="enscript-keyword">\line</span><span class="enscript-keyword">\bgroup</span>
          <span class="enscript-keyword">\hfil</span> <span class="enscript-comment">% center the page within the outer (page) hsize.
</span>          <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span><span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\bindingoffset</span><span class="enscript-keyword">\fi</span>
          <span class="enscript-keyword">\vbox</span><span class="enscript-keyword">\bgroup</span>
      <span class="enscript-keyword">\fi</span>
      <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\headlinebox</span>
      <span class="enscript-keyword">\pagebody</span>{#1}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\ht</span><span class="enscript-keyword">\footlinebox</span> &gt; 0pt
        <span class="enscript-comment">% Only leave this space if the footline is nonempty.
</span>        <span class="enscript-comment">% (We lessened \vsize for it in \oddfootingxxx.)
</span>        <span class="enscript-comment">% The \baselineskip=24pt in plain's \makefootline has no effect.
</span>        <span class="enscript-keyword">\vskip</span> 2<span class="enscript-keyword">\baselineskip</span>
        <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\footlinebox</span>
      <span class="enscript-keyword">\fi</span>
      <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\ifcropmarks</span>
          <span class="enscript-keyword">\egroup</span> <span class="enscript-comment">% end of \vbox\bgroup
</span>        <span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\egroup</span> <span class="enscript-comment">% end of (centering) \line\bgroup
</span>        <span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\topandbottommargin</span> plus1fill minus1fill
        <span class="enscript-keyword">\boxmaxdepth</span> = <span class="enscript-keyword">\cornerthick</span>
        <span class="enscript-keyword">\vbox</span> to0pt{<span class="enscript-keyword">\vss</span>
          <span class="enscript-keyword">\line</span>{<span class="enscript-comment">%
</span>            <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\moveleft</span><span class="enscript-keyword">\cornerthick</span><span class="enscript-keyword">\nsbot</span>}<span class="enscript-comment">%
</span>            <span class="enscript-keyword">\hfill</span>
            <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\moveright</span><span class="enscript-keyword">\cornerthick</span><span class="enscript-keyword">\nsbot</span>}<span class="enscript-comment">%
</span>          }<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\nointerlineskip</span>
          <span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\ewbot</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\ewbot</span>}<span class="enscript-comment">%
</span>        }<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\egroup</span> <span class="enscript-comment">% \vbox from first cropmarks clause
</span>      <span class="enscript-keyword">\fi</span>
    }<span class="enscript-comment">% end of \shipout\vbox
</span>  }<span class="enscript-comment">% end of group with \normalturnoffactive
</span>  <span class="enscript-keyword">\advancepageno</span>
  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\outputpenalty</span>&gt;-20000 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\dosupereject</span><span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\newinsert</span><span class="enscript-keyword">\margin</span> <span class="enscript-keyword">\dimen</span><span class="enscript-keyword">\margin</span>=<span class="enscript-keyword">\maxdimen</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\pagebody</span>#1{<span class="enscript-keyword">\vbox</span> to<span class="enscript-keyword">\pageheight</span>{<span class="enscript-keyword">\boxmaxdepth</span>=<span class="enscript-keyword">\maxdepth</span> #1}}
{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span> =11
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\pagecontents</span>#1{<span class="enscript-keyword">\ifvoid</span><span class="enscript-keyword">\topins</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\topins</span><span class="enscript-keyword">\fi</span>
<span class="enscript-comment">% marginal hacks, <a href="mailto:juha@viisa.uucp">juha@viisa.uucp</a> (Juha Takala)
</span><span class="enscript-keyword">\ifvoid</span><span class="enscript-keyword">\margin</span><span class="enscript-keyword">\else</span> <span class="enscript-comment">% marginal info is present
</span>  <span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\kern</span><span class="enscript-keyword">\hsize</span><span class="enscript-keyword">\vbox</span> to<span class="enscript-keyword">\z</span>@{<span class="enscript-keyword">\kern</span>1pt<span class="enscript-keyword">\box</span><span class="enscript-keyword">\margin</span> <span class="enscript-keyword">\vss</span>}}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\dimen</span>@=<span class="enscript-keyword">\dp</span>#1 <span class="enscript-keyword">\unvbox</span>#1
<span class="enscript-keyword">\ifvoid</span><span class="enscript-keyword">\footins</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\skip</span><span class="enscript-keyword">\footins</span><span class="enscript-keyword">\footnoterule</span> <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\footins</span><span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\ifr</span>@ggedbottom <span class="enscript-keyword">\kern</span>-<span class="enscript-keyword">\dimen</span>@ <span class="enscript-keyword">\vfil</span> <span class="enscript-keyword">\fi</span>}
}

<span class="enscript-comment">% Here are the rules for the cropmarks.  Note that they are
</span><span class="enscript-comment">% offset so that the space between them is truly \outerhsize or \outervsize
</span><span class="enscript-comment">% (P. A. MacKay, 12 November, 1986)
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ewtop</span>{<span class="enscript-keyword">\vrule</span> height<span class="enscript-keyword">\cornerthick</span> depth0pt width<span class="enscript-keyword">\cornerlong</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\nstop</span>{<span class="enscript-keyword">\vbox</span>
  {<span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\cornerthick</span> depth<span class="enscript-keyword">\cornerlong</span> width<span class="enscript-keyword">\cornerthick</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ewbot</span>{<span class="enscript-keyword">\vrule</span> height0pt depth<span class="enscript-keyword">\cornerthick</span> width<span class="enscript-keyword">\cornerlong</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\nsbot</span>{<span class="enscript-keyword">\vbox</span>
  {<span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\cornerlong</span> depth<span class="enscript-keyword">\cornerthick</span> width<span class="enscript-keyword">\cornerthick</span>}}

<span class="enscript-comment">% Parse an argument, then pass it to #1.  The argument is the rest of
</span><span class="enscript-comment">% the input line (except we remove a trailing comment).  #1 should be a
</span><span class="enscript-comment">% macro which expects an ordinary undelimited TeX argument.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsearg</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span> = #1<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\obeylines</span>
    <span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\parseargx</span>
}

<span class="enscript-comment">% If the next token is an obeyed space (from an @example environment or
</span><span class="enscript-comment">% the like), remove it and recurse.  Otherwise, we're done.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parseargx</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% \obeyedspace is defined far below, after the definition of \sepspaces.
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\obeyedspace</span><span class="enscript-keyword">\temp</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parseargdiscardspace</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parseargline</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Remove a single space (as the delimiter token to the macro call).
</span>{<span class="enscript-keyword">\obeyspaces</span> <span class="enscript-comment">%
</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\parseargdiscardspace</span> {<span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\parseargx</span>}}

{<span class="enscript-keyword">\obeylines</span> <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\parseargline</span>#1^^M{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">% End of the group started in \parsearg.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% First remove any @c comment, then any @comment.
</span>    <span class="enscript-comment">% Result of each macro is put in \toks0.
</span>    <span class="enscript-keyword">\argremovec</span> #1<span class="enscript-keyword">\c</span><span class="enscript-keyword">\relax</span> <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\argremovecomment</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0 <span class="enscript-keyword">\comment</span><span class="enscript-keyword">\relax</span> <span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Call the caller's macro, saved as \next in \parsearg.
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\next</span><span class="enscript-keyword">\expandafter</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Since all \c{,omment} does is throw away the argument, we can let TeX
</span><span class="enscript-comment">% do that for us.  The \relax here is matched by the \relax in the call
</span><span class="enscript-comment">% in \parseargline; it could be more or less anything, its purpose is
</span><span class="enscript-comment">% just to delimit the argument to the \c.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\argremovec</span>#1<span class="enscript-keyword">\c</span>#2<span class="enscript-keyword">\relax</span>{<span class="enscript-keyword">\toks</span>0 = {#1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\argremovecomment</span>#1<span class="enscript-keyword">\comment</span>#2<span class="enscript-keyword">\relax</span>{<span class="enscript-keyword">\toks</span>0 = {#1}}

<span class="enscript-comment">% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
</span><span class="enscript-comment">%    @end itemize  @c foo
</span><span class="enscript-comment">% will have two active spaces as part of the argument with the
</span><span class="enscript-comment">% `itemize'.  Here we remove all active spaces from #1, and assign the
</span><span class="enscript-comment">% result to \toks0.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% This loses if there are any *other* active characters besides spaces
</span><span class="enscript-comment">% in the argument -- _ ^ +, for example -- since they get expanded.
</span><span class="enscript-comment">% Fortunately, Texinfo does not define any such commands.  (If it ever
</span><span class="enscript-comment">% does, the catcode of the characters in questionwill have to be changed
</span><span class="enscript-comment">% here.)  But this means we cannot call \removeactivespaces as part of
</span><span class="enscript-comment">% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
</span><span class="enscript-comment">% that \parsearg gets might well have any character at all in it.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\removeactivespaces</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\ignoreactivespaces</span>
    <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\temp</span>{#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\toks</span>0 = <span class="enscript-keyword">\expandafter</span>{<span class="enscript-keyword">\temp</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% Change the active space to expand to nothing.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\obeyspaces</span>
  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\ignoreactivespaces</span>{<span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\let</span> =<span class="enscript-keyword">\empty</span>}
<span class="enscript-keyword">\endgroup</span>


<span class="enscript-keyword">\def</span><span class="enscript-keyword">\flushcr</span>{<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\par</span><span class="enscript-keyword">\lisppar</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\next</span>##1{}<span class="enscript-keyword">\else</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\fi</span> <span class="enscript-keyword">\next</span>}

<span class="enscript-comment">%% These are used to keep @begin/@end levels from running away
</span><span class="enscript-comment">%% Call \inENV within environments (after a \begingroup)
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifENV</span> <span class="enscript-keyword">\ENVfalse</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\inENV</span>{<span class="enscript-keyword">\ifENV</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\ENVtrue</span><span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ENVcheck</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifENV</span><span class="enscript-keyword">\errmessage</span>{Still within an environment; press RETURN to continue}
<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\fi</span>} <span class="enscript-comment">% This is not perfect, but it should reduce lossage
</span>
<span class="enscript-comment">% @begin foo  is the same as @foo, for now.
</span><span class="enscript-keyword">\newhelp</span><span class="enscript-keyword">\EMsimple</span>{Press RETURN to continue.}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\begin</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\beginxxx</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\beginxxx</span> #1{<span class="enscript-comment">%
</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> #1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
{<span class="enscript-keyword">\errhelp</span>=<span class="enscript-keyword">\EMsimple</span> <span class="enscript-keyword">\errmessage</span>{Undefined command @begin #1}}<span class="enscript-keyword">\else</span>
<span class="enscript-keyword">\csname</span> #1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% @end foo executes the definition of \Efoo.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\end</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\endxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\endxxx</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\removeactivespaces</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\endthing</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> E<span class="enscript-keyword">\endthing</span><span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> <span class="enscript-keyword">\endthing</span><span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
      <span class="enscript-comment">% There's no \foo, i.e., no ``environment'' foo.
</span>      <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\EMsimple</span>
      <span class="enscript-keyword">\errmessage</span>{Undefined command `@end <span class="enscript-keyword">\endthing</span>'}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\unmatchedenderror</span><span class="enscript-keyword">\endthing</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% Everything's ok; the right environment has been started.
</span>    <span class="enscript-keyword">\csname</span> E<span class="enscript-keyword">\endthing</span><span class="enscript-keyword">\endcsname</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% There is an environment #1, but it hasn't been started.  Give an error.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unmatchedenderror</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\EMsimple</span>
  <span class="enscript-keyword">\errmessage</span>{This `@end #1' doesn't have a matching `@#1'}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Define the control sequence \E#1 to give an unmatched @end error.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defineunmatchedend</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> E#1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\unmatchedenderror</span>{#1}}<span class="enscript-comment">%
</span>}


<span class="enscript-comment">%% Simple single-character @ commands
</span>
<span class="enscript-comment">% @@ prints an @
</span><span class="enscript-comment">% Kludge this until the fonts are right (grr).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>64}}

<span class="enscript-comment">% This is turned off because it was never documented
</span><span class="enscript-comment">% and you can use @w{...} around a quote to suppress ligatures.
</span><span class="enscript-comment">%% Define @` and @' to be the same as ` and '
</span><span class="enscript-comment">%% but suppressing ligatures.
</span><span class="enscript-comment">%\def\`{{`}}
</span><span class="enscript-comment">%\def\'{{'}}
</span>
<span class="enscript-comment">% Used to generate quoted braces.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\mylbrace</span> {{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>123}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\myrbrace</span> {{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>125}}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\{</span>=<span class="enscript-keyword">\mylbrace</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\}</span>=<span class="enscript-keyword">\myrbrace</span>
<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-comment">% Definitions to produce \{ and \} commands for indices,
</span>  <span class="enscript-comment">% and @{ and @} for the aux file.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span> = <span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span> = <span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\[</span> = 1 <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\]</span> = 2
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\!</span> = 0 <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span> = <span class="enscript-keyword">\other</span>
  !gdef!lbracecmd[<span class="enscript-keyword">\{</span>]<span class="enscript-comment">%
</span>  !gdef!rbracecmd[<span class="enscript-keyword">\}</span>]<span class="enscript-comment">%
</span>  !gdef!lbraceatcmd[@{]<span class="enscript-comment">%
</span>  !gdef!rbraceatcmd[@}]<span class="enscript-comment">%
</span>!endgroup

<span class="enscript-comment">% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
</span><span class="enscript-comment">% Others are defined by plain TeX: @` @' @&quot; @^ @~ @= @u @v @H.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\,</span> = <span class="enscript-keyword">\c</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\dotaccent</span> = <span class="enscript-keyword">\.</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ringaccent</span>#1{{<span class="enscript-keyword">\accent</span>23 #1}}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\tieaccent</span> = <span class="enscript-keyword">\t</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ubaraccent</span> = <span class="enscript-keyword">\b</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\udotaccent</span> = <span class="enscript-keyword">\d</span>

<span class="enscript-comment">% Other special characters: @questiondown @exclamdown
</span><span class="enscript-comment">% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\questiondown</span>{?`}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\exclamdown</span>{!`}

<span class="enscript-comment">% Dotless i and dotless j, used for accents.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\imacro</span>{i}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\jmacro</span>{j}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dotless</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\imacro</span> <span class="enscript-keyword">\ptexi</span>
  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\jmacro</span> <span class="enscript-keyword">\j</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\errmessage</span>{@dotless can be used only with i or j}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Be sure we're in horizontal mode when doing a tie, since we make space
</span><span class="enscript-comment">% equivalent to this in @example-like environments. Otherwise, a space
</span><span class="enscript-comment">% at the beginning of a line will start with \penalty -- and
</span><span class="enscript-comment">% since \penalty is valid in vertical mode, we'd end up putting the
</span><span class="enscript-comment">% penalty on the vertical list instead of in the new paragraph.
</span>{<span class="enscript-keyword">\catcode</span>`@ = 11
 <span class="enscript-comment">% Avoid using \@M directly, because that causes trouble
</span> <span class="enscript-comment">% if the definition is written into an index file.
</span> <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\tiepenalty</span> = <span class="enscript-keyword">\@</span>M
 <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\tie</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\penalty</span><span class="enscript-keyword">\tiepenalty</span><span class="enscript-keyword">\ </span>}
}

<span class="enscript-comment">% @: forces normal size whitespace following.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\:</span>{<span class="enscript-keyword">\spacefactor</span>=1000 }

<span class="enscript-comment">% @* forces a line break.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\*</span>{<span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\break</span><span class="enscript-keyword">\hbox</span>{}<span class="enscript-keyword">\ignorespaces</span>}

<span class="enscript-comment">% @. is an end-of-sentence period.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\.</span>{.<span class="enscript-keyword">\spacefactor</span>=3000 }

<span class="enscript-comment">% @! is an end-of-sentence bang.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\!</span>{!<span class="enscript-keyword">\spacefactor</span>=3000 }

<span class="enscript-comment">% @? is an end-of-sentence query.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\?</span>{?<span class="enscript-keyword">\spacefactor</span>=3000 }

<span class="enscript-comment">% @w prevents a word break.  Without the \leavevmode, @w at the
</span><span class="enscript-comment">% beginning of a paragraph, when TeX is still in vertical mode, would
</span><span class="enscript-comment">% produce a whole line of output instead of starting the paragraph.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\w</span>#1{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\hbox</span>{#1}}

<span class="enscript-comment">% @group ... @end group forces ... to be all on one page, by enclosing
</span><span class="enscript-comment">% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
</span><span class="enscript-comment">% to keep its height that of a normal line.  According to the rules for
</span><span class="enscript-comment">% \topskip (p.114 of the TeXbook), the glue inserted is
</span><span class="enscript-comment">% max (\topskip - \ht (first item), 0).  If that height is large,
</span><span class="enscript-comment">% therefore, no glue is inserted, and the space between the headline and
</span><span class="enscript-comment">% the text is small, which looks bad.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Another complication is that the group might be very large.  This can
</span><span class="enscript-comment">% cause the glue on the previous page to be unduly stretched, because it
</span><span class="enscript-comment">% does not have much material.  In this case, it's better to add an
</span><span class="enscript-comment">% explicit \vfill so that the extra space is at the bottom.  The
</span><span class="enscript-comment">% threshold for doing this is if the group is more than \vfilllimit
</span><span class="enscript-comment">% percent of a page (\vfilllimit can be changed inside of @tex).
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\groupbox</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\vfilllimit</span>{0.7}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\group</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\catcode</span>13=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\groupinvalidhelp</span>
    <span class="enscript-keyword">\errmessage</span>{@group invalid in context where filling is enabled}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% The \vtop we start below produces a box with normal height and large
</span>  <span class="enscript-comment">% depth; thus, TeX puts \baselineskip glue before it, and (when the
</span>  <span class="enscript-comment">% next line of text is done) \lineskip glue after it.  (See p.82 of
</span>  <span class="enscript-comment">% the TeXbook.)  Thus, space below is not quite equal to space
</span>  <span class="enscript-comment">% above.  But it's pretty close.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Egroup</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\egroup</span>           <span class="enscript-comment">% End the \vtop.
</span>    <span class="enscript-comment">% \dimen0 is the vertical size of the group's box.
</span>    <span class="enscript-keyword">\dimen</span>0 = <span class="enscript-keyword">\ht</span><span class="enscript-keyword">\groupbox</span>  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>0 by <span class="enscript-keyword">\dp</span><span class="enscript-keyword">\groupbox</span>
    <span class="enscript-comment">% \dimen2 is how much space is left on the page (more or less).
</span>    <span class="enscript-keyword">\dimen</span>2 = <span class="enscript-keyword">\pageheight</span>   <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>2 by -<span class="enscript-keyword">\pagetotal</span>
    <span class="enscript-comment">% if the group doesn't fit on the current page, and it's a big big
</span>    <span class="enscript-comment">% group, force a page break.
</span>    <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\dimen</span>0 &gt; <span class="enscript-keyword">\dimen</span>2
      <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\pagetotal</span> &lt; <span class="enscript-keyword">\vfilllimit</span><span class="enscript-keyword">\pageheight</span>
        <span class="enscript-keyword">\page</span>
      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\copy</span><span class="enscript-keyword">\groupbox</span>
    <span class="enscript-keyword">\endgroup</span>         <span class="enscript-comment">% End the \group.
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\groupbox</span> = <span class="enscript-keyword">\vtop</span><span class="enscript-keyword">\bgroup</span>
    <span class="enscript-comment">% We have to put a strut on the last line in case the @group is in
</span>    <span class="enscript-comment">% the midst of an example, rather than completely enclosing it.
</span>    <span class="enscript-comment">% Otherwise, the interline space between the last line of the group
</span>    <span class="enscript-comment">% and the first line afterwards is too small.  But we can't put the
</span>    <span class="enscript-comment">% strut in \Egroup, since there it would be on a line by itself.
</span>    <span class="enscript-comment">% Hence this just inserts a strut at the beginning of each line.
</span>    <span class="enscript-keyword">\everypar</span> = {<span class="enscript-keyword">\strut</span>}<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Since we have a strut on every line, we don't need any of TeX's
</span>    <span class="enscript-comment">% normal interline spacing.
</span>    <span class="enscript-keyword">\offinterlineskip</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% OK, but now we have to do something about blank
</span>    <span class="enscript-comment">% lines in the input in @example-like environments, which normally
</span>    <span class="enscript-comment">% just turn into \lisppar, which will insert no space now that we've
</span>    <span class="enscript-comment">% turned off the interline space.  Simplest is to make them be an
</span>    <span class="enscript-comment">% empty paragraph.
</span>    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\par</span><span class="enscript-keyword">\lisppar</span>
      <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\par</span>{<span class="enscript-keyword">\leavevmode</span> <span class="enscript-keyword">\par</span>}<span class="enscript-comment">%
</span>      <span class="enscript-comment">%
</span>      <span class="enscript-comment">% Reset ^^M's definition to new definition of \par.
</span>      <span class="enscript-keyword">\obeylines</span>
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do @comment since we are called inside an environment such as
</span>    <span class="enscript-comment">% @example, where each end-of-line in the input causes an
</span>    <span class="enscript-comment">% end-of-line in the output.  We don't want the end-of-line after
</span>    <span class="enscript-comment">% the `@group' to put extra space in the output.  Since @group
</span>    <span class="enscript-comment">% should appear on a line by itself (according to the Texinfo
</span>    <span class="enscript-comment">% manual), we don't worry about eating any user text.
</span>    <span class="enscript-keyword">\comment</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
</span><span class="enscript-comment">% message, so this ends up printing `@group can only ...'.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newhelp</span><span class="enscript-keyword">\groupinvalidhelp</span>{<span class="enscript-comment">%
</span>group can only be used in environments such as @example,^^J<span class="enscript-comment">%
</span>where each line of input produces a line of output.}

<span class="enscript-comment">% @need space-in-mils
</span><span class="enscript-comment">% forces a page break if there is not space-in-mils remaining.
</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\mil</span>  <span class="enscript-keyword">\mil</span>=0.001in

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\need</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\needx</span>}

<span class="enscript-comment">% Old definition--didn't work.
</span><span class="enscript-comment">%\def\needx #1{\par %
</span><span class="enscript-comment">%% This method tries to make TeX break the page naturally
</span><span class="enscript-comment">%% if the depth of the box does not fit.
</span><span class="enscript-comment">%{\baselineskip=0pt%
</span><span class="enscript-comment">%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
</span><span class="enscript-comment">%\prevdepth=-1000pt
</span><span class="enscript-comment">%}}
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\needx</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Ensure vertical mode, so we don't make a big box in the middle of a
</span>  <span class="enscript-comment">% paragraph.
</span>  <span class="enscript-keyword">\par</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If the @need value is less than one line space, it's useless.
</span>  <span class="enscript-keyword">\dimen</span>0 = #1<span class="enscript-keyword">\mil</span>
  <span class="enscript-keyword">\dimen</span>2 = <span class="enscript-keyword">\ht</span><span class="enscript-keyword">\strutbox</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>2 by <span class="enscript-keyword">\dp</span><span class="enscript-keyword">\strutbox</span>
  <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\dimen</span>0 &gt; <span class="enscript-keyword">\dimen</span>2
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do a \strut just to make the height of this box be normal, so the
</span>    <span class="enscript-comment">% normal leading is inserted relative to the preceding line.
</span>    <span class="enscript-comment">% And a page break here is fine.
</span>    <span class="enscript-keyword">\vtop</span> to #1<span class="enscript-keyword">\mil</span>{<span class="enscript-keyword">\strut</span><span class="enscript-keyword">\vfil</span>}<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% TeX does not even consider page breaks if a penalty added to the
</span>    <span class="enscript-comment">% main vertical list is 10000 or more.  But in order to see if the
</span>    <span class="enscript-comment">% empty box we just added fits on the page, we must make it consider
</span>    <span class="enscript-comment">% page breaks.  On the other hand, we don't want to actually break the
</span>    <span class="enscript-comment">% page after the empty box.  So we use a penalty of 9999.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% There is an extremely small chance that TeX will actually break the
</span>    <span class="enscript-comment">% page at this \penalty, if there are no other feasible breakpoints in
</span>    <span class="enscript-comment">% sight.  (If the user is using lots of big @group commands, which
</span>    <span class="enscript-comment">% almost-but-not-quite fill up a page, TeX will have a hard time doing
</span>    <span class="enscript-comment">% good page breaking, for example.)  However, I could not construct an
</span>    <span class="enscript-comment">% example where a page broke at this \penalty; if it happens in a real
</span>    <span class="enscript-comment">% document, then we can reconsider our strategy.
</span>    <span class="enscript-keyword">\penalty</span>9999
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Back up by the size of the box, whether we did a page break or not.
</span>    <span class="enscript-keyword">\kern</span> -#1<span class="enscript-keyword">\mil</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do not allow a page break right after this kern.
</span>    <span class="enscript-keyword">\nobreak</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% @br   forces paragraph break
</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\br</span> = <span class="enscript-keyword">\par</span>

<span class="enscript-comment">% @dots{} output an ellipsis using the current font.
</span><span class="enscript-comment">% We do .5em per period so that it has the same spacing in a typewriter
</span><span class="enscript-comment">% font as three actual period characters.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dots</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\leavevmode</span>
  <span class="enscript-keyword">\hbox</span> to 1.5em{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\hskip</span> 0pt plus 0.25fil minus 0.25fil
    .<span class="enscript-keyword">\hss</span>.<span class="enscript-keyword">\hss</span>.<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\hskip</span> 0pt plus 0.5fil minus 0.5fil
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @enddots{} is an end-of-sentence ellipsis.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\enddots</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\leavevmode</span>
  <span class="enscript-keyword">\hbox</span> to 2em{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\hskip</span> 0pt plus 0.25fil minus 0.25fil
    .<span class="enscript-keyword">\hss</span>.<span class="enscript-keyword">\hss</span>.<span class="enscript-keyword">\hss</span>.<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\hskip</span> 0pt plus 0.5fil minus 0.5fil
  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\spacefactor</span>=3000
}


<span class="enscript-comment">% @page    forces the start of a new page
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\page</span>{<span class="enscript-keyword">\par</span><span class="enscript-keyword">\vfill</span><span class="enscript-keyword">\supereject</span>}

<span class="enscript-comment">% @exdent text....
</span><span class="enscript-comment">% outputs text on separate line in roman font, starting at standard page margin
</span>
<span class="enscript-comment">% This records the amount of indent in the innermost environment.
</span><span class="enscript-comment">% That's how much \exdent should take out.
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\exdentamount</span>

<span class="enscript-comment">% This defn is used inside fill environments such as @defun.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\exdent</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\exdentyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\exdentyyy</span> #1{{<span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\break</span><span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\kern</span> -<span class="enscript-keyword">\exdentamount</span>{<span class="enscript-keyword">\rm</span>#1}}<span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\break</span>}}

<span class="enscript-comment">% This defn is used inside nofill environments such as @example.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\nofillexdent</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\nofillexdentyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\nofillexdentyyy</span> #1{{<span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\leftskip</span> by -<span class="enscript-keyword">\exdentamount</span>
<span class="enscript-keyword">\leftline</span>{<span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\leftskip</span>{<span class="enscript-keyword">\rm</span>#1}}}}

<span class="enscript-comment">% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
</span><span class="enscript-comment">% paragraph.  For more general purposes, use the \margin insertion
</span><span class="enscript-comment">% class.  WHICH is `l' or `r'.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\inmarginspacing</span> <span class="enscript-keyword">\inmarginspacing</span>=1cm
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\strutdepth</span>{<span class="enscript-keyword">\dp</span><span class="enscript-keyword">\strutbox</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doinmargin</span>#1#2{<span class="enscript-keyword">\strut</span><span class="enscript-keyword">\vadjust</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\nobreak</span>
  <span class="enscript-keyword">\kern</span>-<span class="enscript-keyword">\strutdepth</span>
  <span class="enscript-keyword">\vtop</span> to <span class="enscript-keyword">\strutdepth</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\baselineskip</span>=<span class="enscript-keyword">\strutdepth</span>
    <span class="enscript-keyword">\vss</span>
    <span class="enscript-comment">% if you have multiple lines of stuff to put here, you'll need to
</span>    <span class="enscript-comment">% make the vbox yourself of the appropriate size.
</span>    <span class="enscript-keyword">\ifx</span>#1l<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\llap</span>{<span class="enscript-keyword">\ignorespaces</span> #2<span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\inmarginspacing</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\inmarginspacing</span> <span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\null</span>
  }<span class="enscript-comment">%
</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\inleftmargin</span>{<span class="enscript-keyword">\doinmargin</span> l}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\inrightmargin</span>{<span class="enscript-keyword">\doinmargin</span> r}
<span class="enscript-comment">%
</span><span class="enscript-comment">% @inmargin{TEXT [, RIGHT-TEXT]}
</span><span class="enscript-comment">% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
</span><span class="enscript-comment">% else use TEXT for both).
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\inmargin</span>#1{<span class="enscript-keyword">\parseinmargin</span> #1,,<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\parseinmargin</span>#1,#2,#3<span class="enscript-keyword">\finish</span>{<span class="enscript-comment">% not perfect, but better than nothing.
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-comment">% 
</span>  <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\lefttext</span>{#1}<span class="enscript-comment">%  have both texts
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\righttext</span>{#2}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\lefttext</span>{#1}<span class="enscript-comment">%  have only one text
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\righttext</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\inrightmargin</span><span class="enscript-keyword">\righttext</span>}<span class="enscript-comment">% odd page -&gt; outside is right margin
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\inleftmargin</span><span class="enscript-keyword">\lefttext</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\temp</span>
}

<span class="enscript-comment">% @include file    insert text of that file as input.
</span><span class="enscript-comment">% Allow normal characters that  we make active in the argument (a file name).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\include</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`~=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`^=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`_=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`|=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`&lt;=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`&gt;=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\includezzz</span>}
<span class="enscript-comment">% Restore active chars for included file.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\includezzz</span>#1{<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-comment">% Read the included file in a group so nested @include's work.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\thisfile</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\value</span>=<span class="enscript-keyword">\expandablevalue</span>
  <span class="enscript-keyword">\input</span><span class="enscript-keyword">\thisfile</span>
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\thisfile</span>{}

<span class="enscript-comment">% @center line
</span><span class="enscript-comment">% outputs that line, centered.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\center</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\docenter</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\docenter</span>#1{{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifhmode</span> <span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\break</span> <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\leftskip</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\rightskip</span>
  <span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\hfil</span> <span class="enscript-keyword">\ignorespaces</span>#1<span class="enscript-keyword">\unskip</span> <span class="enscript-keyword">\hfil</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifhmode</span> <span class="enscript-keyword">\break</span> <span class="enscript-keyword">\fi</span>
}}

<span class="enscript-comment">% @sp n   outputs n lines of vertical space
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\sp</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\spxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\spxxx</span> #1{<span class="enscript-keyword">\vskip</span> #1<span class="enscript-keyword">\baselineskip</span>}

<span class="enscript-comment">% @comment ...line which is ignored...
</span><span class="enscript-comment">% @c is the same as @comment
</span><span class="enscript-comment">% @ignore ... @end ignore  is another way to write a comment
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\comment</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M=<span class="enscript-keyword">\other</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span>=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span>=<span class="enscript-keyword">\other</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\commentxxx</span>}
{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\commentxxx</span>#1^^M{<span class="enscript-keyword">\endgroup</span>}}

<span class="enscript-keyword">\let</span><span class="enscript-keyword">\c</span>=<span class="enscript-keyword">\comment</span>

<span class="enscript-comment">% @paragraphindent NCHARS
</span><span class="enscript-comment">% We'll use ems for NCHARS, close enough.
</span><span class="enscript-comment">% We cannot implement @paragraphindent asis, though.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\asisword</span>{asis} <span class="enscript-comment">% no translation, these are keywords
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\noneword</span>{none}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\paragraphindent</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doparagraphindent</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doparagraphindent</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\asisword</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\noneword</span>
      <span class="enscript-keyword">\defaultparindent</span> = 0pt
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\defaultparindent</span> = #1em
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\parindent</span> = <span class="enscript-keyword">\defaultparindent</span>
}

<span class="enscript-comment">% @exampleindent NCHARS
</span><span class="enscript-comment">% We'll use ems for NCHARS like @paragraphindent.
</span><span class="enscript-comment">% It seems @exampleindent asis isn't necessary, but
</span><span class="enscript-comment">% I preserve it to make it similar to @paragraphindent.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\exampleindent</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doexampleindent</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doexampleindent</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\asisword</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\noneword</span>
      <span class="enscript-keyword">\lispnarrowing</span> = 0pt
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\lispnarrowing</span> = #1em
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% @asis just yields its argument.  Used with @table, for example.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\asis</span>#1{#1}

<span class="enscript-comment">% @math outputs its argument in math mode.
</span><span class="enscript-comment">% We don't use $'s directly in the definition of \math because we need
</span><span class="enscript-comment">% to set catcodes according to plain TeX first, to allow for subscripts,
</span><span class="enscript-comment">% superscripts, special math chars, etc.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\implicitmath</span> = <span class="enscript-variable-name">$%$</span> font-lock fix
<span class="enscript-comment">%
</span><span class="enscript-comment">% One complication: _ usually means subscripts, but it could also mean
</span><span class="enscript-comment">% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
</span><span class="enscript-comment">% _ within @math be active (mathcode &quot;8000), and distinguish by seeing
</span><span class="enscript-comment">% if the current family is \slfam, which is what @var uses.
</span><span class="enscript-comment">% 
</span>{<span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\underChar</span> = <span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\mathunderscore</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\underChar</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\def</span>_{<span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\fam</span>=<span class="enscript-keyword">\slfam</span> <span class="enscript-keyword">\_</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\sb</span><span class="enscript-keyword">\fi</span>}<span class="enscript-comment">%
</span>}}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Another complication: we want \\ (and @\) to output a \ character.
</span><span class="enscript-comment">% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
</span><span class="enscript-comment">% this is not advertised and we don't care.  Texinfo does not
</span><span class="enscript-comment">% otherwise define @\.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\mathbackslash</span>{<span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\fam</span>=<span class="enscript-keyword">\ttfam</span> <span class="enscript-keyword">\mathchar</span>&quot;075C <span class="enscript-keyword">\else</span><span class="enscript-keyword">\backslash</span> <span class="enscript-keyword">\fi</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\math</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tex</span>
  <span class="enscript-keyword">\mathcode</span>`<span class="enscript-keyword">\_</span>=&quot;8000 <span class="enscript-keyword">\mathunderscore</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\\</span> = <span class="enscript-keyword">\mathbackslash</span>
  <span class="enscript-keyword">\mathactive</span>
  <span class="enscript-keyword">\implicitmath</span><span class="enscript-keyword">\finishmath</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\finishmath</span>#1{#1<span class="enscript-keyword">\implicitmath</span><span class="enscript-keyword">\Etex</span>}

<span class="enscript-comment">% Some active characters (such as &lt;) are spaced differently in math.
</span><span class="enscript-comment">% We have to reset their definitions in case the @math was an
</span><span class="enscript-comment">% argument to a command which set the catcodes (such as @item or @section).
</span><span class="enscript-comment">% 
</span>{
  <span class="enscript-keyword">\catcode</span>`^ = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`&lt; = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`&gt; = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`+ = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\mathactive</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\let</span>^ = <span class="enscript-keyword">\ptexhat</span>
    <span class="enscript-keyword">\let</span>&lt; = <span class="enscript-keyword">\ptexless</span>
    <span class="enscript-keyword">\let</span>&gt; = <span class="enscript-keyword">\ptexgtr</span>
    <span class="enscript-keyword">\let</span>+ = <span class="enscript-keyword">\ptexplus</span>
  }
}

<span class="enscript-comment">% @bullet and @minus need the same treatment as @math, just above.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\bullet</span>{<span class="enscript-keyword">\implicitmath</span><span class="enscript-keyword">\ptexbullet</span><span class="enscript-keyword">\implicitmath</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\minus</span>{<span class="enscript-keyword">\implicitmath</span>-<span class="enscript-keyword">\implicitmath</span>}

<span class="enscript-comment">% @refill is a no-op.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\refill</span>=<span class="enscript-keyword">\relax</span>

<span class="enscript-comment">% If working on a large document in chapters, it is convenient to
</span><span class="enscript-comment">% be able to disable indexing, cross-referencing, and contents, for test runs.
</span><span class="enscript-comment">% This is done with @novalidate (before @setfilename).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\iflinks</span> <span class="enscript-keyword">\linkstrue</span> <span class="enscript-comment">% by default we want the aux files.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\novalidate</span> = <span class="enscript-keyword">\linksfalse</span>

<span class="enscript-comment">% @setfilename is done at the beginning of every texinfo file.
</span><span class="enscript-comment">% So open here the files we need to have open while reading the input.
</span><span class="enscript-comment">% This makes it possible to make a .fmt file for texinfo.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setfilename</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\iflinks</span>
     <span class="enscript-keyword">\readauxfile</span>
   <span class="enscript-keyword">\fi</span> <span class="enscript-comment">% \openindices needs to do some work in any case.
</span>   <span class="enscript-keyword">\openindices</span>
   <span class="enscript-keyword">\fixbackslash</span>  <span class="enscript-comment">% Turn off hack to swallow `\input texinfo'.
</span>   <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\setfilename</span>=<span class="enscript-keyword">\comment</span> <span class="enscript-comment">% Ignore extra @setfilename cmds.
</span>   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% If texinfo.cnf is present on the system, read it.
</span>   <span class="enscript-comment">% Useful for site-wide @afourpaper, etc.
</span>   <span class="enscript-comment">% Just to be on the safe side, close the input stream before the \input.
</span>   <span class="enscript-keyword">\openin</span> 1 texinfo.cnf
   <span class="enscript-keyword">\ifeof</span>1 <span class="enscript-keyword">\let</span><span class="enscript-keyword">\temp</span>=<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\input</span> texinfo.cnf }<span class="enscript-keyword">\fi</span>
   <span class="enscript-keyword">\closein</span>1
   <span class="enscript-keyword">\temp</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-keyword">\comment</span> <span class="enscript-comment">% Ignore the actual filename.
</span>}

<span class="enscript-comment">% Called from \setfilename.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\openindices</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newindex</span>{cp}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newcodeindex</span>{fn}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newcodeindex</span>{vr}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newcodeindex</span>{tp}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newcodeindex</span>{ky}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\newcodeindex</span>{pg}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @bye.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\bye</span>{<span class="enscript-keyword">\pagealignmacro</span><span class="enscript-keyword">\tracingstats</span>=1<span class="enscript-keyword">\ptexend</span>}


<span class="enscript-keyword">\message</span>{pdf,}
<span class="enscript-comment">% adobe `portable' document format
</span><span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\tempnum</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\lnkcount</span>
<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\filename</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\filenamelength</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\pgn</span>
<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\toksA</span>
<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\toksB</span>
<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\toksC</span>
<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\toksD</span>
<span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\boxA</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\countA</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifpdf</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifpdfmakepagedest</span>

<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\pdfoutput</span><span class="enscript-keyword">\undefined</span>
  <span class="enscript-keyword">\pdffalse</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\pdfmkdest</span> = <span class="enscript-keyword">\gobble</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\pdfurl</span> = <span class="enscript-keyword">\gobble</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\endlink</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\linkcolor</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\pdfmakeoutlines</span> = <span class="enscript-keyword">\relax</span>
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\pdftrue</span>
  <span class="enscript-keyword">\pdfoutput</span> = 1
  <span class="enscript-keyword">\input</span> pdfcolor
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\dopdfimage</span>#1#2#3{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\imagewidth</span>{#2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\imageheight</span>{#3}<span class="enscript-comment">%
</span>    <span class="enscript-comment">% without \immediate, pdftex seg faults when the same image is
</span>    <span class="enscript-comment">% included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
</span>    <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\pdftexversion</span> &lt; 14
      <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\pdfimage</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\pdfximage</span>
    <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\empty</span><span class="enscript-keyword">\imagewidth</span><span class="enscript-keyword">\else</span> width <span class="enscript-keyword">\imagewidth</span> <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\empty</span><span class="enscript-keyword">\imageheight</span><span class="enscript-keyword">\else</span> height <span class="enscript-keyword">\imageheight</span> <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\pdftexversion</span>&lt;13
         #1.pdf<span class="enscript-comment">%
</span>       <span class="enscript-keyword">\else</span>
         {#1.pdf}<span class="enscript-comment">%
</span>       <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\pdftexversion</span> &lt; 14 <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\pdfrefximage</span> <span class="enscript-keyword">\pdflastximage</span>
    <span class="enscript-keyword">\fi</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfmkdest</span>#1{{<span class="enscript-keyword">\normalturnoffactive</span> <span class="enscript-keyword">\pdfdest</span> name{#1} xyz}}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfmkpgn</span>#1{#1}
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\linkcolor</span> = <span class="enscript-keyword">\Blue</span>  <span class="enscript-comment">% was Cyan, but that seems light?
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\endlink</span>{<span class="enscript-keyword">\Black</span><span class="enscript-keyword">\pdfendlink</span>}
  <span class="enscript-comment">% Adding outlines to PDF; macros for calculating structure of outlines
</span>  <span class="enscript-comment">% come from Petr Olsak
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\expnumber</span>#1{<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span> 0<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\fi</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\advancenumber</span>#1{<span class="enscript-keyword">\tempnum</span>=<span class="enscript-keyword">\expnumber</span>{#1}<span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\tempnum</span> by1
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\tempnum</span>}}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfmakeoutlines</span>{{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\openin</span> 1 <span class="enscript-keyword">\jobname</span>.toc
    <span class="enscript-keyword">\ifeof</span> 1<span class="enscript-keyword">\else</span><span class="enscript-keyword">\begingroup</span>
      <span class="enscript-keyword">\closein</span> 1 
      <span class="enscript-comment">% Thanh's hack / proper braces in bookmarks  
</span>      <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\mylbrace</span>{<span class="enscript-keyword">\iftrue</span> <span class="enscript-keyword">\string</span>{<span class="enscript-keyword">\else</span>}<span class="enscript-keyword">\fi</span>}<span class="enscript-keyword">\let</span><span class="enscript-keyword">\{</span>=<span class="enscript-keyword">\mylbrace</span>
      <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\myrbrace</span>{<span class="enscript-keyword">\iffalse</span>{<span class="enscript-keyword">\else</span><span class="enscript-keyword">\string</span>}<span class="enscript-keyword">\fi</span>}<span class="enscript-keyword">\let</span><span class="enscript-keyword">\}</span>=<span class="enscript-keyword">\myrbrace</span>
      <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapentry</span> ##1##2##3{}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\secentry</span> ##1##2##3##4{<span class="enscript-keyword">\advancenumber</span>{chap##2}}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecentry</span> ##1##2##3##4##5{<span class="enscript-keyword">\advancenumber</span>{sec##2.##3}}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubsecentry</span> ##1##2##3##4##5##6{<span class="enscript-keyword">\advancenumber</span>{subsec##2.##3.##4}}
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixentry</span> = <span class="enscript-keyword">\chapentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapentry</span> = <span class="enscript-keyword">\chapentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsecentry</span> = <span class="enscript-keyword">\secentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsecentry</span> = <span class="enscript-keyword">\subsecentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsubsecentry</span> = <span class="enscript-keyword">\subsubsecentry</span>
      <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.toc
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapentry</span> ##1##2##3{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\pdfoutline</span> goto name{<span class="enscript-keyword">\pdfmkpgn</span>{##3}}count-<span class="enscript-keyword">\expnumber</span>{chap##2}{##1}}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\secentry</span> ##1##2##3##4{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\pdfoutline</span> goto name{<span class="enscript-keyword">\pdfmkpgn</span>{##4}}count-<span class="enscript-keyword">\expnumber</span>{sec##2.##3}{##1}}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecentry</span> ##1##2##3##4##5{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\pdfoutline</span> goto name{<span class="enscript-keyword">\pdfmkpgn</span>{##5}}count-<span class="enscript-keyword">\expnumber</span>{subsec##2.##3.##4}{##1}}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubsecentry</span> ##1##2##3##4##5##6{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\pdfoutline</span> goto name{<span class="enscript-keyword">\pdfmkpgn</span>{##6}}{##1}}
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixentry</span> = <span class="enscript-keyword">\chapentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapentry</span> = <span class="enscript-keyword">\chapentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsecentry</span> = <span class="enscript-keyword">\secentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsecentry</span> = <span class="enscript-keyword">\subsecentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsubsecentry</span> = <span class="enscript-keyword">\subsubsecentry</span>
      <span class="enscript-comment">%
</span>      <span class="enscript-comment">% Make special characters normal for writing to the pdf file.
</span>      <span class="enscript-comment">% 
</span>      <span class="enscript-keyword">\indexnofonts</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tt</span>=<span class="enscript-keyword">\relax</span>
      <span class="enscript-keyword">\turnoffactive</span>
      <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.toc
    <span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\fi</span>
  }}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\makelinks</span> #1,{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\params</span>{#1}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\E</span>{END}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\params</span><span class="enscript-keyword">\E</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextmakelinks</span>=<span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextmakelinks</span>=<span class="enscript-keyword">\makelinks</span>
      <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lnkcount</span>&gt;0,<span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\picknum</span>{#1}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\startlink</span> attr{/Border [0 0 0]} 
        goto name{<span class="enscript-keyword">\pdfmkpgn</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\pgn</span>}}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\linkcolor</span> #1<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\lnkcount</span> by 1<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\endlink</span>
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\nextmakelinks</span>
  }
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\picknum</span>#1{<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\pn</span>#1}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pn</span>#1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\p</span>{#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\p</span><span class="enscript-keyword">\lbrace</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextpn</span>=<span class="enscript-keyword">\ppn</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextpn</span>=<span class="enscript-keyword">\ppnn</span>
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\first</span>{#1}
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\nextpn</span>
  }
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ppn</span>#1{<span class="enscript-keyword">\pgn</span>=#1<span class="enscript-keyword">\gobble</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ppnn</span>{<span class="enscript-keyword">\pgn</span>=<span class="enscript-keyword">\first</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfmklnk</span>#1{<span class="enscript-keyword">\lnkcount</span>=0<span class="enscript-keyword">\makelinks</span> #1,END,}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\addtokens</span>#1#2{<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\addtoks</span>{<span class="enscript-keyword">\noexpand</span>#1={<span class="enscript-keyword">\the</span>#1#2}}<span class="enscript-keyword">\addtoks</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\skipspaces</span>#1{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\PP</span>{#1}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\D</span>{|}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\PP</span><span class="enscript-keyword">\D</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextsp</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\else</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\nextsp</span><span class="enscript-keyword">\skipspaces</span>
      <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\p</span><span class="enscript-keyword">\space</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\addtokens</span>{<span class="enscript-keyword">\filename</span>}{<span class="enscript-keyword">\PP</span>}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\filenamelength</span> by 1
      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\nextsp</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\getfilename</span>#1{<span class="enscript-keyword">\filenamelength</span>=0<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\skipspaces</span>#1|<span class="enscript-keyword">\relax</span>}
  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\pdftexversion</span> &lt; 14
    <span class="enscript-keyword">\let</span> <span class="enscript-keyword">\startlink</span> <span class="enscript-keyword">\pdfannotlink</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\let</span> <span class="enscript-keyword">\startlink</span> <span class="enscript-keyword">\pdfstartlink</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfurl</span>#1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\begingroup</span>
      <span class="enscript-keyword">\normalturnoffactive</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{@}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\value</span>=<span class="enscript-keyword">\expandablevalue</span>
      <span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\Red</span>
      <span class="enscript-keyword">\startlink</span> attr{/Border [0 0 0]}<span class="enscript-comment">%
</span>        user{/Subtype /Link /A &lt;&lt; /S /URI /URI (#1) &gt;&gt;}<span class="enscript-comment">%
</span>        <span class="enscript-comment">% #1
</span>    <span class="enscript-keyword">\endgroup</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdfgettoks</span>#1.{<span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\boxA</span>=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\toksA</span>={#1.}<span class="enscript-keyword">\toksB</span>={}<span class="enscript-keyword">\maketoks</span>}}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\addtokens</span>#1#2{<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\addtoks</span>{<span class="enscript-keyword">\noexpand</span>#1={<span class="enscript-keyword">\the</span>#1#2}}<span class="enscript-keyword">\addtoks</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\adn</span>#1{<span class="enscript-keyword">\addtokens</span>{<span class="enscript-keyword">\toksC</span>}{#1}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\countA</span>=1<span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\maketoks</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\poptoks</span>#1#2|ENDTOKS|{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\first</span>=#1<span class="enscript-keyword">\toksD</span>={#1}<span class="enscript-keyword">\toksA</span>={#2}}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\maketoks</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\poptoks</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksA</span>|ENDTOKS|
    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>0<span class="enscript-keyword">\adn</span>0
    <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>1<span class="enscript-keyword">\adn</span>1 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>2<span class="enscript-keyword">\adn</span>2 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>3<span class="enscript-keyword">\adn</span>3
    <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>4<span class="enscript-keyword">\adn</span>4 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>5<span class="enscript-keyword">\adn</span>5 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>6<span class="enscript-keyword">\adn</span>6
    <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>7<span class="enscript-keyword">\adn</span>7 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>8<span class="enscript-keyword">\adn</span>8 <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>9<span class="enscript-keyword">\adn</span>9 
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\ifnum</span>0=<span class="enscript-keyword">\countA</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\makelink</span><span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>.<span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\done</span><span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\maketoks</span>
        <span class="enscript-keyword">\addtokens</span>{<span class="enscript-keyword">\toksB</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksD</span>}
        <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\first</span>,<span class="enscript-keyword">\addtokens</span>{<span class="enscript-keyword">\toksB</span>}{<span class="enscript-keyword">\space</span>}<span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\next</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\makelink</span>{<span class="enscript-keyword">\addtokens</span>{<span class="enscript-keyword">\toksB</span>}<span class="enscript-comment">%
</span>    {<span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\pdflink</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksC</span>}}<span class="enscript-keyword">\toksC</span>={}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\countA</span>=0}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\pdflink</span>#1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\startlink</span> attr{/Border [0 0 0]} goto name{<span class="enscript-keyword">\pdfmkpgn</span>{#1}}
    <span class="enscript-keyword">\linkcolor</span> #1<span class="enscript-keyword">\endlink</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\done</span>{<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\st</span>{<span class="enscript-keyword">\global</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\toksA</span>={<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksB</span>}}<span class="enscript-keyword">\st</span>}
<span class="enscript-keyword">\fi</span> <span class="enscript-comment">% \ifx\pdfoutput
</span>

<span class="enscript-keyword">\message</span>{fonts,}
<span class="enscript-comment">% Font-change commands.
</span>
<span class="enscript-comment">% Texinfo sort of supports the sans serif font style, which plain TeX does not.
</span><span class="enscript-comment">% So we set up a \sf analogous to plain's \rm, etc.
</span><span class="enscript-keyword">\newfam</span><span class="enscript-keyword">\sffam</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\sf</span>{<span class="enscript-keyword">\fam</span>=<span class="enscript-keyword">\sffam</span> <span class="enscript-keyword">\tensf</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\li</span> = <span class="enscript-keyword">\sf</span> <span class="enscript-comment">% Sometimes we call it \li, not \sf.
</span>
<span class="enscript-comment">% We don't need math for this one.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ttsl</span>{<span class="enscript-keyword">\tenttsl</span>}

<span class="enscript-comment">% Default leading.
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\textleading</span>  <span class="enscript-keyword">\textleading</span> = 13.2pt

<span class="enscript-comment">% Set the baselineskip to #1, and the lineskip and strut size
</span><span class="enscript-comment">% correspondingly.  There is no deep meaning behind these magic numbers
</span><span class="enscript-comment">% used as factors; they just match (closely enough) what Knuth defined.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\lineskipfactor</span>{.08333}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\strutheightpercent</span>{.70833}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\strutdepthpercent</span> {.29167}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setleading</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\normalbaselineskip</span> = #1<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\normallineskip</span> = <span class="enscript-keyword">\lineskipfactor</span><span class="enscript-keyword">\normalbaselineskip</span>
  <span class="enscript-keyword">\normalbaselines</span>
  <span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\strutbox</span> =<span class="enscript-keyword">\hbox</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\vrule</span> width0pt height<span class="enscript-keyword">\strutheightpercent</span><span class="enscript-keyword">\baselineskip</span>
                    depth <span class="enscript-keyword">\strutdepthpercent</span> <span class="enscript-keyword">\baselineskip</span>
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Set the font macro #1 to the font named #2, adding on the
</span><span class="enscript-comment">% specified font prefix (normally `cm').
</span><span class="enscript-comment">% #3 is the font's design size, #4 is a scale factor
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setfont</span>#1#2#3#4{<span class="enscript-keyword">\font</span>#1=<span class="enscript-keyword">\fontprefix</span>#2#3 scaled #4}

<span class="enscript-comment">% Use cm as the default font prefix.
</span><span class="enscript-comment">% To specify the font prefix, you must define \fontprefix
</span><span class="enscript-comment">% before you read in texinfo.tex.
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\fontprefix</span><span class="enscript-keyword">\undefined</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\fontprefix</span>{cm}
<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">% Support font families that don't use the same naming scheme as CM.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\rmshape</span>{r}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\rmbshape</span>{bx}               <span class="enscript-comment">%where the normal face is bold
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\bfshape</span>{b}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\bxshape</span>{bx}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ttshape</span>{tt}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ttbshape</span>{tt}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ttslshape</span>{sltt}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itshape</span>{ti}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itbshape</span>{bxti}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\slshape</span>{sl}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\slbshape</span>{bxsl}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\sfshape</span>{ss}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\sfbshape</span>{ss}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\scshape</span>{csc}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\scbshape</span>{csc}

<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\mainmagstep</span>
<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\bigger</span><span class="enscript-keyword">\relax</span>
  <span class="enscript-comment">% not really supported.
</span>  <span class="enscript-keyword">\mainmagstep</span>=<span class="enscript-keyword">\magstep</span>1
  <span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textrm</span><span class="enscript-keyword">\rmshape</span>{12}{1000}
  <span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\texttt</span><span class="enscript-keyword">\ttshape</span>{12}{1000}
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\mainmagstep</span>=<span class="enscript-keyword">\magstephalf</span>
  <span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textrm</span><span class="enscript-keyword">\rmshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
  <span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\texttt</span><span class="enscript-keyword">\ttshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">% Instead of cmb10, you may want to use cmbx10.
</span><span class="enscript-comment">% cmbx10 is a prettier font on its own, but cmb10
</span><span class="enscript-comment">% looks better when embedded in a line with cmr10
</span><span class="enscript-comment">% (in Bob's opinion).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textbf</span><span class="enscript-keyword">\bfshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textit</span><span class="enscript-keyword">\itshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textsl</span><span class="enscript-keyword">\slshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textsf</span><span class="enscript-keyword">\sfshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textsc</span><span class="enscript-keyword">\scshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\textttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{<span class="enscript-keyword">\mainmagstep</span>}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\texti</span>=cmmi10 scaled <span class="enscript-keyword">\mainmagstep</span>
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\textsy</span>=cmsy10 scaled <span class="enscript-keyword">\mainmagstep</span>

<span class="enscript-comment">% A few fonts for @defun, etc.
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\defbf</span><span class="enscript-keyword">\bxshape</span>{10}{<span class="enscript-keyword">\magstep</span>1} <span class="enscript-comment">%was 1314
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\deftt</span><span class="enscript-keyword">\ttshape</span>{10}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\df</span>{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\deftt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span> = <span class="enscript-keyword">\defbf</span> <span class="enscript-keyword">\bf</span>}

<span class="enscript-comment">% Fonts for indices, footnotes, small examples (9pt).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallrm</span><span class="enscript-keyword">\rmshape</span>{9}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smalltt</span><span class="enscript-keyword">\ttshape</span>{9}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallbf</span><span class="enscript-keyword">\bfshape</span>{10}{900}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallit</span><span class="enscript-keyword">\itshape</span>{9}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallsl</span><span class="enscript-keyword">\slshape</span>{9}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallsf</span><span class="enscript-keyword">\sfshape</span>{9}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallsc</span><span class="enscript-keyword">\scshape</span>{10}{900}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{900}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\smalli</span>=cmmi9
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\smallsy</span>=cmsy9

<span class="enscript-comment">% Fonts for small examples (8pt).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallerrm</span><span class="enscript-keyword">\rmshape</span>{8}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallertt</span><span class="enscript-keyword">\ttshape</span>{8}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallerbf</span><span class="enscript-keyword">\bfshape</span>{10}{800}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallerit</span><span class="enscript-keyword">\itshape</span>{8}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallersl</span><span class="enscript-keyword">\slshape</span>{8}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallersf</span><span class="enscript-keyword">\sfshape</span>{8}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallersc</span><span class="enscript-keyword">\scshape</span>{10}{800}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\smallerttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{800}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\smalleri</span>=cmmi8
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\smallersy</span>=cmsy8

<span class="enscript-comment">% Fonts for title page:
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlerm</span><span class="enscript-keyword">\rmbshape</span>{12}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titleit</span><span class="enscript-keyword">\itbshape</span>{10}{<span class="enscript-keyword">\magstep</span>4}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlesl</span><span class="enscript-keyword">\slbshape</span>{10}{<span class="enscript-keyword">\magstep</span>4}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlett</span><span class="enscript-keyword">\ttbshape</span>{12}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlettsl</span><span class="enscript-keyword">\ttslshape</span>{10}{<span class="enscript-keyword">\magstep</span>4}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlesf</span><span class="enscript-keyword">\sfbshape</span>{17}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\titlebf</span>=<span class="enscript-keyword">\titlerm</span>
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\titlesc</span><span class="enscript-keyword">\scbshape</span>{10}{<span class="enscript-keyword">\magstep</span>4}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\titlei</span>=cmmi12 scaled <span class="enscript-keyword">\magstep</span>3
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\titlesy</span>=cmsy10 scaled <span class="enscript-keyword">\magstep</span>4
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\authorrm</span>{<span class="enscript-keyword">\secrm</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\authortt</span>{<span class="enscript-keyword">\sectt</span>}

<span class="enscript-comment">% Chapter (and unnumbered) fonts (17.28pt).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chaprm</span><span class="enscript-keyword">\rmbshape</span>{12}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chapit</span><span class="enscript-keyword">\itbshape</span>{10}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chapsl</span><span class="enscript-keyword">\slbshape</span>{10}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chaptt</span><span class="enscript-keyword">\ttbshape</span>{12}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chapttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chapsf</span><span class="enscript-keyword">\sfbshape</span>{17}{1000}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\chapbf</span>=<span class="enscript-keyword">\chaprm</span>
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\chapsc</span><span class="enscript-keyword">\scbshape</span>{10}{<span class="enscript-keyword">\magstep</span>3}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\chapi</span>=cmmi12 scaled <span class="enscript-keyword">\magstep</span>2
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\chapsy</span>=cmsy10 scaled <span class="enscript-keyword">\magstep</span>3

<span class="enscript-comment">% Section fonts (14.4pt).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secrm</span><span class="enscript-keyword">\rmbshape</span>{12}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secit</span><span class="enscript-keyword">\itbshape</span>{10}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secsl</span><span class="enscript-keyword">\slbshape</span>{10}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\sectt</span><span class="enscript-keyword">\ttbshape</span>{12}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secsf</span><span class="enscript-keyword">\sfbshape</span>{12}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\secbf</span><span class="enscript-keyword">\secrm</span>
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\secsc</span><span class="enscript-keyword">\scbshape</span>{10}{<span class="enscript-keyword">\magstep</span>2}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\seci</span>=cmmi12 scaled <span class="enscript-keyword">\magstep</span>1
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\secsy</span>=cmsy10 scaled <span class="enscript-keyword">\magstep</span>2

<span class="enscript-comment">% Subsection fonts (13.15pt).
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecrm</span><span class="enscript-keyword">\rmbshape</span>{12}{<span class="enscript-keyword">\magstephalf</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecit</span><span class="enscript-keyword">\itbshape</span>{10}{1315}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecsl</span><span class="enscript-keyword">\slbshape</span>{10}{1315}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssectt</span><span class="enscript-keyword">\ttbshape</span>{12}{<span class="enscript-keyword">\magstephalf</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecttsl</span><span class="enscript-keyword">\ttslshape</span>{10}{1315}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecsf</span><span class="enscript-keyword">\sfbshape</span>{12}{<span class="enscript-keyword">\magstephalf</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ssecbf</span><span class="enscript-keyword">\ssecrm</span>
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\ssecsc</span><span class="enscript-keyword">\scbshape</span>{10}{<span class="enscript-keyword">\magstep</span>1}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\sseci</span>=cmmi12 scaled <span class="enscript-keyword">\magstephalf</span>
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\ssecsy</span>=cmsy10 scaled 1315
<span class="enscript-comment">% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
</span><span class="enscript-comment">% but that is not a standard magnification.
</span>
<span class="enscript-comment">% In order for the font changes to affect most math symbols and letters,
</span><span class="enscript-comment">% we have to define the \textfont of the standard families.  Since
</span><span class="enscript-comment">% texinfo doesn't allow for producing subscripts and superscripts except
</span><span class="enscript-comment">% in the main text, we don't bother to reset \scriptfont and
</span><span class="enscript-comment">% \scriptscriptfont (which would also require loading a lot more fonts).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\resetmathfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\textfont</span>0=<span class="enscript-keyword">\tenrm</span> <span class="enscript-keyword">\textfont</span>1=<span class="enscript-keyword">\teni</span> <span class="enscript-keyword">\textfont</span>2=<span class="enscript-keyword">\tensy</span>
  <span class="enscript-keyword">\textfont</span><span class="enscript-keyword">\itfam</span>=<span class="enscript-keyword">\tenit</span> <span class="enscript-keyword">\textfont</span><span class="enscript-keyword">\slfam</span>=<span class="enscript-keyword">\tensl</span> <span class="enscript-keyword">\textfont</span><span class="enscript-keyword">\bffam</span>=<span class="enscript-keyword">\tenbf</span>
  <span class="enscript-keyword">\textfont</span><span class="enscript-keyword">\ttfam</span>=<span class="enscript-keyword">\tentt</span> <span class="enscript-keyword">\textfont</span><span class="enscript-keyword">\sffam</span>=<span class="enscript-keyword">\tensf</span>
}

<span class="enscript-comment">% The font-changing commands redefine the meanings of \tenSTYLE, instead
</span><span class="enscript-comment">% of just \STYLE.  We do this so that font changes will continue to work
</span><span class="enscript-comment">% in math mode, where it is the current \fam that is relevant in most
</span><span class="enscript-comment">% cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
</span><span class="enscript-comment">% \tenbf}, for example.  By redefining \tenbf, we obviate the need to
</span><span class="enscript-comment">% redefine \bf itself.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\textfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\textrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\textit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\textsl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\textbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\texttt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\textsc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\textsf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\texti</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\textsy</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\textttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{<span class="enscript-keyword">\textleading</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\titlefonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\titlerm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\titleit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\titlesl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\titlebf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\titlett</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\titlesc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\titlesf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\titlei</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\titlesy</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\titlettsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{25pt}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\titlefont</span>#1{{<span class="enscript-keyword">\titlefonts</span><span class="enscript-keyword">\rm</span> #1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\chaprm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\chapit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\chapsl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\chapbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\chaptt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\chapsc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\chapsf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\chapi</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\chapsy</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\chapttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{19pt}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\secrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\secit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\secsl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\secbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\sectt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\secsc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\secsf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\seci</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\secsy</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\secttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{16pt}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\ssecrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\ssecit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\ssecsl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\ssecbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\ssectt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\ssecsc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\ssecsf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\sseci</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\ssecsy</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\ssecttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{15pt}}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsecfonts</span> = <span class="enscript-keyword">\subsecfonts</span> <span class="enscript-comment">% Maybe make sssec fonts scaled magstephalf?
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smallfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\smallrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\smallit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\smallsl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\smallbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\smalltt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\smallsc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\smallsf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\smalli</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\smallsy</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\smallttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{10.5pt}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\smallerfonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\smallerrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\smallerit</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\smallersl</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\smallerbf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\smallertt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\smallersc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\smallersf</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\teni</span>=<span class="enscript-keyword">\smalleri</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensy</span>=<span class="enscript-keyword">\smallersy</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenttsl</span>=<span class="enscript-keyword">\smallerttsl</span>
  <span class="enscript-keyword">\resetmathfonts</span> <span class="enscript-keyword">\setleading</span>{9.5pt}}

<span class="enscript-comment">% Set the fonts to use with the @small... environments.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallexamplefonts</span> = <span class="enscript-keyword">\smallfonts</span>

<span class="enscript-comment">% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
</span><span class="enscript-comment">% can fit this many characters:
</span><span class="enscript-comment">%   8.5x11=86   smallbook=72  a4=90  a5=69
</span><span class="enscript-comment">% If we use \smallerfonts (8pt), then we can fit this many characters:
</span><span class="enscript-comment">%   8.5x11=90+  smallbook=80  a4=90+  a5=77
</span><span class="enscript-comment">% For me, subjectively, the few extra characters that fit aren't worth
</span><span class="enscript-comment">% the additional smallness of 8pt.  So I'm making the default 9pt.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% By the way, for comparison, here's what fits with @example (10pt):
</span><span class="enscript-comment">%   8.5x11=71  smallbook=60  a4=75  a5=58
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% I wish we used A4 paper on this side of the Atlantic.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% --karl, 24jan03.
</span>

<span class="enscript-comment">% Set up the default fonts, so we can use them for creating boxes.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\textfonts</span>

<span class="enscript-comment">% Define these so they can be easily changed for other fonts.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\angleleft</span>{<span class="enscript-variable-name">$\langle$</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\angleright</span>{<span class="enscript-variable-name">$\rangle$</span>}

<span class="enscript-comment">% Count depth in font-changes, for error checks
</span><span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\fontdepth</span> <span class="enscript-keyword">\fontdepth</span>=0

<span class="enscript-comment">% Fonts for short table of contents.
</span><span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\shortcontrm</span><span class="enscript-keyword">\rmshape</span>{12}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\shortcontbf</span><span class="enscript-keyword">\bxshape</span>{12}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\shortcontsl</span><span class="enscript-keyword">\slshape</span>{12}{1000}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\shortconttt</span><span class="enscript-keyword">\ttshape</span>{12}{1000}

<span class="enscript-comment">%% Add scribe-like font environments, plus @l for inline lisp (usually sans
</span><span class="enscript-comment">%% serif) and @ii for TeX italic
</span>
<span class="enscript-comment">% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
</span><span class="enscript-comment">% unless the following character is such as not to need one.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smartitalicx</span>{<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\next</span>,<span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\next</span>-<span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\next</span>.<span class="enscript-keyword">\else</span><span class="enscript-keyword">\/</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\smartslanted</span>#1{{<span class="enscript-keyword">\ifusingtt</span><span class="enscript-keyword">\ttsl</span><span class="enscript-keyword">\sl</span> #1}<span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\next</span><span class="enscript-keyword">\smartitalicx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\smartitalic</span>#1{{<span class="enscript-keyword">\ifusingtt</span><span class="enscript-keyword">\ttsl</span><span class="enscript-keyword">\it</span> #1}<span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\next</span><span class="enscript-keyword">\smartitalicx</span>}

<span class="enscript-keyword">\let</span><span class="enscript-keyword">\i</span>=<span class="enscript-keyword">\smartitalic</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\var</span>=<span class="enscript-keyword">\smartslanted</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\dfn</span>=<span class="enscript-keyword">\smartslanted</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\emph</span>=<span class="enscript-keyword">\smartitalic</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\cite</span>=<span class="enscript-keyword">\smartslanted</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\b</span>#1{{<span class="enscript-keyword">\bf</span> #1}}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\strong</span>=<span class="enscript-keyword">\b</span>

<span class="enscript-comment">% We can't just use \exhyphenpenalty, because that only has effect at
</span><span class="enscript-comment">% the end of a paragraph.  Restore normal hyphenation at the end of the
</span><span class="enscript-comment">% group within which \nohyphenation is presumably called.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\nohyphenation</span>{<span class="enscript-keyword">\hyphenchar</span><span class="enscript-keyword">\font</span> = -1  <span class="enscript-keyword">\aftergroup</span><span class="enscript-keyword">\restorehyphenation</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\restorehyphenation</span>{<span class="enscript-keyword">\hyphenchar</span><span class="enscript-keyword">\font</span> = `- }

<span class="enscript-comment">% Set sfcode to normal for the chars that usually have another value.
</span><span class="enscript-comment">% Can't use plain's \frenchspacing because it uses the `\x notation, and
</span><span class="enscript-comment">% sometimes \x has an active definition that messes things up.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\catcode</span>`@=11
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\frenchspacing</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\dotChar</span>  =<span class="enscript-keyword">\@</span>m <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\questChar</span>=<span class="enscript-keyword">\@</span>m <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\exclamChar</span>=<span class="enscript-keyword">\@</span>m
    <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\colonChar</span>=<span class="enscript-keyword">\@</span>m <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\semiChar</span> =<span class="enscript-keyword">\@</span>m <span class="enscript-keyword">\sfcode</span><span class="enscript-keyword">\commaChar</span> =<span class="enscript-keyword">\@</span>m
  }
<span class="enscript-keyword">\catcode</span>`@=<span class="enscript-keyword">\other</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\t</span>#1{<span class="enscript-comment">%
</span>  {<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\rawbackslash</span> <span class="enscript-keyword">\frenchspacing</span> #1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\null</span>
}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ttfont</span>=<span class="enscript-keyword">\t</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\samp</span>#1{`<span class="enscript-keyword">\tclose</span>{#1}'<span class="enscript-keyword">\null</span>}
<span class="enscript-keyword">\setfont</span><span class="enscript-keyword">\keyrm</span><span class="enscript-keyword">\rmshape</span>{8}{1000}
<span class="enscript-keyword">\font</span><span class="enscript-keyword">\keysy</span>=cmsy9
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\key</span>#1{{<span class="enscript-keyword">\keyrm</span><span class="enscript-keyword">\textfont</span>2=<span class="enscript-keyword">\keysy</span> <span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\hbox</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\raise</span>0.4pt<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\angleleft</span>}<span class="enscript-keyword">\kern</span>-.08em<span class="enscript-keyword">\vtop</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hrule</span><span class="enscript-keyword">\kern</span>-0.4pt
     <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\raise</span>0.4pt<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\vphantom</span>{<span class="enscript-keyword">\angleleft</span>}}#1}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\kern</span>-0.4pt<span class="enscript-keyword">\hrule</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\kern</span>-.06em<span class="enscript-keyword">\raise</span>0.4pt<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\angleright</span>}}}}
<span class="enscript-comment">% The old definition, with no lozenge:
</span><span class="enscript-comment">%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ctrl</span> #1{{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\rawbackslash</span> <span class="enscript-keyword">\hat</span>}#1}

<span class="enscript-comment">% @file, @option are the same as @samp.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\file</span>=<span class="enscript-keyword">\samp</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\option</span>=<span class="enscript-keyword">\samp</span>

<span class="enscript-comment">% @code is a modification of @t,
</span><span class="enscript-comment">% which makes spaces the same size as normal in the surrounding text.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\tclose</span>#1{<span class="enscript-comment">%
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Change normal interword space to be same as for the current font.
</span>    <span class="enscript-keyword">\spaceskip</span> = <span class="enscript-keyword">\fontdimen</span>2<span class="enscript-keyword">\font</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Switch to typewriter.
</span>    <span class="enscript-keyword">\tt</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% But `\ ' produces the large typewriter interword space.
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ </span>{{<span class="enscript-keyword">\spaceskip</span> = 0pt{} }}<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Turn off hyphenation.
</span>    <span class="enscript-keyword">\nohyphenation</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\rawbackslash</span>
    <span class="enscript-keyword">\frenchspacing</span>
    #1<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\null</span>
}

<span class="enscript-comment">% We *must* turn on hyphenation at `-' and `_' in \code.
</span><span class="enscript-comment">% Otherwise, it is too hard to avoid overfull hboxes
</span><span class="enscript-comment">% in the Emacs manual, the Library manual, etc.
</span>
<span class="enscript-comment">% Unfortunately, TeX uses one parameter (\hyphenchar) to control
</span><span class="enscript-comment">% both hyphenation at - and hyphenation within words.
</span><span class="enscript-comment">% We must therefore turn them both off (\tclose does that)
</span><span class="enscript-comment">% and arrange explicitly to hyphenate at a dash.
</span><span class="enscript-comment">%  -- rms.
</span>{
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\-</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\code</span>{<span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\-</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\let</span>-<span class="enscript-keyword">\codedash</span>
    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\let</span>_<span class="enscript-keyword">\codeunder</span>
    <span class="enscript-keyword">\codex</span>
  }
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If we end up with any active - characters when handling the index,
</span>  <span class="enscript-comment">% just treat them as a normal -.
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexbreaks</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\-</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\let</span>-<span class="enscript-keyword">\realdash</span>}
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\realdash</span>{-}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\codedash</span>{-<span class="enscript-keyword">\discretionary</span>{}{}{}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\codeunder</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% this is all so @math{@code{var_name}+1} can work.  In math mode, _
</span>  <span class="enscript-comment">% is &quot;active&quot; (mathcode&quot;8000) and \normalunderscore (or \char95, etc.)
</span>  <span class="enscript-comment">% will therefore expand the active definition of _, which is us
</span>  <span class="enscript-comment">% (inside @code that is), therefore an endless loop.
</span>  <span class="enscript-keyword">\ifusingtt</span>{<span class="enscript-keyword">\ifmmode</span>
               <span class="enscript-keyword">\mathchar</span>&quot;075F <span class="enscript-comment">% class 0=ordinary, family 7=ttfam, pos 0x5F=_.
</span>             <span class="enscript-keyword">\else</span><span class="enscript-keyword">\normalunderscore</span> <span class="enscript-keyword">\fi</span>
             <span class="enscript-keyword">\discretionary</span>{}{}{}}<span class="enscript-comment">%
</span>            {<span class="enscript-keyword">\_</span>}<span class="enscript-comment">%
</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\codex</span> #1{<span class="enscript-keyword">\tclose</span>{#1}<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% @kbd is like @code, except that if the argument is just one @key command,
</span><span class="enscript-comment">% then @kbd has no effect.
</span>
<span class="enscript-comment">% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
</span><span class="enscript-comment">%   `example' (@kbd uses ttsl only inside of @example and friends),
</span><span class="enscript-comment">%   or `code' (@kbd uses normal tty font always).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\kbdinputstyle</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\kbdinputstylexxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kbdinputstylexxx</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\arg</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\arg</span><span class="enscript-keyword">\worddistinct</span>
    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdexamplefont</span>{<span class="enscript-keyword">\ttsl</span>}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdfont</span>{<span class="enscript-keyword">\ttsl</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\arg</span><span class="enscript-keyword">\wordexample</span>
    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdexamplefont</span>{<span class="enscript-keyword">\ttsl</span>}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdfont</span>{<span class="enscript-keyword">\tt</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\arg</span><span class="enscript-keyword">\wordcode</span>
    <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdexamplefont</span>{<span class="enscript-keyword">\tt</span>}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\kbdfont</span>{<span class="enscript-keyword">\tt</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\EMsimple</span>
    <span class="enscript-keyword">\errmessage</span>{Unknown @kbdinputstyle `<span class="enscript-keyword">\arg</span>'}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\worddistinct</span>{distinct}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\wordexample</span>{example}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\wordcode</span>{code}

<span class="enscript-comment">% Default is `distinct.'
</span><span class="enscript-keyword">\kbdinputstyle</span> distinct

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xkey</span>{<span class="enscript-keyword">\key</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kbdfoo</span>#1#2#3<span class="enscript-keyword">\par</span>{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\one</span>{#1}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\three</span>{#3}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\threex</span>{??}<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\one</span><span class="enscript-keyword">\xkey</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\threex</span><span class="enscript-keyword">\three</span> <span class="enscript-keyword">\key</span>{#2}<span class="enscript-comment">%
</span><span class="enscript-keyword">\else</span>{<span class="enscript-keyword">\tclose</span>{<span class="enscript-keyword">\kbdfont</span><span class="enscript-keyword">\look</span>}}<span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\else</span>{<span class="enscript-keyword">\tclose</span>{<span class="enscript-keyword">\kbdfont</span><span class="enscript-keyword">\look</span>}}<span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% For @url, @env, @command quotes seem unnecessary, so use \code.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\url</span>=<span class="enscript-keyword">\code</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\env</span>=<span class="enscript-keyword">\code</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\command</span>=<span class="enscript-keyword">\code</span>

<span class="enscript-comment">% @uref (abbreviation for `urlref') takes an optional (comma-separated)
</span><span class="enscript-comment">% second argument specifying the text to display and an optional third
</span><span class="enscript-comment">% arg as text to display instead of (rather than in addition to) the url
</span><span class="enscript-comment">% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
</span><span class="enscript-comment">% a hypertex \special here.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\uref</span>#1{<span class="enscript-keyword">\douref</span> #1,,,<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\douref</span>#1,#2,#3,#4<span class="enscript-keyword">\finish</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\unsepspaces</span>
  <span class="enscript-keyword">\pdfurl</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt
    <span class="enscript-keyword">\unhbox</span>0 <span class="enscript-comment">% third arg given, show only that
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt
      <span class="enscript-keyword">\ifpdf</span>
        <span class="enscript-keyword">\unhbox</span>0             <span class="enscript-comment">% PDF: 2nd arg given, show only it
</span>      <span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\unhbox</span>0<span class="enscript-keyword">\ </span>(<span class="enscript-keyword">\code</span>{#1})<span class="enscript-comment">% DVI: 2nd arg given, show both it and url
</span>      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\code</span>{#1}<span class="enscript-comment">% only url given, so show it
</span>    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\endlink</span>
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% rms does not like angle brackets --karl, 17may97.
</span><span class="enscript-comment">% So now @email is just like @uref, unless we are pdf.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">%\def\email#1{\angleleft{\tt #1}\angleright}
</span><span class="enscript-keyword">\ifpdf</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\email</span>#1{<span class="enscript-keyword">\doemail</span>#1,,<span class="enscript-keyword">\finish</span>}
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\doemail</span>#1,#2,#3<span class="enscript-keyword">\finish</span>{<span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\unsepspaces</span>
    <span class="enscript-keyword">\pdfurl</span>{mailto:#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0&gt;0pt<span class="enscript-keyword">\unhbox</span>0<span class="enscript-keyword">\else</span><span class="enscript-keyword">\code</span>{#1}<span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\endlink</span>
  <span class="enscript-keyword">\endgroup</span>}
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\email</span>=<span class="enscript-keyword">\uref</span>
<span class="enscript-keyword">\fi</span>

<span class="enscript-comment">% Check if we are currently using a typewriter font.  Since all the
</span><span class="enscript-comment">% Computer Modern typewriter fonts have zero interword stretch (and
</span><span class="enscript-comment">% shrink), and it is reasonable to expect all typewriter fonts to have
</span><span class="enscript-comment">% this property, we can check that font parameter.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifmonospace</span>{<span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\fontdimen</span>3<span class="enscript-keyword">\font</span>=0pt }

<span class="enscript-comment">% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
</span><span class="enscript-comment">% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dmn</span>#1{<span class="enscript-keyword">\thinspace</span> #1}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kbd</span>#1{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\look</span>{#1}<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\kbdfoo</span><span class="enscript-keyword">\look</span>??<span class="enscript-keyword">\par</span>}

<span class="enscript-comment">% @l was never documented to mean ``switch to the Lisp font'',
</span><span class="enscript-comment">% and it is not used as such in any manual I can find.  We need it for
</span><span class="enscript-comment">% Polish suppressed-l.  --karl, 22sep96.
</span><span class="enscript-comment">%\def\l#1{{\li #1}\null}
</span>
<span class="enscript-comment">% Explicit font changes: @r, @sc, undocumented @ii.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\r</span>#1{{<span class="enscript-keyword">\rm</span> #1}}              <span class="enscript-comment">% roman font
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\sc</span>#1{{<span class="enscript-keyword">\smallcaps</span>#1}}       <span class="enscript-comment">% smallcaps font
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ii</span>#1{{<span class="enscript-keyword">\it</span> #1}}             <span class="enscript-comment">% italic font
</span>
<span class="enscript-comment">% @acronym downcases the argument and prints in smallcaps.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\acronym</span>#1{{<span class="enscript-keyword">\smallcaps</span> <span class="enscript-keyword">\lowercase</span>{#1}}}

<span class="enscript-comment">% @pounds{} is a sterling sign.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\pounds</span>{{<span class="enscript-keyword">\it</span><span class="enscript-keyword">\$</span>}}


<span class="enscript-keyword">\message</span>{page headings,}

<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\titlepagetopglue</span> <span class="enscript-keyword">\titlepagetopglue</span> = 1.5in
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\titlepagebottomglue</span> <span class="enscript-keyword">\titlepagebottomglue</span> = 2pc

<span class="enscript-comment">% First the title page.  Must do @settitle before @titlepage.
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifseenauthor</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\iffinishedtitlepage</span>

<span class="enscript-comment">% Do an implicit @contents or @shortcontents after @end titlepage if the
</span><span class="enscript-comment">% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifsetcontentsaftertitlepage</span>
 <span class="enscript-keyword">\let</span><span class="enscript-keyword">\setcontentsaftertitlepage</span> = <span class="enscript-keyword">\setcontentsaftertitlepagetrue</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifsetshortcontentsaftertitlepage</span>
 <span class="enscript-keyword">\let</span><span class="enscript-keyword">\setshortcontentsaftertitlepage</span> = <span class="enscript-keyword">\setshortcontentsaftertitlepagetrue</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\shorttitlepage</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\shorttitlepagezzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\shorttitlepagezzz</span> #1{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\hbox</span>{}<span class="enscript-keyword">\vskip</span> 1.5in <span class="enscript-keyword">\chaprm</span> <span class="enscript-keyword">\centerline</span>{#1}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\page</span><span class="enscript-keyword">\hbox</span>{}<span class="enscript-keyword">\page</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\titlepage</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\parindent</span>=0pt <span class="enscript-keyword">\textfonts</span>
   <span class="enscript-keyword">\let</span><span class="enscript-keyword">\subtitlerm</span>=<span class="enscript-keyword">\tenrm</span>
   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subtitlefont</span>{<span class="enscript-keyword">\subtitlerm</span> <span class="enscript-keyword">\normalbaselineskip</span> = 13pt <span class="enscript-keyword">\normalbaselines</span>}<span class="enscript-comment">%
</span>   <span class="enscript-comment">%
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\authorfont</span>{<span class="enscript-keyword">\authorrm</span> <span class="enscript-keyword">\normalbaselineskip</span> = 16pt <span class="enscript-keyword">\normalbaselines</span>
                   <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tt</span>=<span class="enscript-keyword">\authortt</span>}<span class="enscript-comment">%
</span>   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Leave some space at the very top of the page.
</span>   <span class="enscript-keyword">\vglue</span><span class="enscript-keyword">\titlepagetopglue</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Now you can print the title using @title.
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\title</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\titlezzz</span>}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\titlezzz</span>##1{<span class="enscript-keyword">\leftline</span>{<span class="enscript-keyword">\titlefonts</span><span class="enscript-keyword">\rm</span> ##1}
                    <span class="enscript-comment">% print a rule at the page bottom also.
</span>                    <span class="enscript-keyword">\finishedtitlepagefalse</span>
                    <span class="enscript-keyword">\vskip</span>4pt <span class="enscript-keyword">\hrule</span> height 4pt width <span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\vskip</span>4pt}<span class="enscript-comment">%
</span>   <span class="enscript-comment">% No rule at page bottom unless we print one at the top with @title.
</span>   <span class="enscript-keyword">\finishedtitlepagetrue</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Now you can put text using @subtitle.
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subtitle</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\subtitlezzz</span>}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subtitlezzz</span>##1{{<span class="enscript-keyword">\subtitlefont</span> <span class="enscript-keyword">\rightline</span>{##1}}}<span class="enscript-comment">%
</span>   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% @author should come last, but may come many times.
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\author</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\authorzzz</span>}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\authorzzz</span>##1{<span class="enscript-keyword">\ifseenauthor</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\vskip</span> 0pt plus 1filll<span class="enscript-keyword">\seenauthortrue</span><span class="enscript-keyword">\fi</span>
      {<span class="enscript-keyword">\authorfont</span> <span class="enscript-keyword">\leftline</span>{##1}}}<span class="enscript-comment">%
</span>   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Most title ``pages'' are actually two pages long, with space
</span>   <span class="enscript-comment">% at the top of the second.  We don't want the ragged left on the second.
</span>   <span class="enscript-keyword">\let</span><span class="enscript-keyword">\oldpage</span> = <span class="enscript-keyword">\page</span>
   <span class="enscript-keyword">\def</span><span class="enscript-keyword">\page</span>{<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\iffinishedtitlepage</span><span class="enscript-keyword">\else</span>
         <span class="enscript-keyword">\finishtitlepage</span>
      <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\oldpage</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\page</span> = <span class="enscript-keyword">\oldpage</span>
      <span class="enscript-keyword">\hbox</span>{}}<span class="enscript-comment">%
</span><span class="enscript-comment">%   \def\page{\oldpage \hbox{}}
</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Etitlepage</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\iffinishedtitlepage</span><span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\finishtitlepage</span>
   <span class="enscript-keyword">\fi</span>
   <span class="enscript-comment">% It is important to do the page break before ending the group,
</span>   <span class="enscript-comment">% because the headline and footline are only empty inside the group.
</span>   <span class="enscript-comment">% If we use the new definition of \page, we always get a blank page
</span>   <span class="enscript-comment">% after the title page, which we certainly don't want.
</span>   <span class="enscript-keyword">\oldpage</span>
   <span class="enscript-keyword">\endgroup</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Need this before the \...aftertitlepage checks so that if they are
</span>   <span class="enscript-comment">% in effect the toc pages will come out with page numbers.
</span>   <span class="enscript-keyword">\HEADINGSon</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% If they want short, they certainly want long too.
</span>   <span class="enscript-keyword">\ifsetshortcontentsaftertitlepage</span>
     <span class="enscript-keyword">\shortcontents</span>
     <span class="enscript-keyword">\contents</span>
     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\shortcontents</span> = <span class="enscript-keyword">\relax</span>
     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contents</span> = <span class="enscript-keyword">\relax</span>
   <span class="enscript-keyword">\fi</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-keyword">\ifsetcontentsaftertitlepage</span>
     <span class="enscript-keyword">\contents</span>
     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contents</span> = <span class="enscript-keyword">\relax</span>
     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\shortcontents</span> = <span class="enscript-keyword">\relax</span>
   <span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\finishtitlepage</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\vskip</span>4pt <span class="enscript-keyword">\hrule</span> height 2pt width <span class="enscript-keyword">\hsize</span>
   <span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\titlepagebottomglue</span>
   <span class="enscript-keyword">\finishedtitlepagetrue</span>
}

<span class="enscript-comment">%%% Set up page headings and footings.
</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\thispage</span>=<span class="enscript-keyword">\folio</span>

<span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\evenheadline</span>    <span class="enscript-comment">% headline on even pages
</span><span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\oddheadline</span>     <span class="enscript-comment">% headline on odd pages
</span><span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\evenfootline</span>    <span class="enscript-comment">% footline on even pages
</span><span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\oddfootline</span>     <span class="enscript-comment">% footline on odd pages
</span>
<span class="enscript-comment">% Now make Tex use those variables
</span><span class="enscript-keyword">\headline</span>={{<span class="enscript-keyword">\textfonts</span><span class="enscript-keyword">\rm</span> <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\oddheadline</span>
                            <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\evenheadline</span> <span class="enscript-keyword">\fi</span>}}
<span class="enscript-keyword">\footline</span>={{<span class="enscript-keyword">\textfonts</span><span class="enscript-keyword">\rm</span> <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\oddfootline</span>
                            <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\evenfootline</span> <span class="enscript-keyword">\fi</span>}<span class="enscript-keyword">\HEADINGShook</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\HEADINGShook</span>=<span class="enscript-keyword">\relax</span>

<span class="enscript-comment">% Commands to set those variables.
</span><span class="enscript-comment">% For example, this is what  @headings on  does
</span><span class="enscript-comment">% @evenheading @thistitle|@thispage|@thischapter
</span><span class="enscript-comment">% @oddheading @thischapter|@thispage|@thistitle
</span><span class="enscript-comment">% @evenfooting @thisfile||
</span><span class="enscript-comment">% @oddfooting ||@thisfile
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\evenheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\evenheadingxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\oddheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\oddheadingxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\everyheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\everyheadingxxx</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\evenfooting</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\evenfootingxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\oddfooting</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\oddfootingxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\everyfooting</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\everyfootingxxx</span>}

{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=0 <span class="enscript-comment">%
</span>
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\evenheadingxxx</span> #1{<span class="enscript-keyword">\evenheadingyyy</span> #1@|@|@|@|<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\evenheadingyyy</span> #1@|#2@|#3@|#4<span class="enscript-keyword">\finish</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\centerline</span>{#2}}<span class="enscript-keyword">\line</span>{#1<span class="enscript-keyword">\hfil</span>#3}}}

<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\oddheadingxxx</span> #1{<span class="enscript-keyword">\oddheadingyyy</span> #1@|@|@|@|<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\oddheadingyyy</span> #1@|#2@|#3@|#4<span class="enscript-keyword">\finish</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\centerline</span>{#2}}<span class="enscript-keyword">\line</span>{#1<span class="enscript-keyword">\hfil</span>#3}}}

<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\everyheadingxxx</span>#1{<span class="enscript-keyword">\oddheadingxxx</span>{#1}<span class="enscript-keyword">\evenheadingxxx</span>{#1}}<span class="enscript-comment">%
</span>
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\evenfootingxxx</span> #1{<span class="enscript-keyword">\evenfootingyyy</span> #1@|@|@|@|<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\evenfootingyyy</span> #1@|#2@|#3@|#4<span class="enscript-keyword">\finish</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\centerline</span>{#2}}<span class="enscript-keyword">\line</span>{#1<span class="enscript-keyword">\hfil</span>#3}}}

<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\oddfootingxxx</span> #1{<span class="enscript-keyword">\oddfootingyyy</span> #1@|@|@|@|<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\oddfootingyyy</span> #1@|#2@|#3@|#4<span class="enscript-keyword">\finish</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span> = {<span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\centerline</span>{#2}}<span class="enscript-keyword">\line</span>{#1<span class="enscript-keyword">\hfil</span>#3}}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Leave some space for the footline.  Hopefully ok to assume
</span>  <span class="enscript-comment">% @evenfooting will not be used by itself.
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\pageheight</span> by -<span class="enscript-keyword">\baselineskip</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\vsize</span> by -<span class="enscript-keyword">\baselineskip</span>
}

<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\everyfootingxxx</span>#1{<span class="enscript-keyword">\oddfootingxxx</span>{#1}<span class="enscript-keyword">\evenfootingxxx</span>{#1}}
<span class="enscript-comment">%
</span>}<span class="enscript-comment">% unbind the catcode of @.
</span>
<span class="enscript-comment">% @headings double      turns headings on for double-sided printing.
</span><span class="enscript-comment">% @headings single      turns headings on for single-sided printing.
</span><span class="enscript-comment">% @headings off         turns them off.
</span><span class="enscript-comment">% @headings on          same as @headings double, retained for compatibility.
</span><span class="enscript-comment">% @headings after       turns on double-sided headings after this page.
</span><span class="enscript-comment">% @headings doubleafter turns on double-sided headings after this page.
</span><span class="enscript-comment">% @headings singleafter turns on single-sided headings after this page.
</span><span class="enscript-comment">% By default, they are off at the start of a document,
</span><span class="enscript-comment">% and turned `on' after @end titlepage.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\headings</span> #1 {<span class="enscript-keyword">\csname</span> HEADINGS#1<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSoff</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\hfil</span>} <span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\hfil</span>} <span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span>={<span class="enscript-keyword">\hfil</span>}}
<span class="enscript-keyword">\HEADINGSoff</span>
<span class="enscript-comment">% When we turn headings on, set the page number to 1.
</span><span class="enscript-comment">% For double-sided printing, put current file name in lower left corner,
</span><span class="enscript-comment">% chapter name on inside top of right hand pages, document
</span><span class="enscript-comment">% title on inside top of left hand pages, and page numbers on outside top
</span><span class="enscript-comment">% edge of all pages.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSdouble</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\pageno</span>=1
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\folio</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\thistitle</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chapoddpage</span>
}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chappager</span>

<span class="enscript-comment">% For single-sided printing, chapter title goes across top left of page,
</span><span class="enscript-comment">% page number on top right.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSsingle</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\pageno</span>=1
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chappager</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSon</span>{<span class="enscript-keyword">\HEADINGSdouble</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSafter</span>{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\HEADINGShook</span>=<span class="enscript-keyword">\HEADINGSdoublex</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\HEADINGSdoubleafter</span>=<span class="enscript-keyword">\HEADINGSafter</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSdoublex</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\folio</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\thistitle</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chapoddpage</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSsingleafter</span>{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\HEADINGShook</span>=<span class="enscript-keyword">\HEADINGSsinglex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSsinglex</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddfootline</span>={<span class="enscript-keyword">\hfil</span>}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\evenheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\oddheadline</span>={<span class="enscript-keyword">\line</span>{<span class="enscript-keyword">\thischapter</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\folio</span>}}
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chappager</span>
}

<span class="enscript-comment">% Subroutines used in generating headings
</span><span class="enscript-comment">% This produces Day Month Year style of output.
</span><span class="enscript-comment">% Only define if not already defined, in case a txi-??.tex file has set
</span><span class="enscript-comment">% up a different format (e.g., txi-cs.tex does this).
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\today</span><span class="enscript-keyword">\undefined</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\today</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\number</span><span class="enscript-keyword">\day</span><span class="enscript-keyword">\space</span>
  <span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\month</span>
  <span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMJan</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMFeb</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMMar</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMApr</span>
  <span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMMay</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMJun</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMJul</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMAug</span>
  <span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMSep</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMOct</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMNov</span><span class="enscript-keyword">\or</span><span class="enscript-keyword">\putwordMDec</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\space</span><span class="enscript-keyword">\number</span><span class="enscript-keyword">\year</span>}
<span class="enscript-keyword">\fi</span>

<span class="enscript-comment">% @settitle line...  specifies the title of the document, for headings.
</span><span class="enscript-comment">% It generates no output of its own.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\thistitle</span>{<span class="enscript-keyword">\putwordNoTitle</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\settitle</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\settitlezzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\settitlezzz</span> #1{<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thistitle</span>{#1}}


<span class="enscript-keyword">\message</span>{tables,}
<span class="enscript-comment">% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
</span>
<span class="enscript-comment">% default indentation of table text
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\tableindent</span> <span class="enscript-keyword">\tableindent</span>=.8in
<span class="enscript-comment">% default indentation of @itemize and @enumerate text
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\itemindent</span>  <span class="enscript-keyword">\itemindent</span>=.3in
<span class="enscript-comment">% margin between end of table item and start of table text.
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\itemmargin</span>  <span class="enscript-keyword">\itemmargin</span>=.1in

<span class="enscript-comment">% used internally for \itemindent minus \itemmargin
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\itemmax</span>

<span class="enscript-comment">% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
</span><span class="enscript-comment">% these defs.
</span><span class="enscript-comment">% They also define \itemindex
</span><span class="enscript-comment">% to index the item name in whatever manner is desired (perhaps none).
</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifitemxneedsnegativevskip</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemxpar</span>{<span class="enscript-keyword">\par</span><span class="enscript-keyword">\ifitemxneedsnegativevskip</span><span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span>-<span class="enscript-keyword">\parskip</span><span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBitem</span>{<span class="enscript-keyword">\smallbreak</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\itemzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBitemx</span>{<span class="enscript-keyword">\itemxpar</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\itemzzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBxitem</span> &quot;#1&quot;{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xitemsubtopix</span>{#1} <span class="enscript-keyword">\smallbreak</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\xitemzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBxitemx</span> &quot;#1&quot;{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xitemsubtopix</span>{#1} <span class="enscript-keyword">\itemxpar</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\xitemzzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBkitem</span>{<span class="enscript-keyword">\smallbreak</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\kitemzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalBkitemx</span>{<span class="enscript-keyword">\itemxpar</span> <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\kitemzzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kitemzzz</span> #1{<span class="enscript-keyword">\dosubind</span> {kw}{<span class="enscript-keyword">\code</span>{#1}}{for {<span class="enscript-keyword">\bf</span> <span class="enscript-keyword">\lastfunction</span>}}<span class="enscript-comment">%
</span>                 <span class="enscript-keyword">\itemzzz</span> {#1}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xitemzzz</span> #1{<span class="enscript-keyword">\dosubind</span> {kw}{<span class="enscript-keyword">\code</span>{#1}}{for {<span class="enscript-keyword">\bf</span> <span class="enscript-keyword">\xitemsubtopic</span>}}<span class="enscript-comment">%
</span>                 <span class="enscript-keyword">\itemzzz</span> {#1}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemzzz</span> #1{<span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\rightskip</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\tableindent</span>
  <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\itemfont</span>{#1}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\itemindex</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\nobreak</span> <span class="enscript-comment">% This prevents a break before @itemx.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If the item text does not fit in the space we have, put it on a line
</span>  <span class="enscript-comment">% by itself, and do not allow a page break either before or after that
</span>  <span class="enscript-comment">% line.  We do not start a paragraph here because then if the next
</span>  <span class="enscript-comment">% command is, e.g., @kindex, the whatsit would get put into the
</span>  <span class="enscript-comment">% horizontal list on a line by itself, resulting in extra blank space.
</span>  <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\wd</span>0&gt;<span class="enscript-keyword">\itemmax</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Make this a paragraph so we get the \parskip glue and wrapping,
</span>    <span class="enscript-comment">% but leave it ragged-right.
</span>    <span class="enscript-keyword">\begingroup</span>
      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by-<span class="enscript-keyword">\tableindent</span>
      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by<span class="enscript-keyword">\tableindent</span>
      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\rightskip</span> by0pt plus1fil
      <span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\unhbox</span>0<span class="enscript-keyword">\par</span>
    <span class="enscript-keyword">\endgroup</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% We're going to be starting a paragraph, but we don't want the
</span>    <span class="enscript-comment">% \parskip glue -- logically it's part of the @item we just started.
</span>    <span class="enscript-keyword">\nobreak</span> <span class="enscript-keyword">\vskip</span>-<span class="enscript-keyword">\parskip</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Stop a page break at the \parskip glue coming up.  (Unfortunately
</span>    <span class="enscript-comment">% we can't prevent a possible page break at the following
</span>    <span class="enscript-comment">% \baselineskip glue.)  However, if what follows is an environment
</span>    <span class="enscript-comment">% such as @example, there will be no \parskip glue; then
</span>    <span class="enscript-comment">% the negative vskip we just would cause the example and the item to
</span>    <span class="enscript-comment">% crash together.  So we use this bizarre value of 10001 as a signal
</span>    <span class="enscript-comment">% to \aboveenvbreak to insert \parskip glue after all.
</span>    <span class="enscript-comment">% (Possibly there are other commands that could be followed by
</span>    <span class="enscript-comment">% @example which need the same treatment, but not section titles; or
</span>    <span class="enscript-comment">% maybe section titles are the only special case and they should be
</span>    <span class="enscript-comment">% penalty 10001...)
</span>    <span class="enscript-keyword">\penalty</span> 10001
    <span class="enscript-keyword">\endgroup</span>
    <span class="enscript-keyword">\itemxneedsnegativevskipfalse</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% The item text fits into the space.  Start a paragraph, so that the
</span>    <span class="enscript-comment">% following text (if any) will end up on the same line.
</span>    <span class="enscript-keyword">\noindent</span>
    <span class="enscript-comment">% Do this with kerns and \unhbox so that if there is a footnote in
</span>    <span class="enscript-comment">% the item text, it can migrate to the main vertical list and
</span>    <span class="enscript-comment">% eventually be printed.
</span>    <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\kern</span>-<span class="enscript-keyword">\tableindent</span>
    <span class="enscript-keyword">\dimen</span>0 = <span class="enscript-keyword">\itemmax</span>  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>0 by <span class="enscript-keyword">\itemmargin</span> <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>0 by -<span class="enscript-keyword">\wd</span>0
    <span class="enscript-keyword">\unhbox</span>0
    <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\kern</span><span class="enscript-keyword">\dimen</span>0
    <span class="enscript-keyword">\endgroup</span>
    <span class="enscript-keyword">\itemxneedsnegativevskiptrue</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\item</span>{<span class="enscript-keyword">\errmessage</span>{@item while not in a table}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemx</span>{<span class="enscript-keyword">\errmessage</span>{@itemx while not in a table}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kitem</span>{<span class="enscript-keyword">\errmessage</span>{@kitem while not in a table}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kitemx</span>{<span class="enscript-keyword">\errmessage</span>{@kitemx while not in a table}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xitem</span>{<span class="enscript-keyword">\errmessage</span>{@xitem while not in a table}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xitemx</span>{<span class="enscript-keyword">\errmessage</span>{@xitemx while not in a table}}

<span class="enscript-comment">% Contains a kludge to get @end[description] to work.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\description</span>{<span class="enscript-keyword">\tablez</span>{<span class="enscript-keyword">\dontindex</span>}{1}{}{}{}{}}

<span class="enscript-comment">% @table, @ftable, @vtable.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\table</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\inENV</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\tablex</span>}
{<span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\tablex</span> #1^^M{<span class="enscript-comment">%
</span><span class="enscript-keyword">\tabley</span><span class="enscript-keyword">\dontindex</span>#1        <span class="enscript-keyword">\endtabley</span>}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ftable</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\inENV</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\ftablex</span>}
{<span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\ftablex</span> #1^^M{<span class="enscript-comment">%
</span><span class="enscript-keyword">\tabley</span><span class="enscript-keyword">\fnitemindex</span>#1        <span class="enscript-keyword">\endtabley</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Eftable</span>{<span class="enscript-keyword">\endgraf</span><span class="enscript-keyword">\afterenvbreak</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\Etable</span>=<span class="enscript-keyword">\relax</span>}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\vtable</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\inENV</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\vtablex</span>}
{<span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\vtablex</span> #1^^M{<span class="enscript-comment">%
</span><span class="enscript-keyword">\tabley</span><span class="enscript-keyword">\vritemindex</span>#1        <span class="enscript-keyword">\endtabley</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Evtable</span>{<span class="enscript-keyword">\endgraf</span><span class="enscript-keyword">\afterenvbreak</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\Etable</span>=<span class="enscript-keyword">\relax</span>}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dontindex</span> #1{}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\fnitemindex</span> #1{<span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#1}}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\vritemindex</span> #1{<span class="enscript-keyword">\doind</span> {vr}{<span class="enscript-keyword">\code</span>{#1}}}<span class="enscript-comment">%
</span>
{<span class="enscript-keyword">\obeyspaces</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\tabley</span>#1#2 #3 #4 #5 #6 #7<span class="enscript-keyword">\endtabley</span>{<span class="enscript-keyword">\endgroup</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\tablez</span>{#1}{#2}{#3}{#4}{#5}{#6}}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\tablez</span> #1#2#3#4#5#6{<span class="enscript-comment">%
</span><span class="enscript-keyword">\aboveenvbreak</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\Edescription</span>{<span class="enscript-keyword">\Etable</span>}<span class="enscript-comment">% Necessary kludge.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\itemindex</span>=#1<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifnum</span> 0#3&gt;0 <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\leftskip</span> by #3<span class="enscript-keyword">\mil</span> <span class="enscript-keyword">\fi</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\ifnum</span> 0#4&gt;0 <span class="enscript-keyword">\tableindent</span>=#4<span class="enscript-keyword">\mil</span> <span class="enscript-keyword">\fi</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\ifnum</span> 0#5&gt;0 <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\rightskip</span> by #5<span class="enscript-keyword">\mil</span> <span class="enscript-keyword">\fi</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemfont</span>{#2}<span class="enscript-comment">%
</span><span class="enscript-keyword">\itemmax</span>=<span class="enscript-keyword">\tableindent</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\itemmax</span> by -<span class="enscript-keyword">\itemmargin</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\leftskip</span> by <span class="enscript-keyword">\tableindent</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\exdentamount</span>=<span class="enscript-keyword">\tableindent</span>
<span class="enscript-keyword">\parindent</span> = 0pt
<span class="enscript-keyword">\parskip</span> = <span class="enscript-keyword">\smallskipamount</span>
<span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\parskip</span>=0pt <span class="enscript-keyword">\parskip</span>=2pt <span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\Etable</span>{<span class="enscript-keyword">\endgraf</span><span class="enscript-keyword">\afterenvbreak</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\item</span> = <span class="enscript-keyword">\internalBitem</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\itemx</span> = <span class="enscript-keyword">\internalBitemx</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\kitem</span> = <span class="enscript-keyword">\internalBkitem</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\kitemx</span> = <span class="enscript-keyword">\internalBkitemx</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\xitem</span> = <span class="enscript-keyword">\internalBxitem</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\xitemx</span> = <span class="enscript-keyword">\internalBxitemx</span> <span class="enscript-comment">%
</span>}

<span class="enscript-comment">% This is the counter used by @enumerate, which is really @itemize
</span>
<span class="enscript-keyword">\newcount</span> <span class="enscript-keyword">\itemno</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemize</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\itemizezzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemizezzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">% ended by the @end itemize
</span>  <span class="enscript-keyword">\itemizey</span> {#1}{<span class="enscript-keyword">\Eitemize</span>}
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemizey</span> #1#2{<span class="enscript-comment">%
</span><span class="enscript-keyword">\aboveenvbreak</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\itemmax</span>=<span class="enscript-keyword">\itemindent</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\itemmax</span> by -<span class="enscript-keyword">\itemmargin</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\leftskip</span> by <span class="enscript-keyword">\itemindent</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\exdentamount</span>=<span class="enscript-keyword">\itemindent</span>
<span class="enscript-keyword">\parindent</span> = 0pt <span class="enscript-comment">%
</span><span class="enscript-keyword">\parskip</span> = <span class="enscript-keyword">\smallskipamount</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\parskip</span>=0pt <span class="enscript-keyword">\parskip</span>=2pt <span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span>#2{<span class="enscript-keyword">\endgraf</span><span class="enscript-keyword">\afterenvbreak</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemcontents</span>{#1}<span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\item</span>=<span class="enscript-keyword">\itemizeitem</span>}

<span class="enscript-comment">% \splitoff TOKENS\endmark defines \first to be the first token in
</span><span class="enscript-comment">% TOKENS, and \rest to be the remainder.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\splitoff</span>#1#2<span class="enscript-keyword">\endmark</span>{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\first</span>{#1}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\rest</span>{#2}}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% Allow an optional argument of an uppercase letter, lowercase letter,
</span><span class="enscript-comment">% or number, to specify the first label in the enumerated list.  No
</span><span class="enscript-comment">% argument is the same as `1'.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\enumerate</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\enumeratezzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\enumeratezzz</span> #1{<span class="enscript-keyword">\enumeratey</span> #1  <span class="enscript-keyword">\endenumeratey</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\enumeratey</span> #1 #2<span class="enscript-keyword">\endenumeratey</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">% ended by the @end enumerate
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If we were given no argument, pretend we were given `1'.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\thearg</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\thearg</span><span class="enscript-keyword">\empty</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\thearg</span>{1}<span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Detect if the argument is a single token.  If so, it might be a
</span>  <span class="enscript-comment">% letter.  Otherwise, the only valid thing it can be is a number.
</span>  <span class="enscript-comment">% (We will always have one token, because of the test we just made.
</span>  <span class="enscript-comment">% This is a good thing, since \splitoff doesn't work given nothing at
</span>  <span class="enscript-comment">% all -- the first parameter is undelimited.)
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\splitoff</span><span class="enscript-keyword">\thearg</span><span class="enscript-keyword">\endmark</span>
  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\rest</span><span class="enscript-keyword">\empty</span>
    <span class="enscript-comment">% Only one token in the argument.  It could still be anything.
</span>    <span class="enscript-comment">% A ``lowercase letter'' is one whose \lccode is nonzero.
</span>    <span class="enscript-comment">% An ``uppercase letter'' is one whose \lccode is both nonzero, and
</span>    <span class="enscript-comment">%   not equal to itself.
</span>    <span class="enscript-comment">% Otherwise, we assume it's a number.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% We need the \relax at the end of the \ifnum lines to stop TeX from
</span>    <span class="enscript-comment">% continuing to look for a &lt;number&gt;.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lccode</span><span class="enscript-keyword">\expandafter</span>`<span class="enscript-keyword">\thearg</span>=0<span class="enscript-keyword">\relax</span>
      <span class="enscript-keyword">\numericenumerate</span> <span class="enscript-comment">% a number (we hope)
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-comment">% It's a letter.
</span>      <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lccode</span><span class="enscript-keyword">\expandafter</span>`<span class="enscript-keyword">\thearg</span>=<span class="enscript-keyword">\expandafter</span>`<span class="enscript-keyword">\thearg</span><span class="enscript-keyword">\relax</span>
        <span class="enscript-keyword">\lowercaseenumerate</span> <span class="enscript-comment">% lowercase letter
</span>      <span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\uppercaseenumerate</span> <span class="enscript-comment">% uppercase letter
</span>      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% Multiple tokens in the argument.  We hope it's a number.
</span>    <span class="enscript-keyword">\numericenumerate</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% An @enumerate whose labels are integers.  The starting integer is
</span><span class="enscript-comment">% given in \thearg.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numericenumerate</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\itemno</span> = <span class="enscript-keyword">\thearg</span>
  <span class="enscript-keyword">\startenumeration</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\itemno</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% The starting (lowercase) letter is in \thearg.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\lowercaseenumerate</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\itemno</span> = <span class="enscript-keyword">\expandafter</span>`<span class="enscript-keyword">\thearg</span>
  <span class="enscript-keyword">\startenumeration</span>{<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Be sure we're not beyond the end of the alphabet.
</span>    <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\itemno</span>=0
      <span class="enscript-keyword">\errmessage</span>{No more lowercase letters in @enumerate; get a bigger
                  alphabet}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\char</span><span class="enscript-keyword">\lccode</span><span class="enscript-keyword">\itemno</span>
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% The starting (uppercase) letter is in \thearg.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\uppercaseenumerate</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\itemno</span> = <span class="enscript-keyword">\expandafter</span>`<span class="enscript-keyword">\thearg</span>
  <span class="enscript-keyword">\startenumeration</span>{<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Be sure we're not beyond the end of the alphabet.
</span>    <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\itemno</span>=0
      <span class="enscript-keyword">\errmessage</span>{No more uppercase letters in @enumerate; get a bigger
                  alphabet}
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\char</span><span class="enscript-keyword">\uccode</span><span class="enscript-keyword">\itemno</span>
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Call itemizey, adding a period to the first argument and supplying the
</span><span class="enscript-comment">% common last two arguments.  Also subtract one from the initial value in
</span><span class="enscript-comment">% \itemno, since @item increments \itemno.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\startenumeration</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\itemno</span> by -1
  <span class="enscript-keyword">\itemizey</span>{#1.}<span class="enscript-keyword">\Eenumerate</span><span class="enscript-keyword">\flushcr</span>
}

<span class="enscript-comment">% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
</span><span class="enscript-comment">% to @enumerate.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\alphaenumerate</span>{<span class="enscript-keyword">\enumerate</span>{a}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\capsenumerate</span>{<span class="enscript-keyword">\enumerate</span>{A}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ealphaenumerate</span>{<span class="enscript-keyword">\Eenumerate</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ecapsenumerate</span>{<span class="enscript-keyword">\Eenumerate</span>}

<span class="enscript-comment">% Definition of @item while inside @itemize.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\itemizeitem</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\itemno</span> by 1
{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\par</span>=<span class="enscript-keyword">\endgraf</span> <span class="enscript-keyword">\smallbreak</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifhmode</span> <span class="enscript-keyword">\errmessage</span>{In hmode at itemizeitem}<span class="enscript-keyword">\fi</span>
{<span class="enscript-keyword">\parskip</span>=0in <span class="enscript-keyword">\hskip</span> 0pt
<span class="enscript-keyword">\hbox</span> to 0pt{<span class="enscript-keyword">\hss</span> <span class="enscript-keyword">\itemcontents</span><span class="enscript-keyword">\hskip</span> <span class="enscript-keyword">\itemmargin</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\vadjust</span>{<span class="enscript-keyword">\penalty</span> 1200}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\flushcr</span>}

<span class="enscript-comment">% @multitable macros
</span><span class="enscript-comment">% Amy Hendrickson, 8/18/94, 3/6/96
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% @multitable ... @end multitable will make as many columns as desired.
</span><span class="enscript-comment">% Contents of each column will wrap at width given in preamble.  Width
</span><span class="enscript-comment">% can be specified either with sample text given in a template line,
</span><span class="enscript-comment">% or in percent of \hsize, the current width of text on page.
</span>
<span class="enscript-comment">% Table can continue over pages but will only break between lines.
</span>
<span class="enscript-comment">% To make preamble:
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Either define widths of columns in terms of percent of \hsize:
</span><span class="enscript-comment">%   @multitable @columnfractions .25 .3 .45
</span><span class="enscript-comment">%   @item ...
</span><span class="enscript-comment">%
</span><span class="enscript-comment">%   Numbers following @columnfractions are the percent of the total
</span><span class="enscript-comment">%   current hsize to be used for each column. You may use as many
</span><span class="enscript-comment">%   columns as desired.
</span>

<span class="enscript-comment">% Or use a template:
</span><span class="enscript-comment">%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
</span><span class="enscript-comment">%   @item ...
</span><span class="enscript-comment">%   using the widest term desired in each column.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% For those who want to use more than one line's worth of words in
</span><span class="enscript-comment">% the preamble, break the line within one argument and it
</span><span class="enscript-comment">% will parse correctly, i.e.,
</span><span class="enscript-comment">%
</span><span class="enscript-comment">%     @multitable {Column 1 template} {Column 2 template} {Column 3
</span><span class="enscript-comment">%      template}
</span><span class="enscript-comment">% Not:
</span><span class="enscript-comment">%     @multitable {Column 1 template} {Column 2 template}
</span><span class="enscript-comment">%      {Column 3 template}
</span>
<span class="enscript-comment">% Each new table line starts with @item, each subsequent new column
</span><span class="enscript-comment">% starts with @tab. Empty columns may be produced by supplying @tab's
</span><span class="enscript-comment">% with nothing between them for as many times as empty columns are needed,
</span><span class="enscript-comment">% ie, @tab@tab@tab will produce two empty columns.
</span>
<span class="enscript-comment">% @item, @tab, @multitable or @end multitable do not need to be on their
</span><span class="enscript-comment">% own lines, but it will not hurt if they are.
</span>
<span class="enscript-comment">% Sample multitable:
</span>
<span class="enscript-comment">%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
</span><span class="enscript-comment">%   @item first col stuff @tab second col stuff @tab third col
</span><span class="enscript-comment">%   @item
</span><span class="enscript-comment">%   first col stuff
</span><span class="enscript-comment">%   @tab
</span><span class="enscript-comment">%   second col stuff
</span><span class="enscript-comment">%   @tab
</span><span class="enscript-comment">%   third col
</span><span class="enscript-comment">%   @item first col stuff @tab second col stuff
</span><span class="enscript-comment">%   @tab Many paragraphs of text may be used in any column.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">%         They will wrap at the width determined by the template.
</span><span class="enscript-comment">%   @item@tab@tab This will be in third column.
</span><span class="enscript-comment">%   @end multitable
</span>
<span class="enscript-comment">% Default dimensions may be reset by user.
</span><span class="enscript-comment">% @multitableparskip is vertical space between paragraphs in table.
</span><span class="enscript-comment">% @multitableparindent is paragraph indent in table.
</span><span class="enscript-comment">% @multitablecolmargin is horizontal space to be left between columns.
</span><span class="enscript-comment">% @multitablelinespace is space to leave between table items, baseline
</span><span class="enscript-comment">%                                                            to baseline.
</span><span class="enscript-comment">%   0pt means it depends on current normal line spacing.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\multitableparskip</span>
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\multitableparindent</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\multitablecolspace</span>
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\multitablelinespace</span>
<span class="enscript-keyword">\multitableparskip</span>=0pt
<span class="enscript-keyword">\multitableparindent</span>=6pt
<span class="enscript-keyword">\multitablecolspace</span>=12pt
<span class="enscript-keyword">\multitablelinespace</span>=0pt

<span class="enscript-comment">% Macros used to set up halign preamble:
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\endsetuptable</span><span class="enscript-keyword">\relax</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xendsetuptable</span>{<span class="enscript-keyword">\endsetuptable</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\columnfractions</span><span class="enscript-keyword">\relax</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xcolumnfractions</span>{<span class="enscript-keyword">\columnfractions</span>}
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifsetpercent</span>

<span class="enscript-comment">% #1 is the part of the @columnfraction before the decimal point, which
</span><span class="enscript-comment">% is presumably either 0 or the empty string (but we don't check, we
</span><span class="enscript-comment">% just throw it away).  #2 is the decimal part, which we use as the
</span><span class="enscript-comment">% percent of \hsize for this column.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\pickupwholefraction</span>#1.#2 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\colcount</span> by 1
  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span> col<span class="enscript-keyword">\the</span><span class="enscript-keyword">\colcount</span><span class="enscript-keyword">\endcsname</span>{.#2<span class="enscript-keyword">\hsize</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setuptable</span>
}

<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\colcount</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setuptable</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\firstarg</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\firstarg</span><span class="enscript-keyword">\xendsetuptable</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\go</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\firstarg</span><span class="enscript-keyword">\xcolumnfractions</span>
      <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setpercenttrue</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\ifsetpercent</span>
         <span class="enscript-keyword">\let</span><span class="enscript-keyword">\go</span><span class="enscript-keyword">\pickupwholefraction</span>
      <span class="enscript-keyword">\else</span>
         <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\colcount</span> by 1
         <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span>{#1<span class="enscript-keyword">\unskip</span><span class="enscript-keyword">\space</span>}<span class="enscript-comment">% Add a normal word space as a
</span>                   <span class="enscript-comment">% separator; typically that is always in the input, anyway.
</span>         <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span> col<span class="enscript-keyword">\the</span><span class="enscript-keyword">\colcount</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\wd</span>0}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\go</span><span class="enscript-keyword">\pickupwholefraction</span>
      <span class="enscript-comment">% Put the argument back for the \pickupwholefraction call, so
</span>      <span class="enscript-comment">% we'll always have a period there to be parsed.
</span>      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\go</span>{<span class="enscript-keyword">\pickupwholefraction</span>#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\go</span> = <span class="enscript-keyword">\setuptable</span>
    <span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\go</span>
}

<span class="enscript-comment">% @multitable ... @end multitable definitions:
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\multitable</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\dotable</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dotable</span>#1{<span class="enscript-keyword">\bgroup</span>
  <span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\parskip</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\item</span>=<span class="enscript-keyword">\crcrwithfootnotes</span>
  <span class="enscript-comment">% A \tab used to include \hskip1sp.  But then the space in a template
</span>  <span class="enscript-comment">% line is not enough.  That is bad.  So let's go back to just &amp; until
</span>  <span class="enscript-comment">% we encounter the problem it was intended to solve again.  --karl,
</span>  <span class="enscript-comment">% <a href="mailto:nathan@acm.org">nathan@acm.org</a>, 20apr99.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tab</span>=&amp;<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\startfootins</span>=<span class="enscript-keyword">\startsavedfootnote</span>
  <span class="enscript-keyword">\tolerance</span>=9500
  <span class="enscript-keyword">\hbadness</span>=9500
  <span class="enscript-keyword">\setmultitablespacing</span>
  <span class="enscript-keyword">\parskip</span>=<span class="enscript-keyword">\multitableparskip</span>
  <span class="enscript-keyword">\parindent</span>=<span class="enscript-keyword">\multitableparindent</span>
  <span class="enscript-keyword">\overfullrule</span>=0pt
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\colcount</span>=0
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Emultitable</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setpercentfalse</span>
    <span class="enscript-keyword">\crcrwithfootnotes</span><span class="enscript-keyword">\crcr</span>
    <span class="enscript-keyword">\egroup</span><span class="enscript-keyword">\egroup</span>
  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% To parse everything between @multitable and @item:
</span>  <span class="enscript-keyword">\setuptable</span>#1 <span class="enscript-keyword">\endsetuptable</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \everycr will reset column counter, \colcount, at the end of
</span>  <span class="enscript-comment">% each line. Every column entry will cause \colcount to advance by one.
</span>  <span class="enscript-comment">% The table preamble
</span>  <span class="enscript-comment">% looks at the current \colcount to find the correct column width.
</span>  <span class="enscript-keyword">\everycr</span>{<span class="enscript-keyword">\noalign</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \filbreak%% keeps underfull box messages off when table breaks over pages.
</span>  <span class="enscript-comment">% Maybe so, but it also creates really weird page breaks when the table
</span>  <span class="enscript-comment">% breaks over pages. Wouldn't \vfil be better?  Wait until the problem
</span>  <span class="enscript-comment">% manifests itself, so it can be fixed for real --karl.
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\colcount</span>=0<span class="enscript-keyword">\relax</span>}}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% This preamble sets up a generic column definition, which will
</span>  <span class="enscript-comment">% be used as many times as user calls for columns.
</span>  <span class="enscript-comment">% \vtop will set a single line and will also let text wrap and
</span>  <span class="enscript-comment">% continue for many paragraphs if desired.
</span>  <span class="enscript-keyword">\halign</span><span class="enscript-keyword">\bgroup</span>&amp;<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\colcount</span> by 1<span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\multistrut</span><span class="enscript-keyword">\vtop</span>{<span class="enscript-keyword">\hsize</span>=<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\csname</span> col<span class="enscript-keyword">\the</span><span class="enscript-keyword">\colcount</span><span class="enscript-keyword">\endcsname</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% In order to keep entries from bumping into each other
</span>  <span class="enscript-comment">% we will add a \leftskip of \multitablecolspace to all columns after
</span>  <span class="enscript-comment">% the first one.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If a template has been used, we will add \multitablecolspace
</span>  <span class="enscript-comment">% to the width of each template entry.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If the user has set preamble in terms of percent of \hsize we will
</span>  <span class="enscript-comment">% use that dimension as the width of the column, and the \leftskip
</span>  <span class="enscript-comment">% will keep entries from bumping into each other.  Table will start at
</span>  <span class="enscript-comment">% left margin and final column will justify at right margin.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Make sure we don't inherit \rightskip from the outer environment.
</span>  <span class="enscript-keyword">\rightskip</span>=0pt
  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\colcount</span>=1
    <span class="enscript-comment">% The first column will be indented with the surrounding text.
</span>    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by<span class="enscript-keyword">\leftskip</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\ifsetpercent</span> <span class="enscript-keyword">\else</span>
      <span class="enscript-comment">% If user has not set preamble in terms of percent of \hsize
</span>      <span class="enscript-comment">% we will advance \hsize by \multitablecolspace.
</span>      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by <span class="enscript-keyword">\multitablecolspace</span>
    <span class="enscript-keyword">\fi</span>
   <span class="enscript-comment">% In either case we will make \leftskip=\multitablecolspace:
</span>  <span class="enscript-keyword">\leftskip</span>=<span class="enscript-keyword">\multitablecolspace</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">% Ignoring space at the beginning and end avoids an occasional spurious
</span>  <span class="enscript-comment">% blank line, when TeX decides to break the line at the space before the
</span>  <span class="enscript-comment">% box from the multistrut, so the strut ends up on a line by itself.
</span>  <span class="enscript-comment">% For example:
</span>  <span class="enscript-comment">% @multitable @columnfractions .11 .89
</span>  <span class="enscript-comment">% @item @code{#}
</span>  <span class="enscript-comment">% @tab Legal holiday which is valid in major parts of the whole country.
</span>  <span class="enscript-comment">% Is automatically provided with highlighting sequences respectively marking
</span>  <span class="enscript-comment">% characters.
</span>  <span class="enscript-keyword">\noindent</span><span class="enscript-keyword">\ignorespaces</span>##<span class="enscript-keyword">\unskip</span><span class="enscript-keyword">\multistrut</span>}<span class="enscript-keyword">\cr</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setmultitablespacing</span>{<span class="enscript-comment">% test to see if user has set \multitablelinespace.
</span><span class="enscript-comment">% If so, do nothing. If not, give it an appropriate dimension based on
</span><span class="enscript-comment">% current baselineskip.
</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\multitablelinespace</span>=0pt
<span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\vbox</span>{X}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\multitablelinespace</span>=<span class="enscript-keyword">\the</span><span class="enscript-keyword">\baselineskip</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\multitablelinespace</span> by-<span class="enscript-keyword">\ht</span>0
<span class="enscript-comment">%% strut to put in table in case some entry doesn't have descenders,
</span><span class="enscript-comment">%% to keep lines equally spaced
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\multistrut</span> = <span class="enscript-keyword">\strut</span>
<span class="enscript-keyword">\else</span>
<span class="enscript-comment">%% FIXME: what is \box0 supposed to be?
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\multistrut</span>{<span class="enscript-keyword">\vrule</span> height<span class="enscript-keyword">\multitablelinespace</span> depth<span class="enscript-keyword">\dp</span>0
width0pt<span class="enscript-keyword">\relax</span>} <span class="enscript-keyword">\fi</span>
<span class="enscript-comment">%% Test to see if parskip is larger than space between lines of
</span><span class="enscript-comment">%% table. If not, do nothing.
</span><span class="enscript-comment">%%        If so, set to same dimension as multitablelinespace.
</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\multitableparskip</span>&gt;<span class="enscript-keyword">\multitablelinespace</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\multitableparskip</span>=<span class="enscript-keyword">\multitablelinespace</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\multitableparskip</span>-7pt <span class="enscript-comment">%% to keep parskip somewhat smaller
</span>                                      <span class="enscript-comment">%% than skip between lines in the table.
</span><span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\multitableparskip</span>=0pt
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\multitableparskip</span>=<span class="enscript-keyword">\multitablelinespace</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\multitableparskip</span>-7pt <span class="enscript-comment">%% to keep parskip somewhat smaller
</span>                                      <span class="enscript-comment">%% than skip between lines in the table.
</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% In case a @footnote appears inside an alignment, save the footnote
</span><span class="enscript-comment">% text to a box and make the \insert when a row of the table is
</span><span class="enscript-comment">% finished.  Otherwise, the insertion is lost, it never migrates to the
</span><span class="enscript-comment">% main vertical list.  --kasal, 22jan03.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\savedfootnotes</span>
<span class="enscript-comment">%
</span><span class="enscript-comment">% \dotable \let's \startfootins to this, so that \dofootnote will call
</span><span class="enscript-comment">% it instead of starting the insertion right away.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\startsavedfootnote</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\savedfootnotes</span> = <span class="enscript-keyword">\vbox</span><span class="enscript-keyword">\bgroup</span>
    <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\savedfootnotes</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\crcrwithfootnotes</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\crcr</span>
  <span class="enscript-keyword">\ifvoid</span><span class="enscript-keyword">\savedfootnotes</span> <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\noalign</span>{<span class="enscript-keyword">\insert</span><span class="enscript-keyword">\footins</span>{<span class="enscript-keyword">\box</span><span class="enscript-keyword">\savedfootnotes</span>}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\message</span>{conditionals,}
<span class="enscript-comment">% Prevent errors for section commands.
</span><span class="enscript-comment">% Used in @ignore and in failing conditionals.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ignoresections</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\chapter</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbered</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\top</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsubsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsubsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsubsubsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumberedsubsubsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\section</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendix</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsubsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsubsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsubsubsec</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixsubsubsection</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\contents</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallbook</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\titlepage</span>=<span class="enscript-keyword">\relax</span>
}

<span class="enscript-comment">% Used in nested conditionals, where we have to parse the Texinfo source
</span><span class="enscript-comment">% and so want to turn off most commands, in case they are used
</span><span class="enscript-comment">% incorrectly.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% We use \empty instead of \relax for the @def... commands, so that \end
</span><span class="enscript-comment">% doesn't throw an error.  For instance:
</span><span class="enscript-comment">% @ignore
</span><span class="enscript-comment">% @deffn ...
</span><span class="enscript-comment">% @end deffn
</span><span class="enscript-comment">% @end ignore
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% The @end deffn is going to get expanded, because we're trying to allow
</span><span class="enscript-comment">% nested conditionals.  But we don't want to expand the actual @deffn,
</span><span class="enscript-comment">% since it might be syntactically correct and intended to be ignored.
</span><span class="enscript-comment">% Since \end checks for \relax, using \empty does not cause an error.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ignoremorecommands</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defcodeindex</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defcv</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defcvx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefcv</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deffn</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deffnx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeffn</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defindex</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defivar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defivarx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefivar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defmac</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defmacx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefmac</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defmethod</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defmethodx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefmethod</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defop</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defopx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefop</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defopt</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defoptx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefopt</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defspec</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defspecx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefspec</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftp</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftpx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftp</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypefn</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypefnx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypefn</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypefun</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypefunx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypefun</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypeivar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypeivarx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypeivar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypemethod</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypemethodx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypemethod</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypeop</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypeopx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypeop</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypevar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypevarx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypevar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypevr</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\deftypevrx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edeftypevr</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defun</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defunx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefun</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defvar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defvarx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefvar</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defvr</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\defvrx</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edefvr</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\clear</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\down</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\evenfooting</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\evenheading</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\everyfooting</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\everyheading</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\headings</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\include</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\item</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\lowersections</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\oddfooting</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\oddheading</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\printindex</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\pxref</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\raisesections</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\ref</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\set</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\setchapternewpage</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\setchapterstyle</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\settitle</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\up</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\verbatiminclude</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\xref</span> = <span class="enscript-keyword">\relax</span>
}

<span class="enscript-comment">% Ignore @ignore, @ifhtml, @ifinfo, and the like.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\direntry</span>{<span class="enscript-keyword">\doignore</span>{direntry}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\documentdescriptionword</span>{documentdescription}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\documentdescription</span>{<span class="enscript-keyword">\doignore</span>{documentdescription}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\html</span>{<span class="enscript-keyword">\doignore</span>{html}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifhtml</span>{<span class="enscript-keyword">\doignore</span>{ifhtml}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifinfo</span>{<span class="enscript-keyword">\doignore</span>{ifinfo}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifnottex</span>{<span class="enscript-keyword">\doignore</span>{ifnottex}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifplaintext</span>{<span class="enscript-keyword">\doignore</span>{ifplaintext}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifxml</span>{<span class="enscript-keyword">\doignore</span>{ifxml}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ignore</span>{<span class="enscript-keyword">\doignore</span>{ignore}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\menu</span>{<span class="enscript-keyword">\doignore</span>{menu}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xml</span>{<span class="enscript-keyword">\doignore</span>{xml}}

<span class="enscript-comment">% @dircategory CATEGORY  -- specify a category of the dir file
</span><span class="enscript-comment">% which this file should belong to.  Ignore this in TeX.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\dircategory</span> = <span class="enscript-keyword">\comment</span>

<span class="enscript-comment">% Ignore text until a line `@end #1'.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doignore</span>#1{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-comment">% Don't complain about control sequences we have declared \outer.
</span>  <span class="enscript-keyword">\ignoresections</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Define a command to swallow text until we reach `@end #1'.
</span>  <span class="enscript-comment">% This @ is a catcode 12 token (that is the normal catcode of @ in
</span>  <span class="enscript-comment">% this texinfo.tex file).  We change the catcode of @ below to match.
</span>  <span class="enscript-keyword">\long</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doignoretext</span>##1@end #1{<span class="enscript-keyword">\enddoignore</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Make sure that spaces turn into tokens that match what \doignoretext wants.
</span>  <span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\spaceChar</span> = 10
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Ignore braces, too, so mismatched braces don't cause trouble.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span> = 9
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span> = 9
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% We must not have @c interpreted as a control sequence.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span> = 12
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ignoreword</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\ignoreword</span><span class="enscript-keyword">\documentdescriptionword</span>
    <span class="enscript-comment">% The c kludge breaks documentdescription, since
</span>    <span class="enscript-comment">% `documentdescription' contains a `c'.  Means not everything will
</span>    <span class="enscript-comment">% be ignored inside @documentdescription, but oh well...
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% Make the letter c a comment character so that the rest of the line
</span>    <span class="enscript-comment">% will be ignored. This way, the document can have (for example)
</span>    <span class="enscript-comment">%   @c @end ifinfo
</span>    <span class="enscript-comment">% and the @end ifinfo will be properly ignored.
</span>    <span class="enscript-comment">% (We've just changed @ to catcode 12.)
</span>    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\c</span> = 14
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% And now expand the command defined above.
</span>  <span class="enscript-keyword">\doignoretext</span>
}

<span class="enscript-comment">% What we do to finish off ignored text.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\enddoignore</span>{<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\ignorespaces</span>}<span class="enscript-comment">%
</span>
<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifwarnedobs</span><span class="enscript-keyword">\warnedobsfalse</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\obstexwarn</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifwarnedobs</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span>
  <span class="enscript-comment">% We need to warn folks that they may have trouble with TeX 3.0.
</span>  <span class="enscript-comment">% This uses \immediate\write16 rather than \message to get newlines.
</span>    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{WARNING: for users of Unix TeX 3.0!}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{This manual trips a bug in TeX version 3.0 (tex hangs).}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{If you are running another version of TeX, relax.}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{If you are running Unix TeX 3.0, kill this TeX process.}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{  Then upgrade your TeX installation if you can.}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{  (See <a href="ftp://ftp.gnu.org/non-gnu/TeX.README.">ftp://ftp.gnu.org/non-gnu/TeX.README.</a>)}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{If you are stuck with version 3.0, run the}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{  script ``tex3patch'' from the Texinfo distribution}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{  to use a workaround.}
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span>16{}
    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\warnedobstrue</span>
    <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% **In TeX 3.0, setting text in \nullfont hangs tex.  For a
</span><span class="enscript-comment">% workaround (which requires the file ``dummy.tfm'' to be installed),
</span><span class="enscript-comment">% uncomment the following line:
</span><span class="enscript-comment">%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
</span>
<span class="enscript-comment">% Ignore text, except that we keep track of conditional commands for
</span><span class="enscript-comment">% purposes of nesting, up to an `@end #1' command.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\nestedignore</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\obstexwarn</span>
  <span class="enscript-comment">% We must actually expand the ignored text to look for the @end
</span>  <span class="enscript-comment">% command, so that nested ignore constructs work.  Thus, we put the
</span>  <span class="enscript-comment">% text into a \vbox and then do nothing with the result.  To minimize
</span>  <span class="enscript-comment">% the chance of memory overflow, we follow the approach outlined on
</span>  <span class="enscript-comment">% page 401 of the TeXbook.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\vbox</span><span class="enscript-keyword">\bgroup</span>
    <span class="enscript-comment">% Don't complain about control sequences we have declared \outer.
</span>    <span class="enscript-keyword">\ignoresections</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Define `@end #1' to end the box, which will in turn undefine the
</span>    <span class="enscript-comment">% @end command again.
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> E#1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\egroup</span><span class="enscript-keyword">\ignorespaces</span>}<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% We are going to be parsing Texinfo commands.  Most cause no
</span>    <span class="enscript-comment">% trouble when they are used incorrectly, but some commands do
</span>    <span class="enscript-comment">% complicated argument parsing or otherwise get confused, so we
</span>    <span class="enscript-comment">% undefine them.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% We can't do anything about stray @-signs, unfortunately;
</span>    <span class="enscript-comment">% they'll produce `undefined control sequence' errors.
</span>    <span class="enscript-keyword">\ignoremorecommands</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Set the current font to be \nullfont, a TeX primitive, and define
</span>    <span class="enscript-comment">% all the font commands to also use \nullfont.  We don't use
</span>    <span class="enscript-comment">% dummy.tfm, as suggested in the TeXbook, because some sites
</span>    <span class="enscript-comment">% might not have that installed.  Therefore, math mode will still
</span>    <span class="enscript-comment">% produce output, but that should be an extremely small amount of
</span>    <span class="enscript-comment">% stuff compared to the main input.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenrm</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenit</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensl</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tenbf</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallcaps</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tensf</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-comment">% Similarly for index fonts.
</span>    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallrm</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallit</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallsl</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallbf</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smalltt</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallsc</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallsf</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-comment">% Similarly for smallexample fonts.
</span>    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallerrm</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallerit</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallersl</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallerbf</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallertt</span>=<span class="enscript-keyword">\nullfont</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallersc</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallersf</span>=<span class="enscript-keyword">\nullfont</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Don't complain when characters are missing from the fonts.
</span>    <span class="enscript-keyword">\tracinglostchars</span> = 0
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Don't bother to do space factor calculations.
</span>    <span class="enscript-keyword">\frenchspacing</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Don't report underfull hboxes.
</span>    <span class="enscript-keyword">\hbadness</span> = 10000
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do minimal line-breaking.
</span>    <span class="enscript-keyword">\pretolerance</span> = 10000
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do not execute instructions in @tex.
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\tex</span>{<span class="enscript-keyword">\doignore</span>{tex}}<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Do not execute macro definitions.
</span>    <span class="enscript-comment">% `c' is a comment character, so the word `macro' will get cut off.
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\macro</span>{<span class="enscript-keyword">\doignore</span>{ma}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @set VAR sets the variable VAR to an empty value.
</span><span class="enscript-comment">% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Since we want to separate VAR from REST-OF-LINE (which might be
</span><span class="enscript-comment">% empty), we can't just use \parsearg; we have to insert a space of our
</span><span class="enscript-comment">% own to delimit the rest of the line, and then take it out again if we
</span><span class="enscript-comment">% didn't need it.  Make sure the catcode of space is correct to avoid
</span><span class="enscript-comment">% losing inside @example, for instance.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\set</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\catcode</span>` =10
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\-</span>=12 <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=12 <span class="enscript-comment">% Allow - and _ in VAR.
</span>  <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\setxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setxxx</span>#1{<span class="enscript-keyword">\setyyy</span>#1 <span class="enscript-keyword">\endsetyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setyyy</span>#1 #2<span class="enscript-keyword">\endsetyyy</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{#2}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\empty</span> <span class="enscript-keyword">\global</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span> = <span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\setzzz</span>{#1}#2<span class="enscript-keyword">\endsetzzz</span> <span class="enscript-comment">% Remove the trailing space \setxxx inserted.
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\endgroup</span>
}
<span class="enscript-comment">% Can't use \xdef to pre-expand #2 and save some time, since \temp or
</span><span class="enscript-comment">% \next or other control sequences that we've defined might get us into
</span><span class="enscript-comment">% an infinite loop. Consider `@set foo @cite{bar}'.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setzzz</span>#1#2 <span class="enscript-keyword">\endsetzzz</span>{<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span>{#2}}

<span class="enscript-comment">% @clear VAR clears (i.e., unsets) the variable VAR.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\clear</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\clearxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\clearxxx</span>#1{<span class="enscript-keyword">\global</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span>=<span class="enscript-keyword">\relax</span>}

<span class="enscript-comment">% @value{foo} gets the text saved in variable foo.
</span>{
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span> = <span class="enscript-keyword">\active</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% We might end up with active _ or - characters in the argument if
</span>  <span class="enscript-comment">% we're called from @code, as @code{@value{foo-bar_}}.  So \let any
</span>  <span class="enscript-comment">% such active characters to their normal equivalents.
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\value</span>{<span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\-</span>=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\indexbreaks</span> <span class="enscript-keyword">\let</span>_<span class="enscript-keyword">\normalunderscore</span>
    <span class="enscript-keyword">\valuexxx</span>}
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\valuexxx</span>#1{<span class="enscript-keyword">\expandablevalue</span>{#1}<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% We have this subroutine so that we can handle at least some @value's
</span><span class="enscript-comment">% properly in indexes (we \let\value to this in \indexdummies).  Ones
</span><span class="enscript-comment">% whose names contain - or _ still won't work, but we can't do anything
</span><span class="enscript-comment">% about that.  The command has to be fully expandable (if the variable
</span><span class="enscript-comment">% is set), since the result winds up in the index file.  This means that
</span><span class="enscript-comment">% if the variable's value contains other Texinfo commands, it's almost
</span><span class="enscript-comment">% certain it will fail (although perhaps we could fix that with
</span><span class="enscript-comment">% sufficient work to do a one-level expansion on the result, instead of
</span><span class="enscript-comment">% complete).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\expandablevalue</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
    {[No value for ``#1'']}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\message</span>{Variable `#1', used in @value, is not set.}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
</span><span class="enscript-comment">% with @set.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifset</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doifset</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doifset</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\ifsetfail</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\ifsetsucceed</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\next</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifsetsucceed</span>{<span class="enscript-keyword">\conditionalsucceed</span>{ifset}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifsetfail</span>{<span class="enscript-keyword">\nestedignore</span>{ifset}}
<span class="enscript-keyword">\defineunmatchedend</span>{ifset}

<span class="enscript-comment">% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
</span><span class="enscript-comment">% defined with @set, or has been undefined with @clear.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifclear</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doifclear</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doifclear</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> SET#1<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\ifclearsucceed</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\ifclearfail</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\next</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifclearsucceed</span>{<span class="enscript-keyword">\conditionalsucceed</span>{ifclear}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifclearfail</span>{<span class="enscript-keyword">\nestedignore</span>{ifclear}}
<span class="enscript-keyword">\defineunmatchedend</span>{ifclear}

<span class="enscript-comment">% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
</span><span class="enscript-comment">% read the text following, through the first @end iftex (etc.).  Make
</span><span class="enscript-comment">% `@end iftex' (etc.) valid only after an @iftex.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\iftex</span>{<span class="enscript-keyword">\conditionalsucceed</span>{iftex}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifnothtml</span>{<span class="enscript-keyword">\conditionalsucceed</span>{ifnothtml}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifnotinfo</span>{<span class="enscript-keyword">\conditionalsucceed</span>{ifnotinfo}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifnotplaintext</span>{<span class="enscript-keyword">\conditionalsucceed</span>{ifnotplaintext}}
<span class="enscript-keyword">\defineunmatchedend</span>{iftex}
<span class="enscript-keyword">\defineunmatchedend</span>{ifnothtml}
<span class="enscript-keyword">\defineunmatchedend</span>{ifnotinfo}
<span class="enscript-keyword">\defineunmatchedend</span>{ifnotplaintext}

<span class="enscript-comment">% True conditional.  Since \set globally defines its variables, we can
</span><span class="enscript-comment">% just start and end a group (to keep the @end definition undefined at
</span><span class="enscript-comment">% the outer level).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\conditionalsucceed</span>#1{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> E#1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @defininfoenclose.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\definfoenclose</span>=<span class="enscript-keyword">\comment</span>


<span class="enscript-keyword">\message</span>{indexing,}
<span class="enscript-comment">% Index generation facilities
</span>
<span class="enscript-comment">% Define \newwrite to be identical to plain tex's \newwrite
</span><span class="enscript-comment">% except not \outer, so it can be used within \newindex.
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=11
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\newwrite</span>{<span class="enscript-keyword">\alloc</span>@7<span class="enscript-keyword">\write</span><span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\sixt</span>@@n}}

<span class="enscript-comment">% \newindex {foo} defines an index named foo.
</span><span class="enscript-comment">% It automatically defines \fooindex such that
</span><span class="enscript-comment">% \fooindex ...rest of line... puts an entry in the index foo.
</span><span class="enscript-comment">% It also defines \fooindfile to be the number of the output channel for
</span><span class="enscript-comment">% the file that accumulates this index.  The file's extension is foo.
</span><span class="enscript-comment">% The name of an index should be no more than 2 characters long
</span><span class="enscript-comment">% for the sake of vms.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\newindex</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\iflinks</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\newwrite</span> <span class="enscript-keyword">\csname</span>#1indfile<span class="enscript-keyword">\endcsname</span>
    <span class="enscript-keyword">\openout</span> <span class="enscript-keyword">\csname</span>#1indfile<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\jobname</span>.#1 <span class="enscript-comment">% Open the file
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span>#1index<span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%     % Define @#1index
</span>    <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\doindex</span>{#1}}
}

<span class="enscript-comment">% @defindex foo  ==  \newindex{foo}
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defindex</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\newindex</span>}

<span class="enscript-comment">% Define @defcodeindex, like @defindex except put all entries in @code.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defcodeindex</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\newcodeindex</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\newcodeindex</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\iflinks</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\newwrite</span> <span class="enscript-keyword">\csname</span>#1indfile<span class="enscript-keyword">\endcsname</span>
    <span class="enscript-keyword">\openout</span> <span class="enscript-keyword">\csname</span>#1indfile<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\jobname</span>.#1
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span>#1index<span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\docodeindex</span>{#1}}<span class="enscript-comment">%
</span>}


<span class="enscript-comment">% @synindex foo bar    makes index foo feed into index bar.
</span><span class="enscript-comment">% Do this instead of @defindex foo if you don't want it as a separate index.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% @syncodeindex foo bar   similar, but put all entries made for index foo
</span><span class="enscript-comment">% inside @code.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\synindex</span>#1 #2 {<span class="enscript-keyword">\dosynindex</span><span class="enscript-keyword">\doindex</span>{#1}{#2}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\syncodeindex</span>#1 #2 {<span class="enscript-keyword">\dosynindex</span><span class="enscript-keyword">\docodeindex</span>{#1}{#2}}

<span class="enscript-comment">% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
</span><span class="enscript-comment">% #3 the target index (bar).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosynindex</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Only do \closeout if we haven't already done it, else we'll end up
</span>  <span class="enscript-comment">% closing the target index.
</span>  <span class="enscript-keyword">\expandafter</span> <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> donesynindex#2<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\undefined</span>
    <span class="enscript-comment">% The \closeout helps reduce unnecessary open files; the limit on the
</span>    <span class="enscript-comment">% Acorn RISC OS is a mere 16 files.
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\closeout</span><span class="enscript-keyword">\csname</span>#2indfile<span class="enscript-keyword">\endcsname</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\donesynindex</span>#2<span class="enscript-keyword">\endcsname</span> = 1
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">% redefine \fooindfile:
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\temp</span><span class="enscript-keyword">\expandafter</span>=<span class="enscript-keyword">\csname</span>#3indfile<span class="enscript-keyword">\endcsname</span>
  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span>#2indfile<span class="enscript-keyword">\endcsname</span>=<span class="enscript-keyword">\temp</span>
  <span class="enscript-comment">% redefine \fooindex:
</span>  <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span>#2index<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\noexpand</span>#1{#3}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Define \doindex, the driver for all \fooindex macros.
</span><span class="enscript-comment">% Argument #1 is generated by the calling \fooindex macro,
</span><span class="enscript-comment">%  and it is &quot;foo&quot;, the name of the index.
</span>
<span class="enscript-comment">% \doindex just uses \parsearg; it calls \doind for the actual work.
</span><span class="enscript-comment">% This is because \doind is more useful to call from other macros.
</span>
<span class="enscript-comment">% There is also \dosubind {index}{topic}{subtopic}
</span><span class="enscript-comment">% which makes an entry in a two-level index such as the operation index.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doindex</span>#1{<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\indexname</span>{#1}<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\singleindexer</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\singleindexer</span> #1{<span class="enscript-keyword">\doind</span>{<span class="enscript-keyword">\indexname</span>}{#1}}

<span class="enscript-comment">% like the previous two, but they put @code around the argument.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\docodeindex</span>#1{<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\indexname</span>{#1}<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\singlecodeindexer</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\singlecodeindexer</span> #1{<span class="enscript-keyword">\doind</span>{<span class="enscript-keyword">\indexname</span>}{<span class="enscript-keyword">\code</span>{#1}}}

<span class="enscript-comment">% Take care of Texinfo commands that can appear in an index entry.
</span><span class="enscript-comment">% Since there are some commands we want to expand, and others we don't,
</span><span class="enscript-comment">% we have to laboriously prevent expansion for those that we don't.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexdummies</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{@}<span class="enscript-comment">% change to @@ when we switch to @ as escape char in index files.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ </span>{<span class="enscript-keyword">\realbackslash</span><span class="enscript-keyword">\space</span> }<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Need these in case \tex is in effect and \{ is a \delimiter again.
</span>  <span class="enscript-comment">% But can't use \lbracecmd and \rbracecmd because texindex assumes
</span>  <span class="enscript-comment">% braces and backslashes are used only as delimiters.  
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\{</span> = <span class="enscript-keyword">\mylbrace</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\}</span> = <span class="enscript-keyword">\myrbrace</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \definedummyword defines \#1 as \realbackslash #1\space, thus
</span>  <span class="enscript-comment">% effectively preventing its expansion.  This is used only for control
</span>  <span class="enscript-comment">% words, not control letters, because the \space would be incorrect
</span>  <span class="enscript-comment">% for control characters, but is needed to separate the control word
</span>  <span class="enscript-comment">% from whatever follows.
</span>  <span class="enscript-comment">% 
</span>  <span class="enscript-comment">% For control letters, we have \definedummyletter, which omits the
</span>  <span class="enscript-comment">% space.
</span>  <span class="enscript-comment">% 
</span>  <span class="enscript-comment">% These can be used both for control words that take an argument and
</span>  <span class="enscript-comment">% those that do not.  If it is followed by {arg} in the input, then
</span>  <span class="enscript-comment">% that will dutifully get written to the index (or wherever).
</span>  <span class="enscript-comment">% 
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\definedummyword</span>##1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> ##1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\realbackslash</span> ##1<span class="enscript-keyword">\space</span>}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\definedummyletter</span>##1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> ##1<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\realbackslash</span> ##1}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do the redefinitions.
</span>  <span class="enscript-keyword">\commondummies</span>
}

<span class="enscript-comment">% For the aux file, @ is the escape character.  So we want to redefine
</span><span class="enscript-comment">% everything using @ instead of \realbackslash.  When everything uses 
</span><span class="enscript-comment">% @, this will be simpler.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\atdummies</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{@@}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ </span>{@ }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\{</span> = <span class="enscript-keyword">\lbraceatcmd</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\}</span> = <span class="enscript-keyword">\rbraceatcmd</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% (See comments in \indexdummies.)
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\definedummyword</span>##1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> ##1<span class="enscript-keyword">\endcsname</span>{@##1<span class="enscript-keyword">\space</span>}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\definedummyletter</span>##1{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> ##1<span class="enscript-keyword">\endcsname</span>{@##1}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do the redefinitions.
</span>  <span class="enscript-keyword">\commondummies</span>
}

<span class="enscript-comment">% Called from \indexdummies and \atdummies.  \definedummyword and
</span><span class="enscript-comment">% \definedummyletter must be defined first.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\commondummies</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\normalturnoffactive</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Control letters and accents.
</span>  <span class="enscript-keyword">\definedummyletter</span>{_}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{,}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{&quot;}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{`}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{'}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{^}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{~}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyletter</span>{=}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{u}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{v}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{H}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{dotaccent}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{ringaccent}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{tieaccent}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{ubaraccent}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{udotaccent}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{dotless}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Other non-English letters.
</span>  <span class="enscript-keyword">\definedummyword</span>{AA}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{AE}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{L}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{OE}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{O}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{aa}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{ae}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{l}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{oe}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{o}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{ss}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Although these internal commands shouldn't show up, sometimes they do.
</span>  <span class="enscript-keyword">\definedummyword</span>{bf}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{gtr}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{hat}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{less}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{sf}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{sl}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{tclose}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{tt}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Texinfo font commands.
</span>  <span class="enscript-keyword">\definedummyword</span>{b}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{i}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{r}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{sc}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{t}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{TeX}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{acronym}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{cite}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{code}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{command}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{dfn}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{dots}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{emph}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{env}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{file}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{kbd}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{key}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{math}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{option}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{samp}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{strong}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{uref}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{url}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{var}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{w}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Assorted special characters.
</span>  <span class="enscript-keyword">\definedummyword</span>{bullet}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{copyright}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{dots}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{enddots}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{equiv}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{error}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{expansion}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{minus}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{pounds}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{point}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{print}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\definedummyword</span>{result}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Handle some cases of @value -- where the variable name does not
</span>  <span class="enscript-comment">% contain - or _, and the value does not contain any
</span>  <span class="enscript-comment">% (non-fully-expandable) commands.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\value</span> = <span class="enscript-keyword">\expandablevalue</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Normal spaces, not active ones.
</span>  <span class="enscript-keyword">\unsepspaces</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% No macro expansion.
</span>  <span class="enscript-keyword">\turnoffmacros</span>
}

<span class="enscript-comment">% If an index command is used in an @example environment, any spaces
</span><span class="enscript-comment">% therein should become regular spaces in the raw index file, not the
</span><span class="enscript-comment">% expansion of \tie (\leavevmode \penalty \@M \ ).
</span>{<span class="enscript-keyword">\obeyspaces</span>
 <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\unsepspaces</span>{<span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\let</span> =<span class="enscript-keyword">\space</span>}}


<span class="enscript-comment">% \indexnofonts is used when outputting the strings to sort the index
</span><span class="enscript-comment">% by, and when constructing control sequence names.  It eliminates all
</span><span class="enscript-comment">% control sequences and just writes whatever the best ASCII sort string
</span><span class="enscript-comment">% would be for a given command (usually its argument).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexdummytex</span>{TeX}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexdummydots</span>{...}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexnofonts</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ </span>{ }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{@}<span class="enscript-comment">%
</span>  <span class="enscript-comment">% how to handle braces?
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\_</span>{<span class="enscript-keyword">\normalunderscore</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\,</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\&quot;</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\`</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\'</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\=</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\u</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\v</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\H</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\dotaccent</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\ringaccent</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tieaccent</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\ubaraccent</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\udotaccent</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\dotless</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Other non-English letters.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\AA</span>{AA}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\AE</span>{AE}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\L</span>{L}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\OE</span>{OE}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\O</span>{O}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\aa</span>{aa}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ae</span>{ae}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\l</span>{l}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\oe</span>{oe}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\o</span>{o}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\ss</span>{ss}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\exclamdown</span>{!}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\questiondown</span>{?}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Don't no-op \tt, since it isn't a user-level command
</span>  <span class="enscript-comment">% and is used in the definitions of the active chars like &lt;, &gt;, |, etc.
</span>  <span class="enscript-comment">% Likewise with the other plain tex font commands.
</span>  <span class="enscript-comment">%\let\tt=\asis
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Texinfo font commands.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\b</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\i</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\r</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\sc</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\t</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\TeX</span>=<span class="enscript-keyword">\indexdummytex</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\acronym</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\cite</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\code</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\command</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\dfn</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\dots</span>=<span class="enscript-keyword">\indexdummydots</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\emph</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\env</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\file</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\kbd</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\key</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\math</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\option</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\samp</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\strong</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\uref</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\url</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\var</span>=<span class="enscript-keyword">\asis</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\w</span>=<span class="enscript-keyword">\asis</span>
}

<span class="enscript-keyword">\let</span><span class="enscript-keyword">\indexbackslash</span>=0  <span class="enscript-comment">%overridden during \printindex.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\SETmarginindex</span>=<span class="enscript-keyword">\relax</span> <span class="enscript-comment">% put index entries in margin (undocumented)?
</span>
<span class="enscript-comment">% For \ifx comparisons.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\emptymacro</span>{<span class="enscript-keyword">\empty</span>}

<span class="enscript-comment">% Most index entries go through here, but \dosubind is the general case.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doind</span>#1#2{<span class="enscript-keyword">\dosubind</span>{#1}{#2}<span class="enscript-keyword">\empty</span>}

<span class="enscript-comment">% Workhorse for all \fooindexes.
</span><span class="enscript-comment">% #1 is name of index, #2 is stuff to put there, #3 is subentry --
</span><span class="enscript-comment">% \empty if called from \doind, as we usually are.  The main exception
</span><span class="enscript-comment">% is with defuns, which call us directly.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosubind</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Put the index entry in the margin if desired.
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\SETmarginindex</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\insert</span><span class="enscript-keyword">\margin</span>{<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\vrule</span> height8pt depth3pt width0pt #2}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\count</span>255=<span class="enscript-keyword">\lastpenalty</span>
    {<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\indexdummies</span> <span class="enscript-comment">% Must do this here, since \bf, etc expand at this stage
</span>      <span class="enscript-keyword">\escapechar</span>=`<span class="enscript-keyword">\\</span>
      {<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\let</span><span class="enscript-keyword">\folio</span> = 0<span class="enscript-comment">% We will expand all macros now EXCEPT \folio.
</span>        <span class="enscript-keyword">\def</span><span class="enscript-keyword">\rawbackslashxx</span>{<span class="enscript-keyword">\indexbackslash</span>}<span class="enscript-comment">% \indexbackslash isn't defined now
</span>        <span class="enscript-comment">% so it will be output as is; and it will print as backslash.
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% The main index entry text.
</span>        <span class="enscript-keyword">\toks</span>0 = {#2}<span class="enscript-comment">%
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% If third arg is present, precede it with space in sort key.
</span>        <span class="enscript-keyword">\def</span><span class="enscript-keyword">\thirdarg</span>{#3}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\thirdarg</span><span class="enscript-keyword">\emptymacro</span> <span class="enscript-keyword">\else</span>
           <span class="enscript-comment">% If the third (subentry) arg is present, add it to the index
</span>           <span class="enscript-comment">% line to write.
</span>          <span class="enscript-keyword">\toks</span>0 = <span class="enscript-keyword">\expandafter</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0 <span class="enscript-keyword">\space</span> #3}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\fi</span>
        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% Process the index entry with all font commands turned off, to
</span>        <span class="enscript-comment">% get the string to sort by.
</span>        {<span class="enscript-keyword">\indexnofonts</span>
         <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}<span class="enscript-comment">% need full expansion
</span>         <span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\indexsorttmp</span>{<span class="enscript-keyword">\temp</span>}<span class="enscript-comment">%
</span>        }<span class="enscript-comment">%
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% Set up the complete index entry, with both the sort key and
</span>        <span class="enscript-comment">% the original text, including any font commands.  We write
</span>        <span class="enscript-comment">% three arguments to \entry to the .?? file (four in the
</span>        <span class="enscript-comment">% subentry case), texindex reduces to two when writing the .??s
</span>        <span class="enscript-comment">% sorted result.
</span>        <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\temp</span>{<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\write</span><span class="enscript-keyword">\csname</span>#1indfile<span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>            <span class="enscript-keyword">\realbackslash</span> entry{<span class="enscript-keyword">\indexsorttmp</span>}{<span class="enscript-keyword">\folio</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}}<span class="enscript-comment">%
</span>        }<span class="enscript-comment">%
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% If a skip is the last thing on the list now, preserve it
</span>        <span class="enscript-comment">% by backing up by \lastskip, doing the \write, then inserting
</span>        <span class="enscript-comment">% the skip again.  Otherwise, the whatsit generated by the
</span>        <span class="enscript-comment">% \write will make \lastskip zero.  The result is that sequences
</span>        <span class="enscript-comment">% like this:
</span>        <span class="enscript-comment">% @end defun
</span>        <span class="enscript-comment">% @tindex whatever
</span>        <span class="enscript-comment">% @defun ...
</span>        <span class="enscript-comment">% will have extra space inserted, because the \medbreak in the
</span>        <span class="enscript-comment">% start of the @defun won't see the skip inserted by the @end of
</span>        <span class="enscript-comment">% the previous defun.
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% But don't do any of this if we're not in vertical mode.  We
</span>        <span class="enscript-comment">% don't want to do a \vskip and prematurely end a paragraph.
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-comment">% Avoid page breaks due to these extra skips, too.
</span>        <span class="enscript-comment">%
</span>        <span class="enscript-keyword">\iflinks</span>
          <span class="enscript-keyword">\ifvmode</span>
            <span class="enscript-keyword">\skip</span>0 = <span class="enscript-keyword">\lastskip</span>
            <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span> = 0pt <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span>-<span class="enscript-keyword">\skip</span>0 <span class="enscript-keyword">\fi</span>
          <span class="enscript-keyword">\fi</span>
          <span class="enscript-comment">%
</span>          <span class="enscript-keyword">\temp</span> <span class="enscript-comment">% do the write
</span>          <span class="enscript-comment">%
</span>          <span class="enscript-keyword">\ifvmode</span> <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\skip</span>0 = 0pt <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\skip</span>0 <span class="enscript-keyword">\fi</span> <span class="enscript-keyword">\fi</span>
        <span class="enscript-keyword">\fi</span>
      }<span class="enscript-comment">%
</span>    }<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\penalty</span><span class="enscript-keyword">\count</span>255
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% The index entry written in the file actually looks like
</span><span class="enscript-comment">%  \entry {sortstring}{page}{topic}
</span><span class="enscript-comment">% or
</span><span class="enscript-comment">%  \entry {sortstring}{page}{topic}{subtopic}
</span><span class="enscript-comment">% The texindex program reads in these files and writes files
</span><span class="enscript-comment">% containing these kinds of lines:
</span><span class="enscript-comment">%  \initial {c}
</span><span class="enscript-comment">%     before the first topic whose initial is c
</span><span class="enscript-comment">%  \entry {topic}{pagelist}
</span><span class="enscript-comment">%     for a topic that is used without subtopics
</span><span class="enscript-comment">%  \primary {topic}
</span><span class="enscript-comment">%     for the beginning of a topic that is used with subtopics
</span><span class="enscript-comment">%  \secondary {subtopic}{pagelist}
</span><span class="enscript-comment">%     for each subtopic.
</span>
<span class="enscript-comment">% Define the user-accessible indexing commands
</span><span class="enscript-comment">% @findex, @vindex, @kindex, @cindex.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\findex</span> {<span class="enscript-keyword">\fnindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\kindex</span> {<span class="enscript-keyword">\kyindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cindex</span> {<span class="enscript-keyword">\cpindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\vindex</span> {<span class="enscript-keyword">\vrindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\tindex</span> {<span class="enscript-keyword">\tpindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\pindex</span> {<span class="enscript-keyword">\pgindex</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cindexsub</span> {<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\cindexsub</span>}
{<span class="enscript-keyword">\obeylines</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\cindexsub</span> &quot;#1&quot; #2^^M{<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\dosubind</span>{cp}{#2}{#1}}}

<span class="enscript-comment">% Define the macros used in formatting output of the sorted index material.
</span>
<span class="enscript-comment">% @printindex causes a particular index (the ??s file) to get printed.
</span><span class="enscript-comment">% It does not print any chapter heading (usually an @unnumbered).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\printindex</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doprintindex</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doprintindex</span>#1{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\dobreak</span> <span class="enscript-keyword">\chapheadingskip</span>{10000}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\smallfonts</span> <span class="enscript-keyword">\rm</span>
  <span class="enscript-keyword">\tolerance</span> = 9500
  <span class="enscript-keyword">\indexbreaks</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% See if the index file exists and is nonempty.
</span>  <span class="enscript-comment">% Change catcode of @ here so that if the index file contains
</span>  <span class="enscript-comment">% \initial {@}
</span>  <span class="enscript-comment">% as its first line, TeX doesn't complain about mismatched braces
</span>  <span class="enscript-comment">% (because it thinks @} is a control sequence).
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span> = 11
  <span class="enscript-keyword">\openin</span> 1 <span class="enscript-keyword">\jobname</span>.#1s
  <span class="enscript-keyword">\ifeof</span> 1
    <span class="enscript-comment">% \enddoublecolumns gets confused if there is no text in the index,
</span>    <span class="enscript-comment">% and it loses the chapter title and the aux file entries for the
</span>    <span class="enscript-comment">% index.  The easiest way to prevent this problem is to make sure
</span>    <span class="enscript-comment">% there is some text.
</span>    <span class="enscript-keyword">\putwordIndexNonexistent</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% If the index file exists but is empty, then \openin leaves \ifeof
</span>    <span class="enscript-comment">% false.  We have to make TeX try to read something from the file, so
</span>    <span class="enscript-comment">% it can discover if there is anything in it.
</span>    <span class="enscript-keyword">\read</span> 1 to <span class="enscript-keyword">\temp</span>
    <span class="enscript-keyword">\ifeof</span> 1
      <span class="enscript-keyword">\putwordIndexIsEmpty</span>
    <span class="enscript-keyword">\else</span>
      <span class="enscript-comment">% Index files are almost Texinfo source, but we use \ as the escape
</span>      <span class="enscript-comment">% character.  It would be better to use @, but that's too big a change
</span>      <span class="enscript-comment">% to make right now.
</span>      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexbackslash</span>{<span class="enscript-keyword">\rawbackslashxx</span>}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span> = 0
      <span class="enscript-keyword">\escapechar</span> = `<span class="enscript-keyword">\\</span>
      <span class="enscript-keyword">\begindoublecolumns</span>
      <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.#1s
      <span class="enscript-keyword">\enddoublecolumns</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\closein</span> 1
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% These macros are used by the sorted index file itself.
</span><span class="enscript-comment">% Change them to control the appearance of the index.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\initial</span>#1{{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Some minor font changes for the special characters.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tentt</span>=<span class="enscript-keyword">\sectt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tt</span>=<span class="enscript-keyword">\sectt</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\sf</span>=<span class="enscript-keyword">\sectt</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Remove any glue we may have, we'll be inserting our own.
</span>  <span class="enscript-keyword">\removelastskip</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% We like breaks before the index initials, so insert a bonus.
</span>  <span class="enscript-keyword">\penalty</span> -300
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Typeset the initial.  Making this add up to a whole number of
</span>  <span class="enscript-comment">% baselineskips increases the chance of the dots lining up from column
</span>  <span class="enscript-comment">% to column.  It still won't often be perfect, because of the stretch
</span>  <span class="enscript-comment">% we need before each entry, but it's better.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% No shrink because it confuses \balancecolumns.
</span>  <span class="enscript-keyword">\vskip</span> 1.67<span class="enscript-keyword">\baselineskip</span> plus .5<span class="enscript-keyword">\baselineskip</span>
  <span class="enscript-keyword">\leftline</span>{<span class="enscript-keyword">\secbf</span> #1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\vskip</span> .33<span class="enscript-keyword">\baselineskip</span> plus .1<span class="enscript-keyword">\baselineskip</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do our best not to break after the initial.
</span>  <span class="enscript-keyword">\nobreak</span>
}}

<span class="enscript-comment">% This typesets a paragraph consisting of #1, dot leaders, and then #2
</span><span class="enscript-comment">% flush to the right margin.  It is used for index and table of contents
</span><span class="enscript-comment">% entries.  The paragraph is indented by \leftskip.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\entry</span>#1#2{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Start a new paragraph if necessary, so our assignments below can't
</span>  <span class="enscript-comment">% affect previous text.
</span>  <span class="enscript-keyword">\par</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do not fill out the last line with white space.
</span>  <span class="enscript-keyword">\parfillskip</span> = 0in
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% No extra space above this paragraph.
</span>  <span class="enscript-keyword">\parskip</span> = 0in
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Do not prefer a separate line ending with a hyphen to fewer lines.
</span>  <span class="enscript-keyword">\finalhyphendemerits</span> = 0
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \hangindent is only relevant when the entry text and page number
</span>  <span class="enscript-comment">% don't both fit on one line.  In that case, bob suggests starting the
</span>  <span class="enscript-comment">% dots pretty far over on the line.  Unfortunately, a large
</span>  <span class="enscript-comment">% indentation looks wrong when the entry text itself is broken across
</span>  <span class="enscript-comment">% lines.  So we use a small indentation and put up with long leaders.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \hangafter is reset to 1 (which is the value we want) at the start
</span>  <span class="enscript-comment">% of each paragraph, so we need not do anything with that.
</span>  <span class="enscript-keyword">\hangindent</span> = 2em
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% When the entry text needs to be broken, just fill out the first line
</span>  <span class="enscript-comment">% with blank space.
</span>  <span class="enscript-keyword">\rightskip</span> = 0pt plus1fil
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% A bit of stretch before each entry for the benefit of balancing columns.
</span>  <span class="enscript-keyword">\vskip</span> 0pt plus1pt
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Start a ``paragraph'' for the index entry so the line breaking
</span>  <span class="enscript-comment">% parameters we've set above will have an effect.
</span>  <span class="enscript-keyword">\noindent</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Insert the text of the index entry.  TeX will do line-breaking on it.
</span>  #1<span class="enscript-comment">%
</span>  <span class="enscript-comment">% The following is kludged to not output a line of dots in the index if
</span>  <span class="enscript-comment">% there are no page numbers.  The next person who breaks this will be
</span>  <span class="enscript-comment">% cursed by a Unix daemon.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\tempa</span>{{<span class="enscript-keyword">\rm</span> }}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\tempb</span>{#2}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\tempc</span>{<span class="enscript-keyword">\tempa</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\tempd</span>{<span class="enscript-keyword">\tempb</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\tempc</span><span class="enscript-keyword">\tempd</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\else</span><span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% If we must, put the page number on a line of its own, and fill out
</span>    <span class="enscript-comment">% this line with blank space.  (The \hfil is overwhelmed with the
</span>    <span class="enscript-comment">% fill leaders glue in \indexdotfill if the page number does fit.)
</span>    <span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\penalty</span>50
    <span class="enscript-keyword">\null</span><span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\indexdotfill</span> <span class="enscript-comment">% Have leaders before the page number.
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% The `\ ' here is removed by the implicit \unskip that TeX does as
</span>    <span class="enscript-comment">% part of (the primitive) \par.  Without it, a spurious underfull
</span>    <span class="enscript-comment">% \hbox ensues.
</span>    <span class="enscript-keyword">\ifpdf</span>
      <span class="enscript-keyword">\pdfgettoks</span>#2.<span class="enscript-keyword">\ </span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksA</span> <span class="enscript-comment">% The page number ends the paragraph.
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\ </span>#2<span class="enscript-comment">% The page number ends the paragraph.
</span>    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span>  <span class="enscript-keyword">\par</span>
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% Like \dotfill except takes at least 1 em.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\indexdotfill</span>{<span class="enscript-keyword">\cleaders</span>
  <span class="enscript-keyword">\hbox</span>{<span class="enscript-variable-name">$\mathsurround=0pt \mkern1.5mu $</span>{<span class="enscript-keyword">\it</span> .}<span class="enscript-variable-name">$ \mkern1.5mu$</span>}<span class="enscript-keyword">\hskip</span> 1em plus 1fill}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\primary</span> #1{<span class="enscript-keyword">\line</span>{#1<span class="enscript-keyword">\hfil</span>}}

<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\secondaryindent</span> <span class="enscript-keyword">\secondaryindent</span>=0.5cm
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secondary</span>#1#2{{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parfillskip</span>=0in
  <span class="enscript-keyword">\parskip</span>=0in
  <span class="enscript-keyword">\hangindent</span>=1in
  <span class="enscript-keyword">\hangafter</span>=1
  <span class="enscript-keyword">\noindent</span><span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\secondaryindent</span><span class="enscript-keyword">\hbox</span>{#1}<span class="enscript-keyword">\indexdotfill</span>
  <span class="enscript-keyword">\ifpdf</span>
    <span class="enscript-keyword">\pdfgettoks</span>#2.<span class="enscript-keyword">\ </span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\toksA</span> <span class="enscript-comment">% The page number ends the paragraph.
</span>  <span class="enscript-keyword">\else</span>
    #2
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\par</span>
}}

<span class="enscript-comment">% Define two-column mode, which we use to typeset indexes.
</span><span class="enscript-comment">% Adapted from the TeXbook, page 416, which is to say,
</span><span class="enscript-comment">% the manmac.tex format used to print the TeXbook itself.
</span><span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=11

<span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\partialpage</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\doublecolumnhsize</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\begindoublecolumns</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">% ended by \enddoublecolumns
</span>  <span class="enscript-comment">% Grab any single-column material above us.
</span>  <span class="enscript-keyword">\output</span> = {<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Here is a possibility not foreseen in manmac: if we accumulate a
</span>    <span class="enscript-comment">% whole lot of material, we might end up calling this \output
</span>    <span class="enscript-comment">% routine twice in a row (see the doublecol-lose test, which is
</span>    <span class="enscript-comment">% essentially a couple of indexes with @setchapternewpage off).  In
</span>    <span class="enscript-comment">% that case we just ship out what is in \partialpage with the normal
</span>    <span class="enscript-comment">% output routine.  Generally, \partialpage will be empty when this
</span>    <span class="enscript-comment">% runs and this will be a no-op.  See the indexspread.tex test case.
</span>    <span class="enscript-keyword">\ifvoid</span><span class="enscript-keyword">\partialpage</span> <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\onepageout</span>{<span class="enscript-keyword">\pagecontents</span><span class="enscript-keyword">\partialpage</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\partialpage</span> = <span class="enscript-keyword">\vbox</span>{<span class="enscript-comment">%
</span>      <span class="enscript-comment">% Unvbox the main output page.
</span>      <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\PAGE</span>
      <span class="enscript-keyword">\kern</span>-<span class="enscript-keyword">\topskip</span> <span class="enscript-keyword">\kern</span><span class="enscript-keyword">\baselineskip</span>
    }<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\eject</span> <span class="enscript-comment">% run that output routine to set \partialpage
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Use the double-column output routine for subsequent pages.
</span>  <span class="enscript-keyword">\output</span> = {<span class="enscript-keyword">\doublecolumnout</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Change the page size parameters.  We could do this once outside this
</span>  <span class="enscript-comment">% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
</span>  <span class="enscript-comment">% format, but then we repeat the same computation.  Repeating a couple
</span>  <span class="enscript-comment">% of assignments once per index is clearly meaningless for the
</span>  <span class="enscript-comment">% execution time, so we may as well do it in one place.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% First we halve the line length, less a little for the gutter between
</span>  <span class="enscript-comment">% the columns.  We compute the gutter based on the line length, so it
</span>  <span class="enscript-comment">% changes automatically with the paper format.  The magic constant
</span>  <span class="enscript-comment">% below is chosen so that the gutter has the same value (well, +-&lt;1pt)
</span>  <span class="enscript-comment">% as it did when we hard-coded it.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% We put the result in a separate register, \doublecolumhsize, so we
</span>  <span class="enscript-comment">% can restore it in \pagesofar, after \hsize itself has (potentially)
</span>  <span class="enscript-comment">% been clobbered.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\doublecolumnhsize</span> = <span class="enscript-keyword">\hsize</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\doublecolumnhsize</span> by -.04154<span class="enscript-keyword">\hsize</span>
    <span class="enscript-keyword">\divide</span><span class="enscript-keyword">\doublecolumnhsize</span> by 2
  <span class="enscript-keyword">\hsize</span> = <span class="enscript-keyword">\doublecolumnhsize</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Double the \vsize as well.  (We don't need a separate register here,
</span>  <span class="enscript-comment">% since nobody clobbers \vsize.)
</span>  <span class="enscript-keyword">\vsize</span> = 2<span class="enscript-keyword">\vsize</span>
}

<span class="enscript-comment">% The double-column output routine for all double-column pages except
</span><span class="enscript-comment">% the last.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doublecolumnout</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\splittopskip</span>=<span class="enscript-keyword">\topskip</span> <span class="enscript-keyword">\splitmaxdepth</span>=<span class="enscript-keyword">\maxdepth</span>
  <span class="enscript-comment">% Get the available space for the double columns -- the normal
</span>  <span class="enscript-comment">% (undoubled) page height minus any material left over from the
</span>  <span class="enscript-comment">% previous page.
</span>  <span class="enscript-keyword">\dimen</span>@ = <span class="enscript-keyword">\vsize</span>
  <span class="enscript-keyword">\divide</span><span class="enscript-keyword">\dimen</span>@ by 2
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>@ by -<span class="enscript-keyword">\ht</span><span class="enscript-keyword">\partialpage</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% box0 will be the left-hand column, box2 the right.
</span>  <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\vsplit</span>255 to<span class="enscript-keyword">\dimen</span>@ <span class="enscript-keyword">\setbox</span>2=<span class="enscript-keyword">\vsplit</span>255 to<span class="enscript-keyword">\dimen</span>@
  <span class="enscript-keyword">\onepageout</span><span class="enscript-keyword">\pagesofar</span>
  <span class="enscript-keyword">\unvbox</span>255
  <span class="enscript-keyword">\penalty</span><span class="enscript-keyword">\outputpenalty</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Re-output the contents of the output page -- any previous material,
</span><span class="enscript-comment">% followed by the two boxes we just split, in box0 and box2.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\pagesofar</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\unvbox</span><span class="enscript-keyword">\partialpage</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\hsize</span> = <span class="enscript-keyword">\doublecolumnhsize</span>
  <span class="enscript-keyword">\wd</span>0=<span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\wd</span>2=<span class="enscript-keyword">\hsize</span>
  <span class="enscript-keyword">\hbox</span> to<span class="enscript-keyword">\pagewidth</span>{<span class="enscript-keyword">\box</span>0<span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\box</span>2}<span class="enscript-comment">%
</span>}
<span class="enscript-comment">% 
</span><span class="enscript-comment">% All done with double columns.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\enddoublecolumns</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\output</span> = {<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Split the last of the double-column material.  Leave it on the
</span>    <span class="enscript-comment">% current page, no automatic page break.
</span>    <span class="enscript-keyword">\balancecolumns</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% If we end up splitting too much material for the current page,
</span>    <span class="enscript-comment">% though, there will be another page break right after this \output
</span>    <span class="enscript-comment">% invocation ends.  Having called \balancecolumns once, we do not
</span>    <span class="enscript-comment">% want to call it again.  Therefore, reset \output to its normal
</span>    <span class="enscript-comment">% definition right away.  (We hope \balancecolumns will never be
</span>    <span class="enscript-comment">% called on to balance too much material, but if it is, this makes
</span>    <span class="enscript-comment">% the output somewhat more palatable.)
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\output</span> = {<span class="enscript-keyword">\onepageout</span>{<span class="enscript-keyword">\pagecontents</span><span class="enscript-keyword">\PAGE</span>}}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\eject</span>
  <span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">% started in \begindoublecolumns
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% \pagegoal was set to the doubled \vsize above, since we restarted
</span>  <span class="enscript-comment">% the current page.  We're now back to normal single-column
</span>  <span class="enscript-comment">% typesetting, so reset \pagegoal to the normal \vsize (after the
</span>  <span class="enscript-comment">% \endgroup where \vsize got restored).
</span>  <span class="enscript-keyword">\pagegoal</span> = <span class="enscript-keyword">\vsize</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Called at the end of the double column material.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\balancecolumns</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\unvbox</span>255}<span class="enscript-comment">% like \box255 but more efficient, see p.120.
</span>  <span class="enscript-keyword">\dimen</span>@ = <span class="enscript-keyword">\ht</span>0
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>@ by <span class="enscript-keyword">\topskip</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>@ by-<span class="enscript-keyword">\baselineskip</span>
  <span class="enscript-keyword">\divide</span><span class="enscript-keyword">\dimen</span>@ by 2 <span class="enscript-comment">% target to split to
</span>  <span class="enscript-comment">%debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
</span>  <span class="enscript-keyword">\splittopskip</span> = <span class="enscript-keyword">\topskip</span>
  <span class="enscript-comment">% Loop until we get a decent breakpoint.
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\vbadness</span> = 10000
    <span class="enscript-keyword">\loop</span>
      <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setbox</span>3 = <span class="enscript-keyword">\copy</span>0
      <span class="enscript-keyword">\global</span><span class="enscript-keyword">\setbox</span>1 = <span class="enscript-keyword">\vsplit</span>3 to <span class="enscript-keyword">\dimen</span>@
    <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\ht</span>3&gt;<span class="enscript-keyword">\dimen</span>@
      <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>@ by 1pt
    <span class="enscript-keyword">\repeat</span>
  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
</span>  <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\vbox</span> to<span class="enscript-keyword">\dimen</span>@{<span class="enscript-keyword">\unvbox</span>1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>2=<span class="enscript-keyword">\vbox</span> to<span class="enscript-keyword">\dimen</span>@{<span class="enscript-keyword">\unvbox</span>3}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\pagesofar</span>
}
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span> = <span class="enscript-keyword">\other</span>


<span class="enscript-keyword">\message</span>{sectioning,}
<span class="enscript-comment">% Chapters, sections, etc.
</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\chapno</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\secno</span>        <span class="enscript-keyword">\secno</span>=0
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\subsecno</span>     <span class="enscript-keyword">\subsecno</span>=0
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\subsubsecno</span>  <span class="enscript-keyword">\subsubsecno</span>=0

<span class="enscript-comment">% This counter is funny since it counts through charcodes of letters A, B, ...
</span><span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\appendixno</span>  <span class="enscript-keyword">\appendixno</span> = `<span class="enscript-keyword">\@</span>
<span class="enscript-comment">% \def\appendixletter{\char\the\appendixno}
</span><span class="enscript-comment">% We do the following for the sake of pdftex, which needs the actual
</span><span class="enscript-comment">% letter in the expansion, not just typeset.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixletter</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`A A<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`B B<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`C C<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`D D<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`E E<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`F F<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`G G<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`H H<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`I I<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`J J<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`K K<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`L L<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`M M<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`N N<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`O O<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`P P<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`Q Q<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`R R<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`S S<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`T T<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`U U<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`V V<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`W W<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`X X<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`Y Y<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\appendixno</span>=`Z Z<span class="enscript-comment">%
</span>  <span class="enscript-comment">% The \the is necessary, despite appearances, because \appendixletter is
</span>  <span class="enscript-comment">% expanded while writing the .toc file.  \char\appendixno is not
</span>  <span class="enscript-comment">% expandable, thus it is written literally, thus all appendixes come out
</span>  <span class="enscript-comment">% with the same letter (or @) in the toc without it.
</span>  <span class="enscript-keyword">\else</span><span class="enscript-keyword">\char</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\appendixno</span>
  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% Each @chapter defines this as the name of the chapter.
</span><span class="enscript-comment">% page headings and footings can use it.  @section does likewise.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\thischapter</span>{}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\thissection</span>{}

<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\absseclevel</span> <span class="enscript-comment">% used to calculate proper heading level
</span><span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\secbase</span><span class="enscript-keyword">\secbase</span>=0 <span class="enscript-comment">% @raise/lowersections modify this count
</span>
<span class="enscript-comment">% @raisesections: treat @section as chapter, @subsection as section, etc.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\raisesections</span>{<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\secbase</span> by -1}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\up</span>=<span class="enscript-keyword">\raisesections</span> <span class="enscript-comment">% original BFox name
</span>
<span class="enscript-comment">% @lowersections: treat @chapter as section, @section as subsection, etc.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\lowersections</span>{<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\secbase</span> by 1}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\down</span>=<span class="enscript-keyword">\lowersections</span> <span class="enscript-comment">% original BFox name
</span>
<span class="enscript-comment">% Choose a numbered-heading macro
</span><span class="enscript-comment">% #1 is heading level if unmodified by @raisesections or @lowersections
</span><span class="enscript-comment">% #2 is text for heading
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numhead</span>#1#2{<span class="enscript-keyword">\absseclevel</span>=<span class="enscript-keyword">\secbase</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\absseclevel</span> by #1
<span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\absseclevel</span>
  <span class="enscript-keyword">\chapterzzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\seczzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\numberedsubseczzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\numberedsubsubseczzz</span>{#2}
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\absseclevel</span>&lt;0
    <span class="enscript-keyword">\chapterzzz</span>{#2}
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\numberedsubsubseczzz</span>{#2}
  <span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% like \numhead, but chooses appendix heading levels
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\apphead</span>#1#2{<span class="enscript-keyword">\absseclevel</span>=<span class="enscript-keyword">\secbase</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\absseclevel</span> by #1
<span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\absseclevel</span>
  <span class="enscript-keyword">\appendixzzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\appendixsectionzzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\appendixsubseczzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\appendixsubsubseczzz</span>{#2}
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\absseclevel</span>&lt;0
    <span class="enscript-keyword">\appendixzzz</span>{#2}
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\appendixsubsubseczzz</span>{#2}
  <span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% like \numhead, but chooses numberless heading levels
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnmhead</span>#1#2{<span class="enscript-keyword">\absseclevel</span>=<span class="enscript-keyword">\secbase</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\absseclevel</span> by #1
<span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\absseclevel</span>
  <span class="enscript-keyword">\unnumberedzzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\unnumberedseczzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\unnumberedsubseczzz</span>{#2}
<span class="enscript-keyword">\or</span>
  <span class="enscript-keyword">\unnumberedsubsubseczzz</span>{#2}
<span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\absseclevel</span>&lt;0
    <span class="enscript-keyword">\unnumberedzzz</span>{#2}
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\unnumberedsubsubseczzz</span>{#2}
  <span class="enscript-keyword">\fi</span>
<span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% @chapter, @appendix, @unnumbered.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\thischaptername</span>{No Chapter Title}
<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapter</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\chapteryyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapteryyy</span> #1{<span class="enscript-keyword">\numhead</span>0{#1}} <span class="enscript-comment">% normally numhead0 calls chapterzzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapterzzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\secno</span>=0 <span class="enscript-keyword">\subsecno</span>=0 <span class="enscript-keyword">\subsubsecno</span>=0
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\chapno</span> by 1 <span class="enscript-keyword">\message</span>{<span class="enscript-keyword">\putwordChapter</span><span class="enscript-keyword">\space</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\chapmacro</span> {#1}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thischaptername</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-comment">% We don't substitute the actual chapter name into \thischapter
</span>  <span class="enscript-comment">% because we don't want its macros evaluated now.
</span>  <span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\thischapter</span>{<span class="enscript-keyword">\putwordChapter</span>{} <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>: <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\thischaptername</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{chap}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}}
  <span class="enscript-keyword">\donoderef</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\section</span> = <span class="enscript-keyword">\numberedsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsection</span> = <span class="enscript-keyword">\numberedsubsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsection</span> = <span class="enscript-keyword">\numberedsubsubsec</span>
}

<span class="enscript-comment">% we use \chapno to avoid indenting back
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixbox</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\putwordAppendix</span>{} <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\hbox</span> to <span class="enscript-keyword">\wd</span>0{#1<span class="enscript-keyword">\hss</span>}}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendix</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixyyy</span> #1{<span class="enscript-keyword">\apphead</span>0{#1}} <span class="enscript-comment">% normally apphead0 calls appendixzzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixzzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\secno</span>=0 <span class="enscript-keyword">\subsecno</span>=0 <span class="enscript-keyword">\subsubsecno</span>=0
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\appendixno</span> by 1
  <span class="enscript-keyword">\message</span>{<span class="enscript-keyword">\putwordAppendix</span><span class="enscript-keyword">\space</span> <span class="enscript-keyword">\appendixletter</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\chapmacro</span> {#1}{<span class="enscript-keyword">\appendixbox</span>{<span class="enscript-keyword">\putwordAppendix</span>{} <span class="enscript-keyword">\appendixletter</span>}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thischaptername</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\thischapter</span>{<span class="enscript-keyword">\putwordAppendix</span>{} <span class="enscript-keyword">\appendixletter</span>: <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\thischaptername</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{appendix}{#1}{{<span class="enscript-keyword">\appendixletter</span>}}
  <span class="enscript-keyword">\appendixnoderef</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\section</span> = <span class="enscript-keyword">\appendixsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsection</span> = <span class="enscript-keyword">\appendixsubsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsection</span> = <span class="enscript-keyword">\appendixsubsubsec</span>
}

<span class="enscript-comment">% @centerchap is like @unnumbered, but the heading is centered.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\centerchap</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\centerchapyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\centerchapyyy</span> #1{{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapmacro</span>=<span class="enscript-keyword">\centerchapmacro</span> <span class="enscript-keyword">\unnumberedyyy</span>{#1}}}

<span class="enscript-comment">% @top is like @unnumbered.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\top</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedyyy</span>}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbered</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedyyy</span> #1{<span class="enscript-keyword">\unnmhead</span>0{#1}} <span class="enscript-comment">% normally unnmhead0 calls unnumberedzzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedzzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\secno</span>=0 <span class="enscript-keyword">\subsecno</span>=0 <span class="enscript-keyword">\subsubsecno</span>=0
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% This used to be simply \message{#1}, but TeX fully expands the
</span>  <span class="enscript-comment">% argument to \message.  Therefore, if #1 contained @-commands, TeX
</span>  <span class="enscript-comment">% expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
</span>  <span class="enscript-comment">% expanded @cite (which turns out to cause errors because \cite is meant
</span>  <span class="enscript-comment">% to be executed, not expanded).
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Anyway, we don't want the fully-expanded definition of @cite to appear
</span>  <span class="enscript-comment">% as a result of the \message, we just want `@cite' itself.  We use
</span>  <span class="enscript-comment">% \the&lt;toks register&gt; to achieve this: TeX expands \the&lt;toks&gt; only once,
</span>  <span class="enscript-comment">% simply yielding the contents of &lt;toks register&gt;.  (We also do this for
</span>  <span class="enscript-comment">% the toc entries.)
</span>  <span class="enscript-keyword">\toks</span>0 = {#1}<span class="enscript-keyword">\message</span>{(<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0)}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\unnumbchapmacro</span> {#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thischapter</span>{#1}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{unnumbchap}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}}
  <span class="enscript-keyword">\unnumbnoderef</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\section</span> = <span class="enscript-keyword">\unnumberedsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsection</span> = <span class="enscript-keyword">\unnumberedsubsec</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsection</span> = <span class="enscript-keyword">\unnumberedsubsubsec</span>
}

<span class="enscript-comment">% Sections.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\secyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secyyy</span> #1{<span class="enscript-keyword">\numhead</span>1{#1}} <span class="enscript-comment">% normally calls seczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\seczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsecno</span>=0 <span class="enscript-keyword">\subsubsecno</span>=0 <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\secno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\secheading</span> {#1}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{sec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}}
  <span class="enscript-keyword">\donoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsection</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsecyyy</span>}
<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsecyyy</span> #1{<span class="enscript-keyword">\apphead</span>1{#1}} <span class="enscript-comment">% normally calls appendixsectionzzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsectionzzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsecno</span>=0 <span class="enscript-keyword">\subsubsecno</span>=0 <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\secno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\secheading</span> {#1}{<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{sec}{#1}{{<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}}
  <span class="enscript-keyword">\appendixnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsecyyy</span> #1{<span class="enscript-keyword">\unnmhead</span>1{#1}} <span class="enscript-comment">% normally calls unnumberedseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\plainsecheading</span> {#1}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{unnumbsec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}}
  <span class="enscript-keyword">\unnumbnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-comment">% Subsections.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\numberedsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubsecyyy</span> #1{<span class="enscript-keyword">\numhead</span>2{#1}} <span class="enscript-comment">% normally calls numberedsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\subsubsecno</span>=0 <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\subsecno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsecheading</span> {#1}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{subsec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}}
  <span class="enscript-keyword">\donoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubsecyyy</span> #1{<span class="enscript-keyword">\apphead</span>2{#1}} <span class="enscript-comment">% normally calls appendixsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\subsubsecno</span>=0 <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\subsecno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsecheading</span> {#1}{<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{subsec}{#1}{{<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}}
  <span class="enscript-keyword">\appendixnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubsecyyy</span> #1{<span class="enscript-keyword">\unnmhead</span>2{#1}} <span class="enscript-comment">%normally calls unnumberedsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\plainsubsecheading</span> {#1}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{unnumbsubsec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}}
  <span class="enscript-keyword">\unnumbnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-comment">% Subsubsections.
</span><span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\numberedsubsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubsubsecyyy</span> #1{<span class="enscript-keyword">\numhead</span>3{#1}} <span class="enscript-comment">% normally numberedsubsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\numberedsubsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\subsubsecno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsubsecheading</span> {#1}
    {<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{subsubsec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>}}
  <span class="enscript-keyword">\donoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsubsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubsubsecyyy</span> #1{<span class="enscript-keyword">\apphead</span>3{#1}} <span class="enscript-comment">% normally appendixsubsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixsubsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\subsubsecno</span> by 1 <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\subsubsecheading</span> {#1}
    {<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{subsubsec}{#1}{{<span class="enscript-keyword">\appendixletter</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>}}
  <span class="enscript-keyword">\appendixnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\outer</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedsubsubsecyyy</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubsubsecyyy</span> #1{<span class="enscript-keyword">\unnmhead</span>3{#1}} <span class="enscript-comment">%normally unnumberedsubsubseczzz
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumberedsubsubseczzz</span> #1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\plainsubsubsecheading</span> {#1}<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\thissection</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\writetocentry</span>{unnumbsubsubsec}{#1}{{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>}}
  <span class="enscript-keyword">\unnumbnoderef</span>
  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-comment">% These are variants which are not &quot;outer&quot;, so they can appear in @ifinfo.
</span><span class="enscript-comment">% Actually, they should now be obsolete; ordinary section commands should work.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\infotop</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infounnumbered</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infounnumberedsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedseczzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infounnumberedsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedsubseczzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infounnumberedsubsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\unnumberedsubsubseczzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infoappendix</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infoappendixsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixseczzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infoappendixsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsubseczzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infoappendixsubsubsec</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\appendixsubsubseczzz</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infochapter</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\chapterzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infosection</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\sectionzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infosubsection</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\subsectionzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\infosubsubsection</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\subsubsectionzzz</span>}

<span class="enscript-comment">% These macros control what the section commands do, according
</span><span class="enscript-comment">% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
</span><span class="enscript-comment">% Define them by default for a numbered chapter.
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\section</span> = <span class="enscript-keyword">\numberedsec</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsection</span> = <span class="enscript-keyword">\numberedsubsec</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsection</span> = <span class="enscript-keyword">\numberedsubsubsec</span>

<span class="enscript-comment">% Define @majorheading, @heading and @subheading
</span>
<span class="enscript-comment">% NOTE on use of \vbox for chapter headings, section headings, and such:
</span><span class="enscript-comment">%       1) We use \vbox rather than the earlier \line to permit
</span><span class="enscript-comment">%          overlong headings to fold.
</span><span class="enscript-comment">%       2) \hyphenpenalty is set to 10000 because hyphenation in a
</span><span class="enscript-comment">%          heading is obnoxious; this forbids it.
</span><span class="enscript-comment">%       3) Likewise, headings look best if no \parindent is used, and
</span><span class="enscript-comment">%          if justification is not attempted.  Hence \raggedright.
</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\majorheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\majorheadingzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\majorheadingzzz</span> #1{<span class="enscript-comment">%
</span>  {<span class="enscript-keyword">\advance</span><span class="enscript-keyword">\chapheadingskip</span> by 10pt <span class="enscript-keyword">\chapbreak</span> }<span class="enscript-comment">%
</span>  {<span class="enscript-keyword">\chapfonts</span> <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000<span class="enscript-keyword">\tolerance</span>=5000
                    <span class="enscript-keyword">\parindent</span>=0pt<span class="enscript-keyword">\raggedright</span>
                    <span class="enscript-keyword">\rm</span> #1<span class="enscript-keyword">\hfill</span>}}<span class="enscript-keyword">\bigskip</span> <span class="enscript-keyword">\par</span><span class="enscript-keyword">\penalty</span> 200}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\chapheadingzzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapheadingzzz</span> #1{<span class="enscript-keyword">\chapbreak</span> <span class="enscript-comment">%
</span>  {<span class="enscript-keyword">\chapfonts</span> <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000<span class="enscript-keyword">\tolerance</span>=5000
                    <span class="enscript-keyword">\parindent</span>=0pt<span class="enscript-keyword">\raggedright</span>
                    <span class="enscript-keyword">\rm</span> #1<span class="enscript-keyword">\hfill</span>}}<span class="enscript-keyword">\bigskip</span> <span class="enscript-keyword">\par</span><span class="enscript-keyword">\penalty</span> 200}

<span class="enscript-comment">% @heading, @subheading, @subsubheading.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\heading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\plainsecheading</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\plainsubsecheading</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubheading</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\plainsubsubsecheading</span>}

<span class="enscript-comment">% These macros generate a chapter, section, etc. heading only
</span><span class="enscript-comment">% (including whitespace, linebreaking, etc. around it),
</span><span class="enscript-comment">% given all the information in convenient, parsed form.
</span>
<span class="enscript-comment">%%% Args are the skip and penalty (usually negative)
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dobreak</span>#1#2{<span class="enscript-keyword">\par</span><span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span>&lt;#1<span class="enscript-keyword">\removelastskip</span><span class="enscript-keyword">\penalty</span>#2<span class="enscript-keyword">\vskip</span>#1<span class="enscript-keyword">\fi</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setchapterstyle</span> #1 {<span class="enscript-keyword">\csname</span> CHAPF#1<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-comment">%%% Define plain chapter starts, and page on/off switching for it
</span><span class="enscript-comment">% Parameter controlling skip before chapter headings (if needed)
</span>
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\chapheadingskip</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapbreak</span>{<span class="enscript-keyword">\dobreak</span> <span class="enscript-keyword">\chapheadingskip</span> {-4000}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chappager</span>{<span class="enscript-keyword">\par</span><span class="enscript-keyword">\vfill</span><span class="enscript-keyword">\supereject</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapoddpage</span>{<span class="enscript-keyword">\chappager</span> <span class="enscript-keyword">\ifodd</span><span class="enscript-keyword">\pageno</span> <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\hbox</span> to 0pt{} <span class="enscript-keyword">\chappager</span><span class="enscript-keyword">\fi</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setchapternewpage</span> #1 {<span class="enscript-keyword">\csname</span> CHAPPAG#1<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\CHAPPAGoff</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chappager</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pchapsepmacro</span>=<span class="enscript-keyword">\chapbreak</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pagealignmacro</span>=<span class="enscript-keyword">\chappager</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\CHAPPAGon</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chappager</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pchapsepmacro</span>=<span class="enscript-keyword">\chappager</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pagealignmacro</span>=<span class="enscript-keyword">\chappager</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSon</span>{<span class="enscript-keyword">\HEADINGSsingle</span>}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\CHAPPAGodd</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\contentsalignmacro</span> = <span class="enscript-keyword">\chapoddpage</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pchapsepmacro</span>=<span class="enscript-keyword">\chapoddpage</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\pagealignmacro</span>=<span class="enscript-keyword">\chapoddpage</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\HEADINGSon</span>{<span class="enscript-keyword">\HEADINGSdouble</span>}}

<span class="enscript-keyword">\CHAPPAGon</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\CHAPFplain</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\chapmacro</span>=<span class="enscript-keyword">\chfplain</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapmacro</span>=<span class="enscript-keyword">\unnchfplain</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\centerchapmacro</span>=<span class="enscript-keyword">\centerchfplain</span>}

<span class="enscript-comment">% Plain chapter opening.
</span><span class="enscript-comment">% #1 is the text, #2 the chapter number or empty if unnumbered.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\chfplain</span>#1#2{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\pchapsepmacro</span>
  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\chapfonts</span> <span class="enscript-keyword">\rm</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapnum</span>{#2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{#2<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\chapnum</span><span class="enscript-keyword">\empty</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\enspace</span><span class="enscript-keyword">\fi</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000 <span class="enscript-keyword">\tolerance</span>=5000 <span class="enscript-keyword">\parindent</span>=0pt <span class="enscript-keyword">\raggedright</span>
          <span class="enscript-keyword">\hangindent</span> = <span class="enscript-keyword">\wd</span>0 <span class="enscript-keyword">\centerparametersmaybe</span>
          <span class="enscript-keyword">\unhbox</span>0 #1<span class="enscript-keyword">\par</span>}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\bigskip</span> <span class="enscript-comment">% no page break after a chapter title
</span>  <span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-comment">% Plain opening for unnumbered.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnchfplain</span>#1{<span class="enscript-keyword">\chfplain</span>{#1}{}}

<span class="enscript-comment">% @centerchap -- centered and unnumbered.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\centerparametersmaybe</span> = <span class="enscript-keyword">\relax</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\centerchfplain</span>#1{{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\centerparametersmaybe</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\rightskip</span> by 3<span class="enscript-keyword">\rightskip</span>
    <span class="enscript-keyword">\leftskip</span> = <span class="enscript-keyword">\rightskip</span>
    <span class="enscript-keyword">\parfillskip</span> = 0pt
  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\chfplain</span>{#1}{}<span class="enscript-comment">%
</span>}}

<span class="enscript-keyword">\CHAPFplain</span> <span class="enscript-comment">% The default
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnchfopen</span> #1{<span class="enscript-comment">%
</span><span class="enscript-keyword">\chapoddpage</span> {<span class="enscript-keyword">\chapfonts</span> <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000<span class="enscript-keyword">\tolerance</span>=5000
                       <span class="enscript-keyword">\parindent</span>=0pt<span class="enscript-keyword">\raggedright</span>
                       <span class="enscript-keyword">\rm</span> #1<span class="enscript-keyword">\hfill</span>}}<span class="enscript-keyword">\bigskip</span> <span class="enscript-keyword">\par</span><span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chfopen</span> #1#2{<span class="enscript-keyword">\chapoddpage</span> {<span class="enscript-keyword">\chapfonts</span>
<span class="enscript-keyword">\vbox</span> to 3in{<span class="enscript-keyword">\vfil</span> <span class="enscript-keyword">\hbox</span> to<span class="enscript-keyword">\hsize</span>{<span class="enscript-keyword">\hfil</span> #2} <span class="enscript-keyword">\hbox</span> to<span class="enscript-keyword">\hsize</span>{<span class="enscript-keyword">\hfil</span> #1} <span class="enscript-keyword">\vfil</span>}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\par</span><span class="enscript-keyword">\penalty</span> 5000 <span class="enscript-comment">%
</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\centerchfopen</span> #1{<span class="enscript-comment">%
</span><span class="enscript-keyword">\chapoddpage</span> {<span class="enscript-keyword">\chapfonts</span> <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000<span class="enscript-keyword">\tolerance</span>=5000
                       <span class="enscript-keyword">\parindent</span>=0pt
                       <span class="enscript-keyword">\hfill</span> {<span class="enscript-keyword">\rm</span> #1}<span class="enscript-keyword">\hfill</span>}}<span class="enscript-keyword">\bigskip</span> <span class="enscript-keyword">\par</span><span class="enscript-keyword">\nobreak</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\CHAPFopen</span>{
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\chapmacro</span>=<span class="enscript-keyword">\chfopen</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapmacro</span>=<span class="enscript-keyword">\unnchfopen</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\centerchapmacro</span>=<span class="enscript-keyword">\centerchfopen</span>}


<span class="enscript-comment">% Section titles.
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\secheadingskip</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secheadingbreak</span>{<span class="enscript-keyword">\dobreak</span> <span class="enscript-keyword">\secheadingskip</span> {-1000}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secheading</span>#1#2#3{<span class="enscript-keyword">\sectionheading</span>{sec}{#2.#3}{#1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\plainsecheading</span>#1{<span class="enscript-keyword">\sectionheading</span>{sec}{}{#1}}

<span class="enscript-comment">% Subsection titles.
</span><span class="enscript-keyword">\newskip</span> <span class="enscript-keyword">\subsecheadingskip</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecheadingbreak</span>{<span class="enscript-keyword">\dobreak</span> <span class="enscript-keyword">\subsecheadingskip</span> {-500}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecheading</span>#1#2#3#4{<span class="enscript-keyword">\sectionheading</span>{subsec}{#2.#3.#4}{#1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\plainsubsecheading</span>#1{<span class="enscript-keyword">\sectionheading</span>{subsec}{}{#1}}

<span class="enscript-comment">% Subsubsection titles.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsecheadingskip</span> = <span class="enscript-keyword">\subsecheadingskip</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsecheadingbreak</span> = <span class="enscript-keyword">\subsecheadingbreak</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubsecheading</span>#1#2#3#4#5{<span class="enscript-keyword">\sectionheading</span>{subsubsec}{#2.#3.#4.#5}{#1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\plainsubsubsecheading</span>#1{<span class="enscript-keyword">\sectionheading</span>{subsubsec}{}{#1}}


<span class="enscript-comment">% Print any size section title.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is the section type (sec/subsec/subsubsec), #2 is the section
</span><span class="enscript-comment">% number (maybe empty), #3 the text.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\sectionheading</span>#1#2#3{<span class="enscript-comment">%
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\csname</span> #1headingskip<span class="enscript-keyword">\endcsname</span> by <span class="enscript-keyword">\parskip</span>
    <span class="enscript-keyword">\csname</span> #1headingbreak<span class="enscript-keyword">\endcsname</span>
  }<span class="enscript-comment">%
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Switch to the right set of fonts.
</span>    <span class="enscript-keyword">\csname</span> #1fonts<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\rm</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% Only insert the separating space if we have a section number.
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\secnum</span>{#2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{#2<span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\secnum</span><span class="enscript-keyword">\empty</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\enspace</span><span class="enscript-keyword">\fi</span>}<span class="enscript-comment">%
</span>    <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hyphenpenalty</span>=10000 <span class="enscript-keyword">\tolerance</span>=5000 <span class="enscript-keyword">\parindent</span>=0pt <span class="enscript-keyword">\raggedright</span>
          <span class="enscript-keyword">\hangindent</span> = <span class="enscript-keyword">\wd</span>0 <span class="enscript-comment">% zero if no section number
</span>          <span class="enscript-keyword">\unhbox</span>0 #3}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Add extra space after the heading -- either a line space or a
</span>  <span class="enscript-comment">% paragraph space, whichever is more.  (Some people like to set
</span>  <span class="enscript-comment">% \parskip to large values for some reason.)  Don't allow stretch, though.
</span>  <span class="enscript-keyword">\nobreak</span>
  <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\parskip</span>&gt;<span class="enscript-keyword">\normalbaselineskip</span>
    <span class="enscript-keyword">\kern</span><span class="enscript-keyword">\parskip</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\kern</span><span class="enscript-keyword">\normalbaselineskip</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\nobreak</span>
}


<span class="enscript-keyword">\message</span>{toc,}
<span class="enscript-comment">% Table of contents.
</span><span class="enscript-keyword">\newwrite</span><span class="enscript-keyword">\tocfile</span>

<span class="enscript-comment">% Write an entry to the toc file, opening it if necessary.
</span><span class="enscript-comment">% Called from @chapter, etc.  We supply {\folio} at the end of the
</span><span class="enscript-comment">% argument, which will end up as the last argument to the \...entry macro.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
</span><span class="enscript-comment">% We open the .toc file for writing here instead of at @setfilename (or
</span><span class="enscript-comment">% any other fixed time) so that @contents can be anywhere in the document.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\iftocfileopened</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\writetocentry</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\iftocfileopened</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\openout</span><span class="enscript-keyword">\tocfile</span> = <span class="enscript-keyword">\jobname</span>.toc
    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\tocfileopenedtrue</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\iflinks</span>
    <span class="enscript-keyword">\toks</span>0 = {#2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\write</span><span class="enscript-keyword">\tocfile</span>{<span class="enscript-keyword">\realbackslash</span> #1entry{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}#3{<span class="enscript-keyword">\folio</span>}}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\temp</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Tell \shipout to create a page destination if we're doing pdf, which
</span>  <span class="enscript-comment">% will be the target of the links in the table of contents.  We can't
</span>  <span class="enscript-comment">% just do it on every page because the title pages are numbered 1 and
</span>  <span class="enscript-comment">% 2 (the page numbers aren't printed), and so are the first two pages
</span>  <span class="enscript-comment">% of the document.  Thus, we'd have two destinations named `1', and
</span>  <span class="enscript-comment">% two named `2'.
</span>  <span class="enscript-keyword">\ifpdf</span> <span class="enscript-keyword">\pdfmakepagedesttrue</span> <span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\contentsrightmargin</span> <span class="enscript-keyword">\contentsrightmargin</span>=1in
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\savepageno</span>
<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\lastnegativepageno</span> <span class="enscript-keyword">\lastnegativepageno</span> = -1

<span class="enscript-comment">% Finish up the main text and prepare to read what we've written
</span><span class="enscript-comment">% to \tocfile.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\startcontents</span>#1{<span class="enscript-comment">%
</span>   <span class="enscript-comment">% If @setchapternewpage on, and @headings double, the contents should
</span>   <span class="enscript-comment">% start on an odd page, unlike chapters.  Thus, we maintain
</span>   <span class="enscript-comment">% \contentsalignmacro in parallel with \pagealignmacro.
</span>   <span class="enscript-comment">% From: Torbjorn Granlund &lt;<a href="mailto:tege@matematik.su.se">tege@matematik.su.se</a>&gt;
</span>   <span class="enscript-keyword">\contentsalignmacro</span>
   <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\closeout</span><span class="enscript-keyword">\tocfile</span>
   <span class="enscript-comment">%
</span>   <span class="enscript-comment">% Don't need to put `Contents' or `Short Contents' in the headline.
</span>   <span class="enscript-comment">% It is abundantly clear what they are.
</span>   <span class="enscript-keyword">\unnumbchapmacro</span>{#1}<span class="enscript-keyword">\def</span><span class="enscript-keyword">\thischapter</span>{}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\savepageno</span> = <span class="enscript-keyword">\pageno</span>
   <span class="enscript-keyword">\begingroup</span>                  <span class="enscript-comment">% Set up to handle contents files properly.
</span>      <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=0  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span>=1  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span>=2  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=11
      <span class="enscript-comment">% We can't do this, because then an actual ^ in a section
</span>      <span class="enscript-comment">% title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
</span>      <span class="enscript-comment">%\catcode`\^=7 % to see ^^e4 as \&quot;a etc. <a href="mailto:juha@piuha.ydi.vtt.fi">juha@piuha.ydi.vtt.fi</a>
</span>      <span class="enscript-keyword">\raggedbottom</span>             <span class="enscript-comment">% Worry more about breakpoints than the bottom.
</span>      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\contentsrightmargin</span> <span class="enscript-comment">% Don't use the full line length.
</span>      <span class="enscript-comment">%
</span>      <span class="enscript-comment">% Roman numerals for page numbers.
</span>      <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\pageno</span>&gt;0 <span class="enscript-keyword">\global</span><span class="enscript-keyword">\pageno</span> = <span class="enscript-keyword">\lastnegativepageno</span> <span class="enscript-keyword">\fi</span>
}


<span class="enscript-comment">% Normal (long) toc.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\contents</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\startcontents</span>{<span class="enscript-keyword">\putwordTOC</span>}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\openin</span> 1 <span class="enscript-keyword">\jobname</span>.toc
     <span class="enscript-keyword">\ifeof</span> 1 <span class="enscript-keyword">\else</span>
       <span class="enscript-keyword">\closein</span> 1
       <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.toc
     <span class="enscript-keyword">\fi</span>
     <span class="enscript-keyword">\vfill</span> <span class="enscript-keyword">\eject</span>
     <span class="enscript-keyword">\contentsalignmacro</span> <span class="enscript-comment">% in case @setchapternewpage odd is in effect
</span>     <span class="enscript-keyword">\pdfmakeoutlines</span>
   <span class="enscript-keyword">\endgroup</span>
   <span class="enscript-keyword">\lastnegativepageno</span> = <span class="enscript-keyword">\pageno</span>
   <span class="enscript-keyword">\global</span><span class="enscript-keyword">\pageno</span> = <span class="enscript-keyword">\savepageno</span>
}

<span class="enscript-comment">% And just the chapters.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\summarycontents</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\startcontents</span>{<span class="enscript-keyword">\putwordShortTOC</span>}<span class="enscript-comment">%
</span>      <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\chapentry</span> = <span class="enscript-keyword">\shortchapentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\appendixentry</span> = <span class="enscript-keyword">\shortappendixentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbchapentry</span> = <span class="enscript-keyword">\shortunnumberedentry</span>
      <span class="enscript-comment">% We want a true roman here for the page numbers.
</span>      <span class="enscript-keyword">\secfonts</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\rm</span>=<span class="enscript-keyword">\shortcontrm</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\bf</span>=<span class="enscript-keyword">\shortcontbf</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\sl</span>=<span class="enscript-keyword">\shortcontsl</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\tt</span>=<span class="enscript-keyword">\shortconttt</span>
      <span class="enscript-keyword">\rm</span>
      <span class="enscript-keyword">\hyphenpenalty</span> = 10000
      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\baselineskip</span> by 1pt <span class="enscript-comment">% Open it up a little.
</span>      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\secentry</span> ##1##2##3##4{}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecentry</span> ##1##2##3##4##5{}
      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubsecentry</span> ##1##2##3##4##5##6{}
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsecentry</span> = <span class="enscript-keyword">\secentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsecentry</span> = <span class="enscript-keyword">\subsecentry</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\unnumbsubsubsecentry</span> = <span class="enscript-keyword">\subsubsecentry</span>
      <span class="enscript-keyword">\openin</span> 1 <span class="enscript-keyword">\jobname</span>.toc
      <span class="enscript-keyword">\ifeof</span> 1 <span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\closein</span> 1
        <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.toc
      <span class="enscript-keyword">\fi</span>
     <span class="enscript-keyword">\vfill</span> <span class="enscript-keyword">\eject</span>
     <span class="enscript-keyword">\contentsalignmacro</span> <span class="enscript-comment">% in case @setchapternewpage odd is in effect
</span>   <span class="enscript-keyword">\endgroup</span>
   <span class="enscript-keyword">\lastnegativepageno</span> = <span class="enscript-keyword">\pageno</span>
   <span class="enscript-keyword">\global</span><span class="enscript-keyword">\pageno</span> = <span class="enscript-keyword">\savepageno</span>
}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\shortcontents</span> = <span class="enscript-keyword">\summarycontents</span>

<span class="enscript-keyword">\ifpdf</span>
  <span class="enscript-keyword">\pdfcatalog</span>{/PageMode /UseOutlines}<span class="enscript-comment">%
</span><span class="enscript-keyword">\fi</span>

<span class="enscript-comment">% These macros generate individual entries in the table of contents.
</span><span class="enscript-comment">% The first argument is the chapter or section name.
</span><span class="enscript-comment">% The last argument is the page number.
</span><span class="enscript-comment">% The arguments in between are the chapter number, section number, ...
</span>
<span class="enscript-comment">% Chapters, in the main contents.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapentry</span>#1#2#3{<span class="enscript-keyword">\dochapentry</span>{#2<span class="enscript-keyword">\labelspace</span>#1}{#3}}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Chapters, in the short toc.
</span><span class="enscript-comment">% See comments in \dochapentry re vbox and related settings.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\shortchapentry</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tocentry</span>{<span class="enscript-keyword">\shortchaplabel</span>{#2}<span class="enscript-keyword">\labelspace</span> #1}{<span class="enscript-keyword">\doshortpageno</span><span class="enscript-keyword">\bgroup</span>#3<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Appendices, in the main contents.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixentry</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dochapentry</span>{<span class="enscript-keyword">\appendixbox</span>{<span class="enscript-keyword">\putwordAppendix</span>{} #2}<span class="enscript-keyword">\labelspace</span>#1}{#3}}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Appendices, in the short toc.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\shortappendixentry</span> = <span class="enscript-keyword">\shortchapentry</span>

<span class="enscript-comment">% Typeset the label for a chapter or appendix for the short contents.
</span><span class="enscript-comment">% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
</span><span class="enscript-comment">% We could simplify the code here by writing out an \appendixentry
</span><span class="enscript-comment">% command in the toc file for appendices, instead of using \chapentry
</span><span class="enscript-comment">% for both, but it doesn't seem worth it.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\shortappendixwidth</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\shortchaplabel</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% This space should be enough, since a single number is .5em, and the
</span>  <span class="enscript-comment">% widest letter (M) is 1em, at least in the Computer Modern fonts.
</span>  <span class="enscript-comment">% But use \hss just in case.
</span>  <span class="enscript-comment">% (This space doesn't include the extra space that gets added after
</span>  <span class="enscript-comment">% the label; that gets put in by \shortchapentry above.)
</span>  <span class="enscript-keyword">\dimen</span>0 = 1em
  <span class="enscript-keyword">\hbox</span> to <span class="enscript-keyword">\dimen</span>0{#1<span class="enscript-keyword">\hss</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Unnumbered chapters.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbchapentry</span>#1#2#3{<span class="enscript-keyword">\dochapentry</span>{#1}{#3}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\shortunnumberedentry</span>#1#2#3{<span class="enscript-keyword">\tocentry</span>{#1}{<span class="enscript-keyword">\doshortpageno</span><span class="enscript-keyword">\bgroup</span>#3<span class="enscript-keyword">\egroup</span>}}

<span class="enscript-comment">% Sections.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\secentry</span>#1#2#3#4{<span class="enscript-keyword">\dosecentry</span>{#2.#3<span class="enscript-keyword">\labelspace</span>#1}{#4}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbsecentry</span>#1#2#3#4{<span class="enscript-keyword">\dosecentry</span>{#1}{#4}}

<span class="enscript-comment">% Subsections.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsecentry</span>#1#2#3#4#5{<span class="enscript-keyword">\dosubsecentry</span>{#2.#3.#4<span class="enscript-keyword">\labelspace</span>#1}{#5}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbsubsecentry</span>#1#2#3#4#5{<span class="enscript-keyword">\dosubsecentry</span>{#1}{#5}}

<span class="enscript-comment">% And subsubsections.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\subsubsecentry</span>#1#2#3#4#5#6{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubsubsecentry</span>{#2.#3.#4.#5<span class="enscript-keyword">\labelspace</span>#1}{#6}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbsubsubsecentry</span>#1#2#3#4#5#6{<span class="enscript-keyword">\dosubsubsecentry</span>{#1}{#6}}

<span class="enscript-comment">% This parameter controls the indentation of the various levels.
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\tocindent</span> <span class="enscript-keyword">\tocindent</span> = 3pc

<span class="enscript-comment">% Now for the actual typesetting. In all these, #1 is the text and #2 is the
</span><span class="enscript-comment">% page number.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% If the toc has to be broken over pages, we want it to be at chapters
</span><span class="enscript-comment">% if at all possible; hence the \penalty.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dochapentry</span>#1#2{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\penalty</span>-300 <span class="enscript-keyword">\vskip</span>1<span class="enscript-keyword">\baselineskip</span> plus.33<span class="enscript-keyword">\baselineskip</span> minus.25<span class="enscript-keyword">\baselineskip</span>
   <span class="enscript-keyword">\begingroup</span>
     <span class="enscript-keyword">\chapentryfonts</span>
     <span class="enscript-keyword">\tocentry</span>{#1}{<span class="enscript-keyword">\dopageno</span><span class="enscript-keyword">\bgroup</span>#2<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\endgroup</span>
   <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span> .25<span class="enscript-keyword">\baselineskip</span> plus.1<span class="enscript-keyword">\baselineskip</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosecentry</span>#1#2{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\secentryfonts</span> <span class="enscript-keyword">\leftskip</span>=<span class="enscript-keyword">\tocindent</span>
  <span class="enscript-keyword">\tocentry</span>{#1}{<span class="enscript-keyword">\dopageno</span><span class="enscript-keyword">\bgroup</span>#2<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosubsecentry</span>#1#2{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\subsecentryfonts</span> <span class="enscript-keyword">\leftskip</span>=2<span class="enscript-keyword">\tocindent</span>
  <span class="enscript-keyword">\tocentry</span>{#1}{<span class="enscript-keyword">\dopageno</span><span class="enscript-keyword">\bgroup</span>#2<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosubsubsecentry</span>#1#2{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\subsubsecentryfonts</span> <span class="enscript-keyword">\leftskip</span>=3<span class="enscript-keyword">\tocindent</span>
  <span class="enscript-keyword">\tocentry</span>{#1}{<span class="enscript-keyword">\dopageno</span><span class="enscript-keyword">\bgroup</span>#2<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% Final typesetting of a toc entry; we use the same \entry macro as for
</span><span class="enscript-comment">% the index entries, but we want to suppress hyphenation here.  (We
</span><span class="enscript-comment">% can't do that in the \entry macro, since index entries might consist
</span><span class="enscript-comment">% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\tocentry</span>#1#2{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\vskip</span> 0pt plus1pt <span class="enscript-comment">% allow a little stretch for the sake of nice page breaks
</span>  <span class="enscript-comment">% Do not use \turnoffactive in these arguments.  Since the toc is
</span>  <span class="enscript-comment">% typeset in cmr, characters such as _ would come out wrong; we
</span>  <span class="enscript-comment">% have to do the usual translation tricks.
</span>  <span class="enscript-keyword">\entry</span>{#1}{#2}<span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% Space between chapter (or whatever) number and the title.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\labelspace</span>{<span class="enscript-keyword">\hskip</span>1em <span class="enscript-keyword">\relax</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dopageno</span>#1{{<span class="enscript-keyword">\rm</span> #1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\doshortpageno</span>#1{{<span class="enscript-keyword">\rm</span> #1}}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\chapentryfonts</span>{<span class="enscript-keyword">\secfonts</span> <span class="enscript-keyword">\rm</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\secentryfonts</span>{<span class="enscript-keyword">\textfonts</span>}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsecentryfonts</span> = <span class="enscript-keyword">\textfonts</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\subsubsecentryfonts</span> = <span class="enscript-keyword">\textfonts</span>


<span class="enscript-keyword">\message</span>{environments,}
<span class="enscript-comment">% @foo ... @end foo.
</span>
<span class="enscript-comment">% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% Since these characters are used in examples, it should be an even number of
</span><span class="enscript-comment">% \tt widths. Each \tt character is 1en, so two makes it 1em.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\point</span>{<span class="enscript-variable-name">$\star$</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\result</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\raise</span>.15ex<span class="enscript-keyword">\hbox</span> to 1em{<span class="enscript-keyword">\hfil</span><span class="enscript-variable-name">$\Rightarrow$</span><span class="enscript-keyword">\hfil</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\expansion</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\raise</span>.1ex<span class="enscript-keyword">\hbox</span> to 1em{<span class="enscript-keyword">\hfil</span><span class="enscript-variable-name">$\mapsto$</span><span class="enscript-keyword">\hfil</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\print</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\lower</span>.1ex<span class="enscript-keyword">\hbox</span> to 1em{<span class="enscript-keyword">\hfil</span><span class="enscript-variable-name">$\dashv$</span><span class="enscript-keyword">\hfil</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\equiv</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\lower</span>.1ex<span class="enscript-keyword">\hbox</span> to 1em{<span class="enscript-keyword">\hfil</span><span class="enscript-variable-name">$\ptexequiv$</span><span class="enscript-keyword">\hfil</span>}}

<span class="enscript-comment">% The @error{} command.
</span><span class="enscript-comment">% Adapted from the TeXbook's \boxit.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\newbox</span><span class="enscript-keyword">\errorbox</span>
<span class="enscript-comment">%
</span>{<span class="enscript-keyword">\tentt</span> <span class="enscript-keyword">\global</span><span class="enscript-keyword">\dimen</span>0 = 3em}<span class="enscript-comment">% Width of the box.
</span><span class="enscript-keyword">\dimen</span>2 = .55pt <span class="enscript-comment">% Thickness of rules
</span><span class="enscript-comment">% The text. (`r' is open on the right, `e' somewhat less so on the left.)
</span><span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\kern</span>-.75pt <span class="enscript-keyword">\tensf</span> error<span class="enscript-keyword">\kern</span>-1.5pt}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\setbox</span><span class="enscript-keyword">\errorbox</span>=<span class="enscript-keyword">\hbox</span> to <span class="enscript-keyword">\dimen</span>0{<span class="enscript-keyword">\hfil</span>
   <span class="enscript-keyword">\hsize</span> = <span class="enscript-keyword">\dimen</span>0 <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -5.8pt <span class="enscript-comment">% Space to left+right.
</span>   <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\hsize</span> by -2<span class="enscript-keyword">\dimen</span>2 <span class="enscript-comment">% Rules.
</span>   <span class="enscript-keyword">\vbox</span>{
      <span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\dimen</span>2
      <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\vrule</span> width<span class="enscript-keyword">\dimen</span>2 <span class="enscript-keyword">\kern</span>3pt          <span class="enscript-comment">% Space to left of text.
</span>         <span class="enscript-keyword">\vtop</span>{<span class="enscript-keyword">\kern</span>2.4pt <span class="enscript-keyword">\box</span>0 <span class="enscript-keyword">\kern</span>2.4pt}<span class="enscript-comment">% Space above/below.
</span>         <span class="enscript-keyword">\kern</span>3pt<span class="enscript-keyword">\vrule</span> width<span class="enscript-keyword">\dimen</span>2}<span class="enscript-comment">% Space to right.
</span>      <span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\dimen</span>2}
    <span class="enscript-keyword">\hfil</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\error</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\lower</span>.7ex<span class="enscript-keyword">\copy</span><span class="enscript-keyword">\errorbox</span>}

<span class="enscript-comment">% @tex ... @end tex    escapes into raw Tex temporarily.
</span><span class="enscript-comment">% One exception: @ is still an escape character, so that @end tex works.
</span><span class="enscript-comment">% But \@ or @@ will get a plain tex @ character.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\tex</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\\</span>=0 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\{</span>=1 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\}</span>=2
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\$</span>=3 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\&amp;</span>=4 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\#</span>=6
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\^</span>=7 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\_</span>=8 <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\let</span>~=<span class="enscript-keyword">\tie</span>
  <span class="enscript-keyword">\catcode</span> `\%=14
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\&quot;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\=</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\escapechar</span>=`<span class="enscript-keyword">\\</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\b</span>=<span class="enscript-keyword">\ptexb</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\bullet</span>=<span class="enscript-keyword">\ptexbullet</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\c</span>=<span class="enscript-keyword">\ptexc</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\,</span>=<span class="enscript-keyword">\ptexcomma</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\.</span>=<span class="enscript-keyword">\ptexdot</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\dots</span>=<span class="enscript-keyword">\ptexdots</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\equiv</span>=<span class="enscript-keyword">\ptexequiv</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\!</span>=<span class="enscript-keyword">\ptexexclam</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\i</span>=<span class="enscript-keyword">\ptexi</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\{</span>=<span class="enscript-keyword">\ptexlbrace</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\tabalign</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\}</span>=<span class="enscript-keyword">\ptexrbrace</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\*</span>=<span class="enscript-keyword">\ptexstar</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\t</span>=<span class="enscript-keyword">\ptext</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\endldots</span>{<span class="enscript-keyword">\mathinner</span>{<span class="enscript-keyword">\ldots</span><span class="enscript-keyword">\ldots</span><span class="enscript-keyword">\ldots</span><span class="enscript-keyword">\ldots</span>}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\enddots</span>{<span class="enscript-keyword">\relax</span><span class="enscript-keyword">\ifmmode</span><span class="enscript-keyword">\endldots</span><span class="enscript-keyword">\else</span><span class="enscript-variable-name">$\mathsurround=0pt \endldots\,$</span><span class="enscript-keyword">\fi</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\@</span>{@}<span class="enscript-comment">%
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\Etex</span>=<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% Define @lisp ... @end lisp.
</span><span class="enscript-comment">% @lisp does a \begingroup so it can rebind things,
</span><span class="enscript-comment">% including the definition of @end lisp (which normally is erroneous).
</span>
<span class="enscript-comment">% Amount to narrow the margins by for @lisp.
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\lispnarrowing</span> <span class="enscript-keyword">\lispnarrowing</span>=0.4in

<span class="enscript-comment">% This is the definition that ^^M gets inside @lisp, @example, and other
</span><span class="enscript-comment">% such environments.  \null is better than a space, since it doesn't
</span><span class="enscript-comment">% have any width.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\lisppar</span>{<span class="enscript-keyword">\null</span><span class="enscript-keyword">\endgraf</span>}

<span class="enscript-comment">% Make each space character in the input produce a normal interword
</span><span class="enscript-comment">% space in the output.  Don't allow a line break at this space, as this
</span><span class="enscript-comment">% is used only in environments like @example, where each line of input
</span><span class="enscript-comment">% should produce a line of output anyway.
</span><span class="enscript-comment">%
</span>{<span class="enscript-keyword">\obeyspaces</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\sepspaces</span>{<span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\let</span> =<span class="enscript-keyword">\tie</span>}}

<span class="enscript-comment">% Define \obeyedspace to be our active space, whatever it is.  This is
</span><span class="enscript-comment">% for use in \parsearg.
</span>{<span class="enscript-keyword">\sepspaces</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\obeyedspace</span>= }

<span class="enscript-comment">% This space is always present above and below environments.
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\envskipamount</span> <span class="enscript-keyword">\envskipamount</span> = 0pt

<span class="enscript-comment">% Make spacing and below environment symmetrical.  We use \parskip here
</span><span class="enscript-comment">% to help in doing that, since in @example-like environments \parskip
</span><span class="enscript-comment">% is reset to zero; thus the \afterenvbreak inserts no space -- but the
</span><span class="enscript-comment">% start of the next paragraph will insert \parskip.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\aboveenvbreak</span>{{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% =10000 instead of &lt;10000 because of a special case in \itemzzz, q.v.
</span>  <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\lastpenalty</span>=10000 <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\envskipamount</span> by <span class="enscript-keyword">\parskip</span>
    <span class="enscript-keyword">\endgraf</span>
    <span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\lastskip</span>&lt;<span class="enscript-keyword">\envskipamount</span>
      <span class="enscript-keyword">\removelastskip</span>
      <span class="enscript-comment">% it's not a good place to break if the last penalty was \nobreak
</span>      <span class="enscript-comment">% or better ...
</span>      <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>&gt;10000 <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\penalty</span>-50 <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\envskipamount</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
}}

<span class="enscript-keyword">\let</span><span class="enscript-keyword">\afterenvbreak</span> = <span class="enscript-keyword">\aboveenvbreak</span>

<span class="enscript-comment">% \nonarrowing is a flag.  If &quot;set&quot;, @lisp etc don't narrow margins.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span>=<span class="enscript-keyword">\relax</span>

<span class="enscript-comment">% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
</span><span class="enscript-comment">% environment contents.
</span><span class="enscript-keyword">\font</span><span class="enscript-keyword">\circle</span>=lcircle10
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\circthick</span>
<span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\cartouter</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\cartinner</span>
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\normbskip</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\normpskip</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\normlskip</span>
<span class="enscript-keyword">\circthick</span>=<span class="enscript-keyword">\fontdimen</span>8<span class="enscript-keyword">\circle</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ctl</span>{{<span class="enscript-keyword">\circle</span><span class="enscript-keyword">\char</span>'013<span class="enscript-keyword">\hskip</span> -6pt}}<span class="enscript-comment">% 6pt from pl file: 1/2charwidth
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ctr</span>{{<span class="enscript-keyword">\hskip</span> 6pt<span class="enscript-keyword">\circle</span><span class="enscript-keyword">\char</span>'010}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cbl</span>{{<span class="enscript-keyword">\circle</span><span class="enscript-keyword">\char</span>'012<span class="enscript-keyword">\hskip</span> -6pt}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cbr</span>{{<span class="enscript-keyword">\hskip</span> 6pt<span class="enscript-keyword">\circle</span><span class="enscript-keyword">\char</span>'011}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\carttop</span>{<span class="enscript-keyword">\hbox</span> to <span class="enscript-keyword">\cartouter</span>{<span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\lskip</span>
        <span class="enscript-keyword">\ctl</span><span class="enscript-keyword">\leaders</span><span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\circthick</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\ctr</span>
        <span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\rskip</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cartbot</span>{<span class="enscript-keyword">\hbox</span> to <span class="enscript-keyword">\cartouter</span>{<span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\lskip</span>
        <span class="enscript-keyword">\cbl</span><span class="enscript-keyword">\leaders</span><span class="enscript-keyword">\hrule</span> height<span class="enscript-keyword">\circthick</span><span class="enscript-keyword">\hfil</span><span class="enscript-keyword">\cbr</span>
        <span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\rskip</span>}}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\lskip</span><span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\rskip</span>

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\cartouche</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\par</span>  <span class="enscript-comment">% can't be in the midst of a paragraph.
</span><span class="enscript-keyword">\begingroup</span>
        <span class="enscript-keyword">\lskip</span>=<span class="enscript-keyword">\leftskip</span> <span class="enscript-keyword">\rskip</span>=<span class="enscript-keyword">\rightskip</span>
        <span class="enscript-keyword">\leftskip</span>=0pt<span class="enscript-keyword">\rightskip</span>=0pt <span class="enscript-comment">%we want these *outside*.
</span>        <span class="enscript-keyword">\cartinner</span>=<span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\cartinner</span> by-<span class="enscript-keyword">\lskip</span>
                          <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\cartinner</span> by-<span class="enscript-keyword">\rskip</span>
        <span class="enscript-keyword">\cartouter</span>=<span class="enscript-keyword">\hsize</span>
        <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\cartouter</span> by 18.4pt <span class="enscript-comment">% allow for 3pt kerns on either
</span><span class="enscript-comment">%                                    side, and for 6pt waste from
</span><span class="enscript-comment">%                                    each corner char, and rule thickness
</span>        <span class="enscript-keyword">\normbskip</span>=<span class="enscript-keyword">\baselineskip</span> <span class="enscript-keyword">\normpskip</span>=<span class="enscript-keyword">\parskip</span> <span class="enscript-keyword">\normlskip</span>=<span class="enscript-keyword">\lineskip</span>
        <span class="enscript-comment">% Flag to tell @lisp, etc., not to narrow margin.
</span>        <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span>=<span class="enscript-keyword">\comment</span>
        <span class="enscript-keyword">\vbox</span><span class="enscript-keyword">\bgroup</span>
                <span class="enscript-keyword">\baselineskip</span>=0pt<span class="enscript-keyword">\parskip</span>=0pt<span class="enscript-keyword">\lineskip</span>=0pt
                <span class="enscript-keyword">\carttop</span>
                <span class="enscript-keyword">\hbox</span><span class="enscript-keyword">\bgroup</span>
                        <span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\lskip</span>
                        <span class="enscript-keyword">\vrule</span><span class="enscript-keyword">\kern</span>3pt
                        <span class="enscript-keyword">\vbox</span><span class="enscript-keyword">\bgroup</span>
                                <span class="enscript-keyword">\hsize</span>=<span class="enscript-keyword">\cartinner</span>
                                <span class="enscript-keyword">\kern</span>3pt
                                <span class="enscript-keyword">\begingroup</span>
                                        <span class="enscript-keyword">\baselineskip</span>=<span class="enscript-keyword">\normbskip</span>
                                        <span class="enscript-keyword">\lineskip</span>=<span class="enscript-keyword">\normlskip</span>
                                        <span class="enscript-keyword">\parskip</span>=<span class="enscript-keyword">\normpskip</span>
                                        <span class="enscript-keyword">\vskip</span> -<span class="enscript-keyword">\parskip</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ecartouche</span>{<span class="enscript-comment">%
</span>                                <span class="enscript-keyword">\endgroup</span>
                                <span class="enscript-keyword">\kern</span>3pt
                        <span class="enscript-keyword">\egroup</span>
                        <span class="enscript-keyword">\kern</span>3pt<span class="enscript-keyword">\vrule</span>
                        <span class="enscript-keyword">\hskip</span><span class="enscript-keyword">\rskip</span>
                <span class="enscript-keyword">\egroup</span>
                <span class="enscript-keyword">\cartbot</span>
        <span class="enscript-keyword">\egroup</span>
<span class="enscript-keyword">\endgroup</span>
}}


<span class="enscript-comment">% This macro is called at the beginning of all the @example variants,
</span><span class="enscript-comment">% inside a group.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\nonfillstart</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\aboveenvbreak</span>
  <span class="enscript-keyword">\inENV</span> <span class="enscript-comment">% This group ends at the end of the body
</span>  <span class="enscript-keyword">\hfuzz</span> = 12pt <span class="enscript-comment">% Don't be fussy
</span>  <span class="enscript-keyword">\sepspaces</span> <span class="enscript-comment">% Make spaces be word-separators rather than space tokens.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\par</span> = <span class="enscript-keyword">\lisppar</span> <span class="enscript-comment">% don't ignore blank lines
</span>  <span class="enscript-keyword">\obeylines</span> <span class="enscript-comment">% each line of input is a line of output
</span>  <span class="enscript-keyword">\parskip</span> = 0pt
  <span class="enscript-keyword">\parindent</span> = 0pt
  <span class="enscript-keyword">\emergencystretch</span> = 0pt <span class="enscript-comment">% don't try to avoid overfull boxes
</span>  <span class="enscript-comment">% @cartouche defines \nonarrowing to inhibit narrowing
</span>  <span class="enscript-comment">% at next level down.
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\nonarrowing</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\leftskip</span> by <span class="enscript-keyword">\lispnarrowing</span>
    <span class="enscript-keyword">\exdentamount</span>=<span class="enscript-keyword">\lispnarrowing</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\exdent</span>=<span class="enscript-keyword">\nofillexdent</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Define the \E... control sequence only if we are inside the particular
</span><span class="enscript-comment">% environment, so the error checking in \end will work.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% To end an @example-like environment, we first end the paragraph (via
</span><span class="enscript-comment">% \afterenvbreak's vertical glue), and then the group.  That way we keep
</span><span class="enscript-comment">% the zero \parskip that the environments set -- \parskip glue will be
</span><span class="enscript-comment">% inserted at the beginning of the next paragraph in the document, after
</span><span class="enscript-comment">% the environment.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\nonfillfinish</span>{<span class="enscript-keyword">\afterenvbreak</span><span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% @lisp: indented, narrowed, typewriter font.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\lisp</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\nonfillstart</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Elisp</span> = <span class="enscript-keyword">\nonfillfinish</span>
  <span class="enscript-keyword">\tt</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\kbdfont</span> = <span class="enscript-keyword">\kbdexamplefont</span> <span class="enscript-comment">% Allow @kbd to do something special.
</span>  <span class="enscript-keyword">\gobble</span>       <span class="enscript-comment">% eat return
</span>}

<span class="enscript-comment">% @example: Same as @lisp.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\example</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Eexample</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-keyword">\lisp</span>}

<span class="enscript-comment">% @smallexample and @smalllisp: use smaller fonts.
</span><span class="enscript-comment">% Originally contributed by Pavel@xerox.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smalllisp</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Esmalllisp</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Esmallexample</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\smallexamplefonts</span>
  <span class="enscript-keyword">\lisp</span>
}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\smallexample</span> = <span class="enscript-keyword">\smalllisp</span>


<span class="enscript-comment">% @display: same as @lisp except keep current font.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\display</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\nonfillstart</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Edisplay</span> = <span class="enscript-keyword">\nonfillfinish</span>
  <span class="enscript-keyword">\gobble</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% @smalldisplay: @display plus smaller fonts.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smalldisplay</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Esmalldisplay</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\smallexamplefonts</span> <span class="enscript-keyword">\rm</span>
  <span class="enscript-keyword">\display</span>
}

<span class="enscript-comment">% @format: same as @display except don't narrow margins.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\format</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span> = t
  <span class="enscript-keyword">\nonfillstart</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Eformat</span> = <span class="enscript-keyword">\nonfillfinish</span>
  <span class="enscript-keyword">\gobble</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% @smallformat: @format plus smaller fonts.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smallformat</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Esmallformat</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\smallexamplefonts</span> <span class="enscript-keyword">\rm</span>
  <span class="enscript-keyword">\format</span>
}

<span class="enscript-comment">% @flushleft (same as @format).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\flushleft</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Eflushleft</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-keyword">\format</span>}

<span class="enscript-comment">% @flushright.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\flushright</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span> = t
  <span class="enscript-keyword">\nonfillstart</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\Eflushright</span> = <span class="enscript-keyword">\nonfillfinish</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by 0pt plus 1fill
  <span class="enscript-keyword">\gobble</span>
}


<span class="enscript-comment">% @quotation does normal linebreaking (hence we can't use \nonfillstart)
</span><span class="enscript-comment">% and narrows the margins.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\quotation</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\inENV</span> <span class="enscript-comment">%This group ends at the end of the @quotation body
</span>  {<span class="enscript-keyword">\parskip</span>=0pt <span class="enscript-keyword">\aboveenvbreak</span>}<span class="enscript-comment">% because \aboveenvbreak inserts \parskip
</span>  <span class="enscript-keyword">\parindent</span>=0pt
  <span class="enscript-comment">% We have retained a nonzero parskip for the environment, since we're
</span>  <span class="enscript-comment">% doing normal filling. So to avoid extra space below the environment...
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Equotation</span>{<span class="enscript-keyword">\parskip</span> = 0pt <span class="enscript-keyword">\nonfillfinish</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\nonarrowing</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by <span class="enscript-keyword">\lispnarrowing</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\rightskip</span> by <span class="enscript-keyword">\lispnarrowing</span>
    <span class="enscript-keyword">\exdentamount</span> = <span class="enscript-keyword">\lispnarrowing</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\nonarrowing</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
}


<span class="enscript-comment">% LaTeX-like @verbatim...@end verbatim and @verb{&lt;char&gt;...&lt;char&gt;}
</span><span class="enscript-comment">% If we want to allow any &lt;char&gt; as delimiter, 
</span><span class="enscript-comment">% we need the curly braces so that makeinfo sees the @verb command, eg:
</span><span class="enscript-comment">% `@verbx...x' would look like the '@verbx' command.  <a href="mailto:--janneke@gnu.org">--janneke@gnu.org</a>
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% [Knuth] p.344; only we need to do the other characters Texinfo sets
</span><span class="enscript-comment">% active too.  Otherwise, they get lost as the first character on a
</span><span class="enscript-comment">% verbatim line.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dospecials</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\do</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\\</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\{</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\}</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\$</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\&amp;</span><span class="enscript-comment">%
</span>  <span class="enscript-keyword">\do</span><span class="enscript-keyword">\#</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\^</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\^</span>^K<span class="enscript-keyword">\do</span><span class="enscript-keyword">\_</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\^</span>^A<span class="enscript-keyword">\do</span>\%<span class="enscript-keyword">\do</span><span class="enscript-keyword">\~</span><span class="enscript-comment">%
</span>  <span class="enscript-keyword">\do</span><span class="enscript-keyword">\&lt;</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\&gt;</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\|</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\@</span><span class="enscript-keyword">\do</span>+<span class="enscript-keyword">\do</span><span class="enscript-keyword">\&quot;</span><span class="enscript-comment">%
</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% [Knuth] p. 380
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\uncatcodespecials</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\do</span>##1{<span class="enscript-keyword">\catcode</span>`##1=12}<span class="enscript-keyword">\dospecials</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% [Knuth] pp. 380,381,391
</span><span class="enscript-comment">% Disable Spanish ligatures ?` and !` of \tt font
</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\`</span>=<span class="enscript-keyword">\active</span><span class="enscript-keyword">\gdef</span>`{<span class="enscript-keyword">\relax</span><span class="enscript-keyword">\lq</span>}
<span class="enscript-keyword">\endgroup</span>
<span class="enscript-comment">%
</span><span class="enscript-comment">% Setup for the @verb command.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Eight spaces for a tab
</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^I=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\tabeightspaces</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^I=<span class="enscript-keyword">\active</span><span class="enscript-keyword">\def</span>^^I{<span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\ </span>}}
<span class="enscript-keyword">\endgroup</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setupverb</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tt</span>  <span class="enscript-comment">% easiest (and conventionally used) font for verbatim
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\par</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\endgraf</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\`</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\tabeightspaces</span>
  <span class="enscript-comment">% Respect line breaks,
</span>  <span class="enscript-comment">% print special symbols as themselves, and
</span>  <span class="enscript-comment">% make each space count
</span>  <span class="enscript-comment">% must do in this order:
</span>  <span class="enscript-keyword">\obeylines</span> <span class="enscript-keyword">\uncatcodespecials</span> <span class="enscript-keyword">\sepspaces</span>
}

<span class="enscript-comment">% Setup for the @verbatim environment
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Real tab expansion
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\tabw</span> <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\space</span>} <span class="enscript-keyword">\tabw</span>=8<span class="enscript-keyword">\wd</span>0 <span class="enscript-comment">% tab amount
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\starttabbox</span>{<span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span><span class="enscript-keyword">\bgroup</span>}
<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^I=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\tabexpand</span>{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^I=<span class="enscript-keyword">\active</span>
    <span class="enscript-keyword">\def</span>^^I{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\egroup</span>
      <span class="enscript-keyword">\dimen</span>0=<span class="enscript-keyword">\wd</span>0 <span class="enscript-comment">% the width so far, or since the previous tab
</span>      <span class="enscript-keyword">\divide</span><span class="enscript-keyword">\dimen</span>0 by<span class="enscript-keyword">\tabw</span>
      <span class="enscript-keyword">\multiply</span><span class="enscript-keyword">\dimen</span>0 by<span class="enscript-keyword">\tabw</span> <span class="enscript-comment">% compute previous multiple of \tabw
</span>      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>0 by<span class="enscript-keyword">\tabw</span>  <span class="enscript-comment">% advance to next multiple of \tabw
</span>      <span class="enscript-keyword">\wd</span>0=<span class="enscript-keyword">\dimen</span>0 <span class="enscript-keyword">\box</span>0 <span class="enscript-keyword">\starttabbox</span>
    }<span class="enscript-comment">%
</span>  }
<span class="enscript-keyword">\endgroup</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setupverbatim</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% Easiest (and conventionally used) font for verbatim
</span>  <span class="enscript-keyword">\tt</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\par</span>{<span class="enscript-keyword">\leavevmode</span><span class="enscript-keyword">\egroup</span><span class="enscript-keyword">\box</span>0<span class="enscript-keyword">\endgraf</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\`</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\tabexpand</span>
  <span class="enscript-comment">% Respect line breaks,
</span>  <span class="enscript-comment">% print special symbols as themselves, and
</span>  <span class="enscript-comment">% make each space count
</span>  <span class="enscript-comment">% must do in this order:
</span>  <span class="enscript-keyword">\obeylines</span> <span class="enscript-keyword">\uncatcodespecials</span> <span class="enscript-keyword">\sepspaces</span>
  <span class="enscript-keyword">\everypar</span>{<span class="enscript-keyword">\starttabbox</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Do the @verb magic: verbatim text is quoted by unique 
</span><span class="enscript-comment">% delimiter characters.  Before first delimiter expect a 
</span><span class="enscript-comment">% right brace, after last delimiter expect closing brace:
</span><span class="enscript-comment">%
</span><span class="enscript-comment">%    \def\doverb'{'&lt;char&gt;#1&lt;char&gt;'}'{#1}
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% [Knuth] p. 382; only eat outer {}
</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`[=1<span class="enscript-keyword">\catcode</span>`]=2<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span>=12<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span>=12
  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\doverb</span>{#1[<span class="enscript-keyword">\def</span><span class="enscript-keyword">\next</span>##1#1}[##1<span class="enscript-keyword">\endgroup</span>]<span class="enscript-keyword">\next</span>]
<span class="enscript-keyword">\endgroup</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\verb</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\setupverb</span><span class="enscript-keyword">\doverb</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Do the @verbatim magic: define the macro \doverbatim so that
</span><span class="enscript-comment">% the (first) argument ends when '@end verbatim' is reached, ie:
</span><span class="enscript-comment">%
</span><span class="enscript-comment">%     \def\doverbatim#1@end verbatim{#1}
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% For Texinfo it's a lot easier than for LaTeX, 
</span><span class="enscript-comment">% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
</span><span class="enscript-comment">% we need not redefine '\', '{' and '}'.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Inspired by LaTeX's verbatim command set [latex.ltx]
</span><span class="enscript-comment">%% Include LaTeX hack for completeness -- never know
</span><span class="enscript-comment">%% \begingroup
</span><span class="enscript-comment">%% \catcode`|=0 \catcode`[=1
</span><span class="enscript-comment">%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
</span><span class="enscript-comment">%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
</span><span class="enscript-comment">%% #1|endgroup|def|Everbatim[]|end[verbatim]]
</span><span class="enscript-comment">%% |endgroup
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\ </span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\obeylines</span> <span class="enscript-comment">%
</span>  <span class="enscript-comment">% ignore everything up to the first ^^M, that's the newline at the end
</span>  <span class="enscript-comment">% of the @verbatim input line itself.  Otherwise we get an extra blank
</span>  <span class="enscript-comment">% line in the output.
</span>  <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\doverbatim</span>#1^^M#2@end verbatim{#2<span class="enscript-keyword">\end</span>{verbatim}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\verbatim</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\Everbatim</span>{<span class="enscript-keyword">\nonfillfinish</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\nonfillstart</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by -<span class="enscript-keyword">\defbodyindent</span>
    <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\setupverbatim</span><span class="enscript-keyword">\doverbatim</span>
}

<span class="enscript-comment">% @verbatiminclude FILE - insert text of file in verbatim environment.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Allow normal characters that we make active in the argument (a file name).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\verbatiminclude</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`~=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`^=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`_=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`|=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`&lt;=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`&gt;=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\other</span>
    <span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\doverbatiminclude</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\setupverbatiminclude</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\nonfillstart</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by -<span class="enscript-keyword">\defbodyindent</span>
    <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\setupverbatim</span>
}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\doverbatiminclude</span>#1{<span class="enscript-comment">%
</span>     <span class="enscript-comment">% Restore active chars for included file.
</span>  <span class="enscript-keyword">\endgroup</span>
  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\value</span>=<span class="enscript-keyword">\expandablevalue</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\thisfile</span>{#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\setupverbatiminclude</span><span class="enscript-keyword">\input</span><span class="enscript-keyword">\thisfile</span>
  <span class="enscript-keyword">\endgroup</span>
  <span class="enscript-keyword">\nonfillfinish</span>
  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @copying ... @end copying.
</span><span class="enscript-comment">% Save the text away for @insertcopying later.  Many commands won't be
</span><span class="enscript-comment">% allowed in this context, but that's ok.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% We save the uninterpreted tokens, rather than creating a box.
</span><span class="enscript-comment">% Saving the text in a box would be much easier, but then all the
</span><span class="enscript-comment">% typesetting commands (@smallbook, font changes, etc.) have to be done
</span><span class="enscript-comment">% beforehand -- and a) we want @copying to be done first in the source
</span><span class="enscript-comment">% file; b) letting users define the frontmatter in as flexible order as
</span><span class="enscript-comment">% possible is very desirable.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\copying</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-comment">% Define a command to swallow text until we reach `@end copying'.
</span>  <span class="enscript-comment">% \ is the escape char in this texinfo.tex file, so it is the
</span>  <span class="enscript-comment">% delimiter for the command; @ will be the escape char when we read
</span>  <span class="enscript-comment">% it, but that doesn't matter.
</span>  <span class="enscript-keyword">\long</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\docopying</span>##1<span class="enscript-keyword">\end</span> copying{<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\copyingtext</span>{##1}<span class="enscript-keyword">\enddocopying</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% We must preserve ^^M's in the input file; see \insertcopying below.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\docopying</span>
}

<span class="enscript-comment">% What we do to finish off the copying text.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\enddocopying</span>{<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\ignorespaces</span>}

<span class="enscript-comment">% @insertcopying.  Here we must play games with ^^M's.  On the one hand,
</span><span class="enscript-comment">% we need them to delimit commands such as `@end quotation', so they
</span><span class="enscript-comment">% must be active.  On the other hand, we certainly don't want every
</span><span class="enscript-comment">% end-of-line to be a \par, as would happen with the normal active
</span><span class="enscript-comment">% definition of ^^M.  On the third hand, two ^^M's in a row should still
</span><span class="enscript-comment">% generate a \par.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% Our approach is to make ^^M insert a space and a penalty1 normally;
</span><span class="enscript-comment">% then it can also check if \lastpenalty=1.  If it does, then manually
</span><span class="enscript-comment">% do \par.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% This messes up the normal definitions of @c[omment], so we redefine
</span><span class="enscript-comment">% it.  Similarly for @ignore.  (These commands are used in the gcc
</span><span class="enscript-comment">% manual for man page generation.)
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% Seems pretty fragile, most line-oriented commands will presumably
</span><span class="enscript-comment">% fail, but for the limited use of getting the copying text (which
</span><span class="enscript-comment">% should be quite simple) inserted, we can hope it's ok.
</span><span class="enscript-comment">%
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M=<span class="enscript-keyword">\active</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\insertcopying</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parindent</span> = 0pt  <span class="enscript-comment">% looks wrong on title page
</span>  <span class="enscript-keyword">\def</span>^^M{<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\lastpenalty</span>=1 <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\par</span> <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span> <span class="enscript-comment">%
</span>      <span class="enscript-keyword">\space</span> <span class="enscript-keyword">\penalty</span> 1 <span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span> <span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Fix @c[omment] for catcode 13 ^^M's.
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\c</span>##1^^M{<span class="enscript-keyword">\ignorespaces</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\comment</span> = <span class="enscript-keyword">\c</span> <span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Don't bother jumping through all the hoops that \doignore does, it
</span>  <span class="enscript-comment">% would be very hard since the catcodes are already set.
</span>  <span class="enscript-keyword">\long</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ignore</span>##1<span class="enscript-keyword">\end</span> ignore{<span class="enscript-keyword">\ignorespaces</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\copyingtext</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\endgroup</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-keyword">\message</span>{defuns,}
<span class="enscript-comment">% @defun etc.
</span>
<span class="enscript-comment">% Allow user to change definition object font (\df) internally
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setdeffont</span>#1 {<span class="enscript-keyword">\csname</span> DEF#1<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\defbodyindent</span> <span class="enscript-keyword">\defbodyindent</span>=.4in
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\defargsindent</span> <span class="enscript-keyword">\defargsindent</span>=50pt
<span class="enscript-keyword">\newskip</span><span class="enscript-keyword">\deflastargmargin</span> <span class="enscript-keyword">\deflastargmargin</span>=18pt

<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\parencount</span>

<span class="enscript-comment">% We want ()&amp;[] to print specially on the defun line.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\activeparens</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\(</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\)</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&amp;</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\[</span>=<span class="enscript-keyword">\active</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\]</span>=<span class="enscript-keyword">\active</span>
}

<span class="enscript-comment">% Make control sequences which act like normal parenthesis chars.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\lparen</span> = ( <span class="enscript-keyword">\let</span><span class="enscript-keyword">\rparen</span> = )

{<span class="enscript-keyword">\activeparens</span> <span class="enscript-comment">% Now, smart parens don't turn on until &amp;foo (see \amprm)
</span>
<span class="enscript-comment">% Be sure that we always have a definition for `(', etc.  For example,
</span><span class="enscript-comment">% if the fn name has parens in it, \boldbrax will not be in effect yet,
</span><span class="enscript-comment">% so TeX would otherwise complain about undefined control sequence.
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\lparen</span> <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span>)=<span class="enscript-keyword">\rparen</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span>[=<span class="enscript-keyword">\lbrack</span> <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span>]=<span class="enscript-keyword">\rbrack</span>

<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\functionparens</span>{<span class="enscript-keyword">\boldbrax</span><span class="enscript-keyword">\let</span>&amp;=<span class="enscript-keyword">\amprm</span><span class="enscript-keyword">\parencount</span>=0 }
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\boldbrax</span>{<span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\opnr</span><span class="enscript-keyword">\let</span>)=<span class="enscript-keyword">\clnr</span><span class="enscript-keyword">\let</span>[=<span class="enscript-keyword">\lbrb</span><span class="enscript-keyword">\let</span>]=<span class="enscript-keyword">\rbrb</span>}
<span class="enscript-comment">% This is used to turn on special parens
</span><span class="enscript-comment">% but make &amp; act ordinary (given that it's active).
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\boldbraxnoamp</span>{<span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\opnr</span><span class="enscript-keyword">\let</span>)=<span class="enscript-keyword">\clnr</span><span class="enscript-keyword">\let</span>[=<span class="enscript-keyword">\lbrb</span><span class="enscript-keyword">\let</span>]=<span class="enscript-keyword">\rbrb</span><span class="enscript-keyword">\let</span>&amp;=<span class="enscript-keyword">\ampnr</span>}

<span class="enscript-comment">% Definitions of (, ) and &amp; used in args for functions.
</span><span class="enscript-comment">% This is the definition of ( outside of all parentheses.
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\oprm</span>#1 {{<span class="enscript-keyword">\rm</span><span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\(</span>}#1 <span class="enscript-keyword">\bf</span> <span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\opnested</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\parencount</span> by 1
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% This is the definition of ( when already inside a level of parens.
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\opnested</span>{<span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\(</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\parencount</span> by 1 }
<span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\clrm</span>{<span class="enscript-comment">% Print a paren in roman if it is taking us back to depth of 0.
</span>  <span class="enscript-comment">% also in that case restore the outer-level definition of (.
</span>  <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\parencount</span>=1 {<span class="enscript-keyword">\rm</span> <span class="enscript-keyword">\char</span> `<span class="enscript-keyword">\)</span>}<span class="enscript-keyword">\sl</span> <span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\oprm</span> <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\char</span> `<span class="enscript-keyword">\)</span> <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\parencount</span> by -1 }
<span class="enscript-comment">% If we encounter &amp;foo, then turn on ()-hacking afterwards
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\amprm</span>#1 {{<span class="enscript-keyword">\rm</span><span class="enscript-keyword">\&amp;</span>#1}<span class="enscript-keyword">\let</span>(=<span class="enscript-keyword">\oprm</span> <span class="enscript-keyword">\let</span>)=<span class="enscript-keyword">\clrm</span><span class="enscript-keyword">\ </span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\normalparens</span>{<span class="enscript-keyword">\boldbrax</span><span class="enscript-keyword">\let</span>&amp;=<span class="enscript-keyword">\ampnr</span>}
} <span class="enscript-comment">% End of definition inside \activeparens
</span><span class="enscript-comment">%% These parens (in \boldbrax) actually are a little bolder than the
</span><span class="enscript-comment">%% contained text.  This is especially needed for [ and ]
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\opnr</span>{{<span class="enscript-keyword">\sf</span><span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\(</span>}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\parencount</span> by 1 }
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\clnr</span>{{<span class="enscript-keyword">\sf</span><span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\)</span>}<span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\parencount</span> by -1 }
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ampnr</span> = <span class="enscript-keyword">\&amp;</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\lbrb</span>{{<span class="enscript-keyword">\bf</span><span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\[</span>}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\rbrb</span>{{<span class="enscript-keyword">\bf</span><span class="enscript-keyword">\char</span>`<span class="enscript-keyword">\]</span>}}

<span class="enscript-comment">% Active &amp;'s sneak into the index arguments, so make sure it's defined.
</span>{
  <span class="enscript-keyword">\catcode</span>`&amp; = <span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span>&amp; = <span class="enscript-keyword">\ampnr</span>
}

<span class="enscript-comment">% \defname, which formats the name of the @def (not the args).
</span><span class="enscript-comment">% #1 is the function name.
</span><span class="enscript-comment">% #2 is the type of definition, such as &quot;Function&quot;.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defname</span>#1#2{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% How we'll output the type name.  Putting it in brackets helps
</span>  <span class="enscript-comment">% distinguish it from the body text that may end up on the next line
</span>  <span class="enscript-comment">% just below it.
</span>  <span class="enscript-keyword">\ifempty</span>{#2}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\defnametype</span>{}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\defnametype</span>{[<span class="enscript-keyword">\rm</span> #2]}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Get the values of \leftskip and \rightskip as they were outside the @def...
</span>  <span class="enscript-keyword">\dimen</span>2=<span class="enscript-keyword">\leftskip</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>2 by -<span class="enscript-keyword">\defbodyindent</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Figure out values for the paragraph shape.
</span>  <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\hskip</span> <span class="enscript-keyword">\deflastargmargin</span>{<span class="enscript-keyword">\defnametype</span>}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dimen</span>0=<span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\dimen</span>0 by -<span class="enscript-keyword">\wd</span>0  <span class="enscript-comment">% compute size for first line
</span>  <span class="enscript-keyword">\dimen</span>1=<span class="enscript-keyword">\hsize</span> <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\dimen</span>1 by -<span class="enscript-keyword">\defargsindent</span>  <span class="enscript-comment">% size for continuations
</span>  <span class="enscript-keyword">\parshape</span> 2 0in <span class="enscript-keyword">\dimen</span>0 <span class="enscript-keyword">\defargsindent</span> <span class="enscript-keyword">\dimen</span>1
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Output arg 2 (&quot;Function&quot; or some such) but stuck inside a box of
</span>  <span class="enscript-comment">% width 0 so it does not interfere with linebreaking.
</span>  <span class="enscript-keyword">\noindent</span>
  <span class="enscript-comment">%
</span>  {<span class="enscript-comment">% Adjust \hsize to exclude the ambient margins,
</span>   <span class="enscript-comment">% so that \rightline will obey them.
</span>   <span class="enscript-keyword">\advance</span> <span class="enscript-keyword">\hsize</span> by -<span class="enscript-keyword">\dimen</span>2
   <span class="enscript-keyword">\dimen</span>3 = 0pt  <span class="enscript-comment">% was -1.25pc
</span>   <span class="enscript-keyword">\rlap</span>{<span class="enscript-keyword">\rightline</span>{<span class="enscript-keyword">\defnametype</span><span class="enscript-keyword">\kern</span><span class="enscript-keyword">\dimen</span>3}}<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Allow all lines to be underfull without complaint:
</span>  <span class="enscript-keyword">\tolerance</span>=10000 <span class="enscript-keyword">\hbadness</span>=10000
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by -<span class="enscript-keyword">\defbodyindent</span>
  <span class="enscript-keyword">\exdentamount</span>=<span class="enscript-keyword">\defbodyindent</span>
  {<span class="enscript-keyword">\df</span> #1}<span class="enscript-keyword">\enskip</span>        <span class="enscript-comment">% output function name
</span>  <span class="enscript-comment">% \defunargs will be called next to output the arguments, if any.
</span>}

<span class="enscript-comment">% Common pieces to start any @def...
</span><span class="enscript-comment">% #1 is the \E... control sequence to end the definition (which we define).
</span><span class="enscript-comment">% #2 is the \...x control sequence (which our caller defines).
</span><span class="enscript-comment">% #3 is the control sequence to process the header, such as \defunheader.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsebodycommon</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\inENV</span>
  <span class="enscript-comment">% If there are two @def commands in a row, we'll have a \nobreak,
</span>  <span class="enscript-comment">% which is there to keep the function description together with its
</span>  <span class="enscript-comment">% header.  But if there's nothing but headers, we want to allow a
</span>  <span class="enscript-comment">% break after all.  Check for penalty 10002 (inserted by
</span>  <span class="enscript-comment">% \defargscommonending) instead of 10000, since the sectioning
</span>  <span class="enscript-comment">% commands insert a \penalty10000, and we don't want to allow a break
</span>  <span class="enscript-comment">% between a section heading and a defun.
</span>  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>=10002 <span class="enscript-keyword">\penalty</span>0 <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\medbreak</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Define the \E... end token that this defining construct specifies
</span>  <span class="enscript-comment">% so that it will exit this group.
</span>  <span class="enscript-keyword">\def</span>#1{<span class="enscript-keyword">\endgraf</span><span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\medbreak</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parindent</span>=0in
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\leftskip</span> by <span class="enscript-keyword">\defbodyindent</span>
  <span class="enscript-keyword">\exdentamount</span>=<span class="enscript-keyword">\defbodyindent</span>
}

<span class="enscript-comment">% Common part of the \...x definitions.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defxbodycommon</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% As with \parsebodycommon above, allow line break if we have multiple
</span>  <span class="enscript-comment">% x headers in a row.  It's not a great place, though.
</span>  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\lastpenalty</span>=10000 <span class="enscript-keyword">\penalty</span>1000 <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span>
}

<span class="enscript-comment">% Process body of @defun, @deffn, @defmac, etc.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defparsebody</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2{<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\activeparens</span> <span class="enscript-keyword">\spacesplit</span>#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\activeparens</span>
  <span class="enscript-keyword">\spacesplit</span>#3<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% #1, #2, #3 are the common arguments (see \parsebodycommon above).
</span><span class="enscript-comment">% #4, delimited by the space, is the class name.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmethparsebody</span>#1#2#3#4 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 {<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\activeparens</span> <span class="enscript-keyword">\spacesplit</span>{#3{##1}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\activeparens</span>
  <span class="enscript-comment">% The \empty here prevents misinterpretation of a construct such as
</span>  <span class="enscript-comment">%   @deffn {whatever} {Enharmonic comma}
</span>  <span class="enscript-comment">% See comments at \deftpparsebody, although in our case we don't have
</span>  <span class="enscript-comment">% to remove the \empty afterwards, since it is empty.
</span>  <span class="enscript-keyword">\spacesplit</span>{#3{#4}}<span class="enscript-keyword">\empty</span>
}

<span class="enscript-comment">% Used for @deftypemethod and @deftypeivar.
</span><span class="enscript-comment">% #1, #2, #3 are the common arguments (see \defparsebody).
</span><span class="enscript-comment">% #4, delimited by a space, is the class name.
</span><span class="enscript-comment">% #5 is the method's return type.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypemethparsebody</span>#1#2#3#4 #5 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 ##2 {<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\activeparens</span> <span class="enscript-keyword">\spacesplit</span>{#3{##1}{##2}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\activeparens</span>
  <span class="enscript-keyword">\spacesplit</span>{#3{#4}{#5}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Used for @deftypeop.  The change from \deftypemethparsebody is an
</span><span class="enscript-comment">% extra argument at the beginning which is the `category', instead of it
</span><span class="enscript-comment">% being the hardwired string `Method' or `Instance Variable'.  We have
</span><span class="enscript-comment">% to account for this both in the \...x definition and in parsing the
</span><span class="enscript-comment">% input at hand.  Thus also need a control sequence (passed as #5) for
</span><span class="enscript-comment">% the \E... definition to assign the category name to.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeopparsebody</span>#1#2#3#4#5 #6 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 ##2 ##3 {<span class="enscript-keyword">\def</span>#4{##1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\activeparens</span> <span class="enscript-keyword">\spacesplit</span>{#3{##2}{##3}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\activeparens</span>
  <span class="enscript-keyword">\spacesplit</span>{#3{#5}{#6}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% For @defop.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defopparsebody</span> #1#2#3#4#5 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 ##2 {<span class="enscript-keyword">\def</span>#4{##1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\activeparens</span> <span class="enscript-keyword">\spacesplit</span>{#3{##2}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span><span class="enscript-keyword">\activeparens</span>
  <span class="enscript-keyword">\spacesplit</span>{#3{#5}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% These parsing functions are similar to the preceding ones
</span><span class="enscript-comment">% except that they do not make parens into active characters.
</span><span class="enscript-comment">% These are used for &quot;variables&quot; since they have no arguments.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvarparsebody</span> #1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2{<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\spacesplit</span>#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\active</span>
  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span>
  <span class="enscript-keyword">\spacesplit</span>#3<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @defopvar.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defopvarparsebody</span> #1#2#3#4#5 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 ##2 {<span class="enscript-keyword">\def</span>#4{##1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\spacesplit</span>{#3{##2}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span>
  <span class="enscript-keyword">\spacesplit</span>{#3{#5}}<span class="enscript-comment">%
</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvrparsebody</span>#1#2#3#4 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 {<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\spacesplit</span>{#3{##1}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span>
  <span class="enscript-keyword">\spacesplit</span>{#3{#4}}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
</span><span class="enscript-comment">% type is just `struct', because we lose the braces in `{struct
</span><span class="enscript-comment">% termios}' when \spacesplit reads its undelimited argument.  Sigh.
</span><span class="enscript-comment">% \let\deftpparsebody=\defvrparsebody
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% So, to get around this, we put \empty in with the type name.  That
</span><span class="enscript-comment">% way, TeX won't find exactly `{...}' as an undelimited argument, and
</span><span class="enscript-comment">% won't strip off the braces.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftpparsebody</span> #1#2#3#4 {<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parsebodycommon</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span>#2##1 {<span class="enscript-keyword">\defxbodycommon</span> <span class="enscript-keyword">\spacesplit</span>{#3{##1}}}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeylines</span>
  <span class="enscript-keyword">\spacesplit</span>{<span class="enscript-keyword">\parsetpheaderline</span>{#3{#4}}}<span class="enscript-keyword">\empty</span>
}

<span class="enscript-comment">% Fine, but then we have to eventually remove the \empty *and* the
</span><span class="enscript-comment">% braces (if any).  That's what this does.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\removeemptybraces</span><span class="enscript-keyword">\empty</span>#1<span class="enscript-keyword">\relax</span>{#1}

<span class="enscript-comment">% After \spacesplit has done its work, this is called -- #1 is the final
</span><span class="enscript-comment">% thing to call, #2 the type name (which starts with \empty), and #3
</span><span class="enscript-comment">% (which might be empty) the arguments.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsetpheaderline</span>#1#2#3{<span class="enscript-comment">%
</span>  #1{<span class="enscript-keyword">\removeemptybraces</span>#2<span class="enscript-keyword">\relax</span>}{#3}<span class="enscript-comment">%
</span>}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% Split up #2 (the rest of the input line) at the first space token.
</span><span class="enscript-comment">% call #1 with two arguments:
</span><span class="enscript-comment">%  the first is all of #2 before the space token,
</span><span class="enscript-comment">%  the second is all of #2 after that space token.
</span><span class="enscript-comment">% If #2 contains no space token, all of it is passed as the first arg
</span><span class="enscript-comment">% and the second is passed as empty.
</span><span class="enscript-comment">%
</span>{<span class="enscript-keyword">\obeylines</span> <span class="enscript-comment">%
</span> <span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\spacesplit</span>#1#2^^M{<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\spacesplitx</span>{#1}#2 <span class="enscript-keyword">\relax</span><span class="enscript-keyword">\spacesplitx</span>}<span class="enscript-comment">%
</span> <span class="enscript-keyword">\long</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\spacesplitx</span>#1#2 #3#4<span class="enscript-keyword">\spacesplitx</span>{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\relax</span> #3<span class="enscript-comment">%
</span>     #1{#2}{}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\else</span> <span class="enscript-comment">%
</span>     #1{#2}{#3#4}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\fi</span>}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Define @defun.
</span>
<span class="enscript-comment">% This is called to end the arguments processing for all the @def... commands.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defargscommonending</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\interlinepenalty</span> = 10000
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\rightskip</span> by 0pt plus 1fil
  <span class="enscript-keyword">\endgraf</span>
  <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span> -<span class="enscript-keyword">\parskip</span>
  <span class="enscript-keyword">\penalty</span> 10002  <span class="enscript-comment">% signal to \parsebodycommon.
</span>}

<span class="enscript-comment">% This expands the args and terminates the paragraph they comprise.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defunargs</span>#1{<span class="enscript-keyword">\functionparens</span> <span class="enscript-keyword">\sl</span>
<span class="enscript-comment">% Expand, preventing hyphenation at `-' chars.
</span><span class="enscript-comment">% Note that groups don't affect changes in \hyphenchar.
</span><span class="enscript-comment">% Set the font temporarily and use \font in case \setfont made \tensl a macro.
</span>{<span class="enscript-keyword">\tensl</span><span class="enscript-keyword">\hyphenchar</span><span class="enscript-keyword">\font</span>=0}<span class="enscript-comment">%
</span>#1<span class="enscript-comment">%
</span>{<span class="enscript-keyword">\tensl</span><span class="enscript-keyword">\hyphenchar</span><span class="enscript-keyword">\font</span>=45}<span class="enscript-comment">%
</span><span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\parencount</span>=0 <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\errmessage</span>{Unbalanced parentheses in @def}<span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span>  <span class="enscript-keyword">\defargscommonending</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefunargs</span> #1{<span class="enscript-comment">%
</span><span class="enscript-comment">% Expand, preventing hyphenation at `-' chars.
</span><span class="enscript-comment">% Note that groups don't affect changes in \hyphenchar.
</span><span class="enscript-comment">% Use \boldbraxnoamp, not \functionparens, so that &amp; is not special.
</span><span class="enscript-keyword">\boldbraxnoamp</span>
<span class="enscript-keyword">\tclose</span>{#1}<span class="enscript-comment">% avoid \code because of side effects on active chars
</span>  <span class="enscript-keyword">\defargscommonending</span>
}

<span class="enscript-comment">% Do complete processing of one @defun or @defunx line already parsed.
</span>
<span class="enscript-comment">% @deffn Command forward-char nchars
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deffn</span>{<span class="enscript-keyword">\defmethparsebody</span><span class="enscript-keyword">\Edeffn</span><span class="enscript-keyword">\deffnx</span><span class="enscript-keyword">\deffnheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deffnheader</span> #1#2#3{<span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#2}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#2}{#1}<span class="enscript-keyword">\defunargs</span>{#3}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @defun == @deffn Function
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defun</span>{<span class="enscript-keyword">\defparsebody</span><span class="enscript-keyword">\Edefun</span><span class="enscript-keyword">\defunx</span><span class="enscript-keyword">\defunheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defunheader</span> #1#2{<span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% Make entry in function index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#1}{<span class="enscript-keyword">\putwordDeffunc</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defunargs</span> {#2}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @deftypefun int foobar (int @var{foo}, float @var{bar})
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefun</span>{<span class="enscript-keyword">\defparsebody</span><span class="enscript-keyword">\Edeftypefun</span><span class="enscript-keyword">\deftypefunx</span><span class="enscript-keyword">\deftypefunheader</span>}

<span class="enscript-comment">% #1 is the data type.  #2 is the name and args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefunheader</span> #1#2{<span class="enscript-keyword">\deftypefunheaderx</span>{#1}#2 <span class="enscript-keyword">\relax</span>}
<span class="enscript-comment">% #1 is the data type, #2 the name, #3 the args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefunheaderx</span> #1#2 #3<span class="enscript-keyword">\relax</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#2}}<span class="enscript-comment">% Make entry in function index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {<span class="enscript-keyword">\defheaderxcond</span>#1<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#2}{<span class="enscript-keyword">\putwordDeftypefun</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\deftypefunargs</span> {#3}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefn</span>{<span class="enscript-keyword">\defmethparsebody</span><span class="enscript-keyword">\Edeftypefn</span><span class="enscript-keyword">\deftypefnx</span><span class="enscript-keyword">\deftypefnheader</span>}

<span class="enscript-comment">% \defheaderxcond#1\relax$.$
</span><span class="enscript-comment">% puts #1 in @code, followed by a space, but does nothing if #1 is null.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defheaderxcond</span>#1#2<span class="enscript-variable-name">$.$</span>{<span class="enscript-keyword">\ifx</span>#1<span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span><span class="enscript-keyword">\code</span>{#1#2} <span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% #1 is the classification.  #2 is the data type.  #3 is the name and args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefnheader</span> #1#2#3{<span class="enscript-keyword">\deftypefnheaderx</span>{#1}{#2}#3 <span class="enscript-keyword">\relax</span>}
<span class="enscript-comment">% #1 is the classification, #2 the data type, #3 the name, #4 the args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefnheaderx</span> #1#2#3 #4<span class="enscript-keyword">\relax</span>{<span class="enscript-comment">%
</span><span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#3}}<span class="enscript-comment">% Make entry in function index
</span><span class="enscript-keyword">\begingroup</span>
<span class="enscript-keyword">\normalparens</span> <span class="enscript-comment">% notably, turn off `&amp;' magic, which prevents
</span><span class="enscript-comment">%               at least some C++ text from working
</span><span class="enscript-keyword">\defname</span> {<span class="enscript-keyword">\defheaderxcond</span>#2<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#3}{#1}<span class="enscript-comment">%
</span><span class="enscript-keyword">\deftypefunargs</span> {#4}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @defmac == @deffn Macro
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmac</span>{<span class="enscript-keyword">\defparsebody</span><span class="enscript-keyword">\Edefmac</span><span class="enscript-keyword">\defmacx</span><span class="enscript-keyword">\defmacheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmacheader</span> #1#2{<span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% Make entry in function index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#1}{<span class="enscript-keyword">\putwordDefmac</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defunargs</span> {#2}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @defspec == @deffn Special Form
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defspec</span>{<span class="enscript-keyword">\defparsebody</span><span class="enscript-keyword">\Edefspec</span><span class="enscript-keyword">\defspecx</span><span class="enscript-keyword">\defspecheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defspecheader</span> #1#2{<span class="enscript-keyword">\doind</span> {fn}{<span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% Make entry in function index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#1}{<span class="enscript-keyword">\putwordDefspec</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defunargs</span> {#2}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span><span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\equalChar</span>=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% Turn off change made in \defparsebody
</span>}

<span class="enscript-comment">% @defop CATEGORY CLASS OPERATION ARG...
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defop</span> #1 {<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defoptype</span>{#1}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defopparsebody</span><span class="enscript-keyword">\Edefop</span><span class="enscript-keyword">\defopx</span><span class="enscript-keyword">\defopheader</span><span class="enscript-keyword">\defoptype</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defopheader</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{fn}{<span class="enscript-keyword">\code</span>{#2}}{<span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% function index entry
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{#2}{<span class="enscript-keyword">\defoptype</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span>#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defunargs</span>{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeop</span> #1 {<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeopcategory</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\deftypeopparsebody</span><span class="enscript-keyword">\Edeftypeop</span><span class="enscript-keyword">\deftypeopx</span><span class="enscript-keyword">\deftypeopheader</span>
                       <span class="enscript-keyword">\deftypeopcategory</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeopheader</span>#1#2#3#4{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{fn}{<span class="enscript-keyword">\code</span>{#3}}{<span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% entry in function index
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{<span class="enscript-keyword">\defheaderxcond</span>#2<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#3}
            {<span class="enscript-keyword">\deftypeopcategory</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\deftypefunargs</span>{#4}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @deftypemethod CLASS TYPE METHOD ARG...
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypemethod</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\deftypemethparsebody</span><span class="enscript-keyword">\Edeftypemethod</span><span class="enscript-keyword">\deftypemethodx</span><span class="enscript-keyword">\deftypemethodheader</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypemethodheader</span>#1#2#3#4{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{fn}{<span class="enscript-keyword">\code</span>{#3}}{<span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% entry in function index
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{<span class="enscript-keyword">\defheaderxcond</span>#2<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#3}{<span class="enscript-keyword">\putwordMethodon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\deftypefunargs</span>{#4}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @deftypeivar CLASS TYPE VARNAME
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeivar</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\deftypemethparsebody</span><span class="enscript-keyword">\Edeftypeivar</span><span class="enscript-keyword">\deftypeivarx</span><span class="enscript-keyword">\deftypeivarheader</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is the class name, #2 the data type, #3 the variable name.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeivarheader</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{vr}{<span class="enscript-keyword">\code</span>{#3}}{<span class="enscript-keyword">\putwordof</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% entry in variable index
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{<span class="enscript-keyword">\defheaderxcond</span>#2<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#3}
            {<span class="enscript-keyword">\putwordInstanceVariableof</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defvarargs</span>{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @defmethod == @defop Method
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmethod</span>{<span class="enscript-keyword">\defmethparsebody</span><span class="enscript-keyword">\Edefmethod</span><span class="enscript-keyword">\defmethodx</span><span class="enscript-keyword">\defmethodheader</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is the class name, #2 the method name, #3 the args.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmethodheader</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{fn}{<span class="enscript-keyword">\code</span>{#2}}{<span class="enscript-keyword">\putwordon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% entry in function index
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{#2}{<span class="enscript-keyword">\putwordMethodon</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defunargs</span>{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @defcv {Class Option} foo-class foo-flag
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defcv</span> #1 {<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defcvtype</span>{#1}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defopvarparsebody</span><span class="enscript-keyword">\Edefcv</span><span class="enscript-keyword">\defcvx</span><span class="enscript-keyword">\defcvarheader</span><span class="enscript-keyword">\defcvtype</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defcvarheader</span> #1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{vr}{<span class="enscript-keyword">\code</span>{#2}}{<span class="enscript-keyword">\putwordof</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% variable index entry
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{#2}{<span class="enscript-keyword">\defcvtype</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\putwordof</span><span class="enscript-keyword">\ </span>#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defvarargs</span>{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defivar</span>{<span class="enscript-keyword">\defvrparsebody</span><span class="enscript-keyword">\Edefivar</span><span class="enscript-keyword">\defivarx</span><span class="enscript-keyword">\defivarheader</span>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defivarheader</span>#1#2#3{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosubind</span>{vr}{<span class="enscript-keyword">\code</span>{#2}}{<span class="enscript-keyword">\putwordof</span><span class="enscript-keyword">\ </span><span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% entry in var index
</span>  <span class="enscript-keyword">\begingroup</span>
    <span class="enscript-keyword">\defname</span>{#2}{<span class="enscript-keyword">\putwordInstanceVariableof</span><span class="enscript-keyword">\ </span>#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\defvarargs</span>{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\endgroup</span>
}

<span class="enscript-comment">% @defvar
</span><span class="enscript-comment">% First, define the processing that is wanted for arguments of @defvar.
</span><span class="enscript-comment">% This is actually simple: just print them in roman.
</span><span class="enscript-comment">% This must expand the args and terminate the paragraph they make up
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvarargs</span> #1{<span class="enscript-keyword">\normalparens</span> #1<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\defargscommonending</span>
}

<span class="enscript-comment">% @defvr Counter foo-count
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvr</span>{<span class="enscript-keyword">\defvrparsebody</span><span class="enscript-keyword">\Edefvr</span><span class="enscript-keyword">\defvrx</span><span class="enscript-keyword">\defvrheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvrheader</span> #1#2#3{<span class="enscript-keyword">\doind</span> {vr}{<span class="enscript-keyword">\code</span>{#2}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#2}{#1}<span class="enscript-keyword">\defvarargs</span>{#3}<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% @defvar == @defvr Variable
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvar</span>{<span class="enscript-keyword">\defvarparsebody</span><span class="enscript-keyword">\Edefvar</span><span class="enscript-keyword">\defvarx</span><span class="enscript-keyword">\defvarheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvarheader</span> #1#2{<span class="enscript-keyword">\doind</span> {vr}{<span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% Make entry in var index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#1}{<span class="enscript-keyword">\putwordDefvar</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defvarargs</span> {#2}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @defopt == @defvr {User Option}
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defopt</span>{<span class="enscript-keyword">\defvarparsebody</span><span class="enscript-keyword">\Edefopt</span><span class="enscript-keyword">\defoptx</span><span class="enscript-keyword">\defoptheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defoptheader</span> #1#2{<span class="enscript-keyword">\doind</span> {vr}{<span class="enscript-keyword">\code</span>{#1}}<span class="enscript-comment">% Make entry in var index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#1}{<span class="enscript-keyword">\putwordDefopt</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\defvarargs</span> {#2}<span class="enscript-keyword">\endgroup</span> <span class="enscript-comment">%
</span>}

<span class="enscript-comment">% @deftypevar int foobar
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevar</span>{<span class="enscript-keyword">\defvarparsebody</span><span class="enscript-keyword">\Edeftypevar</span><span class="enscript-keyword">\deftypevarx</span><span class="enscript-keyword">\deftypevarheader</span>}

<span class="enscript-comment">% #1 is the data type.  #2 is the name, perhaps followed by text that
</span><span class="enscript-comment">% is actually part of the data type, which should not be put into the index.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevarheader</span> #1#2{<span class="enscript-comment">%
</span><span class="enscript-keyword">\dovarind</span>#2 <span class="enscript-keyword">\relax</span><span class="enscript-comment">% Make entry in variables index
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {<span class="enscript-keyword">\defheaderxcond</span>#1<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#2}{<span class="enscript-keyword">\putwordDeftypevar</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\defargscommonending</span>
<span class="enscript-keyword">\endgroup</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dovarind</span>#1 #2<span class="enscript-keyword">\relax</span>{<span class="enscript-keyword">\doind</span>{vr}{<span class="enscript-keyword">\code</span>{#1}}}

<span class="enscript-comment">% @deftypevr {Global Flag} int enable
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevr</span>{<span class="enscript-keyword">\defvrparsebody</span><span class="enscript-keyword">\Edeftypevr</span><span class="enscript-keyword">\deftypevrx</span><span class="enscript-keyword">\deftypevrheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevrheader</span> #1#2#3{<span class="enscript-keyword">\dovarind</span>#3 <span class="enscript-keyword">\relax</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {<span class="enscript-keyword">\defheaderxcond</span>#2<span class="enscript-keyword">\relax</span><span class="enscript-variable-name">$.$</span>#3}{#1}
  <span class="enscript-keyword">\defargscommonending</span>
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% Now define @deftp
</span><span class="enscript-comment">% Args are printed in bold, a slight difference from @defvar.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftpargs</span> #1{<span class="enscript-keyword">\bf</span> <span class="enscript-keyword">\defvarargs</span>{#1}}

<span class="enscript-comment">% @deftp Class window height width ...
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftp</span>{<span class="enscript-keyword">\deftpparsebody</span><span class="enscript-keyword">\Edeftp</span><span class="enscript-keyword">\deftpx</span><span class="enscript-keyword">\deftpheader</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftpheader</span> #1#2#3{<span class="enscript-keyword">\doind</span> {tp}{<span class="enscript-keyword">\code</span>{#2}}<span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\defname</span> {#2}{#1}<span class="enscript-keyword">\deftpargs</span>{#3}<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% These definitions are used if you use @defunx (etc.)
</span><span class="enscript-comment">% anywhere other than immediately after a @defun or @defunx.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defcvx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defcvx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deffnx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deffnx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defivarx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defivarx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmacx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defmacx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmethodx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defmethodx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defoptx</span> #1 {<span class="enscript-keyword">\errmessage</span>{@defoptx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defopx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defopx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defspecx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defspecx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftpx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftpx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefnx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypefnx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypefunx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypefunx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeivarx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypeivarx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypemethodx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypemethodx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypeopx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypeopx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevarx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypevarx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\deftypevrx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@deftypevrx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defunx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defunx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvarx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defvarx in invalid context}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\defvrx</span>#1 {<span class="enscript-keyword">\errmessage</span>{@defvrx in invalid context}}


<span class="enscript-keyword">\message</span>{macros,}
<span class="enscript-comment">% @macro.
</span>
<span class="enscript-comment">% To do this right we need a feature of e-TeX, \scantokens,
</span><span class="enscript-comment">% which we arrange to emulate with a temporary file in ordinary TeX.
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\eTeXversion</span><span class="enscript-keyword">\undefined</span>
 <span class="enscript-keyword">\newwrite</span><span class="enscript-keyword">\macscribble</span>
 <span class="enscript-keyword">\def</span><span class="enscript-keyword">\scanmacro</span>#1{<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\newlinechar</span>`<span class="enscript-keyword">\^</span>^M
   <span class="enscript-comment">% Undo catcode changes of \startcontents and \doprintindex
</span>   <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=0 <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\escapechar</span>=`<span class="enscript-keyword">\@</span>
   <span class="enscript-comment">% Append \endinput to make sure that TeX does not see the ending newline.
</span>   <span class="enscript-keyword">\toks</span>0={#1<span class="enscript-keyword">\endinput</span>}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\openout</span><span class="enscript-keyword">\macscribble</span>=<span class="enscript-keyword">\jobname</span>.tmp
   <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\write</span><span class="enscript-keyword">\macscribble</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\immediate</span><span class="enscript-keyword">\closeout</span><span class="enscript-keyword">\macscribble</span>
   <span class="enscript-keyword">\let</span><span class="enscript-keyword">\xeatspaces</span><span class="enscript-keyword">\eatspaces</span>
   <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.tmp
   <span class="enscript-keyword">\endgroup</span>
}
<span class="enscript-keyword">\else</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\scanmacro</span>#1{<span class="enscript-comment">%
</span><span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\newlinechar</span>`<span class="enscript-keyword">\^</span>^M
<span class="enscript-comment">% Undo catcode changes of \startcontents and \doprintindex
</span><span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=0 <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\escapechar</span>=`<span class="enscript-keyword">\@</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\xeatspaces</span><span class="enscript-keyword">\eatspaces</span><span class="enscript-keyword">\scantokens</span>{#1<span class="enscript-keyword">\endinput</span>}<span class="enscript-keyword">\endgroup</span>}
<span class="enscript-keyword">\fi</span>

<span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\paramno</span>   <span class="enscript-comment">% Count of parameters
</span><span class="enscript-keyword">\newtoks</span><span class="enscript-keyword">\macname</span>    <span class="enscript-comment">% Macro name
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifrecursive</span>  <span class="enscript-comment">% Is it recursive?
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\macrolist</span>{}    <span class="enscript-comment">% List of all defined macros in the form
</span>                    <span class="enscript-comment">% \do\macro1\do\macro2...
</span>
<span class="enscript-comment">% Utility routines.
</span><span class="enscript-comment">% Thisdoes \let #1 = #2, except with \csnames.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\cslet</span>#1#2{<span class="enscript-comment">%
</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span>
<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
<span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span>
<span class="enscript-keyword">\csname</span>#2<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-comment">% Trim leading and trailing spaces off a string.
</span><span class="enscript-comment">% Concepts from aro-bend problem 15 (see CTAN).
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=11
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\eatspaces</span> #1{<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\trim</span>@<span class="enscript-keyword">\expandafter</span>{#1 }}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\trim</span>@ #1{<span class="enscript-keyword">\trim</span>@@ @#1 @ #1 @ @@}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\trim</span>@@ #1@ #2@ #3@@{<span class="enscript-keyword">\trim</span>@@@<span class="enscript-keyword">\empty</span> #2 @}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unbrace</span>#1{#1}
<span class="enscript-keyword">\unbrace</span>{<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\trim</span>@@@ #1 } #2@{#1}
}

<span class="enscript-comment">% Trim a single trailing ^^M off a string.
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\Q</span>=3<span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\eatcr</span> #1{<span class="enscript-keyword">\eatcra</span> #1Q^^MQ}<span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\eatcra</span>#1^^MQ{<span class="enscript-keyword">\eatcrb</span>#1Q}<span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\eatcrb</span>#1Q#2Q{#1}<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% Macro bodies are absorbed as an argument in a context where
</span><span class="enscript-comment">% all characters are catcode 10, 11 or 12, except \ which is active
</span><span class="enscript-comment">% (as in normal texinfo). It is necessary to change the definition of \.
</span>
<span class="enscript-comment">% It's necessary to have hard CRs when the macro is executed. This is
</span><span class="enscript-comment">% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
</span><span class="enscript-comment">% body, and then making it the \newlinechar in \scanmacro.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\macrobodyctxt</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\usembodybackslash</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\macroargctxt</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span>}

<span class="enscript-comment">% \mbodybackslash is the definition of \ in @macro bodies.
</span><span class="enscript-comment">% It maps \foo\ =&gt; \csname macarg.foo\endcsname =&gt; #N
</span><span class="enscript-comment">% where N is the macro parameter number.
</span><span class="enscript-comment">% We define \csname macarg.\endcsname to be \realbackslash, so
</span><span class="enscript-comment">% \\ in macro replacement text gets you a backslash.
</span>
{<span class="enscript-keyword">\catcode</span>`@=0 @catcode`@<span class="enscript-keyword">\=</span>@active
 @gdef@usembodybackslash{@let<span class="enscript-keyword">\=</span>@mbodybackslash}
 @gdef@mbodybackslash#1<span class="enscript-keyword">\{</span>@csname macarg.#1@endcsname}
}
<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\csname</span> macarg.<span class="enscript-keyword">\endcsname</span>{<span class="enscript-keyword">\realbackslash</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\macro</span>{<span class="enscript-keyword">\recursivefalse</span><span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\macroxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\rmacro</span>{<span class="enscript-keyword">\recursivetrue</span><span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\macroxxx</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\macroxxx</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\getargs</span>{#1}<span class="enscript-comment">%           now \macname is the macname and \argl the arglist
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\argl</span><span class="enscript-keyword">\empty</span>       <span class="enscript-comment">% no arguments
</span>     <span class="enscript-keyword">\paramno</span>=0<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
     <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parsemargdef</span> <span class="enscript-keyword">\argl</span>;<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\if</span>1<span class="enscript-keyword">\csname</span> ismacro.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>
     <span class="enscript-keyword">\message</span>{Warning: redefining <span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
     <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> <span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\relax</span>
     <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\errmessage</span>{Macro name <span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\space</span> already defined}<span class="enscript-keyword">\fi</span>
     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\cslet</span>{macsave.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\global</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span> ismacro.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>=1<span class="enscript-comment">%
</span>     <span class="enscript-comment">% Add the macroname to \macrolist
</span>     <span class="enscript-keyword">\toks</span>0 = <span class="enscript-keyword">\expandafter</span>{<span class="enscript-keyword">\macrolist</span><span class="enscript-keyword">\do</span>}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\macrolist</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\toks</span>0
       <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\macrobodyctxt</span>
  <span class="enscript-keyword">\ifrecursive</span> <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parsermacbody</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parsemacbody</span>
  <span class="enscript-keyword">\fi</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unmacro</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\dounmacro</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dounmacro</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\if</span>1<span class="enscript-keyword">\csname</span> ismacro.#1<span class="enscript-keyword">\endcsname</span>
    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\cslet</span>{#1}{macsave.#1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span> <span class="enscript-keyword">\csname</span> ismacro.#1<span class="enscript-keyword">\endcsname</span>=0<span class="enscript-comment">%
</span>    <span class="enscript-comment">% Remove the macro name from \macrolist:
</span>    <span class="enscript-keyword">\begingroup</span>
      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span> <span class="enscript-keyword">\relax</span>
      <span class="enscript-keyword">\let</span><span class="enscript-keyword">\do</span><span class="enscript-keyword">\unmacrodo</span>
      <span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\macrolist</span>{<span class="enscript-keyword">\macrolist</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\endgroup</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\errmessage</span>{Macro #1 not defined}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Called by \do from \dounmacro on each macro.  The idea is to omit any
</span><span class="enscript-comment">% macro definitions that have been changed to \relax.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\unmacrodo</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span>#1<span class="enscript-keyword">\relax</span>
    <span class="enscript-comment">% remove this
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\do</span> <span class="enscript-keyword">\noexpand</span> #1<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% This makes use of the obscure feature that if the last token of a
</span><span class="enscript-comment">% &lt;parameter list&gt; is #, then the preceding argument is delimited by
</span><span class="enscript-comment">% an opening brace, and that opening brace is not consumed.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\getargs</span>#1{<span class="enscript-keyword">\getargsxxx</span>#1{}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\getargsxxx</span>#1#{<span class="enscript-keyword">\getmacname</span> #1 <span class="enscript-keyword">\relax</span><span class="enscript-keyword">\getmacargs</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\getmacname</span> #1 #2<span class="enscript-keyword">\relax</span>{<span class="enscript-keyword">\macname</span>={#1}}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\getmacargs</span>#1{<span class="enscript-keyword">\def</span><span class="enscript-keyword">\argl</span>{#1}}

<span class="enscript-comment">% Parse the optional {params} list.  Set up \paramno and \paramlist
</span><span class="enscript-comment">% so \defmacro knows what to do.  Define \macarg.blah for each blah
</span><span class="enscript-comment">% in the params list, to be ##N where N is the position in that list.
</span><span class="enscript-comment">% That gets used by \mbodybackslash (above).
</span>
<span class="enscript-comment">% We need to get `macro parameter char #' into several definitions.
</span><span class="enscript-comment">% The technique used is stolen from LaTeX:  let \hash be something
</span><span class="enscript-comment">% unexpandable, insert that wherever you need a #, and then redefine
</span><span class="enscript-comment">% it to # just before using the token list produced.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% The same technique is used to protect \eatspaces till just before
</span><span class="enscript-comment">% the macro is used.
</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsemargdef</span>#1;{<span class="enscript-keyword">\paramno</span>=0<span class="enscript-keyword">\def</span><span class="enscript-keyword">\paramlist</span>{}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\let</span><span class="enscript-keyword">\hash</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\xeatspaces</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\parsemargdefxxx</span>#1,;,}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsemargdefxxx</span>#1,{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\if</span>#1;<span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=<span class="enscript-keyword">\parsemargdefxxx</span>
    <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\paramno</span> by 1<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\edef</span><span class="enscript-keyword">\csname</span> macarg.<span class="enscript-keyword">\eatspaces</span>{#1}<span class="enscript-keyword">\endcsname</span>
        {<span class="enscript-keyword">\xeatspaces</span>{<span class="enscript-keyword">\hash</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\paramno</span>}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\paramlist</span>{<span class="enscript-keyword">\paramlist</span><span class="enscript-keyword">\hash</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\paramno</span>,}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\next</span>}

<span class="enscript-comment">% These two commands read recursive and nonrecursive macro bodies.
</span><span class="enscript-comment">% (They're different since rec and nonrec macros end differently.)
</span>
<span class="enscript-keyword">\long</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsemacbody</span>#1@end macro<span class="enscript-comment">%
</span>{<span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\eatcr</span>{#1}}<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\defmacro</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\long</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\parsermacbody</span>#1@end rmacro<span class="enscript-comment">%
</span>{<span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\eatcr</span>{#1}}<span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\defmacro</span>}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% This defines the macro itself. There are six cases: recursive and
</span><span class="enscript-comment">% nonrecursive macros of zero, one, and many arguments.
</span><span class="enscript-comment">% Much magic with \expandafter here.
</span><span class="enscript-comment">% \xdef is used so that macro definitions will survive the file
</span><span class="enscript-comment">% they're defined in; @include reads the file inside a group.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\defmacro</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\hash</span>=##<span class="enscript-comment">% convert placeholders to macro parameter chars
</span>  <span class="enscript-keyword">\ifrecursive</span>
    <span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\paramno</span>
    <span class="enscript-comment">% 0
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\or</span> <span class="enscript-comment">% 1
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>         <span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\macroargctxt</span>
         <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\braceorline</span>
         <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>##1{<span class="enscript-comment">%
</span>         <span class="enscript-keyword">\egroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span> <span class="enscript-comment">% many
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>         <span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\macroargctxt</span>
         <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xx<span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xx<span class="enscript-keyword">\endcsname</span>##1{<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span> ##1,}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span>
      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
        <span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>
          <span class="enscript-keyword">\paramlist</span>{<span class="enscript-keyword">\egroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\ifcase</span><span class="enscript-keyword">\paramno</span>
    <span class="enscript-comment">% 0
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\norecurse</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\or</span> <span class="enscript-comment">% 1
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>         <span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\macroargctxt</span>
         <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\braceorline</span>
         <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>##1{<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\egroup</span>
        <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\norecurse</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span> <span class="enscript-comment">% many
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span><span class="enscript-keyword">\endcsname</span>{<span class="enscript-comment">%
</span>         <span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\macroargctxt</span>
         <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xx<span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xx<span class="enscript-keyword">\endcsname</span>##1{<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span> ##1,}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\xdef</span>
      <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span>
      <span class="enscript-keyword">\csname</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span> xxx<span class="enscript-keyword">\endcsname</span>
      <span class="enscript-keyword">\paramlist</span>{<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\egroup</span>
          <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\norecurse</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\macname</span>}<span class="enscript-comment">%
</span>          <span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\scanmacro</span>{<span class="enscript-keyword">\temp</span>}<span class="enscript-keyword">\egroup</span>}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\norecurse</span>#1{<span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\cslet</span>{#1}{macsave.#1}}

<span class="enscript-comment">% \braceorline decides whether the next nonwhitespace character is a
</span><span class="enscript-comment">% {.  If so it reads up to the closing }, if not, it reads the whole
</span><span class="enscript-comment">% line.  Whatever was read is then fed to the next control sequence
</span><span class="enscript-comment">% as an argument (by \parsebrace or \parsearg)
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\braceorline</span>#1{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\next</span>=#1<span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\nchar</span><span class="enscript-keyword">\braceorlinexxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\braceorlinexxx</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\nchar</span><span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\parsearg</span>
  <span class="enscript-keyword">\fi</span> <span class="enscript-keyword">\next</span>}

<span class="enscript-comment">% We mant to disable all macros during \shipout so that they are not
</span><span class="enscript-comment">% expanded by \write.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\turnoffmacros</span>{<span class="enscript-keyword">\begingroup</span> <span class="enscript-keyword">\def</span><span class="enscript-keyword">\do</span>##1{<span class="enscript-keyword">\let</span><span class="enscript-keyword">\noexpand</span>##1=<span class="enscript-keyword">\relax</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\next</span>{<span class="enscript-keyword">\macrolist</span>}<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\next</span>}


<span class="enscript-comment">% @alias.
</span><span class="enscript-comment">% We need some trickery to remove the optional spaces around the equal
</span><span class="enscript-comment">% sign.  Just make them active and then expand them all to nothing.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\alias</span>{<span class="enscript-keyword">\begingroup</span><span class="enscript-keyword">\obeyspaces</span><span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\aliasxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\aliasxxx</span> #1{<span class="enscript-keyword">\aliasyyy</span>#1<span class="enscript-keyword">\relax</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\aliasyyy</span> #1=#2<span class="enscript-keyword">\relax</span>{<span class="enscript-keyword">\ignoreactivespaces</span>
<span class="enscript-keyword">\edef</span><span class="enscript-keyword">\next</span>{<span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span>#1<span class="enscript-keyword">\endcsname</span>=<span class="enscript-comment">%
</span>           <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\noexpand</span><span class="enscript-keyword">\csname</span>#2<span class="enscript-keyword">\endcsname</span>}<span class="enscript-comment">%
</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\endgroup</span><span class="enscript-keyword">\next</span>}


<span class="enscript-keyword">\message</span>{cross references,}
<span class="enscript-comment">% @xref etc.
</span>
<span class="enscript-keyword">\newwrite</span><span class="enscript-keyword">\auxfile</span>

<span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifhavexrefs</span>    <span class="enscript-comment">% True if xref values are known.
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifwarnedxrefs</span>  <span class="enscript-comment">% True if we warned once that they aren't known.
</span>
<span class="enscript-comment">% @inforef is relatively simple.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\inforef</span> #1{<span class="enscript-keyword">\inforefzzz</span> #1,,,,**}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\inforefzzz</span> #1,#2,#3,#4**{<span class="enscript-keyword">\putwordSee</span>{} <span class="enscript-keyword">\putwordInfo</span>{} <span class="enscript-keyword">\putwordfile</span>{} <span class="enscript-keyword">\file</span>{<span class="enscript-keyword">\ignorespaces</span> #3{}},
  node <span class="enscript-keyword">\samp</span>{<span class="enscript-keyword">\ignorespaces</span>#1{}}}

<span class="enscript-comment">% @node's job is to define \lastnode.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\node</span>{<span class="enscript-keyword">\ENVcheck</span><span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\nodezzz</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\nodezzz</span>#1{<span class="enscript-keyword">\nodexxx</span> [#1,]}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\nodexxx</span>[#1,#2]{<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\lastnode</span>{#1}}
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\nwnode</span>=<span class="enscript-keyword">\node</span>
<span class="enscript-keyword">\let</span><span class="enscript-keyword">\lastnode</span>=<span class="enscript-keyword">\relax</span>

<span class="enscript-comment">% The sectioning commands (@chapter, etc.) call these.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\donoderef</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\lastnode</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\setref</span>{<span class="enscript-keyword">\lastnode</span>}<span class="enscript-comment">%
</span>      {Ysectionnumberandtype}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\lastnode</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\unnumbnoderef</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\lastnode</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\setref</span>{<span class="enscript-keyword">\lastnode</span>}{Ynothing}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\lastnode</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\appendixnoderef</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\lastnode</span><span class="enscript-keyword">\relax</span><span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\setref</span>{<span class="enscript-keyword">\lastnode</span>}<span class="enscript-comment">%
</span>      {Yappendixletterandtype}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\lastnode</span>=<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
}


<span class="enscript-comment">% @anchor{NAME} -- define xref target at arbitrary point.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newcount</span><span class="enscript-keyword">\savesfregister</span>
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\savesf</span>{<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\ifhmode</span> <span class="enscript-keyword">\savesfregister</span>=<span class="enscript-keyword">\spacefactor</span> <span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\restoresf</span>{<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\ifhmode</span> <span class="enscript-keyword">\spacefactor</span>=<span class="enscript-keyword">\savesfregister</span> <span class="enscript-keyword">\fi</span>}
<span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\anchor</span>#1{<span class="enscript-keyword">\savesf</span> <span class="enscript-keyword">\setref</span>{#1}{Ynothing}<span class="enscript-keyword">\restoresf</span> <span class="enscript-keyword">\ignorespaces</span>}

<span class="enscript-comment">% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
</span><span class="enscript-comment">% anchor), namely NAME-title (the corresponding @chapter/etc. name),
</span><span class="enscript-comment">% NAME-pg (the page number), and NAME-snt (section number and type).
</span><span class="enscript-comment">% Called from \foonoderef.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% We have to set \indexdummies so commands such as @code in a section
</span><span class="enscript-comment">% title aren't expanded.  It would be nicer not to expand the titles in
</span><span class="enscript-comment">% the first place, but there's so many layers that that is hard to do.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Likewise, use \turnoffactive so that punctuation chars such as underscore
</span><span class="enscript-comment">% and backslash work in node names.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setref</span>#1#2{{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\atdummies</span>
  <span class="enscript-keyword">\pdfmkdest</span>{#1}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\turnoffactive</span>
  <span class="enscript-keyword">\dosetq</span>{#1-title}{Ytitle}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosetq</span>{#1-pg}{Ypagenumber}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dosetq</span>{#1-snt}{#2}<span class="enscript-comment">%
</span>}}

<span class="enscript-comment">% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
</span><span class="enscript-comment">% the node name, #2 the name of the Info cross-reference, #3 the printed
</span><span class="enscript-comment">% node name, #4 the name of the Info file, #5 the name of the printed
</span><span class="enscript-comment">% manual.  All but the node name can be omitted.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\pxref</span>#1{<span class="enscript-keyword">\putwordsee</span>{} <span class="enscript-keyword">\xrefX</span>[#1,,,,,,,]}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xref</span>#1{<span class="enscript-keyword">\putwordSee</span>{} <span class="enscript-keyword">\xrefX</span>[#1,,,,,,,]}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\ref</span>#1{<span class="enscript-keyword">\xrefX</span>[#1,,,,,,,]}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\xrefX</span>[#1,#2,#3,#4,#5,#6]{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\unsepspaces</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printedmanual</span>{<span class="enscript-keyword">\ignorespaces</span> #5}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printednodename</span>{<span class="enscript-keyword">\ignorespaces</span> #3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>1=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\printedmanual</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0=<span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\printednodename</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\wd</span>0 = 0pt
    <span class="enscript-comment">% No printed node name was explicitly given.
</span>    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\csname</span> SETxref-automatic-section-title<span class="enscript-keyword">\endcsname</span><span class="enscript-keyword">\relax</span>
      <span class="enscript-comment">% Use the node name inside the square brackets.
</span>      <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printednodename</span>{<span class="enscript-keyword">\ignorespaces</span> #1}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\else</span>
      <span class="enscript-comment">% Use the actual chapter/section title appear inside
</span>      <span class="enscript-comment">% the square brackets.  Use the real section title if we have it.
</span>      <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\wd</span>1 &gt; 0pt
        <span class="enscript-comment">% It is in another manual, so we don't have it.
</span>        <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printednodename</span>{<span class="enscript-keyword">\ignorespaces</span> #1}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\ifhavexrefs</span>
          <span class="enscript-comment">% We know the real title if we have the xref values.
</span>          <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printednodename</span>{<span class="enscript-keyword">\refx</span>{#1-title}{}}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\else</span>
          <span class="enscript-comment">% Otherwise just copy the Info node name.
</span>          <span class="enscript-keyword">\def</span><span class="enscript-keyword">\printednodename</span>{<span class="enscript-keyword">\ignorespaces</span> #1}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\fi</span><span class="enscript-comment">%
</span>      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
</span>  <span class="enscript-comment">% insert empty discretionaries after hyphens, which means that it will
</span>  <span class="enscript-comment">% not find a line break at a hyphen in a node names.  Since some manuals
</span>  <span class="enscript-comment">% are best written with fairly long node names, containing hyphens, this
</span>  <span class="enscript-comment">% is a loss.  Therefore, we give the text of the node name again, so it
</span>  <span class="enscript-comment">% is as if TeX is seeing it for the first time.
</span>  <span class="enscript-keyword">\ifpdf</span>
    <span class="enscript-keyword">\leavevmode</span>
    <span class="enscript-keyword">\getfilename</span>{#4}<span class="enscript-comment">%
</span>    {<span class="enscript-keyword">\turnoffactive</span> <span class="enscript-keyword">\otherbackslash</span>
     <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\filenamelength</span>&gt;0
       <span class="enscript-keyword">\startlink</span> attr{/Border [0 0 0]}<span class="enscript-comment">%
</span>         goto file{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\filename</span>.pdf} name{#1}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\else</span>
       <span class="enscript-keyword">\startlink</span> attr{/Border [0 0 0]}<span class="enscript-comment">%
</span>         goto name{#1}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\fi</span>
    }<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\linkcolor</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\wd</span>1 &gt; 0pt
    <span class="enscript-keyword">\putwordsection</span>{} ``<span class="enscript-keyword">\printednodename</span>'' <span class="enscript-keyword">\putwordin</span>{} <span class="enscript-keyword">\cite</span>{<span class="enscript-keyword">\printedmanual</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% _ (for example) has to be the character _ for the purposes of the
</span>    <span class="enscript-comment">% control sequence corresponding to the node, but it has to expand
</span>    <span class="enscript-comment">% into the usual \leavevmode...\vrule stuff for purposes of
</span>    <span class="enscript-comment">% printing. So we \turnoffactive for the \refx-snt, back on for the
</span>    <span class="enscript-comment">% printing, back off for the \refx-pg.
</span>    {<span class="enscript-keyword">\turnoffactive</span> <span class="enscript-keyword">\otherbackslash</span>
     <span class="enscript-comment">% Only output a following space if the -snt ref is nonempty; for
</span>     <span class="enscript-comment">% @unnumbered and @anchor, it won't be.
</span>     <span class="enscript-keyword">\setbox</span>2 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> <span class="enscript-keyword">\refx</span>{#1-snt}{}}<span class="enscript-comment">%
</span>     <span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\wd</span>2 &gt; 0pt <span class="enscript-keyword">\refx</span>{#1-snt}<span class="enscript-keyword">\space</span><span class="enscript-keyword">\fi</span>
    }<span class="enscript-comment">%
</span>    <span class="enscript-comment">% [mynode],
</span>    [<span class="enscript-keyword">\printednodename</span>],<span class="enscript-keyword">\space</span>
    <span class="enscript-comment">% page 3
</span>    <span class="enscript-keyword">\turnoffactive</span> <span class="enscript-keyword">\otherbackslash</span> <span class="enscript-keyword">\putwordpage</span><span class="enscript-keyword">\tie</span><span class="enscript-keyword">\refx</span>{#1-pg}{}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\endlink</span>
<span class="enscript-keyword">\endgroup</span>}

<span class="enscript-comment">% \dosetq is called from \setref to do the actual \write (\iflinks).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\dosetq</span>#1#2{<span class="enscript-comment">%
</span>  {<span class="enscript-keyword">\let</span><span class="enscript-keyword">\folio</span>=0<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\next</span>{<span class="enscript-keyword">\write</span><span class="enscript-keyword">\auxfile</span>{<span class="enscript-keyword">\internalsetq</span>{#1}{#2}}}<span class="enscript-comment">%
</span>   <span class="enscript-keyword">\iflinks</span> <span class="enscript-keyword">\next</span> <span class="enscript-keyword">\fi</span>
  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% \internalsetq{foo}{page} expands into
</span><span class="enscript-comment">%   CHARACTERS @xrdef{foo}{...expansion of \page...}
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalsetq</span>#1#2{@xrdef{#1}{<span class="enscript-keyword">\csname</span> #2<span class="enscript-keyword">\endcsname</span>}}

<span class="enscript-comment">% Things to be expanded by \internalsetq.
</span><span class="enscript-comment">% 
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ypagenumber</span>{<span class="enscript-keyword">\folio</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ytitle</span>{<span class="enscript-keyword">\thissection</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ynothing</span>{}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Ysectionnumberandtype</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\secno</span>=0
    <span class="enscript-keyword">\putwordChapter</span>@tie <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\subsecno</span>=0
    <span class="enscript-keyword">\putwordSection</span>@tie <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\subsubsecno</span>=0
    <span class="enscript-keyword">\putwordSection</span>@tie <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\putwordSection</span>@tie <span class="enscript-keyword">\the</span><span class="enscript-keyword">\chapno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>
  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
}

<span class="enscript-keyword">\def</span><span class="enscript-keyword">\Yappendixletterandtype</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\secno</span>=0
     <span class="enscript-keyword">\putwordAppendix</span>@tie @char<span class="enscript-keyword">\the</span><span class="enscript-keyword">\appendixno</span>{}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\subsecno</span>=0
     <span class="enscript-keyword">\putwordSection</span>@tie @char<span class="enscript-keyword">\the</span><span class="enscript-keyword">\appendixno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>
  <span class="enscript-keyword">\else</span> <span class="enscript-keyword">\ifnum</span><span class="enscript-keyword">\subsubsecno</span>=0
    <span class="enscript-keyword">\putwordSection</span>@tie @char<span class="enscript-keyword">\the</span><span class="enscript-keyword">\appendixno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\putwordSection</span>@tie
      @char<span class="enscript-keyword">\the</span><span class="enscript-keyword">\appendixno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\secno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsecno</span>.<span class="enscript-keyword">\the</span><span class="enscript-keyword">\subsubsecno</span>
  <span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span><span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Use TeX 3.0's \inputlineno to get the line number, for better error
</span><span class="enscript-comment">% messages, but if we're using an old version of TeX, don't do anything.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\inputlineno</span><span class="enscript-keyword">\thisisundefined</span>
  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\linenumber</span> = <span class="enscript-keyword">\empty</span> <span class="enscript-comment">% Pre-3.0.
</span><span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\linenumber</span>{<span class="enscript-keyword">\the</span><span class="enscript-keyword">\inputlineno</span>:<span class="enscript-keyword">\space</span>}
<span class="enscript-keyword">\fi</span>

<span class="enscript-comment">% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
</span><span class="enscript-comment">% If its value is nonempty, SUFFIX is output afterward.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\refx</span>#1#2{<span class="enscript-comment">%
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\indexnofonts</span>
    <span class="enscript-keyword">\otherbackslash</span>
    <span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\thisrefX</span>
      <span class="enscript-keyword">\csname</span> X#1<span class="enscript-keyword">\endcsname</span>
  }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\thisrefX</span><span class="enscript-keyword">\relax</span>
    <span class="enscript-comment">% If not defined, say something at least.
</span>    <span class="enscript-keyword">\angleleft</span> un<span class="enscript-keyword">\-</span>de<span class="enscript-keyword">\-</span>fined<span class="enscript-keyword">\angleright</span>
    <span class="enscript-keyword">\iflinks</span>
      <span class="enscript-keyword">\ifhavexrefs</span>
        <span class="enscript-keyword">\message</span>{<span class="enscript-keyword">\linenumber</span> Undefined cross reference `#1'.}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\else</span>
        <span class="enscript-keyword">\ifwarnedxrefs</span><span class="enscript-keyword">\else</span>
          <span class="enscript-keyword">\global</span><span class="enscript-keyword">\warnedxrefstrue</span>
          <span class="enscript-keyword">\message</span>{Cross reference values unknown; you must run TeX again.}<span class="enscript-comment">%
</span>        <span class="enscript-keyword">\fi</span>
      <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% It's defined, so just use it.
</span>    <span class="enscript-keyword">\thisrefX</span>
  <span class="enscript-keyword">\fi</span>
  #2<span class="enscript-comment">% Output the suffix in any case.
</span>}

<span class="enscript-comment">% This is the macro invoked by entries in the aux file.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\xrdef</span>#1{<span class="enscript-keyword">\expandafter</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\csname</span> X#1<span class="enscript-keyword">\endcsname</span>}

<span class="enscript-comment">% Read the last existing aux file, if any.  No error if none exists.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\readauxfile</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^@=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^A=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^B=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^C=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^D=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^E=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^F=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^G=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^H=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^K=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^L=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^N=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^P=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^Q=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^R=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^S=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^T=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^U=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^V=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^W=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^X=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^Z=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^[=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^<span class="enscript-keyword">\=</span><span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^]=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^^=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^_=<span class="enscript-keyword">\other</span>
  <span class="enscript-comment">% It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
</span>  <span class="enscript-comment">% in xref tags, i.e., node names.  But since ^^e4 notation isn't
</span>  <span class="enscript-comment">% supported in the main text, it doesn't seem desirable.  Furthermore,
</span>  <span class="enscript-comment">% that is not enough: for node names that actually contain a ^
</span>  <span class="enscript-comment">% character, we would end up writing a line like this: 'xrdef {'hat
</span>  <span class="enscript-comment">% b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
</span>  <span class="enscript-comment">% argument, and \hat is not an expandable control sequence.  It could
</span>  <span class="enscript-comment">% all be worked out, but why?  Either we support ^^ or we don't.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% The other change necessary for this was to define \auxhat:
</span>  <span class="enscript-comment">% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
</span>  <span class="enscript-comment">% and then to call \auxhat in \setq.
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Special characters.  Should be turned off anyway, but...
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\[</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\]</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&quot;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\$</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\#</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&amp;</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`\%=<span class="enscript-keyword">\other</span>
  <span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\other</span> <span class="enscript-comment">% avoid \+ for paranoia even though we've turned it off
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Make the characters 128-255 be printing characters
</span>  {<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\count</span> 1=128
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\loop</span>{<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\catcode</span><span class="enscript-keyword">\count</span> 1=<span class="enscript-keyword">\other</span>
      <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\count</span> 1 by 1
      <span class="enscript-keyword">\ifnum</span> <span class="enscript-keyword">\count</span> 1&lt;256 <span class="enscript-keyword">\loop</span> <span class="enscript-keyword">\fi</span>
    }<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Turn off \ as an escape so we do not lose on
</span>  <span class="enscript-comment">% entries which were dumped with control sequences in their names.
</span>  <span class="enscript-comment">% For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
</span>  <span class="enscript-comment">% Reference to such entries still does not work the way one would wish,
</span>  <span class="enscript-comment">% but at least they do not bomb out when the aux file is read in.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% @ is our escape character in .aux files.
</span>  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\{</span>=1
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\}</span>=2
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=0
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\openin</span> 1 <span class="enscript-keyword">\jobname</span>.aux
  <span class="enscript-keyword">\ifeof</span> 1 <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\closein</span> 1
    <span class="enscript-keyword">\input</span> <span class="enscript-keyword">\jobname</span>.aux
    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\havexrefstrue</span>
    <span class="enscript-keyword">\global</span><span class="enscript-keyword">\warnedobstrue</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">% Open the new aux file.  TeX will close it automatically at exit.
</span>  <span class="enscript-keyword">\openout</span><span class="enscript-keyword">\auxfile</span>=<span class="enscript-keyword">\jobname</span>.aux
<span class="enscript-keyword">\endgroup</span>}


<span class="enscript-comment">% Footnotes.
</span>
<span class="enscript-keyword">\newcount</span> <span class="enscript-keyword">\footnoteno</span>

<span class="enscript-comment">% The trailing space in the following definition for supereject is
</span><span class="enscript-comment">% vital for proper filling; pages come out unaligned when you do a
</span><span class="enscript-comment">% pagealignmacro call if that space before the closing brace is
</span><span class="enscript-comment">% removed. (Generally, numeric constants should always be followed by a
</span><span class="enscript-comment">% space to prevent strange expansion errors.)
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\supereject</span>{<span class="enscript-keyword">\par</span><span class="enscript-keyword">\penalty</span> -20000<span class="enscript-keyword">\footnoteno</span> =0 }

<span class="enscript-comment">% @footnotestyle is meaningful for info output only.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\footnotestyle</span>=<span class="enscript-keyword">\comment</span>

<span class="enscript-keyword">\let</span><span class="enscript-keyword">\ptexfootnote</span>=<span class="enscript-keyword">\footnote</span>

{<span class="enscript-keyword">\catcode</span> `<span class="enscript-keyword">\@</span>=11
<span class="enscript-comment">%
</span><span class="enscript-comment">% Auto-number footnotes.  Otherwise like plain.
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\footnote</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\global</span><span class="enscript-keyword">\advance</span><span class="enscript-keyword">\footnoteno</span> by <span class="enscript-keyword">\@</span>ne
  <span class="enscript-keyword">\edef</span><span class="enscript-keyword">\thisfootno</span>{<span class="enscript-variable-name">$^{\the\footnoteno}$</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% In case the footnote comes at the end of a sentence, preserve the
</span>  <span class="enscript-comment">% extra spacing after we do the footnote number.
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\@</span>sf<span class="enscript-keyword">\empty</span>
  <span class="enscript-keyword">\ifhmode</span><span class="enscript-keyword">\edef</span><span class="enscript-keyword">\@</span>sf{<span class="enscript-keyword">\spacefactor</span><span class="enscript-keyword">\the</span><span class="enscript-keyword">\spacefactor</span>}<span class="enscript-keyword">\/</span><span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Remove inadvertent blank space before typesetting the footnote number.
</span>  <span class="enscript-keyword">\unskip</span>
  <span class="enscript-keyword">\thisfootno</span><span class="enscript-keyword">\@</span>sf
  <span class="enscript-keyword">\dofootnote</span>
}<span class="enscript-comment">%
</span>
<span class="enscript-comment">% Don't bother with the trickery in plain.tex to not require the
</span><span class="enscript-comment">% footnote text as a parameter.  Our footnotes don't need to be so general.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Oh yes, they do; otherwise, @ifset and anything else that uses
</span><span class="enscript-comment">% \parseargline fail inside footnotes because the tokens are fixed when
</span><span class="enscript-comment">% the footnote is read.  --karl, 16nov96.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% The start of the footnote looks usually like this:
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\startfootins</span>{<span class="enscript-keyword">\insert</span><span class="enscript-keyword">\footins</span><span class="enscript-keyword">\bgroup</span>}
<span class="enscript-comment">%
</span><span class="enscript-comment">% ... but this macro is redefined inside @multitable.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\gdef</span><span class="enscript-keyword">\dofootnote</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\startfootins</span>
  <span class="enscript-comment">% We want to typeset this text as a normal paragraph, even if the
</span>  <span class="enscript-comment">% footnote reference occurs in (for example) a display environment.
</span>  <span class="enscript-comment">% So reset some parameters.
</span>  <span class="enscript-keyword">\hsize</span>=<span class="enscript-keyword">\pagewidth</span>
  <span class="enscript-keyword">\interlinepenalty</span><span class="enscript-keyword">\interfootnotelinepenalty</span>
  <span class="enscript-keyword">\splittopskip</span><span class="enscript-keyword">\ht</span><span class="enscript-keyword">\strutbox</span> <span class="enscript-comment">% top baseline for broken footnotes
</span>  <span class="enscript-keyword">\splitmaxdepth</span><span class="enscript-keyword">\dp</span><span class="enscript-keyword">\strutbox</span>
  <span class="enscript-keyword">\floatingpenalty</span><span class="enscript-keyword">\@</span>MM
  <span class="enscript-keyword">\leftskip</span><span class="enscript-keyword">\z</span>@skip
  <span class="enscript-keyword">\rightskip</span><span class="enscript-keyword">\z</span>@skip
  <span class="enscript-keyword">\spaceskip</span><span class="enscript-keyword">\z</span>@skip
  <span class="enscript-keyword">\xspaceskip</span><span class="enscript-keyword">\z</span>@skip
  <span class="enscript-keyword">\parindent</span><span class="enscript-keyword">\defaultparindent</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\smallfonts</span> <span class="enscript-keyword">\rm</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Because we use hanging indentation in footnotes, a @noindent appears
</span>  <span class="enscript-comment">% to exdent this text, so make it be a no-op.  makeinfo does not use
</span>  <span class="enscript-comment">% hanging indentation so @noindent can still be needed within footnote
</span>  <span class="enscript-comment">% text after an @example or the like (not that this is good style).
</span>  <span class="enscript-keyword">\let</span><span class="enscript-keyword">\noindent</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Hang the footnote text off the number.  Use \everypar in case the
</span>  <span class="enscript-comment">% footnote extends for more than one paragraph.
</span>  <span class="enscript-keyword">\everypar</span> = {<span class="enscript-keyword">\hang</span>}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\textindent</span>{<span class="enscript-keyword">\thisfootno</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Don't crash into the line above the footnote text.  Since this
</span>  <span class="enscript-comment">% expands into a box, it must come within the paragraph, lest it
</span>  <span class="enscript-comment">% provide a place where TeX can split the footnote.
</span>  <span class="enscript-keyword">\footstrut</span>
  <span class="enscript-keyword">\futurelet</span><span class="enscript-keyword">\next</span><span class="enscript-keyword">\fo</span>@t
}
}<span class="enscript-comment">%end \catcode `\@=11
</span>
<span class="enscript-comment">% @| inserts a changebar to the left of the current line.  It should
</span><span class="enscript-comment">% surround any changed text.  This approach does *not* work if the
</span><span class="enscript-comment">% change spans more than two lines of output.  To handle that, we would
</span><span class="enscript-comment">% have adopt a much more difficult approach (putting marks into the main
</span><span class="enscript-comment">% vertical list for the beginning and end of each change).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\|</span>{<span class="enscript-comment">%
</span>  <span class="enscript-comment">% \vadjust can only be used in horizontal mode.
</span>  <span class="enscript-keyword">\leavevmode</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Append this vertical mode material after the current line in the output.
</span>  <span class="enscript-keyword">\vadjust</span>{<span class="enscript-comment">%
</span>    <span class="enscript-comment">% We want to insert a rule with the height and depth of the current
</span>    <span class="enscript-comment">% leading; that is exactly what \strutbox is supposed to record.
</span>    <span class="enscript-keyword">\vskip</span>-<span class="enscript-keyword">\baselineskip</span>
    <span class="enscript-comment">%
</span>    <span class="enscript-comment">% \vadjust-items are inserted at the left edge of the type.  So
</span>    <span class="enscript-comment">% the \llap here moves out into the left-hand margin.
</span>    <span class="enscript-keyword">\llap</span>{<span class="enscript-comment">%
</span>      <span class="enscript-comment">%
</span>      <span class="enscript-comment">% For a thicker or thinner bar, change the `1pt'.
</span>      <span class="enscript-keyword">\vrule</span> height<span class="enscript-keyword">\baselineskip</span> width1pt
      <span class="enscript-comment">%
</span>      <span class="enscript-comment">% This is the space between the bar and the text.
</span>      <span class="enscript-keyword">\hskip</span> 12pt
    }<span class="enscript-comment">%
</span>  }<span class="enscript-comment">%
</span>}

<span class="enscript-comment">% For a final copy, take out the rectangles
</span><span class="enscript-comment">% that mark overfull boxes (in case you have decided
</span><span class="enscript-comment">% that the text looks ok even though it passes the margin).
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\finalout</span>{<span class="enscript-keyword">\overfullrule</span>=0pt}

<span class="enscript-comment">% @image.  We use the macros from epsf.tex to support this.
</span><span class="enscript-comment">% If epsf.tex is not installed and @image is used, we complain.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% Check for and read epsf.tex up front.  If we read it only at @image
</span><span class="enscript-comment">% time, we might be inside a group, and then its definitions would get
</span><span class="enscript-comment">% undone and the next image would fail.
</span><span class="enscript-keyword">\openin</span> 1 = epsf.tex
<span class="enscript-keyword">\ifeof</span> 1 <span class="enscript-keyword">\else</span>
  <span class="enscript-keyword">\closein</span> 1
  <span class="enscript-comment">% Do not bother showing banner with epsf.tex v2.7k (available in
</span>  <span class="enscript-comment">% doc/epsf.tex and on ctan).
</span>  <span class="enscript-keyword">\def</span><span class="enscript-keyword">\epsfannounce</span>{<span class="enscript-keyword">\toks</span>0 = }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\input</span> epsf.tex
<span class="enscript-keyword">\fi</span>
<span class="enscript-comment">%
</span><span class="enscript-comment">% We will only complain once about lack of epsf.tex.
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifwarnednoepsf</span>
<span class="enscript-keyword">\newhelp</span><span class="enscript-keyword">\noepsfhelp</span>{epsf.tex must be installed for images to
  work.  It is also included in the Texinfo distribution, or you can get
  it from <a href="ftp://tug.org/tex/epsf.tex.">ftp://tug.org/tex/epsf.tex.</a>}
<span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\image</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\epsfbox</span><span class="enscript-keyword">\undefined</span>
    <span class="enscript-keyword">\ifwarnednoepsf</span> <span class="enscript-keyword">\else</span>
      <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\noepsfhelp</span>
      <span class="enscript-keyword">\errmessage</span>{epsf.tex not found, images will be ignored}<span class="enscript-comment">%
</span>      <span class="enscript-keyword">\global</span><span class="enscript-keyword">\warnednoepsftrue</span>
    <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\imagexxx</span> #1,,,,,<span class="enscript-keyword">\finish</span>
  <span class="enscript-keyword">\fi</span>
}
<span class="enscript-comment">%
</span><span class="enscript-comment">% Arguments to @image:
</span><span class="enscript-comment">% #1 is (mandatory) image filename; we tack on .eps extension.
</span><span class="enscript-comment">% #2 is (optional) width, #3 is (optional) height.
</span><span class="enscript-comment">% #4 is (ignored optional) html alt text.
</span><span class="enscript-comment">% #5 is (ignored optional) extension.
</span><span class="enscript-comment">% #6 is just the usual extra ignored arg for parsing this stuff.
</span><span class="enscript-keyword">\newif</span><span class="enscript-keyword">\ifimagevmode</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\imagexxx</span>#1,#2,#3,#4,#5,#6<span class="enscript-keyword">\finish</span>{<span class="enscript-keyword">\begingroup</span>
  <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>^M = 5     <span class="enscript-comment">% in case we're inside an example
</span>  <span class="enscript-keyword">\normalturnoffactive</span>  <span class="enscript-comment">% allow _ et al. in names
</span>  <span class="enscript-comment">% If the image is by itself, center it.
</span>  <span class="enscript-keyword">\ifvmode</span>
    <span class="enscript-keyword">\imagevmodetrue</span>
    <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\bigskip</span>
    <span class="enscript-comment">% Usually we'll have text after the image which will insert
</span>    <span class="enscript-comment">% \parskip glue, so insert it here too to equalize the space
</span>    <span class="enscript-comment">% above and below. 
</span>    <span class="enscript-keyword">\nobreak</span><span class="enscript-keyword">\vskip</span><span class="enscript-keyword">\parskip</span>
    <span class="enscript-keyword">\nobreak</span>
    <span class="enscript-keyword">\line</span><span class="enscript-keyword">\bgroup</span><span class="enscript-keyword">\hss</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Output the image.
</span>  <span class="enscript-keyword">\ifpdf</span>
    <span class="enscript-keyword">\dopdfimage</span>{#1}{#2}{#3}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-comment">% \epsfbox itself resets \epsf?size at each figure.
</span>    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt <span class="enscript-keyword">\epsfxsize</span>=#2<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #3}<span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt <span class="enscript-keyword">\epsfysize</span>=#3<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\fi</span>
    <span class="enscript-keyword">\epsfbox</span>{#1.eps}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifimagevmode</span> <span class="enscript-keyword">\hss</span> <span class="enscript-keyword">\egroup</span> <span class="enscript-keyword">\bigbreak</span> <span class="enscript-keyword">\fi</span>  <span class="enscript-comment">% space after the image
</span><span class="enscript-keyword">\endgroup</span>}


<span class="enscript-keyword">\message</span>{localization,}
<span class="enscript-comment">% and i18n.
</span>
<span class="enscript-comment">% @documentlanguage is usually given very early, just after
</span><span class="enscript-comment">% @setfilename.  If done too late, it may not override everything
</span><span class="enscript-comment">% properly.  Single argument is the language abbreviation.
</span><span class="enscript-comment">% It would be nice if we could set up a hyphenation file here.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\documentlanguage</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\dodocumentlanguage</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\dodocumentlanguage</span>#1{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tex</span> <span class="enscript-comment">% read txi-??.tex file in plain TeX.
</span>  <span class="enscript-comment">% Read the file if it exists.
</span>  <span class="enscript-keyword">\openin</span> 1 txi-#1.tex
  <span class="enscript-keyword">\ifeof</span>1
    <span class="enscript-keyword">\errhelp</span> = <span class="enscript-keyword">\nolanghelp</span>
    <span class="enscript-keyword">\errmessage</span>{Cannot read language file txi-#1.tex}<span class="enscript-comment">%
</span>    <span class="enscript-keyword">\let</span><span class="enscript-keyword">\temp</span> = <span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\temp</span>{<span class="enscript-keyword">\input</span> txi-#1.tex }<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\temp</span>
  <span class="enscript-keyword">\endgroup</span>
}
<span class="enscript-keyword">\newhelp</span><span class="enscript-keyword">\nolanghelp</span>{The given language definition file cannot be found or
is empty.  Maybe you need to install it?  In the current directory
should work if nowhere else does.}


<span class="enscript-comment">% @documentencoding should change something in TeX eventually, most
</span><span class="enscript-comment">% likely, but for now just recognize it.
</span><span class="enscript-keyword">\let</span><span class="enscript-keyword">\documentencoding</span> = <span class="enscript-keyword">\comment</span>


<span class="enscript-comment">% Page size parameters.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\newdimen</span><span class="enscript-keyword">\defaultparindent</span> <span class="enscript-keyword">\defaultparindent</span> = 15pt

<span class="enscript-keyword">\chapheadingskip</span> = 15pt plus 4pt minus 2pt
<span class="enscript-keyword">\secheadingskip</span> = 12pt plus 3pt minus 2pt
<span class="enscript-keyword">\subsecheadingskip</span> = 9pt plus 2pt minus 2pt

<span class="enscript-comment">% Prevent underfull vbox error messages.
</span><span class="enscript-keyword">\vbadness</span> = 10000

<span class="enscript-comment">% Don't be so finicky about underfull hboxes, either.
</span><span class="enscript-keyword">\hbadness</span> = 2000

<span class="enscript-comment">% Following George Bush, just get rid of widows and orphans.
</span><span class="enscript-keyword">\widowpenalty</span>=10000
<span class="enscript-keyword">\clubpenalty</span>=10000

<span class="enscript-comment">% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
</span><span class="enscript-comment">% using an old version of TeX, don't do anything.  We want the amount of
</span><span class="enscript-comment">% stretch added to depend on the line length, hence the dependence on
</span><span class="enscript-comment">% \hsize.  We call this whenever the paper size is set.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\setemergencystretch</span>{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifx</span><span class="enscript-keyword">\emergencystretch</span><span class="enscript-keyword">\thisisundefined</span>
    <span class="enscript-comment">% Allow us to assign to \emergencystretch anyway.
</span>    <span class="enscript-keyword">\def</span><span class="enscript-keyword">\emergencystretch</span>{<span class="enscript-keyword">\dimen</span>0}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\else</span>
    <span class="enscript-keyword">\emergencystretch</span> = .15<span class="enscript-keyword">\hsize</span>
  <span class="enscript-keyword">\fi</span>
}

<span class="enscript-comment">% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
</span><span class="enscript-comment">% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
</span><span class="enscript-comment">% physical page width.
</span><span class="enscript-comment">% 
</span><span class="enscript-comment">% We also call \setleading{\textleading}, so the caller should define
</span><span class="enscript-comment">% \textleading.  The caller should also set \parskip.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\internalpagesizes</span>#1#2#3#4#5#6#7#8{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\voffset</span> = #3<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\topskip</span> = #6<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\splittopskip</span> = <span class="enscript-keyword">\topskip</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\vsize</span> = #1<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\vsize</span> by <span class="enscript-keyword">\topskip</span>
  <span class="enscript-keyword">\outervsize</span> = <span class="enscript-keyword">\vsize</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\outervsize</span> by 2<span class="enscript-keyword">\topandbottommargin</span>
  <span class="enscript-keyword">\pageheight</span> = <span class="enscript-keyword">\vsize</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\hsize</span> = #2<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\outerhsize</span> = <span class="enscript-keyword">\hsize</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\outerhsize</span> by 0.5in
  <span class="enscript-keyword">\pagewidth</span> = <span class="enscript-keyword">\hsize</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\normaloffset</span> = #4<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\bindingoffset</span> = #5<span class="enscript-keyword">\relax</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\ifpdf</span>
    <span class="enscript-keyword">\pdfpageheight</span> #7<span class="enscript-keyword">\relax</span>
    <span class="enscript-keyword">\pdfpagewidth</span> #8<span class="enscript-keyword">\relax</span>
  <span class="enscript-keyword">\fi</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setleading</span>{<span class="enscript-keyword">\textleading</span>}
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parindent</span> = <span class="enscript-keyword">\defaultparindent</span>
  <span class="enscript-keyword">\setemergencystretch</span>
}

<span class="enscript-comment">% @letterpaper (the default).
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\letterpaper</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\parskip</span> = 3pt plus 2pt minus 1pt
  <span class="enscript-keyword">\textleading</span> = 13.2pt
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% If page is nothing but text, make it come out even.
</span>  <span class="enscript-keyword">\internalpagesizes</span>{46<span class="enscript-keyword">\baselineskip</span>}{6in}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{.25in}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{36pt}<span class="enscript-comment">%
</span>                    {11in}{8.5in}<span class="enscript-comment">%
</span>}}

<span class="enscript-comment">% Use @smallbook to reset parameters for 7x9.5 (or so) format.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\smallbook</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\parskip</span> = 2pt plus 1pt
  <span class="enscript-keyword">\textleading</span> = 12pt
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\internalpagesizes</span>{7.5in}{5in}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{.25in}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{16pt}<span class="enscript-comment">%
</span>                    {9.25in}{7in}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\lispnarrowing</span> = 0.3in
  <span class="enscript-keyword">\tolerance</span> = 700
  <span class="enscript-keyword">\hfuzz</span> = 1pt
  <span class="enscript-keyword">\contentsrightmargin</span> = 0pt
  <span class="enscript-keyword">\defbodyindent</span> = .5cm
}}

<span class="enscript-comment">% Use @afourpaper to print on European A4 paper.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\afourpaper</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\parskip</span> = 3pt plus 2pt minus 1pt
  <span class="enscript-keyword">\textleading</span> = 13.2pt
  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Double-side printing via postscript on Laserjet 4050 
</span>  <span class="enscript-comment">% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
</span>  <span class="enscript-comment">% To change the settings for a different printer or situation, adjust
</span>  <span class="enscript-comment">% \normaloffset until the front-side and back-side texts align.  Then
</span>  <span class="enscript-comment">% do the same for \bindingoffset.  You can set these for testing in
</span>  <span class="enscript-comment">% your texinfo source file like this:
</span>  <span class="enscript-comment">% @tex
</span>  <span class="enscript-comment">% \global\normaloffset = -6mm
</span>  <span class="enscript-comment">% \global\bindingoffset = 10mm
</span>  <span class="enscript-comment">% @end tex
</span>  <span class="enscript-keyword">\internalpagesizes</span>{51<span class="enscript-keyword">\baselineskip</span>}{160mm}
                    {<span class="enscript-keyword">\voffset</span>}{<span class="enscript-keyword">\hoffset</span>}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{44pt}<span class="enscript-comment">%
</span>                    {297mm}{210mm}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\tolerance</span> = 700
  <span class="enscript-keyword">\hfuzz</span> = 1pt
  <span class="enscript-keyword">\contentsrightmargin</span> = 0pt
  <span class="enscript-keyword">\defbodyindent</span> = 5mm
}}

<span class="enscript-comment">% Use @afivepaper to print on European A5 paper.
</span><span class="enscript-comment">% From <a href="mailto:romildo@urano.iceb.ufop.br">romildo@urano.iceb.ufop.br</a>, 2 July 2000.
</span><span class="enscript-comment">% He also recommends making @example and @lisp be small.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\afivepaper</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\parskip</span> = 2pt plus 1pt minus 0.1pt
  <span class="enscript-keyword">\textleading</span> = 12.5pt
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\internalpagesizes</span>{160mm}{120mm}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{<span class="enscript-keyword">\hoffset</span>}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{8pt}<span class="enscript-comment">%
</span>                    {210mm}{148mm}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\lispnarrowing</span> = 0.2in
  <span class="enscript-keyword">\tolerance</span> = 800
  <span class="enscript-keyword">\hfuzz</span> = 1.2pt
  <span class="enscript-keyword">\contentsrightmargin</span> = 0pt
  <span class="enscript-keyword">\defbodyindent</span> = 2mm
  <span class="enscript-keyword">\tableindent</span> = 12mm
}}

<span class="enscript-comment">% A specific text layout, 24x15cm overall, intended for A4 paper.  
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\afourlatex</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\afourpaper</span>
  <span class="enscript-keyword">\internalpagesizes</span>{237mm}{150mm}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{4.6mm}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{7mm}<span class="enscript-comment">%
</span>                    {297mm}{210mm}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-comment">% Must explicitly reset to 0 because we call \afourpaper.
</span>  <span class="enscript-keyword">\globaldefs</span> = 0
}}

<span class="enscript-comment">% Use @afourwide to print on A4 paper in landscape format.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\afourwide</span>{{<span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-keyword">\afourpaper</span>
  <span class="enscript-keyword">\internalpagesizes</span>{241mm}{165mm}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{-2.95mm}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{7mm}<span class="enscript-comment">%
</span>                    {297mm}{210mm}<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\globaldefs</span> = 0
}}

<span class="enscript-comment">% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
</span><span class="enscript-comment">% Perhaps we should allow setting the margins, \topskip, \parskip,
</span><span class="enscript-comment">% and/or leading, also. Or perhaps we should compute them somehow.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\pagesizes</span>{<span class="enscript-keyword">\parsearg</span><span class="enscript-keyword">\pagesizesxxx</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\pagesizesxxx</span>#1{<span class="enscript-keyword">\pagesizesyyy</span> #1,,<span class="enscript-keyword">\finish</span>}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\pagesizesyyy</span>#1,#2,#3<span class="enscript-keyword">\finish</span>{{<span class="enscript-comment">%
</span>  <span class="enscript-keyword">\setbox</span>0 = <span class="enscript-keyword">\hbox</span>{<span class="enscript-keyword">\ignorespaces</span> #2}<span class="enscript-keyword">\ifdim</span><span class="enscript-keyword">\wd</span>0 &gt; 0pt <span class="enscript-keyword">\hsize</span>=#2<span class="enscript-keyword">\relax</span> <span class="enscript-keyword">\fi</span>
  <span class="enscript-keyword">\globaldefs</span> = 1
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\parskip</span> = 3pt plus 2pt minus 1pt
  <span class="enscript-keyword">\setleading</span>{<span class="enscript-keyword">\textleading</span>}<span class="enscript-comment">%
</span>  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dimen</span>0 = #1
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>0 by <span class="enscript-keyword">\voffset</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\dimen</span>2 = <span class="enscript-keyword">\hsize</span>
  <span class="enscript-keyword">\advance</span><span class="enscript-keyword">\dimen</span>2 by <span class="enscript-keyword">\normaloffset</span>
  <span class="enscript-comment">%
</span>  <span class="enscript-keyword">\internalpagesizes</span>{#1}{<span class="enscript-keyword">\hsize</span>}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\voffset</span>}{<span class="enscript-keyword">\normaloffset</span>}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\bindingoffset</span>}{44pt}<span class="enscript-comment">%
</span>                    {<span class="enscript-keyword">\dimen</span>0}{<span class="enscript-keyword">\dimen</span>2}<span class="enscript-comment">%
</span>}}

<span class="enscript-comment">% Set default to letter.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\letterpaper</span>


<span class="enscript-keyword">\message</span>{and turning on texinfo input format.}

<span class="enscript-comment">% Define macros to output various characters with catcode for normal text.
</span><span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&quot;</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\$</span>=<span class="enscript-keyword">\other</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normaldoublequote</span>{&quot;}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normaltilde</span>{~}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalcaret</span>{^}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalunderscore</span>{_}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalverticalbar</span>{|}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalless</span>{&lt;}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalgreater</span>{&gt;}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalplus</span>{+}
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\normaldollar</span>{<span class="enscript-variable-name">$}%$</span> font-lock fix

<span class="enscript-comment">% This macro is used to make a character print one way in ttfont
</span><span class="enscript-comment">% where it can probably just be output, and another way in other fonts,
</span><span class="enscript-comment">% where something hairier probably needs to be done.
</span><span class="enscript-comment">%
</span><span class="enscript-comment">% #1 is what to print if we are indeed using \tt; #2 is what to print
</span><span class="enscript-comment">% otherwise.  Since all the Computer Modern typewriter fonts have zero
</span><span class="enscript-comment">% interword stretch (and shrink), and it is reasonable to expect all
</span><span class="enscript-comment">% typewriter fonts to have this, we can check that font parameter.
</span><span class="enscript-comment">%
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifusingtt</span>#1#2{<span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\fontdimen</span>3<span class="enscript-keyword">\font</span>=0pt #1<span class="enscript-keyword">\else</span> #2<span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% Same as above, but check for italic font.  Actually this also catches
</span><span class="enscript-comment">% non-italic slanted fonts since it is impossible to distinguish them from
</span><span class="enscript-comment">% italic fonts.  But since this is only used by $ and it uses \sl anyway
</span><span class="enscript-comment">% this is not a problem.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\ifusingit</span>#1#2{<span class="enscript-keyword">\ifdim</span> <span class="enscript-keyword">\fontdimen</span>1<span class="enscript-keyword">\font</span>&gt;0pt #1<span class="enscript-keyword">\else</span> #2<span class="enscript-keyword">\fi</span>}

<span class="enscript-comment">% Turn off all special characters except @
</span><span class="enscript-comment">% (and those which the user can use as if they were ordinary).
</span><span class="enscript-comment">% Most of these we simply print from the \tt font, but for some, we can
</span><span class="enscript-comment">% use math or other variants that look better in normal text.
</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&quot;</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span><span class="enscript-keyword">\activedoublequote</span>{{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>34}}
<span class="enscript-keyword">\let</span>&quot;=<span class="enscript-keyword">\activedoublequote</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\~</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>~{{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>126}}
<span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\hat</span>=`<span class="enscript-keyword">\^</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\^</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>^{{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\hat</span>}}

<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>_{<span class="enscript-keyword">\ifusingtt</span><span class="enscript-keyword">\normalunderscore</span><span class="enscript-keyword">\_</span>}
<span class="enscript-comment">% Subroutine for the previous macro.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\_</span>{<span class="enscript-keyword">\leavevmode</span> <span class="enscript-keyword">\kern</span>.07em <span class="enscript-keyword">\vbox</span>{<span class="enscript-keyword">\hrule</span> width.3em height.1ex}<span class="enscript-keyword">\kern</span> .07em }

<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\|</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>|{{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\char</span>124}}
<span class="enscript-keyword">\chardef</span> <span class="enscript-keyword">\less</span>=`<span class="enscript-keyword">\&lt;</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&lt;</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>&lt;{{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\less</span>}}
<span class="enscript-keyword">\chardef</span> <span class="enscript-keyword">\gtr</span>=`<span class="enscript-keyword">\&gt;</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\&gt;</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>&gt;{{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\gtr</span>}}
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\+</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span>+{{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\char</span> 43}}
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\$</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\def</span><span class="enscript-variable-name">${\ifusingit{{\sl\$</span>}}<span class="enscript-keyword">\normaldollar</span>}<span class="enscript-comment">%$ font-lock fix
</span>
<span class="enscript-comment">% Set up an active definition for =, but don't enable it most of the time.
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\=</span>=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\global</span><span class="enscript-keyword">\def</span>={{<span class="enscript-keyword">\tt</span> <span class="enscript-keyword">\char</span> 61}}}

<span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\active</span>
<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\active</span>

<span class="enscript-comment">% If a .fmt file is being used, characters that might appear in a file
</span><span class="enscript-comment">% name cannot be active until we have parsed the command line.
</span><span class="enscript-comment">% So turn them off again, and have \everyjob (or @setfilename) turn them on.
</span><span class="enscript-comment">% \otherifyactive is called near the end of this file.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\otherifyactive</span>{<span class="enscript-keyword">\catcode</span>`+=<span class="enscript-keyword">\other</span> <span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\_</span>=<span class="enscript-keyword">\other</span>}

<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\@</span>=0

<span class="enscript-comment">% \rawbackslashxx outputs one backslash character in current font,
</span><span class="enscript-comment">% as in \char`\\.
</span><span class="enscript-keyword">\global</span><span class="enscript-keyword">\chardef</span><span class="enscript-keyword">\rawbackslashxx</span>=`<span class="enscript-keyword">\\</span>

<span class="enscript-comment">% \rawbackslash defines an active \ to do \rawbackslashxx.
</span><span class="enscript-comment">% \otherbackslash defines an active \ to be a literal `\' character with
</span><span class="enscript-comment">% catcode other.
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\active</span>
 @gdef@rawbackslash{@let<span class="enscript-keyword">\=</span>@rawbackslashxx}
 @gdef@otherbackslash{@let<span class="enscript-keyword">\=</span>@realbackslash}
}

<span class="enscript-comment">% \realbackslash is an actual character `\' with catcode other.
</span>{<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\other</span> @gdef@realbackslash{<span class="enscript-keyword">\}</span>}

<span class="enscript-comment">% \normalbackslash outputs one backslash in fixed width font.
</span><span class="enscript-keyword">\def</span><span class="enscript-keyword">\normalbackslash</span>{{<span class="enscript-keyword">\tt</span><span class="enscript-keyword">\rawbackslashxx</span>}}

<span class="enscript-keyword">\catcode</span>`<span class="enscript-keyword">\\</span>=<span class="enscript-keyword">\active</span>

<span class="enscript-comment">% Used sometimes to turn off (effectively) the active characters
</span><span class="enscript-comment">% even after parsing them.
</span>@def@turnoffactive{<span class="enscript-comment">%
</span>  @let&quot;=@normaldoublequote
  @let<span class="enscript-keyword">\=</span>@realbackslash
  @let~=@normaltilde
  @let^=@normalcaret
  @let_=@normalunderscore
  @let|=@normalverticalbar
  @let&lt;=@normalless
  @let&gt;=@normalgreater
  @let+=@normalplus
  @let<span class="enscript-variable-name">$=@normaldollar %$</span> font-lock fix
}

<span class="enscript-comment">% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
</span><span class="enscript-comment">% the literal character `\'.  (Thus, \ is not expandable when this is in
</span><span class="enscript-comment">% effect.)
</span><span class="enscript-comment">% 
</span>@def@normalturnoffactive{@turnoffactive @let<span class="enscript-keyword">\=</span>@normalbackslash}

<span class="enscript-comment">% Make _ and + \other characters, temporarily.
</span><span class="enscript-comment">% This is canceled by @fixbackslash.
</span>@otherifyactive

<span class="enscript-comment">% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
</span><span class="enscript-comment">% That is what \eatinput is for; after that, the `\' should revert to printing
</span><span class="enscript-comment">% a backslash.
</span><span class="enscript-comment">%
</span>@gdef@eatinput input texinfo{@fixbackslash}
@global@let<span class="enscript-keyword">\ </span>= @eatinput

<span class="enscript-comment">% On the other hand, perhaps the file did not have a `\input texinfo'. Then
</span><span class="enscript-comment">% the first `\{ in the file would cause an error. This macro tries to fix
</span><span class="enscript-comment">% that, assuming it is called before the first `\' could plausibly occur.
</span><span class="enscript-comment">% Also back turn on active characters that might appear in the input
</span><span class="enscript-comment">% file name, in case not using a pre-dumped format.
</span><span class="enscript-comment">%
</span>@gdef@fixbackslash{<span class="enscript-comment">%
</span>  @ifx<span class="enscript-keyword">\@</span>eatinput @let<span class="enscript-keyword">\ </span>= @normalbackslash @fi
  @catcode`+=@active
  @catcode`@_=@active
}

<span class="enscript-comment">% Say @foo, not \foo, in error messages.
</span>@escapechar = `@@

<span class="enscript-comment">% These look ok in all fonts, so just make them not special.  
</span>@catcode`@&amp; = @other
@catcode`@# = @other
@catcode`@<span class="enscript-comment">% = @other
</span>
@c Set initial fonts.
@textfonts
@rm


@c Local variables:
@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: &quot;^<span class="enscript-keyword">\\</span><span class="enscript-keyword">\\</span>message&quot;
@c time-stamp-start: &quot;def<span class="enscript-keyword">\\</span><span class="enscript-keyword">\\</span>texinfoversion{&quot;
@c time-stamp-format: &quot;<span class="enscript-comment">%:y-%02m-%02d.%02H&quot;
</span>@c time-stamp-end: &quot;}&quot;
@c End:
</pre>
<hr />
</body></html>