% macros for the appendix to "Errors of TeX" paper
\input manmac
\voffset=-.3in
\catcode`\^=7 % disable the indexing stuff
\font\sltt=cmsltt9
\font\logosl=logosl9
\ninepoint
\vsize=48pc \pageheight=\vsize
\hsize=33.5pc
\def\\{\bgroup\catcode`_=\active\identifier}
{\catcode`_=\active \global\let_=\_}
\def\identifier#1{\hbox{\it#1\/\kern.05em}\egroup} % italic type for identifiers
\newbox\predec % for predecessor "mapsto" info
\newbox\code % for the code letter
\newbox\texsec % for TeX section numbers
\newbox\cbox % the symbol used on commentlines
\newbox\dbox % empty box used after datelines
\setbox\dbox=\hbox to\datemar{}
\setbox\cbox=\hbox to\itemnosize{\hfil$\bullet$}
\def\checkvalid#1{\expandafter\ifx\csname#1!\endcsname\okay\else\invalidcode\fi}
\def\okay{\okay}
\def\makevalid#1{\expandafter\let\csname#1!\endcsname=\okay}
\makevalid A % algorithm
\makevalid B % blunder
\makevalid C % cleanup
\makevalid D % data structure
\makevalid E % efficiency
\makevalid F % forgotten case
\makevalid G % generalization
\makevalid I % interaction
\makevalid L % language
\makevalid M % mismatch
\makevalid P % program organization
\makevalid Q % quality
\makevalid R % robustness
\makevalid S % surprise
\makevalid T % typo
\def\lookahead{\futurelet\next\looky} % we'll do this at end of every line
\def\looky{\if\next \let\cont\continuationline % tab mark
\else\if\next*\let\cont\dateline % asterisk
\else\if\next##\let\cont\commentline % sharp sign
\else\if\next\relax\let\cont\endit % \relax (gets us out)
\else\let\cont\dataline\fi\fi\fi\fi\cont} % otherwise should be a code letter
\def\continuationline { } % insert space if a tab mark starts the next line
\def\dateline* {\smallbreak\begingroup\bf\hfill\nobreaktrue
\global\setbox\code=\copy\dbox}
\def\dataline#1{\fin\checkvalid#1%
\global\setbox\code=\hbox to\codesize{\enspace
\hskip0pt plus 3fil\rm#1\hskip0pt plus1fil}%
\begingroup\rm\catcode`X=\active\itemnumber}
\def\itemnumber#1.{\catcode`X=11\setbox0=\hbox to\itemnosize{\bf\hss#1\relax}%
\setbox2=\hbox{\bf#1\relax}\ifdim\wd2>\wd0 \setbox0=\box2 \fi
\textindent{\hfil\box\predec\box0}}
\def\commentline{\fin\afterassignment\begincomment\let\next}
\def\begincomment{\begingroup\let\tt=\sltt
\let\MF=\slMF\sl\textindent{\hfil\copy\cbox}}
\def\leftheadline{\hbox to \hsize{%
\vbox to 10pt{}% strut to position the baseline
{\tenrm\folio\kern1pc}% folio to left of text
\hfil\eightrm D. \ E. \ KNUTH\hfil% running head
}}
\def\rightheadline{\hbox to \hsize{%
\vbox to 10pt{}% strut to position the baseline
\hfil\eightrm THE \ ERRORS \ OF \ \TeX\hfil% running head
{\kern1pc\tenrm\folio}% folio to right of text
}}