Article View: de.comp.tex
Article #691Re: verbatim input
From: Christian Koenig
Date: Sat, 05 Sep 1992 14:31
Date: Sat, 05 Sep 1992 14:31
59 lines
2702 bytes
2702 bytes
Hi Thomas, am 02 Sep 92 hast Du folgende Zeilen geschrieben:
TM> Wie sag ich's meinem TeX, dass bei einem input die Datei verbatim gesetzt
TM> wird?
TM>
TM> \begin{verbatim} \input{datei} \end{verbatim} muss natuerlich scheitern.
TM>
TM> Bisher helfe ich mir damit, dass ich das "begin-end" in datei anbringen.
TM> Gibt's
TM> da noch eine bessere Loesung?
TM>
TM> Thomas
Klar: Einen Verbatim - Inputfilestyle: (verbatimfiles.sty)
-------------CUT HERE-----------------------------------------
% 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{<filename>} for verbatim inclusion with line numbers
%
% --- 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.
%
% --- 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}
\def\verbatimlisting#1{\setcounter{lineno}{0}%
\begingroup \@verbatim \frenchspacing \@vobeyspaces \parindent=20pt
\everypar{\stepcounter{lineno}\llap{\thelineno\ \ }}\input#1
\endgroup
}
Technical Details
Message-ID:
<93EECC61@p4000.f4.n246.z2.fidonet.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uniol!artcom0!hb.maus.de!p4000.f4.n246.z2.fidonet.org!Christian_KoenigReferences:
<A6239@KA.maus.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!uniol!artcom0!hb.maus.de!p4000.f4.n246.z2.fidonet.org!Christian_Koenig From: Christian_Koenig@p4000.f4.n246.z2.fidonet.org (Christian Koenig) Newsgroups: de.comp.tex Subject: Re: verbatim input Message-ID: <93EECC61@p4000.f4.n246.z2.fidonet.org> Date: 5 Sep 92 14:31:00 GMT Article-I.D.: p4000.93EECC61 References: <A6239@KA.maus.de> Organization: Monster Box, Muenchen Lines: 59 X-Gateway: MausGate/News 1.11