Article View: comp.text.tex
Article #1616Re: Skipping sections of input
From: J. Daniel Smith
Date: Mon, 28 May 1990 18:04
Date: Mon, 28 May 1990 18:04
88 lines
3600 bytes
3600 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
>[..]
>real pain for large sections of text. It would be much nicer if I
>could just do something like
> \begin {blockcomment}
> blah...blah...blah
> \end {blockcomment}
> Everything between the begin and end would be ignored. Does anyone
I asked the same question a few months ago, and since I didn't get any
answer then I wrote up a few macros to handle the job. I'm not sure
if everything is done correctly, but they seem to work OK (I put all
of latex.tex between \begin{comment} and \end{comment} and didn't get
anything). These macros funciton like the 'verbatim' environment, so
you can't use them as part of another environment (e.g.
\newenvironment{blockout}{\begin{comment}}{\end{comment}} won't work).
Send me any comments, questions, improvements, etc.
Dan
-------
%
% J. Daniel Smith
% 7 April 1990
%
% comment.sty
%
% Copyright (c) 1990 J. Daniel Smith. All rights reserved.
% Permission is hereby granted to use this code, or portions thereof,
% in any way desired provided such use is strictly non-commercial
% in nature.
%
% All text between \begin{comment} and \end{comment} is ignored by
% LaTeX. Modified from the verbatim macros of LaTeX.
%
\typeout{Document Style option `comment' <7 Apr 90>.}
%
\catcode`@=11
%
\def\c@tend{\catcode`@=14\catcode``=14}
\def\c@mmentcat{
\let\c@=\catcode
\c@`!=14 \c@`"=14 \c@`\#=14
\c@`\$=14 \c@`\&=14 \c@`'=14 \c@`(=14
\c@`)=14 \c@`*=14 \c@`+=14 \c@`,=14 \c@`-=14
\c@`.=14 \c@`/=14 \c@`0=14 \c@`1=14 \c@`2=14
\c@`3=14 \c@`4=14 \c@`5=14 \c@`6=14 \c@`7=14
\c@`8=14 \c@`9=14 \c@`:=14 \c@`;=14 \c@`<=14
\c@`==14 \c@`>=14 \c@`?=14 \c@`@=14 \c@`A=14
\c@`B=14 \c@`C=14 \c@`D=14 \c@`E=14 \c@`F=14
\c@`G=14 \c@`H=14 \c@`I=14 \c@`J=14 \c@`K=14
\c@`L=14 \c@`M=14 \c@`N=14 \c@`O=14 \c@`P=14
\c@`Q=14 \c@`R=14 \c@`S=14 \c@`T=14 \c@`U=14
\c@`V=14 \c@`W=14 \c@`X=14 \c@`Y=14 \c@`Z=14
\c@`[=14 \c@`]=14 \c@`^=14 \c@`_=14
\c@`a=14 \c@`f=14 \c@`g=14 \c@`h=14 \c@`i=14
\c@`j=14 \c@`k=14
\c@`q=14 \c@`s=14
\c@`u=14 \c@`v=14 \c@`w=14 \c@`x=14
\c@`y=14 \c@`z=14 \c@`|=14
\c@`~=14 \c@` =14\c@tend}
%
\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |long|gdef|@xcomment#1\end{comment}[|end[comment]]
|endgroup
\def\@comment{\let\do\@makeother \dospecials\c@mmentcat}
\let\endc@mment=\endtrivlist
%\newenvironment{comment}{\@comment\@xcomment}{\endc@mment}
\newenvironment{comment}{\@comment\@xcomment}{}
%
\catcode`@=12
=========================================================================
J. Daniel Smith Internet: smithda@cpsvax.cps.msu.edu
Michigan State University BITNET: smithdan@msuegr
East Lansing, Michigan Usenet: uunet!frith!smithda
Great things can be reduced to small things, and small things can be
reduced to nothing.
- Chinese Proverb
=========================================================================
Technical Details
Message-ID:
<1990May28.180442.9166@msuinfo.cl.msu.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mailrus!ncar!tank!msuinfo!cpsvax!smithdaReferences:
<2544@media-lab.MEDIA.MIT.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mailrus!ncar!tank!msuinfo!cpsvax!smithda From: smithda@cpsvax.tmc.edu (J. Daniel Smith) Newsgroups: comp.text.tex Subject: Re: Skipping sections of input Message-ID: <1990May28.180442.9166@msuinfo.cl.msu.edu> Date: 28 May 90 18:04:42 GMT References: <2544@media-lab.MEDIA.MIT.EDU> Sender: news@msuinfo.cl.msu.edu Organization: Michigan State University, East Lansing Lines: 88