On Thu, 30 Sep 2010, Johannes Huesing wrote:

I am failing to uncover Sweave chunks step by step using the LaTeX beamer
class.

The following minimal example:

\documentclass{beamer}
\usepackage{Sweave}
\begin{document}
\begin{frame}[fragile]
 In the year \uncover<2->{25}\uncover<3->{\Sexpr{5*5}}
\uncover<4->{
<<echo=TRUE, print=TRUE>>=
5*5*101
@
}
\end{frame}
\end{document}

leads to an error message when running pdflatex over the *.tex file:

[...]
! FancyVerb Error:
 Extraneous input ` 2525 \end {Soutput} \end {Schunk} \bea...@endcovered ' bet
ween \begin{Soutput}[<key=value>] and line end
.
\...@error ... {FancyVerb Error:
\space \space #1
}


I do not have enough of an understanding of LaTeX to explain this, but it seems \uncover can be tricky.

This works for me:

\documentclass{beamer}
\usepackage{Sweave}
\begin{document}
\begin{frame}[fragile]
  In the year \uncover<2->{25}\uncover<3->{\Sexpr{5*5}}
\begin{uncoverenv}<4->
<<echo=TRUE, print=TRUE>>=
5*5*101
@ %def
\end{uncoverenv}
\end{frame}
\end{document}


--
Johannes H??sing               There is something fascinating about science.
                             One gets such wholesale returns of conjecture
mailto:johan...@huesing.name  from such a trifling investment of fact.
http://derwisch.wikidot.com         (Mark Twain, "Life on the Mississippi")

______________________________________________
R-help@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.


Charles C. Berry                            (858) 534-2098
                                            Dept of Family/Preventive Medicine
E mailto:cbe...@tajo.ucsd.edu               UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
______________________________________________
R-help@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.

Reply via email to