I have a problem with \excludecomment from comment package and a \newcommand.
The following codes work good, which means, it can generate the desired pdf output.
\documentclass{article}
\usepackage{comment}
\excludecomment{dontshow}
\begin{document}
This is a test.
\begin{dontshow}
test test test
\end{dontshow}
\end{document}
However, if I add the following:
\newcommand{\noshow}[2]{#1=#2 \begin{dontshow}#2=#1\end{dontshow} #1=#2}
\noshow{abc}{def}
It generates an error:
(c:/texlive/2010/texmf-dist/tex/latex/comment/comment.sty
Excluding comment 'comment') Excluding comment 'dontshow' (./test.aux))
Runaway argument?
! File ended while scanning use of \next.
<inserted text>
\par
<*> test.tex
?
How can I use 'comment' in a \newcommand?
\noshow{abc}{def}, that is same as:abc=def \begin{dontshow} def=abc\end{dontshow} abc=def? I don't quite understand how\ifshow' connects todontshow' environment. – Chang Feb 27 '11 at 18:01showname can be changed to a different name if you want. Both are getting coupled just after loading the package when the if-switch in- or excludes thedontshowenvironment. – Martin Scharrer Feb 27 '11 at 18:05