what’s wrong with package comment?!

I spent most of the Sunday afternoon trying to understand why defining

\newcommand{\era}{\end{comment}}

did not have the same effect as writing the line

\end{comment}

until I found there is a clash due to the comment package… The assuredly simple code

\documentclass{book}
\usepackage{comment}
\begin{document}

\begin{comment}
prompt, you could embark on an on-line visit of the main features of {\tt R} by typing \verb+demo()+ after the prompt (make sure to test \verb+demo(image)+ and \verb+demo(graphics)+ to get an idea of the
\era

Self-explanatory.
\end{document}

produces an error message:

Runaway argument?
! File ended while scanning use of \next.
<inserted text>
                \par
<*> moretest.tex

This is quite an inconvenience as I need to compile my solution manual for “Introducing Monte Carlo Methods with R” with the even-numbered exercises commented out or not depending on the version… (Leaving this package out and using the comment command within the verbatim package does not work either because era does not seem to be recognised as the end of a commented part…)

5 Responses to “what’s wrong with package comment?!”

  1. As mishaps come by pairs, I also discovered that all my own comments are now tagged as spams! On my own blog!

  2. Try \includecomment and \excludecomment instead

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 633 other followers