🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1617

Re: Skipping sections of input

#1617
From: Guy Metcalfe
Date: Tue, 29 May 1990 00:09
37 lines
2027 bytes
In article <2544@media-lab.MEDIA.MIT.EDU> djs@media-lab.MEDIA.MIT.EDU (David J. Sturman) writes:
>I'm looking for a way to block out large portions of input from a
>Latex document.  This is so I can prevent the printing out of selected
>sections of a large document.  Of course I could just put % in front

This isn't a TeX solution but the c-preprocessor will handle this in
what I think is a more useful way than has so far been mentioned.

Surround blocks of text by #ifdef's, run the file through the
preprocessor, then tex the output.  I.e., cc -P file.tex gives a tex
file with no marked blocks included.  Including a block marked as
COMMENT would be cc -P -DCOMMENT file.tex.

This produces the same result as using TeX's file inclusion commands,
but one needn't have a bunch of small files floating around.  One can
also mark out any number of differnt blocks and include any set of
them easily without editing any files.

The only problem is that the filtered output ends up in a file called
file.i---it doesn't appear that the P option will write to stdout.
But a simple shell script (or---gasp---doing it by hand) could make
this as fancy and automatic as you liked.  An example:

\documentstyle{article}
\begin{document}
This is the some text.
#ifdef COMMENT
And this is a comment of some kind.
#endif
And this is some more text.
\end{document}

--
	Guy Metcalfe				
	Duke University Dept. of Physics	guy@phy.duke.edu
	& Center for Nonlinear Studies		guy@physics.phy.duke.edu
	Durham, N.C.      27706			guy%phy.duke.edu@cs.duke.edu
Technical Details
Message-ID: <19852@duke.cs.duke.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!duke!physics!guy
References: <2544@media-lab.MEDIA.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!duke!physics!guy
From: guy@physics (Guy Metcalfe)
Newsgroups: comp.text.tex
Subject: Re: Skipping sections of input
Message-ID: <19852@duke.cs.duke.edu>
Date: 29 May 90 00:09:18 GMT
References: <2544@media-lab.MEDIA.MIT.EDU>
Sender: news@duke.cs.duke.edu
Reply-To: guy@physics.phy.duke.edu (Guy Metcalfe)
Organization: Duke University Physics Dept.; Durham, N.C.
Lines: 37