%%%
%%% This style file has been copied verbatim (excuse the pun) from
%%% /usr/local/lib/tex/macros for self containment with the understanding that
%%% it is one of the standard public domain style extensions of latex.  Please
%%% DO NOT propagate this file.  Obtain a copy from you local unix directory
%%% or contact sjohnson@cs.indiana.edu.  Thank you.  
%%
%
% Here is a version of Adrian's VERBATIM.STY, for inputting whole files
% verbatim, which is "more LaTeX-like" in that it uses the actual LaTeX 
% macros which set up the `verbatim' environment.
%
% As a matter  of interest, it is much nicer for TeX if you input large
% quantities of "verbatim material" from an "external file" rather than by use 
% of the `verbatim' environment (i.e. putting the material in the main input 
% file. This is because this environment, in common with most (but not all)
% other "verbatim macros", makes the whole of the "vebatim material" a macro
% argument and therefore eats up TeTeX's internal memory.
%
% Chris Rowley
%

% ---              V E R B A T I M F I L E S . S T Y
%
% --- This LaTeX style-file defines two user-callable macros:
% ---     \verbatimfile{<filename>}    for verbatim inclusion of a file
% ---     \verbatimlisting[n]{<filename>} for verbatim inclusion
%                                         with line numbers every nth line
%
% --- The macros are based on those distributed with Sunil Podar's
% --- `EPIC.STY' macro package, attributed to Tim Morgan,
% --- modified to keep internal macros internal by Adrian F. Clark,
% --- alien@uk.ac.essex.ese
% --- ---and further latexification by Chris Rowley,
% --- ca_rowley@uk.ac.open.acs.vax.
% --- optional argument for numbering multiples of [N] by H. Schulzrinne
%     hgschulz@cs.umass.edu
%
% --- Note that the precise layout of line breaks in this file is important!
%

\def\verbatimfile#1{\begingroup
                    \@verbatim \frenchspacing \@vobeyspaces
                    \input#1 \endgroup
}

\newcounter{lineno}\newcounter{Lineno}
\def\verbatimlisting{\@ifnextchar[{\@verbatimlisting}{\@verbatimlisting[5]}}
\def\@verbatimlisting[#1]#2{\setcounter{lineno}{0}\setcounter{Lineno}{0}%
  \begingroup \@verbatim \frenchspacing \@vobeyspaces \parindent=20pt
  \everypar{\stepcounter{lineno}\stepcounter{Lineno}\ifnum\value{Lineno}=#1
    \setcounter{Lineno}{0}\llap{\footnotesize\it\thelineno\ \ }\fi}\input#2
  \endgroup
}
