multiple line comments
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 *\ I wasn't able to find anything like it in manual. In this case, what about a \startcomment \stopccoment syntax? Or maybe is it possible to have a user defined command? \comment{ comments here } Thanks -a- Andrea Valle DAMS - Facoltà di Scienze della Formazione Università degli Studi di Torino http://www.semiotiche.it/andrea andrea.valle@unito.it
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
or \startmode[my comment] \stopmode Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Ah! I was pretty sure there was a way...Better, two. (just to understand, in some way they're two hacks, aren't they?) Thanks -a- On 28 Mar 2006, at 13:09, Hans Hagen wrote:
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
or
\startmode[my comment]
\stopmode
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Andrea Valle DAMS - Facoltà di Scienze della Formazione Università degli Studi di Torino http://www.semiotiche.it/andrea andrea.valle@unito.it
andrea valle wrote:
Ah! I was pretty sure there was a way...Better, two. (just to understand, in some way they're two hacks, aren't they?)
no, features there is also (slow): \starthiding \stophiding or \def\startmycomment{\gobbleuntil\stopmycomment} \startmycomment .... \stopmycomment (\startcomment is something different) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
no, features
Thanks, they are so many...:-) Best -a- Andrea Valle DAMS - Facoltà di Scienze della Formazione Università degli Studi di Torino http://www.semiotiche.it/andrea andrea.valle@unito.it
<--- 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
Aditya Mahajan wrote:
<--- 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.
This one is pretty safe: \startbuffer[comment] bla \startbuffer bla \iftrue \startbuffer bla bla bla \stopbuffer bla bla \stopbuffer bla bla \stopbuffer ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
This one is pretty safe:
\startbuffer[comment] bla \startbuffer bla \iftrue \startbuffer bla bla bla \stopbuffer bla bla \stopbuffer bla bla \stopbuffer \starthiding \stophiding
does not support nesting in the way buffers do (simply because it was not enabled); i added a few lines to the buffer handler, so that now we can say: \definebuffer[mycomment][local=yes] and have \startmycomment .... \stopmycomment (this extension will be available in the next release) (btw, in a similar fashion verbatim supports some nesting, which was needed in order to be able to write manuals) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi all, I do the following: \def\com#1{\blank{\bf commentaar:} {\em #1} ---} %\def\com#1{} When I need the comments in my printed text, I put a % for the second line. Simple. Kind regards, Robert Hans Hagen wrote:
Hans Hagen wrote:
This one is pretty safe:
\startbuffer[comment] bla \startbuffer bla \iftrue \startbuffer bla bla bla \stopbuffer bla bla \stopbuffer bla bla \stopbuffer
\starthiding \stophiding
does not support nesting in the way buffers do (simply because it was not enabled); i added a few lines to the buffer handler, so that now we can say:
\definebuffer[mycomment][local=yes]
and have
\startmycomment .... \stopmycomment
(this extension will be available in the next release)
(btw, in a similar fashion verbatim supports some nesting, which was needed in order to be able to write manuals)
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Tuesday 28 March 2006 10:05, Aditya Mahajan wrote:
<--- 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
When faced with such problems I just comment out a group of lines with one command in my Gvim editor. for example after entering five lines of comments I could use this command: :.,-4 s/^/%/ Try it, you might like it :) -- John Culleton Books with answers to marketing and publishing questions: http://wexfordpress.com/tex/shortlist.pdf Book coaches, consultants and packagers: http://wexfordpress.com/tex/packagers.pdf
participants (6)
-
Aditya Mahajan
-
andrea valle
-
Hans Hagen
-
John R. Culleton
-
r.ermers@hccnet.nl
-
Taco Hoekwater