%
%   The following macros allow you to do:
%   \begverb{`\$}
%   verbatim stuff
%   $endverb
%
%   Tabs are still not handled correctly, and lines too long for
%   the current line are broken.  Also, the sequences ?` and !`
%   will be printed incorrectly (see TeXbook, page 381.)
%
{\obeyspaces\gdef {\ }}
\def\begverb#1{\begingroup\def\par{\leavevmode\endgraf}
\catcode`\\=12\catcode`\{=12
\catcode`\}=12\catcode`\$=12\catcode`\&=12
\catcode`\#=12\catcode`\%=12\catcode`\~=12
\catcode`\_=12\catcode`\^=12\obeyspaces\obeylines\tt
\parindent=0pt\catcode#1=0}
\def\endverb{\par\endgroup}
%
%   The following command allows you to go
%   \verbfile{name}
%   and it will stick the current file into the output in
%   verbatim mode.
%
\newread\verbinfile\newif\ifverbdone
\def\verbfile#1{{\catcode`\\=12\catcode`\{=12
\catcode`\}=12\catcode`\$=12\catcode`\&=12
\catcode`\#=12\catcode`\%=12\catcode`\~=12
\catcode`\_=12\catcode`\^=12\obeyspaces\obeylines\tt
\verbdonetrue\openin\verbinfile=#1
\loop\read\verbinfile to \inline
\ifeof\verbinfile\verbdonefalse\else
\leftline{\inline}\fi
\ifverbdone\repeat\closein\verbinfile}}
