**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

**T**his 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…)

Filed under: Books, R, Statistics, University life Tagged: comment package, Introducing Monte Carlo Methods with R, LaTeX, R, verbatim

*Related*

To

**leave a comment** for the author, please follow the link and comment on his blog:

** Xi'an's Og » R**.

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as: visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...

**Tags:** Books, comment package, Introducing Monte Carlo Methods with R, LaTex, R, statistics, University life, verbatim

## what’s wrong with package comment?!

Xi'an's Og » R, and kindly contributed to R-bloggers)Ispent most of the Sunday afternoon trying to understand why definingdid not have the same effect as writing the line

until I found there is a clash due to the

commentpackage… The assuredly simple codeproduces an error message:

This is quite an inconvenience as I need to compile my solution manual for “” with the even-numbered exercises commented out or not depending on the version… (Leaving this package out and using the comment command within theIntroducing Monte Carlo Methods with Rverbatimpackage does not work either becauseeradoes not seem to be recognised as the end of a commented part…)Filed under: Books, R, Statistics, University life Tagged: comment package, Introducing Monte Carlo Methods with R, LaTeX, R, verbatim

Relatedleave a commentfor the author, please follow the link and comment on his blog:Xi'an's Og » R.R-bloggers.com offers

daily e-mail updatesabout R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...subscribe for updatesTags:Books, comment package, Introducing Monte Carlo Methods with R, LaTex, R, statistics, University life, verbatim