% Macro for literal output.
% For more information see the end of this file.
%
% Oldrich Ulrych                          September 21, 1992
% Mathematical Institute of Charles University
% e-mail: oulrych@cspguk11.bitnet
%
\expandafter\ifx\csname verbatim.tex\endcsname\relax\let\next\relax
   \else
   \immediate\message{[already loaded]}\let\next\endinput\fi
\next
\expandafter\def\csname verbatim.tex\endcsname{}
%
\edef\catcodeat{\the\catcode`\@ } \catcode`\@=11 \chardef\@ther=12
\newskip\v@rbatimskip             \newtoks\f@r@t
{\catcode`\|=0     \catcode`\\=\active
|gdef|t@stbs{|ifx|next\|f@r@t={}|leavevmode|else|leavevmode|fi}
|gdef|verbatim{|par|vskip|parskip
    |begingroup|obeyall|vskip|v@rbatimskip
   |parindent0pt|parskip0pt|catcode`|\=|active
   |def\{|def|hst@ng{endverbatim|relax|relax}|t@k@}%
   |obeyspaces|tt|f@rverbatim}
}
\def\verb{\begingroup\parindent0pt\parskip0pt\obeyall\catcode`\\=\@ther
          \tt\f@rverb\v@rbdef}
\def\verbatimskip#1{\v@rbatimskip=#1\relax}
\def\forverbatim#1{\def\f@rverbatim{#1}}
\def\forverb#1{\def\f@rverb{#1}}
\def\afterverbatim#1{\def\@fterverbatim{#1}}

{\catcode`\^^M=\active%
 \gdef\new@beylines{%
   \def\obeylines{\catcode`\^^M=\active \def^^M{\par\futurelet\next\t@stbs}}%
   }
}
{\obeyspaces\gdef {\ }}
\def\obeyall{%
   \catcode`\{=\@ther   \catcode`\}=\@ther   \catcode`\_=\@ther
   \catcode`\^=\@ther   \catcode`\$=\@ther   \catcode`\&=\@ther
   \catcode`\#=\@ther   \catcode`\%=\@ther   \catcode`\~=\@ther
   \catcode`\'=\@ther   \catcode`\`=\@ther   \catcode`\@=\@ther
   \new@beylines\obeylines}
\def\l@tt@#1#2#3\relax{\def\l@tt{#1}\def\l@@t{#2}%
   \def\hst@ng{#2#3\relax\relax}}
\def\t@k@#1{\expandafter\l@tt@\hst@ng
     \if\noexpand#1\l@tt\f@r@t=\expandafter{\the\f@r@t#1}%
          \if\l@@t\relax\let\next\y@send\else\let\next\t@k@\fi \else
       \char92\the\f@r@t\f@r@t={}\let\next=#1\fi \next}
\def\y@send{\par\vskip-\baselineskip\endgroup\vskip\v@rbatimskip\@fterverbatim}
\def\v@rbdef#1{\obeyspaces\def\sc@nverb##1#1{##1\endgroup}\sc@nverb}


\catcode`\@=\catcodeat                   \let\catcodeat=\undefined

\forverbatim{}     \afterverbatim{}      \forverb{}   \verbatimskip{6pt}

\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%  C o m m e n t  %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Macros in this file enables to print input lines literally as they
% appear in the input file.
%
%  \verbatim  is a control sequence after that all is printed exactly as
%      it appears in the source file.
%  \endverbatim is a control seguence that stops the verbatim mode introduced
%      by control sequence  \verbatim.
%  \verb  is a control sequence with one parameter that will be written
%      word for word. The parameter is introduced and closed by arbitrary
%      (but the same) mark.
%  \forverbatim{...} puts the content of bracket after the \verbatim
%      starts (suitable for setting of margins, fonts, ...)
%  \afterverbatim{...} puts the content of bracket just after \endverbatim
%  \forverb{...} puts the content of bracket after the \verb starts
%  \verbatimskip{<dimen>} sets the skip above and below \verbatim mode
%      to the value <dimen> (default value is 6pt).
%
%  Locally \obeylines is redefined.
%
