[R] Beamer and Sweave

Deepayan Sarkar deepayan.sarkar at gmail.com
Sun Aug 6 22:21:30 CEST 2006


On 8/6/06, Michael Kubovy <kubovy at virginia.edu> wrote:
> Dear R-helpers,
>
> Here is a minimal .Rnw file which shows that builds do not work in
> frames that contain chunks of verbatim code:
>
> \documentclass[]{beamer}
>
> \author{}
> \date{}
>
> \title{Title}
>
> \begin{document}
>
> \frame[containsverbatim]{\frametitle{Here the build doesn't work}
> \begin{enumerate}[<+->]
>         \item A
>         \item \alert{B}
>         \item C
> \end{enumerate}
> <<generateIQ>>=
>         iq <- c(96, 102, 104, 104, 108, 110)
> @
> }
>
> \frame{\frametitle{Here it does}
> \begin{enumerate}[<+->]
>         \item A
>         \item \alert{B}
>         \item C
> \end{enumerate}
> }
>
> \end{document}
>
> Is this a Beamer problem or an Sweave problem? Suggestions?

Beamer. You need

\begin{frame}[fragile]
\frametitle{Should work now}
 \begin{enumerate}[<+->]
         \item A
         \item \alert{B}
         \item C
 \end{enumerate}
<<generateIQ>>=
         iq <- c(96, 102, 104, 104, 108, 110)
@
\end{frame}

(not sure what the \frame version is, probably \frame[fragile]

-Deepayan



More information about the R-help mailing list