Hi, has anyonne experienced problems between the LaTeX beamer class and Sweave? The following code does not work properly: ################################# \documentclass{beamer} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{ngerman} \begin{document} \frame{ \frametitle{test} test <<>> 1+1 @ } \end{document} ################################# Below is the error code: ################################# loading : Context Support Macros / PDF (2004.10.26) ) (d:\programme\texmf\tex\latex\hyperref\nameref.sty) (testset.out) (testset.out) (testset.nav) (d:\programme\texmf\tex\latex\ae\t1aett.fd) Runaway argument?> 1 + 1 \end {Sinput} \begin {Soutput} [1] 2 \end {Soutput} \end{Sch\ETC. ! Paragraph ended before \FV at BeginScanning was complete. <to be read again> \par l.26 } ? x No pages of output. Transcript written on testset.log. ################################# Thanks in advance, Bernd
Hi Bernd, I think it is because you are trying to place a chunk of R code within a LaTeX command. I'm not sure that Sweave will be able to handle that. In situations analogous to this I process the R chunk earlier in my document and create an object that I then access in the LaTeX chunk using \Sexpr{}. Re-working your example might be something like this (untested): ################################# \documentclass{beamer} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{ngerman} \begin{document} <<>>x <- 1+1 @ \frame{ \frametitle{test} test \Sexpr{x}} \end{document} ################################# Dave "Bernd Weiss" <bernd.weiss at uni-koeln.de> writes:> Hi, > > has anyonne experienced problems between the LaTeX beamer class and > Sweave? The following code does not work properly: > ################################# > \documentclass{beamer} > > \usepackage[latin1]{inputenc} > \usepackage[T1]{fontenc} > \usepackage{ngerman} > > \begin{document} > \frame{ > \frametitle{test} > test > <<>>> 1+1 > @ > } > \end{document} > ################################# > > Below is the error code: > ################################# > loading : Context Support Macros / PDF (2004.10.26) > ) (d:\programme\texmf\tex\latex\hyperref\nameref.sty) (testset.out) > (testset.out) (testset.nav) > (d:\programme\texmf\tex\latex\ae\t1aett.fd) > Runaway argument? > > 1 + 1 \end {Sinput} \begin {Soutput} [1] 2 \end {Soutput} \end > {Sch\ETC. > ! Paragraph ended before \FV at BeginScanning was complete. > <to be read again> > \par > l.26 } > > ? x > No pages of output. > Transcript written on testset.log. > ################################# > > Thanks in advance, > > Bernd > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- David Whiting University of Newcastle upon Tyne, UK
On 20 Dec 2004 at 7:11, Bernd Weiss wrote:> Hi, > > has anyonne experienced problems between the LaTeX beamer class and > Sweave? The following code does not work properly: > ################################# \documentclass{beamer} > > \usepackage[latin1]{inputenc} > \usepackage[T1]{fontenc} > \usepackage{ngerman} > > \begin{document} > \frame{ > \frametitle{test} > test > <<>>> 1+1 > @ > } > \end{document} > #################################The following code works as expected! It is important to use a frame-environment and the "fragile"-option. \begin{frame}[fragile] ... \end{frame} ################################## \documentclass{beamer} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{ngerman} \begin{document} \begin{frame}[fragile] \frametitle{test} test <<>> 1+1 @ \end{frame} \end{document} ####################################
I compiled your code exactly as posted but had no problem at all!! I'm using Debian-GNU/Linux & Emacs, so possibly this has to do with your editor Ste>-- Messaggio Originale -- >From: "Bernd Weiss" <bernd.weiss at uni-koeln.de> >To: r-help at stat.math.ethz.ch >Date: Mon, 20 Dec 2004 07:11:31 +0100 >Subject: [R] Sweave and LaTeX beamer class > > >Hi, > >has anyonne experienced problems between the LaTeX beamer class and >Sweave? The following code does not work properly: >################################# >\documentclass{beamer} > >\usepackage[latin1]{inputenc} >\usepackage[T1]{fontenc} >\usepackage{ngerman} > >\begin{document} >\frame{ > \frametitle{test} >test ><<>>> 1+1 >@ >} >\end{document} >################################# > >Below is the error code: >################################# >loading : Context Support Macros / PDF (2004.10.26) >) (d:\programme\texmf\tex\latex\hyperref\nameref.sty) (testset.out) >(testset.out) (testset.nav) >(d:\programme\texmf\tex\latex\ae\t1aett.fd) >Runaway argument? >> 1 + 1 \end {Sinput} \begin {Soutput} [1] 2 \end {Soutput} \end >{Sch\ETC. >! Paragraph ended before \FV at BeginScanning was complete. ><to be read again> > \par >l.26 } > >? x >No pages of output. >Transcript written on testset.log. >################################# > >Thanks in advance, > >Bernd > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html__________________________________________________________________ Tiscali Adsl 2 Mega Free: l'adsl piu' veloce e' gratis! Naviga libero dai costi fissi con Tiscali Adsl 2 Mega Free, l'adsl Free piu' veloce in Italia. In piu', se ti abboni entro il 7 gennaio 2005, navighi gratis fino al 31 marzo. E il costo di adesione e' GRATIS. http://abbonati.tiscali.it/adsl/