Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!sif.claremont.edu From: dhosek@sif.claremont.edu (Hosek, Donald A.) Newsgroups: comp.text.tex Subject: Re: Using \iffalse inside a LaTeX environment definition. Message-ID: <7964@jarthur.Claremont.EDU> Date: 27 Jul 90 19:36:35 GMT Sender: news@jarthur.Claremont.EDU Reply-To: dhosek@sif.claremont.edu Organization: Harvey Mudd College Lines: 47 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} >but no dice, TeX (or LaTeX) won't take it. The first time the >Comments environment is used it complains of a missing \fi. I suppose >this is one of the standard questions that gets asked here, so don't >flame too loudly; I just want a method that doesn't involve editing >all those files. Yes, this is a tricky problem, but there is a convenient way of solving it given in verbatim.sty (get the file verbatim.readme from ymir.claremont.edu in [anonymous.tex.inputs.latex-mainz] to find out what files you will need. mailserv users can send a message to mailserv@ymir.claremont.edu with the line SEND [tex.inputs.latex-mainz]verbatim.readme to get the list of necessary files). [[As an aside, let me point out that the facilities provided in the latex-mainz directory will become part of the next version of LaTeX which is why they have been set aside in their own directory]] If you have verbatim.sty you can then do something like \newenvironment{answer}{\comment}{\endcomment} and have anything between \begin{answer} and \end{answer} ignored. There are also some very nice extensions of the verbatim environment and the ability to do a verbatim input of another file. -dh --- Don Hosek TeX, LaTeX, and Metafont Consulting and dhosek@ymir.claremont.edu production work. Free Estimates. dhosek@ymir.bitnet uunet!jarthur!ymir Phone: 714-625-0147