Re: [R] Trouble with Sweave and Beamer

From: Lorenzo Isella <lorenzo.isella_at_gmail.com>
Date: Sat, 09 Apr 2011 15:21:00 +0200

Hello,
And thanks for the prompt reply.
I also bumped into this thread shortly after posting

http://bit.ly/eLg3QV

where it looks like that the "fragile" option gets the job done (at least on my machine for my example), though I do not know (yet) what it stands for.
I will post again if I have further problems Cheers

Lorenzo

On 09/04/11 14:41, Duncan Murdoch wrote:
> On 11-04-09 8:25 AM, Lorenzo Isella wrote:
>> Dear All,
>> I am running Debian testing on my box and I installed latex and R from
>> the standard repositories.
>> I am trying my hands at sweave, but somehow I am experiencing problems
>> (I am trying to use beamer and Sweave). Please see the snippet at the
>> end of the email and saved as report.Rnw.
>
> Beamer needs to be told that a frame contains verbatim content, which is
> what Sweave uses for R input and output. There are a few ways to do
> this; the one I use is to put this at the start of the frame:
>
> \begin{frame}[containsverbatim]
>
> You had the [t] option on the frame; I don't know beamer well enough to
> know if this is compatible with containsverbatim.
>
> Duncan Murdoch
>
>> When I run the command
>>
>> $ R CMD Sweave report.Rnw
>> Writing to file report.tex
>> Processing code chunks ...
>> 1 : echo term verbatim
>>
>> You can now run LaTeX on 'report.tex'
>>
>> It looks like everything is ok, but when I pdflatex it, I get an error
>> (I am pasting only the end of the console output)
>>
>>
>> no file report.nav.
>> (/usr/share/texmf-texlive/tex/latex/ae/t1aett.fd)
>> Runaway argument?
>> > x<- rnorm(100)> xm<- mean(x)> xm \end {Sinput} \begin {Soutput}\ETC.
>> ! Paragraph ended before \FV_at_BeginScanning was complete.
>> <to be read again>
>> \par
>> l.42 \end{frame}
>>
>> ?
>>
>>
>> Can anyone tell me what is going wrong?
>> Many thanks
>>
>> Lorenzo
>>
>>
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>
>> \documentclass{beamer}
>>
>> \usetheme{Darmstadt}
>> \usefonttheme[onlylarge]{structurebold}
>> \setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}
>> \setbeamertemplate{navigation symbols}{}
>>
>>
>> % Standard packages
>>
>> \usepackage[english]{babel}
>> \usepackage[latin1]{inputenc}
>> \usepackage[T1]{fontenc}
>> \usepackage{Sweave}
>>
>>
>> % The main document
>>
>> \begin{document}
>>
>>
>> \setlength{\unitlength}{\textwidth} % measure in textwidths
>>
>>
>> \begin{frame}[t]{Data Representation and Analysis}
>>
>>
>>
>> <<echo=TRUE>>=
>> x<- rnorm(100)
>> xm<- mean(x)
>> xm
>> @
>>
>>
>>
>> \end{frame}
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 09 Apr 2011 - 13:23:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 09 Apr 2011 - 14:00:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive