Article View: comp.text
Article #3915Re: ewenvironment in LaTeX
From: T Anderson
Date: Wed, 05 Aug 1987 22:01
Date: Wed, 05 Aug 1987 22:01
31 lines
1651 bytes
1651 bytes
A related (but not the same) problem I had with verbatim was to
include a file inside a verbatim environment. I wanted to have
a file of sample LaTeX code that could be LaTeXed alone correctly
and then include that file verbatim as an appendix in another
document. Of course, I could have copied the file in with my
editor, but I wanted changes in the sample file to be automatically
changed in the version in the appendix.
The problem of course is that
\begin{verbatim}
\input examplefile
\end{verbatim}
only prints `\input examplefile'. One can place the verbatim
commands in the examplefile, but then one can not use the example
file directly to generate the example. A solution:
\def\bv{\begin{verbatim}}% necessary to use expandafter
\def\infil{\input examplefile}
\expandafter\bv\infil
\end{verbatim}
There may be a similar solution with more expandafters that avoids
the def's but at least this worked.
-- Terry L Anderson
AT&T Bell Laboratories -- Liberty Corners
UUCP: ...!ihnp4!kaiser!tla
TeleMail: Terry.Anderson
(201) 580-4428
Technical Details
Message-ID:
<633@kaiser.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!kaiser!tlaReferences:
<311@crin.UUCP> <453@cgcha.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!kaiser!tla From: tla@kaiser.UUCP (T Anderson) Newsgroups: comp.text Subject: Re: ewenvironment in LaTeX Message-ID: <633@kaiser.UUCP> Date: Wed, 5-Aug-87 18:01:27 EDT Article-I.D.: kaiser.633 Posted: Wed Aug 5 18:01:27 1987 Date-Received: Sat, 8-Aug-87 06:11:21 EDT References: <311@crin.UUCP> <453@cgcha.UUCP> Distribution: world Organization: AT&T Bell Laboratories, Liberty Corner Lines: 31