1 |
cnh |
1.1 |
% $Id: verbatimfiles.sty,v 1.2 1996/12/23 01:32:18 JCL Exp $ |
2 |
|
|
% verbatimfiles.sty by Rowley/Clark |
3 |
|
|
% Provides commands: |
4 |
|
|
% \verbatiminput{<file>} |
5 |
|
|
% The contents of <file> resp. <file>.tex is displayed verbatim. |
6 |
|
|
% \verbatimlisting{<file>} |
7 |
|
|
% The contents is displayed verbatim together with leading line |
8 |
|
|
% numbering. |
9 |
|
|
% |
10 |
|
|
% Change Log: |
11 |
|
|
% See Log at end of file. |
12 |
|
|
% |
13 |
|
|
% --- start verbatimfiles.sty --- |
14 |
|
|
|
15 |
|
|
% Here is a version of Adrian's VERBATIM.STY, for inputting whole files |
16 |
|
|
% verbatim, which is "more LaTeX-like" in that it uses the actual LaTeX |
17 |
|
|
% macros which set up the `verbatim' environment. |
18 |
|
|
% |
19 |
|
|
% As a matter of interest, it is much nicer for TeX if you input large |
20 |
|
|
% quantities of "verbatim material" from an "external file" rather than by use |
21 |
|
|
% of the `verbatim' environment (i.e. putting the material in the main input |
22 |
|
|
% file. This is because this environment, in common with most (but not all) |
23 |
|
|
% other "verbatim macros", makes the whole of the "vebatim material" a macro |
24 |
|
|
% argument and therefore eats up TeTeX's internal memory. |
25 |
|
|
% |
26 |
|
|
% Chris Rowley |
27 |
|
|
% |
28 |
|
|
|
29 |
|
|
% --- V E R B A T I M F I L E S . S T Y |
30 |
|
|
% |
31 |
|
|
% --- This LaTeX style-file defines two user-callable macros: |
32 |
|
|
% --- \verbatimfile{<filename>} for verbatim inclusion of a file |
33 |
|
|
% --- \verbatimlisting{<filename>} for verbatim inclusion with line numbers |
34 |
|
|
% |
35 |
|
|
% --- The macros are based on those distributed with Sunil Podar's |
36 |
|
|
% --- `EPIC.STY' macro package, attributed to Tim Morgan, |
37 |
|
|
% --- modified to keep internal macros internal by Adrian F. Clark, |
38 |
|
|
% --- alien@uk.ac.essex.ese |
39 |
|
|
% --- ---and further latexification by Chris Rowley, |
40 |
|
|
% --- ca_rowley@uk.ac.open.acs.vax. |
41 |
|
|
% |
42 |
|
|
% --- Note that the precise layout of line breaks in this file is important! |
43 |
|
|
% |
44 |
|
|
|
45 |
|
|
\makeatletter %JCL |
46 |
|
|
|
47 |
|
|
\def\verbatimfile#1{\begingroup |
48 |
|
|
\@verbatim \frenchspacing \@vobeyspaces |
49 |
|
|
\input#1 \endgroup |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
\newcounter{lineno} |
53 |
|
|
|
54 |
|
|
\def\verbatimlisting#1{\setcounter{lineno}{0}% |
55 |
|
|
\begingroup \@verbatim \frenchspacing \@vobeyspaces \parindent=20pt |
56 |
|
|
\everypar{\stepcounter{lineno}\llap{\thelineno\ \ }}\input#1 |
57 |
|
|
\endgroup |
58 |
|
|
} |
59 |
|
|
|
60 |
|
|
\makeatother %JCL |
61 |
|
|
|
62 |
|
|
% --- end verbatimfiles.sty |
63 |
|
|
|
64 |
|
|
\endinput |
65 |
|
|
|
66 |
|
|
% $Log: verbatimfiles.sty,v $ |
67 |
|
|
% Revision 1.2 1996/12/23 01:32:18 JCL |
68 |
|
|
% o added some informative comments and log history |
69 |
|
|
% o uses now \makeatletter, \makeatother (hope that's ok) |
70 |
|
|
% |
71 |
|
|
|