<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% -*- coding: utf-8 -*-
% This is part of the book TeX for the Impatient.
% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry.
% See file fdl.tex for copying conditions.

\input macros
%\chapter{A compendium \linebreak of useful macros}
\chapter{ĺ®žç”¨ĺ®Źé›†ć¦‚čż°}

\chapterdef{eplain}

%This section describes |eplain.tex|, a collection of macros and other
%definitions that extend  plain \TeX.
%\bix^^|eplain.tex|
%The descriptions of the various macros explain their purposes,
%but usually do not explain how they
%work or provide explicit details on
%how to use them.  That information is contained in the source files for
%|eplain.tex| and in the documentation that comes with it.
%See \headcit{Resources}{resources} for how to obtain |eplain.tex|.
čż™ä¸€ç«&nbsp;ćŹŹčż° |eplain.tex|ďĽŚä¸€ç»„ç”¨äşŽć‰©ĺ±• plain \TeX\ çš„ĺ®Źĺ’Śĺ…¶ä»–ĺ®šäą‰ă€‚
\bix^^|eplain.tex|
ĺŻąĺ„ç§Ťĺ®Źçš„ćŹŹčż°č§Łé‡Šäş†ĺ®ä»¬çš„ç›®çš„ďĽŚä˝†é€šĺ¸¸ä¸Ťč§Łé‡Šĺ®ä»¬çš„ĺ·Ąä˝śĺŽźç†ć–ç»™ĺ‡şĺ¦‚ä˝•ä˝żç”¨ĺ®ä»¬çš„čŻ¦ć…ă€‚
é‚Łäş›äżˇćŻĺŚ…ĺ«ĺś¨ |eplain.tex| ćşç&nbsp;ć–‡ä»¶ä»ĄĺŹŠĺ®çš„ć–‡ćˇŁä¸­ă€‚
ĺś¨\headcit{čµ„ćş}{resources}ä¸­ä»‹ç»Ťäş†čŽ·ĺŹ– |eplain.tex| çš„ć–ąćł•ă€‚


%\section{Preliminaries}
\section{é˘„ĺ¤‡ĺ®šäą‰}

%We start with some macros for changing category codes and convenient
%definitions for two of the commonly used ones.
%^^{category codes//useful definitions for}
ć‘ä»¬ĺ…ä»‹ç»Ťĺ‡&nbsp;ä¸Şäż®ć”ąç±»ĺ«ç&nbsp;ĺŹŠĺ®šäą‰ä¸¤ç§Ťĺ¸¸ç”¨ç±»ĺ«ç&nbsp;çš„ĺ®Źă€‚
^^{ç±»ĺ«ç&nbsp;//ćś‰ç”¨çš„ç±»ĺ«ç&nbsp;ĺ®šäą‰}

%\pix^^|\makeactive|
%\pix^^|\letter|
%\pix^^|\other|
%\pix^^|\uncatcodespecials|
\pix^^|\makeactive|
\pix^^|\letter|
\pix^^|\other|
\pix^^|\uncatcodespecials|

\csdisplay
\def\makeactive#1{\catcode`#1 = \active \ignorespaces}%
\chardef\letter = 11 \chardef\other = 12
\def\uncatcodespecials{%
   \def\do##1{\catcode`##1 = \other}%
   \dospecials}% Defined in plain.
|

%In order to define `|^^M|' as an active character, you need to encase
%the definition in a group and invoke some extra machinery.
%\ttidxref{^^M}
%The \pix^|\letreturn| macro lets you define `|^^M|' without that
%extra machinery (which you can see in the definition below).
ä¸şäş†ĺ°† `|^^M|' ĺ®šäą‰ä¸şć´»ĺŠ¨ĺ­—ç¬¦ďĽŚä˝&nbsp;éś€č¦ĺ°†ĺ®šäą‰ć”ľĺś¨çĽ–ç»„ä¸­ďĽŚĺą¶ĺ€źĺŠ©ćźäş›é˘ťĺ¤–ćśşĺ¶ă€‚
\ttidxref{^^M}
\pix^|\letreturn| ĺ®Źč®©ä˝&nbsp;ć—&nbsp;éś€é˘ťĺ¤–ćśşĺ¶ĺ°±ĺŹŻä»Ąĺ®šäą‰ `|^^M|'ďĽĺ®çš„ĺ®šäą‰ĺś¨ä¸‹éť˘ĺŹŻä»Ąçś‹ĺ°ďĽ‰ă€‚

\csdisplay
{\makeactive\^^M \long\gdef\letreturn#1{\let^^M = #1}}%
|

%These macros consume one, two, or three arguments.
čż™äş›ĺ®Źç”¨äşŽĺ¸ć”¶ä¸€ä¸Şă€ä¸¤ä¸Şć–ä¸‰ä¸ŞĺŹ‚é‡Źă€‚

%\pix^^|\gobble|
%\pix^^|\gobbletwo|
%\pix^^|\gobblethree|
%\csdisplay
%\def\gobble#1{}\def\gobbletwo#1#2{}%
%\def\gobblethree#1#2#3{}%
%|
\pix^^|\gobble|
\pix^^|\gobbletwo|
\pix^^|\gobblethree|
\csdisplay
\def\gobble#1{}\def\gobbletwo#1#2{}%
\def\gobblethree#1#2#3{}%
|

%Now we establish some conventions for reading the rest of the file.
%Within the file we allow ``private'' control sequences that contain
%`|@|' in their names.
%These control sequences aren't accessible outside of this file (unless
%you change the category code of `|@|' again).
%\xrdef{eplainconv}
çŽ°ĺś¨ć‘ä»¬ĺ»şç«‹ä¸€äş›ćŻäľ‹ďĽŚç”¨äşŽčŻ»ĺŹ–čż™ä¸Şć–‡ä»¶çš„ĺ…¶ä»–é¨ĺ†ă€‚
ĺś¨čż™ä¸Şć–‡ä»¶ä¸­ć‘ä»¬ĺ…č®¸ĺŤç§°ĺ¸¦ćś‰ `|@|' çš„``ç§ćś‰''ćŽ§ĺ¶ĺşŹĺ—ă€‚
čż™äş›ćŽ§ĺ¶ĺşŹĺ—ĺś¨čż™ä¸Şć–‡ä»¶äą‹ĺ¤–ć—&nbsp;ćł•ä˝żç”¨ďĽé™¤éťžä˝&nbsp;ĺ†Ťć¬ˇäż®ć”ą `|@|' çš„ç±»ĺ«ç&nbsp;ďĽ‰ă€‚
\xrdef{eplainconv}

\csdisplay
\catcode`@ = \letter    % Allow control sequences with @.
\let\@plainwlog = \wlog % Don't log register allocations.
\let\wlog = \gobble
\newlinechar = `^^J
|

%The next two macros provide convenient forms of diagnostic output.
%\pix^|\loggingall|  turns on all tracing, but causes the trace
%output to appear only in the log file and not at your terminal.
%\pix^|\tracingboxes| causes boxes to be displayed completely when
%they're traced.  (\TeX\ normally shows only three levels of boxing
%and five items within each box.)
ćŽĄä¸‹ćťĄä¸¤ä¸Şĺ®ŹćŹäľ›äş†čŻŠć–­čľ“ĺ‡şçš„äľżćŤ·ć–ąĺĽŹă€‚
\pix^|\loggingall| ć‰“ĺĽ€ć‰€ćś‰čż˝č¸ŞďĽŚ
ä˝†č®©čż˝č¸Şčľ“ĺ‡şä»…ĺ†™ĺś¨ć—Ąĺż—ć–‡ä»¶ä¸­ďĽŚč€Śä¸Ťĺś¨ç»ç«Żä¸Šćľç¤şă€‚
\pix^|\tracingboxes| ä˝żĺľ—ç›’ĺ­č˘«čż˝č¸Şć—¶ĺ…¶ĺ†…ĺ®ąĺ®Śĺ…¨ćľç¤şă€‚%
ďĽ\TeX\ é€šĺ¸¸ĺŹŞćľç¤şĺµŚĺĄ—ĺ°ä¸‰ĺ±‚çš„ç›’ĺ­ďĽŚćŻŹä¸Şç›’ĺ­ćľç¤şäş”ä¸Şéˇąç›®ă€‚ďĽ‰

\csdisplay
\def\loggingall{\tracingcommands\tw@\tracingstats\tw@
   \tracingpages\@ne\tracingoutput\@ne
   \tracinglostchars\@ne\tracingmacros\tw@
   \tracingparagraphs\@ne\tracingrestores\@ne
   \showboxbreadth\maxdimen\showboxdepth\maxdimen}%
\def\tracingboxes{\showboxbreadth = \maxdimen
   \showboxdepth = \maxdimen}%
|

%The default thickness of rules is $0.4$\pt.
%You can produce rules of any default thickness you choose by redefining
%|\vruledefaultwidth|, |\hruledefaultheight|, and |\hruledefaultdepth|
%and then using
%\pix^^|\ehrule|
%|\eh!-rule|
%and \pix^|\evrule|
%instead of |\hrule| and |\vrule|. (The `e'  stands for
%``eplain''.)
%^^{rules//thickness of}
%If you give an explicit
%dimension (e.g., |\ehrule height 16pt|), \TeX\ will use it.
ć&nbsp;‡çşżçš„é»č®¤ĺŽšĺş¦ä¸ş $0.4$\pt ă€‚
č¦ç”źćé»č®¤ĺŽšĺş¦ä¸şä»»ä˝•ĺ€Ľçš„ć&nbsp;‡çşżďĽŚ
ä˝&nbsp;ĺŹŻä»Ąé‡Ťć–°ĺ®šäą‰ |\vruledefaultwidth|ă€|\hruledefaultheight| ĺŹŠ |\hrule!-defaultdepth|ďĽŚ
ĺą¶ĺ°† |\hrule| ĺ’Ś |\vrule| ćŤ˘ä¸ş \pix^|\ehrule| ĺ’Ś \pix^|\evrule|ă€‚%
ďĽĺŤç§°ä¸­çš„ `e' ä»Łčˇ¨ ``eplain''ă€‚ďĽ‰%
^^{ć&nbsp;‡çşż//ć&nbsp;‡çşżçš„ĺŽšĺş¦}
ĺ¦‚ćžśä˝&nbsp;ćľĺĽŹç»™ĺ‡şĺ°şĺŻ¸ďĽćŻ”ĺ¦‚ |\ehrule height 16pt|ďĽ‰ďĽŚ\TeX\ ĺ°†ä˝żç”¨ĺ®ă€‚

\csdisplay
\newdimen\hruledefaultheight  \hruledefaultheight = 0.4pt
\newdimen\hruledefaultdepth   \hruledefaultdepth = 0.0pt
\newdimen\vruledefaultwidth   \vruledefaultwidth = 0.4pt
\def\ehrule{\hrule height\hruledefaultheight
   depth\hruledefaultdepth}%
\def\evrule{\vrule width\vruledefaultwidth}%
|

%The |\%| convention for writing a `|%|' character doesn't work when you
%want to include that character in the token list of |\write|.
%^^|\write//writing \b\tt\%\e\ with|
%^^|%//writing out|
%You can use ^|\percentchar| to achieve this.
%We also redefine ^|^^L| to be nonouter so that you can use it in a
%macro definition or argument.
|\%| é€šĺ¸¸ç”¨äşŽĺ†™ĺ‡ş `|%|' ĺ­—ç¬¦ďĽŚä˝†ĺ®ć—&nbsp;ćł•ĺŚ…ĺ«ĺś¨ |\write| çš„č®°ĺŹ·ĺ—ä¸­ă€‚
^^|\write//ç”¨ĺ®ĺ†™ĺ‡ş \b\tt\%\e\|
%^^|%//ĺ†™ĺ‡şčŻĄĺ­—ç¬¦|
ä˝&nbsp;ĺŹŻä»Ąç”¨ ^|\percentchar| čľľĺ°ć­¤ç›®çš„ă€‚
ć‘ä»¬čżĺ°† ^|^^L| é‡Ťć–°ĺ®šäą‰ä¸şéťžĺ¤–é¨ĺ®ŹďĽŚĺ›&nbsp;ć­¤ä˝&nbsp;ĺŹŻä»Ąĺś¨ĺ®Źĺ®šäą‰ć–č€…ĺŹ‚é‡Źä¸­ä˝żç”¨ĺ®ă€‚

\csdisplay
{\catcode`\% = \other \gdef\percentchar{%}}%
 \def^^L{\par
}%
|

%\pix^|\tokstostring| converts its argument into a list of ^{character
%tokens}.
%It uses only expansions that are handled in \TeX's gullet.
%This property is necessary
%for it to work with |\edef|.  It is used by the cross-referencing
%macros (\xref{xrefs}).
\pix^|\tokstostring| ĺ°†ĺ®çš„ĺŹ‚é‡Źč˝¬ćŤ˘ä¸şä¸€ĺ—^{ĺ­—ç¬¦č®°ĺŹ·}ă€‚
ĺ®ä»…ç”¨ĺ°ĺś¨ \TeX\ çš„éŁźé“ä¸­ĺ¤„ç†çš„ĺ±•ĺĽ€ă€‚
ć­¤ç‰ąć€§ćŻĺ’Ś |\edef| ä¸€čµ·ä˝żç”¨ć—¶ć‰€ĺż…éś€çš„ă€‚ĺ®ç”¨äşŽĺ®Źçš„äş¤ĺŹ‰ĺĽ•ç”¨ďĽ\xref{xrefs}ďĽ‰ă€‚

%In order to split the argument up at spaces, we have to use two
%subsidiary macros. |\@ttsA| finds the spaces, and |\@ttsB| handles a
%token sequence without any spaces.  Each space is replaced by the
%expansion of \pix^|\spacesub|.
ä¸şäş†ĺ°†ĺŹ‚é‡Źĺś¨ç©şć&nbsp;Ľĺ¤„ĺ†ĺĽ€ďĽŚć‘ä»¬č¦ç”¨ĺ°ä¸¤ä¸Şĺ­ĺ®Źă€‚
|\@ttsA| ç”¨äşŽĺŻ»ć‰ľç©şć&nbsp;ĽďĽŚč€Ś |\@ttsB| ç”¨äşŽĺ¤„ç†ä¸Ťĺ¸¦ç©şć&nbsp;Ľçš„ćŽ§ĺ¶ĺşŹĺ—ă€‚
ćŻŹä¸Şç©şć&nbsp;Ľé˝č˘«ć›żćŤ˘ä¸ş \pix^|\spacesub| çš„ĺ±•ĺĽ€ă€‚

\csdisplay
\def\tokstostring#1{\@ttsA#1 \ttsmarkA}%
\def\@ttsA#1 #2\ttsmarkA{\ifempty{#1}\else
      \@ttsB #1\@ttsmarkB
      \ifempty{#2}\else
         \spacesub\@ttsA#2\ttsmarkA\fi\fi}%
\def\@ttsB#1{\ifx #1\@ttsmarkB\else
      \string #1%
      \expandafter\@ttsB\fi}%
\def\@ttsmarkB{\@ttsmarkB}% should never be expanded
\def\spacesub{+}%
|

%\noindent
%\pix^|\ifempty| tests if its argument is empty.
\noindent
\pix^|\ifempty| ćŁ€ćµ‹ĺ®çš„ĺŹ‚é‡ŹćŻĺ¦ä¸şç©şă€‚

\csdisplay
\def\ifempty#1{\@ifempty #1\@emptymarkA\@emptymarkB}%
\def\@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}%
\def\@emptymarkA{\@emptymarkA}%
|

%The ^|\for|  macro implements a \TeX\ version of the ^{for loop} in
%traditional programming languages.  These macros come directly from
%\LaTeX.
^|\for| ĺ®Źĺ®žçŽ°äş†ĺ…¶ä»–äĽ&nbsp;ç»źçĽ–ç¨‹čŻ­č¨€ä¸­çš„^{forĺľŞçŽŻ}çš„ \TeX\ ç‰ćś¬ă€‚
čż™äş›ĺ®Źç›´ćŽĄĺŹ–č‡Ş \LaTeX ă€‚

\csdisplay
\def\for#1:=#2\do#3{\edef\@fortmp{#2}%
   \ifx\@fortmp\empty \else
      \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}%
\def\@nnil{\@nil}%
\def\@fornoop#1\@@#2#3{}%
\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil
   \else #5\def#4{#2} ifx #4\@nnil \else
      #5\@iforloop #3\@@#4{#5}\fi\fi}%
\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
   \let\@nextwhile=\@fornoop \else #4\relax
      \let\@nextwhile=\@iforloop\fi
         \@nextwhile#2\@@#3{#4}}%
|

%\pix^|\obeywhitespace| is useful for reproducing line breaks, blank lines,
%and spaces in your input. It combines the effects of |\obey!-lines| and
%|\obey!-spaces|,
%^^|\obeylines| ^^|\obeyspaces|
%and also causes spaces at the start of a line to
%be printed. Tab characters are not affected by this; they still produce
%normal glue.
%\xrdef{ewhitesp}
%^^{space characters}
%^^|\fontdimen|
%^^|\font|
%^^|\letreturn|
\pix^|\obeywhitespace| ç”¨äşŽé‡Ťć–°ç”źćä˝&nbsp;çš„čľ“ĺ…Ąä¸­çš„ćŤ˘čˇŚă€ç©şčˇŚĺ’Śç©şć&nbsp;Ľă€‚
ĺ®ç»“ĺäş†|\obey!-lines| ĺ’Ś |\obey!-spaces| çš„ć•ćžśďĽŚ
^^|\obeylines| ^^|\obeyspaces|
ĺą¶ćŠŠčˇŚé¦–çš„ç©şć&nbsp;Ľäąźć‰“ĺŤ°ĺ‡şćťĄă€‚ĺ¶čˇ¨ç¬¦ä¸ŤĺŹ—ĺ®ĺ˝±ĺ“ŤďĽ›ĺ®ä»¬ä»Ťç„¶ç”źćć­Łĺ¸¸çš„ç˛čżžă€‚
\xrdef{ewhitesp}
^^{ç©şć&nbsp;Ľç¬¦}
^^|\fontdimen|
^^|\font|
^^|\letreturn|

\csdisplay
\def\alwaysspace{\hglue\fontdimen2\the\font \relax}%
{\makeactive\^^M \makeactive\ %
\gdef\obeywhitespace{%
\makeactive\^^M\def^^M{\par\indent}%
\aftergroup\@removebox% Kill extra paragraph at end.
\makeactive\ \let =\alwaysspace}}%
\def\@removebox{\setbox0=\lastbox}
|

%\pix^|\frac| is a good way to print fractions in text when you don't
%want to use |\over| and
%``1/2'' just doesn't look right.  This macro is the answer to
%\knuth{Exercise~11.6}.^^{fractions//slashed form}
ĺ˝“ä˝&nbsp;ä¸Ťćłç”¨ |\over|ďĽŚč€Ś ``1/2'' çś‹ćťĄĺŹä¸Ťĺ¤źĺĄ˝ć—¶ďĽŚ
ä˝&nbsp;ćś€ĺĄ˝ç”¨ \pix^|\frac| ĺś¨ć­Łć–‡ä¸­ć‰“ĺŤ°ĺ†ĺĽŹă€‚
čż™ä¸Şĺ®ŹćŻ\knuth{ç»äą&nbsp;~11.6}çš„ç­”ćˇă€‚^^{ĺ†ĺĽŹ//ć–śçşżĺ˝˘ĺĽŹ}

\csdisplay
\def\frac#1/#2{\leavevmode
   \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}%
   \kern-.1em $/$%
   \kern-.15em \lower .25ex \hbox{\the\scriptfont0 #2}}%
|

%The following macros produce logos that are useful in the \TeX\ world.
%The \AMSTeX\ logo is from \knuth{page~420}.  The \LaTeX\ logo is
%slightly modified from the one in |latex.tex| (we use a different font
%for the `A'); similarly, the \BibTeX\ logo uses |\sevenrm| instead of a
%true caps-and-small-caps font. The |.mf| source file for the \MF\ logo
%is given in the \MF\ manual:
%\smallskip
%{\narrower\noindent
%^{Knuth, Donald E.},{\sl The {\logosl METAFONT}book}.
%  Reading, Mass.: Addison-Wesley, 1986.\par}
%\smallskip
%\pix^^|\LaTeX|
%\pix^^|\AMSTeX|
%\pix^^|\BibTeX|
%\pix^^|\MF|
ä¸‹éť˘čż™äş›ĺ®Źç”źć \TeX\ ĺśä¸­ĺ¸¸ç”¨çš„ć&nbsp;‡čŻ†ă€‚
\AMSTeX\ ć&nbsp;‡čŻ†ĺŹ–č‡Ş \knuth{ç¬¬~420~éˇµ}ă€‚
\LaTeX\ ć&nbsp;‡čŻ†ĺŹ–č‡Ş |latex.tex| ĺą¶ç¨Ťä˝śäż®ć”ąďĽć‘ä»¬äż®ć”ąäş† `A' çš„ĺ­—ä˝“ďĽ‰ďĽ›
ç±»äĽĽĺś°ďĽŚ\BibTeX\ ć&nbsp;‡čŻ†ç”¨ |\sevenrm| ĺ­—ä˝“ä»Łć›żçśźć­Łçš„ĺ°Źĺž‹ĺ¤§ĺ†™ĺ­—ä˝“ă€‚
\MF\ ć&nbsp;‡čŻ†çš„ |.mf| ćşć–‡ä»¶ĺ‡şçŽ°ĺś¨ \MF\ ć‰‹ĺ†Śä¸­ďĽš
\smallskip
{\narrower\noindent
^{Knuth, Donald E.},{\sl The {\logosl METAFONT}book}.
  Reading, Mass.: Addison-Wesley, 1986.\par}
\smallskip
\pix^^|\LaTeX|
\pix^^|\AMSTeX|
\pix^^|\BibTeX|
\pix^^|\MF|

\csdisplay
\def\LaTeX{L\kern-.26em \raise.6ex\hbox{\fiverm A}%
   \kern-.15em TeX}%
\def\AMSTeX{$\cal A\kern-.1667em \lower.5ex\hbox{$\cal M$}%
   \kern-.125em S$-\TeX}%
\def\BibTeX{{\rm B\kern-.05em {\sevenrm I\kern-.025em B}%
   \kern-.08em T\kern-.1667em \lower.7ex\hbox{E}%
   \kern-.125emX}}%
\font\mflogo = logo10
\def\MF{{\mflogo META}{\tenrm \-}{\mflogo FONT}}%
|

%The next two macros produce boxes.  \pix^|\blackbox| produces a ``square
%bullet'', used in the list macros (\xref{listmacs}).
%\pix^|\makeblankbox| (from \knuth{page~311}) produces an unfilled
%rectangle, with the thickness of the border rules given by the
%arguments.
ćŽĄä¸‹ćťĄçš„ä¸¤ä¸Şĺ®Źç”¨äşŽç”źćç›’ĺ­ă€‚
\pix^|\blackbox| ç”źćä¸€ä¸Şć–ąĺť—ďĽŚĺ®ç”¨ĺś¨ĺ—čˇ¨ĺ®Źä¸­ďĽ\xref{listmacs}ďĽ‰ă€‚
\pix^|\makeblankbox|ďĽĺŹ–č‡Ş\knuth{ç¬¬~311~éˇµ}ďĽ‰ç”źćä¸€ä¸Şç©şĺżçź©ĺ˝˘ďĽŚ
ĺ®çš„čľąćˇ†ĺŽšĺş¦ç”±ĺŹ‚é‡ŹćŚ‡ĺ®šă€‚

\csdisplay
\def\blackbox{\vrule height .8ex width .6ex depth -.2ex}%
\def\makeblankbox#1#2{%
   \hbox{\lower\dp0\vbox{\hidehrule{#1}{#2}%
      \kern -#1% overlap rules
      \hbox to \wd0{\hidevrule{#1}{#2}%
         \raise\ht0\vbox to #1{}% vrule height
         \lower\dp0\vtop to #1{}% vrule depth
         \hfil\hidevrule{#2}{#1}}%
      \kern-#1\hidehrule{#2}{#1}}}}%
\def\hidehrule#1#2{\kern-#1\hrule height#1 depth#2
   \kern-#2}%
\def\hidevrule#1#2{\kern-#1{\dimen0 = #1
   \advance\dimen0 by #2 \vrule width\dimen0}\kern-#2}%
|

%\pix^|\numbername| produces the written-out form of a number.  (If the
%number is greater than ten, the macro just reproduces the numerals
%of its argument.)
\pix^|\numbername| ä»Žć•°ĺ­—ç”źćĺ…¶äą¦éť˘ĺŤç§°%
ďĽč‹Ąć•°ĺ­—ĺ¤§äşŽĺŤďĽŚčż™ä¸Şĺ®Źä»…é‡Ťć–°ç”źćĺŹ‚é‡Źçš„ć•°ĺ€Ľă€‚ďĽ‰

\csdisplay
\def\numbername#1{\ifcase#1%
   zero\or one\or two\or three\or four\or five%
   \or six\or seven\or eight\or nine\or ten\or #1\fi}%
|

%\pix^|\testfileexistence| determines whether a file |\jobname.#1| is
%non\-empty and sets |\if!-fileexists| appropriately.
%^^{files//testing for existence of}
%The file name in the argument need not end in a space token since
%the macro provides the space token.
\pix^|\testfileexistence| ĺ¤ĺ®šć–‡ä»¶ |\jobname.#1| ćŻĺ¦éťžç©şďĽŚ
ĺą¶ç›¸ĺş”ĺś°č®ľĺ®š |\if!-fileexists| çš„ĺ€Ľă€‚
^^{ć–‡ä»¶//ćŁ€ćµ‹ć–‡ä»¶ćŻĺ¦ĺ­ĺś¨}
ĺŹ‚é‡Źä¸­çš„ć–‡ä»¶ĺŤć—&nbsp;éś€ä»Ąç©şć&nbsp;Ľč®°ĺŹ·ç»“ĺ°ľďĽŚĺ›&nbsp;ä¸şčż™ä¸Şĺ®Źĺ·˛ç»ŹćŹäľ›äş†ç©şć&nbsp;Ľč®°ĺŹ·ă€‚

\csdisplay
\newif\iffileexists
\def\testfileexistence#1{\begingroup
      \immediate\openin0 = \jobname.#1\space
      \ifeof 0\global\fileexistsfalse
      \else \global\fileexiststrue\fi
      \immediate\closein0
   \endgroup}%
|


%\section Displays
\section é™ĺ—ĺ…¬ĺĽŹ

%By default, \TeX\ centers displayed material (the material between
%|$$|'s).  ^^{displays, formatting} \pix^|\leftdisplays| causes displays
%to be left-justified by default.  You can return to centered displays
%with \pix^|\centereddisplays|.
\TeX\ é»č®¤ĺ°†é™ĺ—ĺ…¬ĺĽŹďĽć”ľĺś¨ |$$| äą‹é—´çš„ĺ…¬ĺĽŹďĽ‰ĺ±…ä¸­ćľç¤şă€‚
^^{é™ĺ—ĺ…¬ĺĽŹ//ćľç¤şĺ˝˘ĺĽŹ}\pix^|\leftdisplays| č®©é™ĺ—ĺ…¬ĺĽŹé»č®¤ä¸şĺ·¦ĺŻąé˝ćľç¤şă€‚
ä˝&nbsp;äąźĺŹŻä»Ąç”¨ \pix^|\centereddisplays| ĺ‘˝ä»¤ć˘ĺ¤Ťĺ±…ä¸­ćľç¤şă€‚

%The macros here are more general than they need to be just for doing
%left-justified displays.  For every display,
%\pix^|\ifeqno| will be true if an |\eqno| occurred in the display.
%\pix^|\ifleqno| will be true if an |\leqno| occurred.  If either
%kind of equation number occurred, \pix^|\eqn| produces the text of the
%equation number.  \pix^|\eq|  always produces the text of the
%equation itself.
čż™äş›ĺ®ŹćŹäľ›č®©é™ĺ—ĺ…¬ĺĽŹĺ·¦ĺŻąé˝ćľç¤şäą‹ĺ¤–çš„ć›´ĺ¤šĺŠźč˝ă€‚
ĺŻąćŻŹä¸Şé™ĺ—ĺ…¬ĺĽŹďĽŚč‹Ą |\eqno| ĺ­ĺś¨ĺ™ \pix^|\ifeqno| ä¸şçśźďĽŚ
č‹Ą |\leqno| ĺ­ĺś¨ĺ™ \pix^|\ifleqno| ä¸şçśźă€‚
ĺ¦‚ćžśĺ…¶ä¸­ä¸€ç§Ťĺ…¬ĺĽŹçĽ–ĺŹ·ĺ­ĺś¨ďĽŚ\pix^|\eqn| ĺ°†ćŽ’ĺŤ°ĺ…¬ĺĽŹçĽ–ĺŹ·çš„ĺ†…ĺ®ąă€‚
č€Ś \pix^|\eq| ĺ§‹ç»ćŽ’ĺŤ°ĺ…¬ĺĽŹćś¬čş«çš„ĺ†…ĺ®ąă€‚

%These macros are based on the code on \knuth{page~376}.
čż™äş›ĺ®ŹĺźşäşŽ\knuth{ç¬¬~376~éˇµ}ä¸­çš„ä»Łç&nbsp;ă€‚

\csdisplay
\newif\ifeqno \newif\ifleqno
\newtoks\@eqtoks \newtoks\@eqnotoks
\def\eq{\the\@eqtoks}\def\eqn{\the\@eqnotoks}%
\def\displaysetup#1$${%
   \@displaytest#1\eqno\eqno\@displaytest}%
\def\@displaytest#1\eqno#2\eqno#3\@displaytest{%
   \if !#3!% No \eqno, check for \leqno:
      \@ldisplaytest#1\leqno\leqno\@ldisplaytest
   \else
      \eqnotrue \leqnofalse % Have \eqno, not \leqno.
      \@eqnotoks = {#2}\@eqtoks = {#1}%
   \fi
   \generaldisplay$$}%
\def\@ldisplaytest#1\leqno#2\leqno#3\@ldisplaytest{%
   \@eqtoks = {#1}%
   \if !#3!%
      \eqnofalse % No \leqno; we're done.
   \else
      \eqnotrue \leqnotrue % Have \leqno.
      \@eqnotoks = {#2}%
   \fi}%
|

%You can format displays differently by defining your own macro,
%analogous to \pix^|\leftdisplays|.
%The macro definition must
%place a call on |\display!-setup| in |\every!-display| ^^|\everydisplay|
%so as to ensure
%that |\dis!-play!-setup| ^^|\displaysetup| is called at the start of
%every display. The macro definition must also include a definition of
%^|\generaldisplay|.
é€ščż‡č‡Şĺ·±ĺ®šäą‰ç±»äĽĽ \pix^|\leftdisplays| çš„ĺ®ŹďĽŚä˝&nbsp;ĺŹŻä»Ąç»™é™ĺ—ĺ…¬ĺĽŹč®ľĺ®šä¸ŤĺŚçš„ĺ˝˘ĺĽŹă€‚
čż™ä¸Şĺ®Źĺ®šäą‰ä¸­ĺż…éˇ»ĺś¨ |\every!-display| ^^|\everydisplay|ä¸­č°ç”¨ |\display!-setup|ďĽŚ
ä»Ąçˇ®äżť |\dis!-play!-setup| ^^|\displaysetup|ĺś¨ćŻŹä¸Şé™ĺ—ĺ…¬ĺĽŹĺĽ€ĺ§‹é˝č˘«č°ç”¨ă€‚
čż™ä¸Şĺ®Źĺ®šäą‰ĺż…éˇ»äąźĺŚ…ĺ« ^|\generaldisplay| çš„ĺ®šäą‰ă€‚

\csdisplay
\newtoks\previouseverydisplay
\def\leftdisplays{%
   \previouseverydisplay = \everydisplay
   \everydisplay =
     {\the\previouseverydisplay \displaysetup}%
   \def\generaldisplay{%
      \leftline{%
         \strut \indent \hskip\leftskip
         \dimen0 = \parindent
         \advance\dimen0 by \leftskip
         \advance\displaywidth by -\dimen0
         \@redefinealignmentdisplays
         \ifeqno \ifleqno
            \kern-\dimen0
            \rlap{$\displaystyle\eqn$}%
            \kern\dimen0
         \fi\fi
         $\displaystyle{\eq}$%
         \ifeqno \ifleqno\else
            \hfill $\displaystyle{\eqn}$%
         \fi\fi}}}%
\def\centereddisplays{\let\displaysetup = \relax}%
|

%\filbreak
%\pix^|\leftdisplays| must go to some pains to make sure that
%|\dis!-play!-lines|, ^^|\displaylines|
%^|\eqalignno|,  and ^|\leqalignno| still work properly.
%|\eq| is typeset in math mode,
%and |\halign| is illegal in math mode.
%^^|\halign//illegal in math mode|
%We use ^|\vcenter| to change the context so that  |\halign| becomes
%legal again. We also remove the |\hfil| commands at the left of the template
%to obtain the flush left formatting. Other than those changes, the macros
%are the same as in |plain.tex|.
%\filbreak
\pix^|\leftdisplays| ĺż…éˇ»ĺŽ†ç»Źčľ›č‹¦ĺś°çˇ®äżť |\dis!-play!-lines|^^|\displaylines|ă€
^|\eqalignno| ĺ’Ś ^|\leqalignno| čżč˝ć­Łĺ¸¸ä˝żç”¨ă€‚
|\eq| ĺś¨ć•°ĺ­¦ć¨ˇĺĽŹä¸­ćŽ’ç‰ďĽŚč€Ś |\halign| ĺś¨ć•°ĺ­¦ć¨ˇĺĽŹä¸­ćŻä¸Ťĺćł•çš„ă€‚
^^|\halign//ĺś¨ć•°ĺ­¦ć¨ˇĺĽŹä¸­ä¸Ťĺćł•|
ć‘ä»¬ç”¨ ^|\vcenter| ć”ąĺŹçŽŻĺ˘ďĽŚä»Ąč®© |\halign| é‡Ťć–°ĺŹćĺćł•çš„ă€‚
ć‘ä»¬čżĺŽ»ćŽ‰ć¨ˇćťżĺ·¦čľąçš„ |\hfil| ĺ‘˝ä»¤ä»Ąĺľ—ĺ°ĺ·¦ĺŻąé˝ć&nbsp;ĽĺĽŹă€‚
é™¤čż™äş›ć”ąĺŹäą‹ĺ¤–ďĽŚčż™äş›ĺ®Źä¸Ž |plain.tex| ä¸­çš„ç›¸ĺŚă€‚

\csdisplay
\def\@redefinealignmentdisplays{%
   \def\displaylines##1{\displ@y
      \vcenter{\halign{\hbox to\displaywidth{$\@lign
            \displaystyle####\hfil$}\crcr##1\crcr}}}%
   \def\eqalignno##1{\displ@y
      \vcenter{\halign to\displaywidth{%
             $\@lign\displaystyle{####}$\tabskip\z@skip
            &amp;$\@lign\displaystyle{{}####}$
               \hfil\tabskip\centering
            &amp;\llap{$\@lign####$}\tabskip\z@skip\crcr
            ##1\crcr}}}%
   \def\leqalignno##1{\displ@y
      \vcenter{\halign to\displaywidth{%
             $\@lign\displaystyle{####}$\tabskip\z@skip
            &amp;$\@lign\displaystyle{{}####}
               $\hfil\tabskip\centering
            &amp;\kern-\displaywidth
             \rlap{\kern-\parindent\kern-\leftskip$
                \@lign####$}%
             \tabskip\displaywidth\crcr
            ##1\crcr}}}}%
|


%\section Time of day
\section ć—Ąćśźć—¶é—´

%When \TeX\ starts up, it sets the values of the
%^|\time|, ^|\day|, ^|\month|, and ^|\year| parameters.
%^^{time of day}^^{date}
%\pix^|\monthname|
%produces the name of the month, abbreviated to three letters.
%\pix^|\timestring| produces the current time, as in ``1:14\thinspace
%p.m.''. \pix^|\timestamp| produces the text of the complete date, as
%in ``23 Apr 1964\quad 1:14\thinspace p.m.''.
\TeX\ ĺĽ€ĺ§‹čżčˇŚć—¶č®ľĺ®šäş† ^|\time|ă€^|\day|ă€^|\month| ĺ’Ś ^|\year| ĺŹ‚ć•°çš„ĺ€Ľă€‚
^^{ć—Ąćśźć—¶é—´}^^{ć—Ąćśź}
\pix^|\monthname| ćŽ’ĺŤ°ćśä»˝ĺŤç§°çš„ä¸‰ĺ­—ćŻŤçĽ©ĺ†™ă€‚
\pix^|\timestring| ćŽ’ĺŤ°ç±»äĽĽĺ˝“ĺ‰Ťć—¶é—´ďĽŚç±»äĽĽäşŽ ``1:14\thinspace p.m.''ă€‚
\pix^|\timestamp| ćŽ’ĺŤ°ĺ®Ść•´ć—Ąćśźć–‡ćś¬ďĽŚç±»äĽĽäşŽ ``23 Apr 1964\quad 1:14\thinspace p.m.''ă€‚

\csdisplay
\def\monthname{%
   \ifcase\month
      \or Jan\or Feb\or Mar\or Apr\or May\or Jun%
      \or Jul\or Aug\or Sep\or Oct\or Nov\or Dec%
   \fi}%
\def\timestring{\begingroup
   \count0 = \time \divide\count0 by 60
   \count2 = \count0   % The hour.
   \count4 = \time \multiply\count0 by 60
   \advance\count4 by -\count0   % The minute.
   \ifnum\count4&lt;10 \toks1 = {0}% Get a leading zero.
   \else            \toks1 = {}%
   \fi
   \ifnum\count2&lt;12 \toks0 = {a.m.}%
   \else            \toks0 = {p.m.}%
      \advance\count2 by -12
   \fi
   \ifnum\count2=0 \count2 = 12 \fi % Make midnight `12'.
   \number\count2:\the\toks1 \number\count4
   \thinspace \the\toks0
\endgroup}%
\def\timestamp{\number\day\space\monthname\space
   \number\year\quad\timestring}%
|


%\section Lists
\section ĺ—čˇ¨

%\null
%\xrdef{listmacs}
%\bix^^{itemized lists}
%\bix^^{enumerations}
%\pix^|\numberedlist| produces numbered lists; |\endnumberedlist| ends
%them.
%\pix^|\unorderedlist| is analogous.
%For either of these, items inside the lists begin
%with \pix^|\li| (``list item'').  You can put \pix^|\listcompact|
%at the beginning of a list if
%you don't want any additional space between the items of that list.
%Lists can be nested arbitrarily.
\null
\xrdef{listmacs}
\bix^^{çĽ–ĺŹ·ĺ—čˇ¨}
\bix^^{ĺ—ä¸ľ}
\pix^|\numberedlist| ćŽ’ĺŤ°çĽ–ĺŹ·ĺ—čˇ¨ďĽ›|\endnumberedlist| ç»“ćťźčŻĄĺ—čˇ¨ă€‚
ç±»äĽĽĺś°ďĽŚ\pix^|\unorderedlist| ćŽ’ĺŤ°ć—&nbsp;ĺşŹĺ—čˇ¨ă€‚
čż™ä¸¤ç§Ťĺ—čˇ¨ä¸­çš„éˇąç›®ä»Ą \pix^|\li|ďĽ``list item''ďĽ‰ĺĽ€ĺ¤´ă€‚
ĺ¦‚ćžśä¸Ťéś€č¦ĺ—čˇ¨éˇąç›®é—´çš„é˘ťĺ¤–é—´éš”ďĽŚä˝&nbsp;ĺŹŻä»Ąĺś¨ĺ—čˇ¨ĺĽ€ĺ§‹ĺ¤„ĺŠ&nbsp;ä¸Š \pix^|\listcompact|ă€‚
ĺ—čˇ¨ĺŹŻä»Ąä»»ć„ŹĺµŚĺĄ—ă€‚

%You can control the spacing between the items more generally by
%assigning values to the registers listed below.  If the items in
%your lists tend to be long, you might want to make |\interitemskip|
%nonzero.
%The left indentation of each list item is given by |\par!-indent| plus
%|\list!-left!-indent|; the right indentation of each list item
%is given by |\list!-right!-indent|.
ć›´ä¸€č¬ĺś°ďĽŚä˝&nbsp;ĺŹŻä»Ąé€ščż‡ć”ąĺŹä¸‹ĺ—ĺŻ„ĺ­ĺ™¨çš„ĺ€ĽćŽ§ĺ¶ĺ—čˇ¨éˇąç›®é—´çš„é—´éš”ă€‚
ĺ¦‚ćžśĺ—čˇ¨éˇąç›®ç»Źĺ¸¸ćŻ”čľé•żďĽŚä˝&nbsp;äąźč®¸ĺ¸Śćś›č®ľĺ®šéťžé›¶çš„ |\interitemskip|ă€‚
ĺ„ĺ—čˇ¨éˇąç›®çš„ĺ·¦çĽ©čż›é‡Źç­‰äşŽ |\par!-indent| ĺŠ&nbsp; |\list!-left!-indent|ďĽ›
ĺ„ĺ—čˇ¨éˇąç›®çš„ĺŹłçĽ©čż›é‡Źç­‰äşŽ |\list!-right!-indent|ă€‚

\csdisplay
\newskip\abovelistskip  \abovelistskip = .5\baselineskip
\newskip\interitemskip  \interitemskip = 0pt
\newskip\belowlistskip  \belowlistskip = .5\baselineskip
\newdimen\listleftindent  \listleftindent = \parindent
\newdimen\listrightindent \listrightindent = 0pt
\def\listcompact{\interitemskip = 0pt \relax}%
|

%Both numbered and unnumbered lists use the macros that follow.
%We don't change |\parindent|, since many existing macros, e.g.,
%|\footnote|, depend on |\parindent|.
%We must account for the
%possibility that items are more than one paragraph long. In this case, all
%paragraphs after the first will be indented.
%We use
%|\leftskip| and |\rightskip| to indent the list items.
%Indentation of displays is accounted for by changes to |\every!-dis!-play|.
%^^|\everydisplay|
çĽ–ĺŹ·ĺ—čˇ¨ĺ’Ść—&nbsp;ĺşŹĺ—čˇ¨é˝ä˝żç”¨ä¸‹éť˘čż™äş›ĺ®Źă€‚
ć‘ä»¬ĺą¶ä¸Ťć”ąĺŹ |\parindent| çš„ĺ€ĽďĽŚ
ĺ›&nbsp;ä¸şĺľĺ¤šçŽ°ćś‰çš„ĺ®ŹćŻ”ĺ¦‚ |\footnote| äľťčµ–äşŽ |\parindent|ă€‚
ć‘ä»¬ĺż…éˇ»č€č™‘ĺ°éˇąç›®ĺŚ…ĺ«ä¸Ťć­˘ä¸€ä¸Şć®µč˝çš„ĺŹŻč˝ć€§ă€‚
ĺś¨čż™ç§Ťć…ĺ˝˘ä¸­ďĽŚé™¤ç¬¬ä¸€ä¸Şäą‹ĺ¤–çš„ć‰€ćś‰ć®µč˝é˝ĺ°†č˘«çĽ©čż›ă€‚
ć‘ä»¬ç”¨ |\leftskip| ĺ’Ś |\rightskip| çĽ©čż›ĺ—čˇ¨éˇąç›®ă€‚
ć‘ä»¬é€ščż‡ć”ąĺŹ |\every!-dis!-play| č®ľĺ®šé™ĺ—ĺ…¬ĺĽŹçš„çĽ©čż›ă€‚
^^|\everydisplay|

\csdisplay
\newdimen\@listindent
\def\beginlist{%
   \@listindent = \parindent
   \advance\@listindent by \listleftindent
   \everydisplay = \expandafter{\the\everydisplay
      % Don't lose user's \everydisplay:
      \advance\displayindent by \@listindent
      \advance\displaywidth by -\@listindent
      \advance\displaywidth by -\listrightindent}%
   \nobreak\vskip\abovelistskip
   \parskip = 0pt
   % \leftskip shifts nested lists to the right on the page.
   \advance\leftskip by \@listindent
   \advance\rightskip by \listrightindent}%
\def\printitem{\par\noindent
   \llap{\hskip-\listleftindent \marker \enspace}}%
\def\endlist{\vskip\belowlistskip}%
|

%\noindent
%You can change the way the item labels are typeset by
%redefining the |\numbered!-marker| macro.
%\pix^^|\numberedmarker|
\noindent
é€šĺ¸¸é‡Ťć–°ĺ®šäą‰ |\numbered!-marker| ĺ®ŹďĽŚä˝&nbsp;ĺŹŻä»Ąć”ąĺŹéˇąç›®ć&nbsp;‡ç­ľçš„ć&nbsp;·ĺĽŹă€‚
\pix^^|\numberedmarker|

\csdisplay
\newcount\numberedlistdepth \newcount\itemnumber
\newcount\itemletter
\def\numberedmarker{%
   \ifcase\numberedlistdepth
       (impossible)%
   \or \itemnumberout)%
   \or \itemletterout)%
   \else *%
   \fi}%
|

%\noindent Here are the definitions of |\numberedlist| and
%|\unorderedlist|.
%Both definitions have the same structure.
\noindent čż™é‡ŚćŻ |\numberedlist| ĺ’Ś |\unorderedlist| çš„ĺ®šäą‰ă€‚
čż™ä¸¤ä¸Şĺ®šäą‰çš„ç»“ćž„ćŻç›¸ĺŚçš„ă€‚

\csdisplay
\def\numberedlist{\environment{@numbered-list}%
   \advance\numberedlistdepth by 1
   \itemnumber = 1 \itemletter = `a
   \beginlist \let\marker = \numberedmarker
   \def\li{%
      \ifnum\itemnumber=1\else \vskip\interitemskip \fi
      \printitem
      \advance\itemnumber by 1 \advance\itemletter by 1
   }}%
\def\itemnumberout{\number\itemnumber}%
\def\itemletterout{\char\itemletter}%
\def\endnumberedlist{\par
   \endenvironment{@numbered-list}\endlist}%
!bigskip
\newcount\unorderedlistdepth
\def\unorderedmarker{%
   \ifcase\unorderedlistdepth
       (impossible)%
   \or \blackbox
   \or ---%
   \else *%
   \fi}%
\def\unorderedlist{\environment{@unordered-list}%
   \advance\unorderedlistdepth by 1
   \beginlist \itemnumber = 1
   \let\marker = \unorderedmarker
   \def\li{%
      \ifnum\itemnumber=1\else \vskip\interitemskip \fi
      \printitem \advance\itemnumber by 1
   }}%
\def\endunorderedlist{\par
   \endenvironment{@unordered-list}\endlist}%
|

%\eix^^{itemized lists}
%\eix^^{enumerations}
\eix^^{çĽ–ĺŹ·ĺ—čˇ¨}
\eix^^{ĺ—ä¸ľ}


%\section Verbatim listing
\section ĺŽźć–‡ĺ‘çŽ°

%The \pix^|\listing| macro produces a verbatim listing of a specified
%file in the |\tt| font.
%It is based on the code on \knuth{page~380}.
%Tabs produce a fixed amount of space, and form
%feeds produce a page break.  Other control characters produce whatever
%happens to be at that font position, which is generally not very useful.
%By redefining |\setup!-listing!-hook|,
%\pix^^|\setuplistinghook|
%you can take additional actions that are appropriate for your particular
%fonts and\slash or environment before the file is read in.
\pix^|\listing| ĺ®Źç”¨ |\tt| ĺ­—ä˝“ćŽ’ĺŤ°ćŚ‡ĺ®šć–‡ä»¶çš„ĺŽźć–‡ĺ‘çŽ°ă€‚
ĺ®ĺźşäşŽ\knuth{ç¬¬~380~éˇµ}ä¸­çš„ä»Łç&nbsp;ă€‚
ĺ¶čˇ¨ç¬¦ç”źćĺ›şĺ®šĺ¤§ĺ°Źçš„é—´éš”ďĽŚč€ŚćŤ˘éˇµç¬¦ç”źćä¸€ä¸Şĺ†éˇµă€‚
ĺ…¶ä»–ćŽ§ĺ¶ĺ­—ç¬¦ç”źćčŻĄĺ­—ä˝“ć‰€ĺś¨ä˝Ťç˝®çš„ĺ­—ç¬¦ďĽŚčż™é€šĺ¸¸ä¸Ťĺ¤Şćś‰ç”¨ă€‚
é€ščż‡é‡Ťć–°ĺ®šäą‰ |\setup!-listing!-hook|\pix^^|\setuplistinghook|ďĽŚ
ä˝&nbsp;ĺŹŻä»Ąĺś¨čŻ»ĺ…Ąć–‡ä»¶ĺ‰Ťé’ĺŻąç‰ąĺ«ĺ­—ä˝“ĺ’Ś\slash ć–ä˝żç”¨çŽŻĺ˘ä˝śé˘ťĺ¤–ĺ®šĺ¶ă€‚

\csdisplay
\def\listing#1{%
   \par \begingroup \@setuplisting \setuplistinghook
   \input #1 \endgroup}%
\let\setuplistinghook = \empty
\def\@setuplisting{%
   \uncatcodespecials
   \obeywhitespace \makeactive\` \makeactive\^^I
   \def^^L{\vfill\eject}\tt}%
{\makeactive\` \gdef`{\relax\lq}}% Defeat ligatures.
{\makeactive\^^I\gdef^^I{\hskip8\fontdimen2\tt \relax}}%
|


%\section Tables of contents
\section ç›®ĺ˝•

%\null ^^{table of contents}
%The macro \pix^|\writetocentry| writes a macro call to the file
%|\jobname.toc|.  The first argument of |\writetocentry|, e.g.,
%``chapter'', is used to compose the name of the called macro. The second
%argument is the text to appear in the table of contents entry.
%|\writetocentry| appends the page number to the macro call.  For
%example:
\null ^^{ç›®ĺ˝•}
\pix^|\writetocentry| ĺ®Źĺś¨ |\jobname.toc| ć–‡ä»¶ä¸­ĺ†™ĺ…Ąä¸€ä¸Şĺ®Źč°ç”¨ă€‚
|\write!-tocentry| çš„ç¬¬ä¸€ä¸ŞĺŹ‚é‡ŹďĽŚćŻ”ĺ¦‚``chapter''ďĽŚç”¨äşŽćž„ćć‰€č°ç”¨çš„ĺ®Źçš„ĺŤç§°ă€‚
ç¬¬äşŚä¸ŞĺŹ‚é‡ŹćŻćľç¤şĺś¨ç›®ĺ˝•éˇąä¸­çš„ć–‡ćś¬ă€‚
|\writetocentry| ć·»ĺŠ&nbsp;éˇµç&nbsp;ĺ°ĺ®Źč°ç”¨ä¸­ă€‚äľ‹ĺ¦‚ďĽš
\csdisplay
\writetocentry{chapter}{Introduction}
|
%\noindent
%will produce the line:
\noindent
ĺ°†ç”źćä¸‹ĺ—čż™čˇŚďĽš
\csdisplay
\tocchapterentry{Introduction}{2}
|
%\noindent in the |.toc| file, indicating
%that `Introduction' started on page 2.
\noindent ĺ° |.toc| ć–‡ä»¶ä¸­ďĽŚčˇ¨ç¤ş `Introduction' ä»Žç¬¬2éˇµĺĽ€ĺ§‹ă€‚

%You can use |\writenumberedtocentry| to provide a third parameter, such
%as a chapter number. For example:
ĺ©ç”¨ |\writenumberedtocentry| ä˝&nbsp;čżĺŹŻä»ĄćŹäľ›ç¬¬ä¸‰ä¸ŞĺŹ‚ć•°ďĽŚćŻ”ĺ¦‚ç«&nbsp;çĽ–ĺŹ·ă€‚äľ‹ĺ¦‚ďĽš
\csdisplay
\writenumberedtocentry{chapter}{The second chapter}{2}
|
%\noindent will write a line:
\noindent ĺ°†ĺ†™ĺ…Ąčż™ä¸€čˇŚďĽš
\csdisplay
\tocchapterentry{The second chapter}{2}{14}
|
%\noindent
%You can also |\write| to |\tocfile| yourself.
\noindent
ä˝&nbsp;äąźĺŹŻä»Ąč‡Şĺ·±ç”¨ |\write| ĺ‘˝ä»¤ĺ†™ĺ…Ą |\tocfile|ă€‚%
\footnote{čŻ‘ćł¨ďĽšĺŽźć–‡çš„ä»Łç&nbsp;ä¸­é—ćĽŹ |\writetocentry| çš„ĺ®šäą‰ďĽŚ
č€Śĺ°† |\writenumberedtocentry| çš„ĺ®šäą‰é‡Ťĺ¤Ťĺ†™äş†ä¸¤éŤďĽŚčŻ‘ć–‡ĺ·˛äż®ć­Łć­¤é—®é˘ă€‚
ĺ®žé™…ä¸ŠďĽŚĺś¨ćś¬äą¦ć‰€ç”¨çš„ |eplain.tex| 1.9 ä¸­ďĽŚ
|\writetocentry| č°ç”¨ |\writenumberedtocentry|ďĽŚ
ĺą¶ĺś¨ĺŽč€…ä¸­ć&nbsp;ąćŤ®ç¬¬ä¸‰ä¸ŞĺŹ‚ć•°ćŻĺ¦éťžç©şĺ†™ĺ…Ąä¸ŤĺŚçš„ç›®ĺ˝•éˇąă€‚
ä˝†ĺś¨ |\writenumberedtocentry| çš„ĺ®šäą‰ä¸­ćś‰é—®é˘ďĽŚ
ĺŻĽč‡´ĺ†™ĺ…Ą |tocfile| ć–‡ä»¶çš„ç›®ĺ˝•éˇąĺ§‹ç»ćś‰ä¸‰ä¸ŞĺŹ‚ć•°ă€‚
ĺś¨çż»čŻ‘ć—¶čŻ‘č€…äąźĺŚć—¶äż®ć­Ł |eplain.tex| ä¸­çš„čż™ä¸Şé”™čŻŻă€‚}

\csdisplay
\newwrite\tocfile \newif\iftocfileopened
\def\opentocfile{\iftocfileopened\else
      \tocfileopenedtrue
      \immediate\openout\tocfile = \jobname.toc
\fi}%
\def\writetocentry#1#2{\ifrewritetocfile
   \opentocfile
   \write\tocfile{%
      \expandafter\noexpand \csname toc#1entry\endcsname
      {#2}{\folio}}%
\ignorespaces\fi}%
\def\writenumberedtocentry#1#2#3{\ifrewritetocfile
   \opentocfile
   \write\tocfile{%
      \expandafter\noexpand \csname toc#1entry\endcsname
      {#2}{#3}{\folio}}%
\ignorespaces\fi}%
|

%To produce a table of contents, read the |.toc| file with
%\pix^|\readtocfile|. You should call |\read!-tocfile| before the first
%|\write!-toc!-entry|.  When you're processing the table of contents
%without regenerating it, you should not rewrite
%the |.toc| file---if you do, its contents will be lost.
%The command
%|\rewrite!-tocfile!-false| will prevent the rewrite.
č¦ćŽ’ĺŤ°ĺ‡şç›®ĺ˝•ďĽŚĺŹŞéś€ç”¨ \pix^|\readtocfile| čŻ»ĺŹ– |.toc| ć–‡ä»¶ă€‚
ä˝&nbsp;ĺş”čŻĄĺś¨é¦–ć¬ˇä˝żç”¨ |\write!-toc!-entry| äą‹ĺ‰Ťč°ç”¨ |\read!-tocfile|ă€‚
ĺś¨ĺ¤„ç†ç›®ĺ˝•ä¸”ä¸Ťćłé‡Ťć–°ç”źćĺ®ć—¶ďĽŚ
ĺŠˇĺż…ä¸Ťč¦ć”ąĺ†™ |.toc| ć–‡ä»¶â€”â€”ĺ¦‚ćžśä˝&nbsp;čż™ć&nbsp;·ĺšďĽŚć–‡ä»¶ĺ†…ĺ®ąĺ°†äĽšä¸˘ĺ¤±ă€‚
ĺ‘˝ä»¤ |\rewrite!-tocfile!-false| ĺ°†ç¦ć­˘čż™ç§Ťć”ąĺ†™ă€‚

\csdisplay
\newif\ifrewritetocfile \rewritetocfiletrue
\def\readtocfile{\testfileexistence{toc}%
   \iffileexists
      \input \jobname.toc
      \ifrewritetocfile \opentocfile \fi
   \fi}%
|

%Here are some definitions of possible |\toc|\dots|entry| macros.  These
%definitions are meant only as examples---running leaders across the line
%is usually not the best way to typeset a table of contents.
čż™é‡Śç»™ĺ‡şĺŹŻč˝ĺ‡şçŽ°çš„ |\toc|\dots|entry| ĺ®Źçš„ä¸€äş›ĺ®šäą‰ă€‚
čż™äş›ĺ®šäą‰ĺŹŞćŻä˝śä¸şäľ‹ĺ­č€Śĺ·˛â€”â€”ĺś¨ç›®ĺ˝•ä¸­ä˝żç”¨ćŚ‡ĺĽ•çşżé€šĺ¸¸ä¸ŤćŻćś€ĺĄ˝çš„ĺšćł•ă€‚

\csdisplay
\def\tocchapterentry#1#2{\line{\bf #1 \dotfill\ #2}}%
\def\tocsectionentry#1#2{%
   \line{\quad\sl #1 \dotfill\ \rm #2}}%
\def\tocsubsectionentry#1#2{%
   \line{\qquad\rm #1 \dotfill\ #2}}%
|


%\section Cross-references
\section äş¤ĺŹ‰ĺĽ•ç”¨

%\null ^^{cross-references}
%\xrdef{xrefs}
%The macros that follow provide symbolic
%cross-referencing, so that you can refer to something in another part of
%a document by name instead of by its actual page number.
%\pix^|\xrdef||{foo}| defines a label |foo| to be the current page
%number, and \pix^|\xrefn||{foo}| produces that page number, e.g., $77$.
%More often you'll want to say something like ``see p.\thinspace77'', so
%\pix^|\xref||{foo}| produces ``p.\thinspace 77''.  If |foo| is not
%defined, a warning message will be given.  |\xrefwarningfalse|
%suppresses the warning.
\null ^^{äş¤ĺŹ‰ĺĽ•ç”¨}
\xrdef{xrefs}
ćŽĄä¸‹ćťĄçš„ĺ®ŹćŹäľ›äş†ç¬¦ĺŹ·ĺĽŹçš„äş¤ĺŹ‰ĺĽ•ç”¨ďĽŚ
č®©ä˝&nbsp;ĺŹŻä»Ąĺś¨ć–‡ćˇŁä¸­é€ščż‡ĺŤç§°č€Śéťžĺ®žé™…éˇµç&nbsp;ćŹĺŹŠĺ…¶ĺ®é¨ĺ†çš„ä¸śčĄżă€‚
\pix^|\xrdef||{foo}| ĺ®šäą‰ć&nbsp;‡ç­ľ |foo| ä¸şĺ˝“ĺ‰Ťéˇµç&nbsp;ďĽŚ
č€Ś \pix^|\xrefn||{foo}| ç”źćčŻĄéˇµç&nbsp;ďĽŚćŻ”ĺ¦‚ $77$ă€‚
ä˝&nbsp;ć›´ĺ¸¸ç”¨çš„ćŻç±»äĽĽ ``see p.\thinspace77'' çš„ĺ†™ćł•ďĽŚ
ĺ›&nbsp;ć­¤ \pix^|\xref||{foo}| ç”źć ``p.\thinspace 77''ă€‚
ĺ¦‚ćžś |foo| ćśŞĺ®šäą‰ďĽŚĺ°±äĽšĺľ—ĺ°ä¸€ä¸Şč­¦ĺ‘ŠäżˇćŻă€‚
|\xrefwarningfalse| ĺŹ–ć¶čż™ç§Ťč­¦ĺ‘Šă€‚

%These macros provide no protection against duplicate definitions.  You can
%check for duplicate definitions by sorting the cross-reference file and
%checking, either mechanically or by eye, for adjacent definitions of
%the same symbol.
čż™äş›ĺ®Źć˛ˇćś‰ćŹäľ›ĺŻąé‡Ťĺ¤Ťĺ®šäą‰çš„äżťćŠ¤ă€‚č¦ćŁ€ćźĄé‡Ťĺ¤Ťĺ®šäą‰ďĽŚ
ä˝&nbsp;ĺŹŻä»Ąĺ°†äş¤ĺŹ‰ĺĽ•ç”¨ć–‡ä»¶ćŽ’ĺşŹďĽŚĺą¶ç”¨ĺ·Ąĺ…·ć–č‚‰çśĽćŁ€ćźĄĺŚä¸€ä¸Şç¬¦ĺŹ·çš„ç›¸é‚»ĺ®šäą‰ă€‚

\csdisplay
\newif\ifxrefwarning  \xrefwarningtrue
\def\xrdef#1{\begingroup
   \xrlabel{#1}%
   \edef\@wr{\@writexrdef{\the\@xrlabeltoks}}%
   \@wr
   \endgroup \ignorespaces}%
\def\@writexrdef#1{\write\reffile{%
     \string\gdef
        \expandafter\string\csname#1\endcsname
        {\noexpand\folio}\percentchar}}%
\def\xrefnumber#1{%
   \xrlabel{#1}%
   % \@xrlabeltoks now has the control sequence name.
   \toks0 =
      \expandafter{\csname\the\@xrlabeltoks\endcsname}%
   \expandafter \ifx\the\toks0\relax
      \ifxrefwarning \message{Undefined label
         `\tokstostring{#1}'.}\fi
      {\let\spacesub = \space
       \expandafter\xdef\the\toks0
          {`{\tt \tokstostring{#1}}'}}\fi
   \the\toks0}%
\def\xref#1{p.\thinspace\xrefnumber{#1}}%
\def\xrefn#1{\xrefnumber{#1}}%
|

%This macro turns a label into a list of character tokens in the token
%register |\labeltoks|.  A label can include blanks and control sequences in
%it as well as normal characters, but it can't include braces.
čż™ä¸Şĺ®Źĺ°†ä¸€ä¸Şć&nbsp;‡ç­ľč˝¬ćŤ˘ä¸şä¸€ĺ—ĺ­—ç¬¦č®°ĺŹ·ďĽŚĺą¶ć”ľĺś¨ĺŻ„ĺ­ĺ™¨ |\labeltoks| ä¸­ă€‚
é™¤äş†ć™®é€šĺ­—ç¬¦äą‹ĺ¤–ďĽŚć&nbsp;‡ç­ľčżĺŹŻä»ĄĺŚ…ĺ«ç©şć&nbsp;Ľĺ’ŚćŽ§ĺ¶ĺşŹĺ—ďĽŚä˝†ä¸Ťč˝ĺŚ…ĺ«čŠ±ć‹¬ĺŹ·ă€‚

\csdisplay
\newtoks\@xrlabeltoks
\def\xrlabel#1{\begingroup
      \escapechar = `\_ \edef\tts{\tokstostring{#1_}}%
      \global\@xrlabeltoks = \expandafter{\tts}%
   \endgroup}%
|

%It takes two passes to get the cross-references right, since the
%definitions are written out to the auxiliary file |\jobname.aux|.
%\pix^|\readreffile| reads them back in. If you don't issue this command
%before the first definition, you'll lose all the definitions from the
%previous run.
éś€č¦čżčˇŚä¸¤éŤć‰Ťč˝ĺľ—ĺ°ć­Łçˇ®çš„äş¤ĺŹ‰ĺĽ•ç”¨ďĽŚ
ĺ›&nbsp;ä¸şčż™äş›ĺ®šäą‰ćŻĺ†™ĺ‡şĺ°čľ…ĺŠ©ć–‡ä»¶|\jobname.aux| é‡Śçš„ă€‚
\pix^|\readreffile| ĺ‘˝ä»¤ç”¨äşŽĺ°†ĺ®ä»¬čŻ»ĺŹ–ĺ›žćťĄă€‚
ĺ¦‚ćžśä˝&nbsp;ä¸Ťĺś¨ç¬¬ä¸€ä¸Şĺ®šäą‰äą‹ĺ‰Ťć‰§čˇŚć­¤ĺ‘˝ä»¤ďĽŚä˝&nbsp;ĺ°†ä¸˘ĺ¤±ä¸Šä¸€éŤčżčˇŚĺľ—ĺ°çš„ĺ®šäą‰ă€‚

\csdisplay
\newwrite\reffile \newif\ifreffileopened
\def\openreffile{\ifreffileopened\else
      \reffileopenedtrue
      \immediate\openout\reffile = \jobname.aux
   \fi}%
\def\readreffile{%
   \testfileexistence{aux}%
   \iffileexists
      \begingroup
         \@setletters
         \input \jobname.aux
      \endgroup
   \else
      \message{No cross-reference file; I won't give you
         warnings about undefined labels.}%
      \xrefwarningfalse
   \fi
   \openreffile}%
\def\@setletters{%
   \catcode`_ = \letter \catcode`+ = \letter
   \catcode`- = \letter \catcode`@ = \letter
   \catcode`0 = \letter \catcode`1 = \letter
   \catcode`2 = \letter \catcode`3 = \letter
   \catcode`4 = \letter \catcode`5 = \letter
   \catcode`6 = \letter \catcode`7 = \letter
   \catcode`8 = \letter \catcode`9 = \letter
   \catcode`( = \letter \catcode`) = \letter}%
|

%^^{equations, labelling}
%You can give symbolic names to equations in a similar way, using
%\pix^|\eqdef| and \pix^|\eqref|.  |\eqdef| inserts its own |\eqno|
%command, so it must be invoked in a place where |\eqno| is legal.
^^{ĺ…¬ĺĽŹçĽ–ĺŹ·}
ćŚ‰ĺŚć&nbsp;·çš„ć–ąĺĽŹďĽŚä˝&nbsp;ĺŹŻä»Ąç”¨ \pix^|\eqdef| ĺ’Ś \pix^|\eqref| ç»™ĺ‡şĺ…¬ĺĽŹçš„ç¬¦ĺŹ·ĺĽŹĺŤç§°ă€‚
|\eqdef| ćŹ’ĺ…Ąč‡Şĺ·±çš„ |\eqno| ĺ‘˝ä»¤ďĽŚĺ›&nbsp;ć­¤ĺ®ĺż…éˇ»ç”¨ĺś¨č˝ç”¨ |\eqno| çš„ĺś°ć–ąă€‚

\csdisplay
\newcount\eqnumber
\def\eqdef#1{\global\advance\eqnumber by 1
   \expandafter\xdef
      \csname#1eqref\endcsname{\the\eqnumber}%
   \immediate\write\reffile{\string\def
      \expandafter\string\csname#1eqref\endcsname
         {\the\eqnumber}}%
   \eqno
   \eqprint{\the\eqnumber}}%
|

%|\eqref| produces ``(equation number)''.  You can handle fancier
%formatting by redefining \pix^|\eqprint|. For example, you could redefine
%it so that the equation numbers include
%the chapter number.
|\eqref| ç”źć``(ĺ…¬ĺĽŹçĽ–ĺŹ·)''ă€‚
é€ščż‡é‡Ťć–°ĺ®šäą‰ \pix^|\eqprint|ďĽŚä˝&nbsp;ĺŹŻä»Ąĺ®žçŽ°ć›´ĺŠ&nbsp;ĺ¤Ťćť‚çš„ć&nbsp;ĽĺĽŹă€‚
ä¸ľä¸Şäľ‹ĺ­ďĽŚä˝&nbsp;ĺŹŻä»Ąé‡Ťć–°ĺ®šäą‰ĺ®ďĽŚä˝żĺľ—ĺ…¬ĺĽŹçĽ–ĺŹ·ä¸­ĺŚ…ĺ«ç«&nbsp;çĽ–ĺŹ·ă€‚

\csdisplay
\def\eqref#1{%
   \expandafter \ifx \csname#1eqref\endcsname \relax
      \ifxrefwarning \message{Undefined equation label
         `#1'.}\fi
      \expandafter\def\csname#1eqref\endcsname{00}%
   \else \eqprint{\csname#1eqref\endcsname}%
   \fi}%
\def\eqprint#1{(#1)}%
|


%\section Environments
\section çŽŻĺ˘

%\null ^^{environments} These macros let you define your own named groups
%(environments) for parts of your manuscript.  Like \TeX\ groups, these
%groups can be nested, and in fact their nesting can be intertwined with
%the nesting of \TeX\ groups.  If the names at the beginning and end of
%an environment don't match, you'll get an error message. The macros are
%designed so that the message you get when such an error occurs will give
%you a good chance of localizing the cause of the error easily.
\null ^^{çŽŻĺ˘}čż™äş›ĺ®Źč®©ä˝&nbsp;ĺŹŻä»Ąĺ°†ć‰‹ç¨żçš„ä¸€é¨ĺ†ĺ®šäą‰ä¸şĺ‘˝ĺŤçĽ–ç»„ďĽçŽŻĺ˘ďĽ‰ă€‚
ç±»äĽĽ \TeX\ çš„çĽ–ç»„ďĽŚčż™äş›çĽ–ç»„äąźĺŹŻä»ĄĺµŚĺĄ—ďĽŚ
č€Śä¸”ĺ®žé™…ä¸Šĺ®ä»¬çš„ĺµŚĺĄ—ĺŹŻä»Ąä¸Ž \TeX\ çĽ–ç»„çš„ĺµŚĺĄ—ç›¸äş’äş¤ç»‡ă€‚
ĺ¦‚ćžśĺĽ€ĺ§‹çš„ĺŤç§°ĺ’Śç»“ćťźçš„ĺŤç§°ä¸ŤĺŚąé…ŤďĽŚä˝&nbsp;ĺ°†ĺľ—ĺ°ä¸€ä¸Şé”™čŻŻäżˇćŻă€‚
čż™äş›ĺ®Źĺ¦‚ć­¤č®ľč®ˇďĽŚä˝żĺľ—ĺ˝“ä˝&nbsp;ĺľ—ĺ°čż™ç§Ťé”™čŻŻäżˇćŻć—¶ďĽŚä˝&nbsp;ćś‰ćśşäĽšć–ąäľżĺś°ĺ®šä˝Ťé”™čŻŻçš„ćťĄćşă€‚

%You begin an environment with
%\pix^^|\environment|
%|\envi!-ron!-ment| |{foo}| and end it with |\endenvironment{foo}|, where
%|foo| is the name of the environment.  Our macros slightly improve on
%the answer to Exercise~5.7 of \texbook, by doing some checks on
%|\begingroup| and |\endgroup| pairs, as well as making sure
%|\environment| and |\endenvironment| pairs match.
ç”¨ \pix^^|\environment||\envi!-ron!-ment| |{foo}| ĺĽ€ĺ§‹ä¸€ä¸ŞçŽŻĺ˘ďĽŚ
ç”¨ |\endenvironment{foo}| ç»“ćťźčŻĄçŽŻĺ˘ďĽŚĺ…¶ä¸­ |foo| ćŻčŻĄçŽŻĺ˘çš„ĺŤç§°ă€‚
ć‘ä»¬çš„ĺ®Źç¨Ťĺľ®ć”ąčż›äş† \texbook\ ç»äą&nbsp;~5.7ďĽŚ
ć·»ĺŠ&nbsp;ĺŻą |\begingroup| ĺ’Ś |\endgroup| ćŻĺ¦é…ŤĺŻąçš„ćŁ€ćźĄďĽŚ
ĺą¶çˇ®äżť |\environment| ĺ’Ś |\endenvironment| č˝ĺ¤źĺŚąé…Ťă€‚

\csdisplay
\def\environment#1{\ifx\@groupname\undefined\else
      \errhelp = \@unnamedendgrouphelp
      \errmessage{`\@groupname' was not closed by
         \string\endenvironment}\fi
   \def\@groupname{#1}%
   \begingroup
      \let\@groupname = \undefined \ignorespaces}%
\def\endenvironment#1{\endgroup
   \def\@thearg{#1}%
   \ifx\@groupname\@thearg
   \else
      \ifx\@groupname\undefined
         \errhelp = \@isolatedendenvironmenthelp
         \errmessage{Isolated
            \string\endenvironment\space for `#1'}%
      \else
         \errhelp = \@mismatchedenvironmenthelp
         \errmessage{Environment `#1' ended,
            but `\@groupname' started}%
         \endgroup % Probably a typo in the names.
      \fi
   \fi
   \let\@groupname = \undefined \ignorespaces}%
|

%We also define help messages for each of the errors above.
%^^|\newhelp|
ä˝&nbsp;äąźĺŹŻä»Ąç»™ä¸Ščż°čż™äş›é”™čŻŻĺ®šäą‰ĺ®ä»¬ĺ„č‡Şçš„ĺ¸®ĺŠ©äżˇćŻă€‚
^^|\newhelp|

\csdisplay
\newhelp\@unnamedendgrouphelp{%
   Most likely, you just forgot an^^J%
   \string\endenvironment.
   Maybe you should try inserting another^^J%
   \string\endgroup to recover.}%
\newhelp\@isolatedendenvironmenthelp{%
   You ended an environment X, but^^J%
   no \string\environment\space to start it
   is anywhere in sight.^^J%
   You might also be at an
   \string\endenvironment\space that would match^^J%
   a \string\begingroup, i.e., you forgot an
   \string\endgroup.}%
\newhelp\@mismatchedenvironmenthelp{%
   You started an environment X, but^^J%
   you ended it with Y.  Maybe you made a typo
   in one or the other^^J%
   of the names.}%
|

%Some environments should not be allowed to occur within
%another environment.  Let's call these environments
%``outer environments''. |\check!-env| checks that no outer environment
%is currently in effect and complains if one is. To use |\check!-env|, you
%must issue the command |\environment!-true| at the beginning of every
%outer environment.
ćźäş›çŽŻĺ˘ĺş”ĺ˝“ä¸Ťĺ…č®¸ĺ‡şçŽ°ĺś¨ĺ…¶ä»–çŽŻĺ˘ĺ†…é¨ă€‚ć‘ä»¬ç§°čż™äş›çŽŻĺ˘ä¸ş``ĺ¤–é¨çŽŻĺ˘''ă€‚
|\check!-env| ćŁ€ćµ‹ćŻĺ¦ä¸Ťĺ­ĺś¨ĺ˝“ĺ‰Ťćś‰ć•çš„ĺ¤–é¨çŽŻĺ˘ďĽŚč‹Ąĺ­ĺś¨çš„čŻťç»™ĺ‡şč­¦ĺ‘ŠäżˇćŻă€‚
č¦ä˝żç”¨ |\checkenv|ďĽŚä˝&nbsp;ĺż…éˇ»ĺś¨ćŻŹä¸Şĺ¤–é¨çŽŻĺ˘ĺĽ€ĺ¤´ĺ¤„ć‰§čˇŚ |\environment!-true| ĺ‘˝ä»¤ă€‚

\csdisplay
\newif\ifenvironment
\def\checkenv{%
   \ifenvironment
      \errhelp = \@interwovenenvhelp
      \errmessage{Interwoven environments}%
      \endgroup
   \fi}%
\newhelp\@interwovenenvhelp{%
   Perhaps you forgot to end the previous^^J%
   environment? I'm finishing off the current group,^^J%
   hoping that will fix it.}%
|


%\section Justification
\section ĺŻąé˝

%\bix^^{flush left}
%\bix^^{flush right}
%\bix^^{centered text}
%The three macros \pix^|\flushleft|, \pix^|\flushright|, and
%\xrdef{eplaincenter}
%\pix^|\center| justify  the text on the following lines in the indicated way.
%The command should appear on a line by itself.
%Both the command and the text should be enclosed in a group---%
%the end of the group indicates the end of the text.
%The entire group is set as a single paragraph, with lines filled out
%on one side or another as appropriate.  Blank lines are reproduced.
\bix^^{ĺ±…ĺ·¦ĺŻąé˝}
\bix^^{ĺ±…ĺŹłĺŻąé˝}
\bix^^{ĺ±…ä¸­ć–‡ćś¬}
čż™ä¸‰ä¸Şĺ®Ź \pix^|\flushleft|ă€\pix^|\flushright| ĺ’Ś
\xrdef{eplaincenter}\pix^|\center| ĺ°†ĺŽéť˘ĺ„čˇŚć–‡ćś¬ä»ĄćŚ‡ĺ®šć–ąĺĽŹĺŻąé˝ă€‚
čż™ç§Ťĺ‘˝ä»¤ĺż…éˇ»ĺŤ•ç‹¬ĺ†™ĺś¨ä¸€čˇŚä¸­ă€‚
ĺ‘˝ä»¤ĺ’Ść–‡ćś¬ĺş”čŻĄĺŚ…ĺ«ĺś¨ä¸€ä¸ŞçĽ–ç»„ä¸­â€”â€”çĽ–ç»„çš„ç»“ćťźĺ°±čˇ¨ç¤şć–‡ćś¬çš„ç»“ćťźă€‚
ć•´ä¸ŞçĽ–ç»„ä˝śä¸şä¸€ä¸Şć®µč˝ćŽ’ç‰ďĽŚĺ„čˇŚč§†ć…ĺ†µĺś¨ä¸€čľąć–ä¸¤čľąç”¨ç©şç™˝ĺˇ«ĺ……ă€‚
ç©şčˇŚäľťĺŽźć&nbsp;·ćľç¤şă€‚

\csdisplay
\begingroup
   \catcode `\^^M = \active
   \globaldefs = 1 %
   \def\flushleft{\beforejustify %
      \aftergroup\@endflushleft %
      \def^^M{\null\hfil\break}%
      \def\@eateol^^M{}\@eateol}%
   \def\flushright{\beforejustify %
      \aftergroup\@endflushright %
      \def^^M{\break\null\hfil}%
      \def\@eateol^^M{\hfil\null}\@eateol}%
   \def\center {\beforejustify %
      \aftergroup\@endcenter %
      \def^^M{\hfil\break\null\hfil}%
      \def\@eateol^^M{\hfil\null}\@eateol}%
\endgroup
|

%The following commands are called as a result of the |\after!-group|
%^^|\aftergroup|
%in the definitions of |\flush!-left|, |\flush!-right|, and |\center|.
%They perform the necessary cleanup operations.
ĺś¨ |\flush!-left|ă€|\flush!-right| ĺ’Ś |\center| çš„ĺ®šäą‰ä¸­ďĽŚ
ä¸‹čż°čż™äş›ĺ‘˝ä»¤ĺ‡şçŽ°ĺś¨ ^|\aftergroup| çš„ĺŽéť˘ďĽ›
ĺ®ä»¬ĺś¨çĽ–ç»„ç»“ćťźĺŽč˘«č°ç”¨ďĽŚä»Ąć‰§čˇŚä¸€äş›ĺż…éś€çš„ć¸…ç†ĺ·Ąä˝śă€‚

\csdisplay
\def\@endflushleft{\unpenalty
   {\parfillskip = 0pt plus 1 fil\par}%
   \ignorespaces}%
\def\@endflushright{%
   % Remove the \hfil\null\break we just put on.
   \unskip \setbox0=\lastbox \unpenalty
   % We have fil glue at the left of the line;
   % \parfillskip shouldn't affect that.
   {\parfillskip = 0pt \par}\ignorespaces}%
\def\@endcenter{%
   % Remove the \hfil\null\break we just put on.
   \unskip \setbox0=\lastbox \unpenalty
   % We have fil glue at the left of the line;
   % \parfillskip must balance it.
   {\parfillskip = 0pt plus 1fil \par}\ignorespaces}%
\def\beforejustify{%
   \par\noindent
   \catcode`\^^M = \active
   \checkenv \environmenttrue}%
|

%\eix^^{flush left}
%\eix^^{flush right}
%\eix^^{centered text}
\eix^^{ĺ±…ĺ·¦ĺŻąé˝}
\eix^^{ĺ±…ĺŹłĺŻąé˝}
\eix^^{ĺ±…ä¸­ć–‡ćś¬}


%\section Tables
\section čˇ¨ć&nbsp;Ľ

%The \pix^|\makecolumns| macro enables you to give all the entries in a
%table without having to worry about where the columns break.  For
%example, if you're typing a long alphabetical list that will be
%formatted in several columns, you usually won't know in advance where
%one column ends and the next begins.  Moreover, if another item gets
%added, the column breaks will change.
\pix^|\makecolumns| ĺ®Źĺ…č®¸ä˝&nbsp;ç»™ĺ‡şčˇ¨ć&nbsp;Ľçš„ć‰€ćś‰ĺ…ç´&nbsp;ďĽŚč€Ść—&nbsp;éś€ć‹…ĺżĺ¦‚ä˝•ĺ†ć&nbsp;Źă€‚
äľ‹ĺ¦‚ďĽŚĺś¨čľ“ĺ…Ąä¸€ä¸Şĺ†—é•żçš„ćŚ‰ĺ­—ćŻŤćŽ’ĺşŹçš„ĺŤĺŤ•ďĽŚĺą¶ĺ†ĺ¤šć&nbsp;Źćľç¤şć—¶ďĽŚ
ä˝&nbsp;é€šĺ¸¸ä¸ŤçźĄé“ĺś¨ä˝•ĺ¤„ç»“ćťźä¸€ć&nbsp;ŹĺĽ€ĺ§‹ä¸‹ä¸€ć&nbsp;Źă€‚
ĺŹ¦ĺ¤–ďĽŚĺ¦‚ćžść·»ĺŠ&nbsp;äş†ĺŹ¦ä¸€éˇąďĽŚĺ„ć&nbsp;Źçš„ĺ’ĺ†ĺ°†äĽšć”ąĺŹă€‚

%|\makecolumns| takes two (delimited) arguments: the total number of
%entries in the table and the number of columns in the table.  For
%example, `|\makecolumns 37/3:|' specifies a three-column table whose
%entries are the next $37$ lines.  You can adjust the positioning of the
%table on the page by changing |\parindent|, which determines the space
%to the left, and |\hsize|, which determines the space from the left
%margin of the page to the right of the block.  You can allow a page
%break above the |\valign|
%^^|\valign//used in {\tt\\makecolumns}|
%by changing
%\pix^|\abovecolumnspenalty|.
|\makecolumns| ćś‰ä¸¤ä¸ŞďĽĺ®šç•ŚďĽ‰ĺŹ‚é‡ŹďĽščˇ¨ć&nbsp;Ľĺ…ç´&nbsp;çš„ć€»ć•°ä»ĄĺŹŠčˇ¨ć&nbsp;Ľçš„ć&nbsp;Źć•°ă€‚
äľ‹ĺ¦‚ďĽŚ`|\makecolumns 37/3:|' ćŚ‡ĺ®šä¸€ä¸Şä¸‰ć&nbsp;Źčˇ¨ć&nbsp;ĽďĽŚĺ…¶ĺ…ç´&nbsp;ä¸şćŽĄä¸‹ćťĄçš„ $37$ čˇŚă€‚
č¦č°ć•´čˇ¨ć&nbsp;Ľĺś¨éˇµéť˘ä¸Šçš„ä˝Ťç˝®ďĽŚä˝&nbsp;ĺŹŻä»Ąäż®ć”ą |\parindent| ä»Ąçˇ®ĺ®ščˇ¨ć&nbsp;Ľĺ·¦äľ§çš„ç©şç™˝ďĽŚ
ä»ĄĺŹŠ |\hsize| ä»Ąçˇ®ĺ®šä»Žéˇµéť˘ĺ·¦čľąçĽĺ°čˇ¨ć&nbsp;ĽĺŹłäľ§çš„č·ťç¦»ă€‚
č¦ĺ…č®¸ĺś¨ |\valign| ^^|\valign//ç”¨äşŽ {\tt\\makecolumns}| äą‹ĺ‰Ťĺ†éˇµďĽŚ
ä˝&nbsp;ĺŹŻä»Ąäż®ć”ą \pix^|\abovecolumnspenalty|ă€‚

\csdisplay
\newcount\abovecolumnspenalty
\abovecolumnspenalty = 10000
\newcount\@linestogo      % Lines remaining to process.
\newcount\@linestogoincolumn % Lines remaining in column.
\newcount\@columndepth    % Number of lines in a column.
\newdimen\@columnwidth    % Width of each column.
\newtoks\crtok  \crtok = {\cr}%
\def\makecolumns#1/#2: {\par \begingroup
   \@columndepth = #1 \advance\@columndepth by #2
   \advance\@columndepth by -1
   \divide \@columndepth by #2
   \@linestogoincolumn = \@columndepth \@linestogo = #1
   \def\@endcolumnactions{%
      \ifnum \@linestogo&lt;2
         \the\crtok \egroup \endgroup \par
            % End \valign and \makecolumns.
      \else
         \global\advance\@linestogo by -1
         \ifnum\@linestogoincolumn&lt;2
            \global\@linestogoincolumn = \@columndepth
            \the\crtok
         \else &amp;\global\advance\@linestogoincolumn by -1
         \fi
      \fi}%
   \makeactive\^^M\letreturn\@endcolumnactions
   \@columnwidth = \hsize
   \advance\@columnwidth by -\parindent
   \divide\@columnwidth by #2
   \penalty\abovecolumnspenalty
   \noindent % It's not a paragraph (usually).
   \valign\bgroup
      &amp;\hbox to \@columnwidth{\strut ##\hfil}\cr
}% The next end-of-line starts everything going.
|


%\section Footnotes
\section č„šćł¨

%\null ^^{footnotes}
%Footnotes are most commonly typeset by using a raised number as the
%reference mark.  We define the \pix^|\numberedfootnote| macro to do
%this.  It also redefines ^|\vfootnote| to allow slightly more general
%formatting of footnotes than \plainTeX\ does. The dimension register
%\pix^^|\footnotemarkseparation| |\foot!-note!-mark!-sepa!-ra!-tion|
%controls the space between the footnote mark (e.g., the number) and the
%beginning of the text. The \pix^|\everyfootnote| tokens are inserted
%before producing the footnote.
\null ^^{č„šćł¨}
č„šćł¨é€šĺ¸¸ç”¨ĺŤ‡é«çš„ć•°ĺ­—ä˝śä¸şĺŹ‚č€ç¬¦ĺŹ·ă€‚
ć‘ä»¬ĺ®šäą‰çš„ \pix^|\numberedfootnote| ĺ®Źĺ°±ćŻčż™ć&nbsp;·çš„ă€‚
ĺ®čżé‡Ťć–°ĺ®šäą‰äş† ^|\vfootnote|ďĽŚä»Ąć”ŻćŚćŻ” \plainTeX\ ć›´ä¸€č¬çš„č„šćł¨ć&nbsp;ĽĺĽŹă€‚
ĺ°şĺŻ¸ĺŻ„ĺ­ĺ™¨ \pix^^|\footnotemarkseparation| |\foot!-note!-mark!-sepa!-ra!-tion|
ćŽ§ĺ¶č„šćł¨ç¬¦ĺŹ·ďĽćŻ”ĺ¦‚ć•°ĺ­—ďĽ‰ä¸Žč„šćł¨ć–‡ćś¬äą‹é—´çš„é—´éš”ă€‚
\pix^|\everyfootnote| č®°ĺŹ·ĺś¨ćŻŹä¸Şč„šćł¨äą‹ĺ‰ŤćŹ’ĺ…Ąă€‚

%The \plainTeX\ definitions of |\footnote| and |\vfootnote| are
%preserved in |\@plain!-footnote| and |\@plain!-vfootnote| in case you should
%need them.
\PlainTeX\ ä¸­çš„ |\footnote| ĺ’Ś |\vfootnote| ĺ®šäą‰äżťç•™ĺś¨
|\@plain!-footnote| ĺ’Ś |\@plain!-vfootnote| ä¸­ďĽŚä»Ąĺ¤‡ä¸Ťć—¶äą‹éś€ă€‚

\csdisplay
\newcount\footnotenumber \newtoks\everyfootnote
\newdimen\footnotemarkseparation
\footnotemarkseparation = .5em
\let\@plainfootnote = \footnote
\let\@plainvfootnote = \vfootnote
\def\vfootnote#1{\insert\footins\bgroup
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\ht\strutbox \splitmaxdepth\dp\strutbox
  \floatingpenalty\@MM
  \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip
  \xspaceskip\z@skip
  \everypar = {}%
  \the\everyfootnote
  \indent\llap{#1\kern\footnotemarkseparation}\footstrut
  \futurelet\next\fo@t}%
\def\numberedfootnote{\global\advance\footnotenumber by 1
  \@plainfootnote{$^{\number\footnotenumber}$}}%
|


%\section Double columns
\section ĺŹŚć&nbsp;Ź

%\null ^^{double columns} The |\doublecolumns| command begins
%double-column output, while the |\single!-column|
%\pix^^|\singlecolumn|
%command restores
%single-column output.  You can switch back and forth between them
%on a single page.
%The glue specified by |\above!-double!-column!-skip| and
%|\below!-double!-column!-skip| is inserted before and after the
%double-column material.
\null ^^{ĺŹŚć&nbsp;Ź} |\doublecolumns| ĺ‘˝ä»¤ĺĽ€ĺ§‹ĺŹŚć&nbsp;Źčľ“ĺ‡şďĽŚ
č€Ś |\single!-column| \pix^^|\singlecolumn| ĺ‘˝ä»¤ć˘ĺ¤ŤĺŤ•ć&nbsp;Źčľ“ĺ‡şă€‚
ä¸¤č€…ĺŹŻä»Ąĺś¨ĺŚä¸Şéˇµéť˘ä¸Šç›¸äş’ĺ‡ćŤ˘ă€‚
ç”¨ |\above!-double!-column!-skip| ĺ’Ś |\below!-double!-column!-skip|
ćŚ‡ĺ®šçš„ç˛čżžćŹ’ĺ…Ąĺ°ĺŹŚć&nbsp;Źç´&nbsp;ćťçš„ĺ‰Ťéť˘ĺ’ŚĺŽéť˘ă€‚

%The approach is derived from \knuth{page~417}.
ĺ®ä»¬çš„ĺ®žçŽ°ć–ąĺĽŹćťĄćşäşŽ\knuth{ç¬¬~417~éˇµ}ă€‚

\csdisplay
\newskip\abovedoublecolumnskip
\newskip\belowdoublecolumnskip
\abovedoublecolumnskip = \bigskipamount
\belowdoublecolumnskip = \bigskipamount
\newdimen\gutter            \gutter = 2pc
\newdimen\doublecolumnhsize \doublecolumnhsize = \hsize
\newbox\@partialpage        \newdimen\singlecolumnhsize
\newdimen\singlecolumnvsize \newtoks\previousoutput
\def\doublecolumns{\par % Don't start in horizontal mode.
   \previousoutput = \expandafter{\the\output}
   \advance\doublecolumnhsize by -\gutter
   \divide\doublecolumnhsize by 2
   \output = {\global\setbox\@partialpage =
         \vbox{\unvbox255\vskip\abovedoublecolumnskip}}%
   \pagegoal = \pagetotal \break % Expands \output above.
   \output = {\doublecolumnoutput}%
   \singlecolumnhsize = \hsize
   \singlecolumnvsize = \vsize
   \hsize = \doublecolumnhsize \vsize = 2\vsize}%
|

%The |\@double!-column!-split| macro does the actual splitting.
%Insertions are assumed to be single-column material.  If you don't want
%this to be the case, you'll have to modify the output routine.  After
%|\@double!-column!-split| has done its work, |\box255| will have the
%double-column material.  The double-column material will be preceded by
%any single-column material that was typeset before |\doublecolumns| was
%invoked. |\box4| will have the material that didn't fit on the page.
|\@double!-column!-split| ĺ®Źć‰§čˇŚĺ®žé™…çš„ĺ†ć&nbsp;Źă€‚ćŹ’ĺ…Ąéˇąč˘«ĺ˝“ä˝śĺŤ•ć&nbsp;Źç´&nbsp;ćťďĽ›
ĺ¦‚ćžśčż™ä¸ŤćŻä˝&nbsp;ćłč¦çš„ďĽŚä˝&nbsp;éś€č¦äż®ć”ąčľ“ĺ‡şäľ‹čˇŚç¨‹ĺşŹă€‚
ĺś¨ |\@double!-column!-split| ĺ®Śćäą‹ĺŽďĽŚ|\box255| ĺ°†ĺŚ…ĺ«ĺŹŚć&nbsp;Źç´&nbsp;ćťă€‚
ĺŹŚć&nbsp;Źç´&nbsp;ćťĺ‰Ťéť˘ćŻč°ç”¨ |\doublecolumns| ĺ‰Ťçš„ĺŤ•ć&nbsp;Źç´&nbsp;ćťă€‚
|\box4| ĺ°†ĺŚ…ĺ«ć—&nbsp;ćł•ć”ľĺ…ĄčŻĄéˇµéť˘çš„ç´&nbsp;ćťă€‚

\csdisplay
\def\@doublecolumnsplit{%
   \splittopskip = \topskip \splitmaxdepth = \maxdepth
   \dimen0 = \singlecolumnvsize
      \advance\dimen0 by -\ht\@partialpage
      \advance\dimen0 by -\ht\footins
      \advance\dimen0 by -\skip\footins
      \advance\dimen0 by -\ht\topins
   \begingroup
      \vbadness = 10000
      \global\setbox1=\vsplit255 to \dimen0 \wd1=\hsize
      \global\setbox3=\vsplit255 to \dimen0 \wd3=\hsize
   \endgroup
   \global\setbox4=\vbox{\unvbox255
      \penalty\outputpenalty}%
   \global\setbox255=\vbox{\unvbox\@partialpage
      \hbox to \singlecolumnhsize{\box1\hfil\box3}%
      \vfill}}%
|
%\needspace{.5in}
%|\double!-column!-out!-put| is the real output routine.  We call the old
%|\output| to do the work of actually shipping out the box.
\needspace{.5in}
|\double!-column!-out!-put| ćŻçśźć­Łçš„čľ“ĺ‡şäľ‹čˇŚç¨‹ĺşŹă€‚
ć‘ä»¬č°ç”¨ |\output| ć‰§čˇŚĺ®žé™…çš„ç›’ĺ­é€ĺ‡şĺ·Ąä˝śă€‚

\csdisplay
\def\doublecolumnoutput{\@doublecolumnsplit
   \hsize = \singlecolumnhsize \vsize = \singlecolumnvsize
   \previousoutput \unvbox4}%
|

%|\singlecolumn| resumes typesetting in one column.  It assumes that
%|\doublecolumns| has been called.
|\singlecolumn| ć˘ĺ¤ŤĺŤ•ć&nbsp;ŹćŽ’ç‰ă€‚ĺ®ĺ‡ĺ®šĺ·˛č°ç”¨äş† |\doublecolumns|ă€‚

\csdisplay
\def\singlecolumn{\par % Don't start in horizontal mode.
   \output = {\global\setbox1 =
      \vbox{\unvbox255\vskip\abovedoublecolumnskip}}%
   \pagegoal = \pagetotal \break \setbox255 = \box1
   {\singlecolumnvsize = \ht255
      \divide\singlecolumnvsize by 2
      \advance\singlecolumnvsize by +\ht\@partialpage
      \advance\singlecolumnvsize by +\ht\footins
      \advance\singlecolumnvsize by +\skip\footins
      \advance\singlecolumnvsize by +\ht\topins
   \@doublecolumnsplit}%
   \hsize = \singlecolumnhsize
   \vsize = \singlecolumnvsize
   \output = \expandafter{\the\previousoutput}%
   \unvbox255}%
|

%\margin{`Sensible paragraph skips' section deleted}
\margin{`Sensible paragraph skips' section deleted}


%\section Finishing up
\section ć”¶ĺ°ľ

%We now must undo the changes that we made when we started (see
%\xref{eplainconv}).  We also give a version identification, which is
%subsequently available in |\fmt!-name| and |\fmt!-version|.
çŽ°ĺś¨ć‘ä»¬ĺż…éˇ»ć’¤é”€ĺĽ€ĺ§‹çš„äż®ć”ąďĽč§\xref{eplainconv}ďĽ‰ă€‚
ć‘ä»¬čżç»™ĺ‡şç‰ćś¬ć&nbsp;‡čŻ†ďĽŚĺ®ĺŹŻä»Ąĺś¨ |\fmt!-name| ĺ’Ś |\fmt!-version| ä¸­ĺľ—ĺ°ă€‚

\csdisplay
\let\wlog = \@plainwlog \catcode`@ = \other
\def\fmtname{eplain}%
{\edef\plainversion{\fmtversion}%
 \xdef\fmtversion{1.0: 15 May 1990
   (and plain \plainversion)}%
}%
|

%\eix^^|eplain.tex|
\eix^^|eplain.tex|

\ifoldeplain\else\ifcompletebook\else
\vskip4em{\sectionfonts\leftline{ćś¬ç«&nbsp;ç´˘ĺĽ•}}
\readindexfile{i}
\fi\fi

\endchapter
\byebye
</pre></body></html>