Article View: de.comp.tex
Article #629Re: verbatim input
From: Christoph Berger
Date: Thu, 03 Sep 1992 12:14
Date: Thu, 03 Sep 1992 12:14
66 lines
2897 bytes
2897 bytes
Thomas Madeya @ KA schrieb am Mi, 02.09.92 um 08:48:
>Wie sag ich's meinem TeX, dass bei einem input die Datei verbatim gesetzt
>wird?
Du brauchst nur den verbatim-Style, den ich in dieser Message mitliefere.
Dann kannst Du folgendes machen:
\documentstyle[dina4,verbatim]{article}
\begin{document}
blabla...
\verbatimfile{<Dateiname>} % macht genau das, was Du suchst!
% oder \verbatimlisting{<Dateiname>}, fuegt Zeilennummern an
blabla...
\end{document}
So, jetzt kommt der Style. Ausschneiden und in dem Ordner einkleben, in dem
die ganzen LaTeX-Style-Files (*.STY) stehen, i. a. der LATEX-Ordner.
Viel Spass damit!
Christoph
---8<------------------------------------------------------------------
% 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:
<A20983@M.maus.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!uniol!artcom0!hb.maus.de!m.maus.de!Christoph_BergerReferences:
<A6239@KA.maus.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!uniol!artcom0!hb.maus.de!m.maus.de!Christoph_Berger From: Christoph_Berger@m.maus.de (Christoph Berger) Newsgroups: de.comp.tex Subject: Re: verbatim input Message-ID: <A20983@M.maus.de> Date: 3 Sep 92 12:14:00 GMT Article-I.D.: M.A20983 References: <A6239@KA.maus.de> Organization: MausNet Lines: 66 X-Gateway: MausGate/News 1.11