As I was preparing my slides for my third year undergraduate stat course, I got a weird error that got a search on the Web to unravel:
! Extra }, or forgotten \endgroup. \endframe ->\egroup \begingroup \def \@currenvir {frame} l.23 \end{frame} \begin{slide} ?
which was related with a fragile environment
\begin{frame}[fragile] \frametitle{simulation in practice} \begin{itemize} \item For a given distribution $F$, call the corresponding pseudo-random generator in an arbitrary computer language \begin{verbatim} > x=rnorm(10) > x [1] -0.021573 -1.134735 1.359812 -0.887579 [7] -0.749418 0.506298 0.835791 0.472144 \end{verbatim} \item use the sample as a statistician would \begin{verbatim} > mean(x) [1] 0.004892123 > var(x) [1] 0.8034657 \end{verbatim} to approximate quantities related with $F$ \end{itemize} \end{frame}\begin{frame}
but not directly the verbatim part: the reason for the bug was that the \end{frame} command did not have a line by itself! Which is one rare occurrence where the carriage return has an impact in LaTeX, as far as I know… (The same bug appears when there is an indentation at the beginning of the line. Weird!) [Another annoying feature is wordpress turning > into > in the sourcecode environment…]
what’s wrong with package comment?!
Posted in Books, R, Statistics, University life with tags comment package, Introducing Monte Carlo Methods with R, LaTeX, R, verbatim on May 4, 2012 by xi'anI spent most of the Sunday afternoon trying to understand why defining
did not have the same effect as writing the line
until I found there is a clash due to the comment package… The assuredly simple code
produces an error message:
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…)
Share:
Like this:
5 Comments »