Path: utzoo!attcan!uunet!decwrl!sdd.hp.com!usc!snorkelwacker!mintaka!yale!cs.yale.edu!newsbase!duchier From: duchier@cs.yale.edu (Denys Duchier) Newsgroups: comp.text.tex Subject: Re: Using \iffalse inside a LaTeX environment definition. Message-ID: Date: 27 Jul 90 14:54:56 GMT References: <811@qusuntrd.queensu.CA> Sender: news@cs.yale.edu Reply-To: duchier-denys@cs.yale.edu Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 29 Nntp-Posting-Host: albania.ai.cs.yale.edu In-reply-to: erskine@qucis.queensu.CA's message of 27 Jul 90 02:17:43 GMT In article <811@qusuntrd.queensu.CA> erskine@qucis.queensu.CA (Neil Erskine) writes: > I have a large number of files written using LaTeX and some > additional macros I wrote. I sometimes want to suppress certain > parts of them, so I thought to do this by placing some parts in null > environments, as in > > \newenvironment{Comments}{}{} > ... > \begin{Comments} > Stuff that is sometimes suppressed. > \end{Comments} > > I now want to suppress the comments, so I tried > > \newenvironment{Comments}{\iffalse}{\fi} >[...] Here comes this question again! :-) The following ought to do what you want. {\catcode`\{= 12 \catcode`\}= 12 \catcode`\@=11 \catcode`\[=1 \catcode`]=2 \catcode`\|=0 \catcode`\\=12 |global|long|def|@Comments#1\end{Comments}[|end[Comments]] |global|def|Comments[|let|do|@makeother|dospecials|@Comments]] --Denys