# [R] Bugreport on integration of Sweave and latex beamer

Duncan Murdoch murdoch at stats.uwo.ca
Fri Aug 31 12:43:40 CEST 2007

Ajay Shah wrote:
> I think I have isolated a problem with integration between Sweave and beamer.
>

Sweave makes a lot of use of verbatim environments, and beamer doesn't
like those.  You need to declare that a slide contains verbatim or you
get errors like that.

I'm sure there are other ways to do this, but one that works is to use

\begin{frame}[containsverbatim]

at the start of each slide.  This makes some other beamer features stop
working, but I forget which.

Duncan Murdoch
> Could you please see the file:
>       http://www.mayin.org/ajayshah/tmp/bugdemo.Rnw
>
> Unfortunately, it uses some of my internal libraries, so you can't run
> it. When I put it through Sweave, I get:
>
>       http://www.mayin.org/ajayshah/tmp/bugdemo.tex
>
> which is, of course, a generic latex file which you can read and run.
>
> When I try to use pdflatex, I get the error:
>
> ...
> ...
> ...
> (/sw/share/texmf-dist/tex/latex/ae/t1aett.fd)
> Runaway argument?
>
>> prices <- cbind(mydb("macro", "nifty", freq = "w"),
>>
> mydb("firm.pric\ETC.
> ! Paragraph ended before \FV at BeginScanning was complete.
>                    \par
> l.60 \end{frame}
>
> ?
>
> I transplanted the R code from bugdemo.Rnw into an ordinary latex
> article context, and everything works fine. Hence, I'm sure it's
> something to do with the integration between Sweave and beamer. Are
> there some catches that I ought to know about?
>
>