[NTG-context] multiple line comments
Aditya Mahajan
adityam at umich.edu
Tue Mar 28 17:05:51 CEST 2006
<--- On Mar 28, Taco Hoekwater wrote --->
>
>
> andrea valle wrote:
>> Dear all,
>> It's a bit tiring to start many lines always with %.
>> Is it possibile to have multiple line comments like in C
>>
>> \*
>> comments here
>> *\
>
> \iffalse
> comments here
> \fi
Be careful with this. From the UK tex FAQ
The simple \newcommand{\gobble}[1]{} and \iffalse ... \fi aren't
really satisfactory (as a general solution) for comments, since the
matter being skipped is nevertheless scanned by TeX, not always as you
would expect. The scanning imposes restrictions on what you're allowed
to skip; this may not be a problem in today's job, but could return to
bite you tomorrow. For an example of surprises that may come to bite
you, consider the following example (derived from real user
experience):
\iffalse % ignoring this bit
consider what happens if we
use \verb|\iftrue| -- a surprise
\fi
The \iftrue is spotted by TeX as it scans, ignoring the \verb command;
so the \iffalse isn't terminated by the following \fi. Also, \gobble
is pretty inefficient at consuming anything non-trivial, since all the
matter to be skipped is copied to the argument stack before being
ignored.
Aditya
More information about the ntg-context
mailing list