[R] Beamer and Sweave

Michael Kubovy kubovy at virginia.edu
Sun Aug 6 23:09:32 CEST 2006


Thanks Deepayan,

\begin{frame}[fragile]
...
\end{frame}

works, but

\frame[fragile]{
...
}

doesn't.

\frame[containsverbatim]{
...
}

works when there's no build, but there's a
\begin{Schunk}
...
\end{frame}

in the frame body.

On Aug 6, 2006, at 4:21 PM, Deepayan Sarkar wrote:

> 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

_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/



More information about the R-help mailing list