Paul
2010-Aug-20  19:58 UTC
[R] Has anyone used Sweave with the Beamer poster macro for Latex ?
Hello,
I'm trying to make a poster in Latex using the beamer poster macro 
(http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), 
and use Sweave to add in R output.
This works fine for adding graphics and tables, but if I want to put 
code in, the file fails to build in Latex.
My Rnw file looks like
\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}
\mode<presentation> {
\usetheme{Berlin}
}
\usepackage{sweave}
\begin{document}
\begin{frame}
    \begin{columns}
       \begin{column}
          \begin{block}{A Block}
             Some text
<<label=sweave, include=TRUE,
echo=TRUE>>x<-rnorm(100,mean=100,sd=15)
print(x)
@
          \end{block}
       \end{column}
    \end{columns}
   \end{frame}
\end{document}
but this doesn't work.  Has anyone else done this ? Any ideas ?
Thanks
Paul.
Duncan Murdoch
2010-Aug-20  20:04 UTC
[R] Has anyone used Sweave with the Beamer poster macro for Latex ?
On 20/08/2010 3:58 PM, Paul wrote:> Hello, > > I'm trying to make a poster in Latex using the beamer poster macro > (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), > and use Sweave to add in R output. > > This works fine for adding graphics and tables, but if I want to put > code in, the file fails to build in Latex. > > My Rnw file looks like > \documentclass[final,hyperref={pdfpagelabels=false}]{beamer} > \mode<presentation> { > \usetheme{Berlin} > } > \usepackage{sweave} > \begin{document} > \begin{frame} > \begin{columns} > \begin{column} > \begin{block}{A Block} > Some text > <<label=sweave, include=TRUE, echo=TRUE>>> x<-rnorm(100,mean=100,sd=15) > print(x) > @ > \end{block} > \end{column} > \end{columns} > \end{frame} > \end{document} > but this doesn't work. Has anyone else done this ? Any ideas ?Code chunks are verbatim, so you need to mark the slide as containing verbatim. I think there's a newer way to do this, but the way I do it is to start them with \begin{frame}[containsverbatim] Duncan Murdoch
Peter Dalgaard
2010-Aug-20  20:08 UTC
[R] Has anyone used Sweave with the Beamer poster macro for Latex ?
On 08/20/2010 09:58 PM, Paul wrote:> Hello, > > I'm trying to make a poster in Latex using the beamer poster macro > (http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), > and use Sweave to add in R output. > > This works fine for adding graphics and tables, but if I want to put > code in, the file fails to build in Latex. > > My Rnw file looks like > \documentclass[final,hyperref={pdfpagelabels=false}]{beamer} > \mode<presentation> { > \usetheme{Berlin} > } > \usepackage{sweave} > \begin{document} > \begin{frame} > \begin{columns} > \begin{column} > \begin{block}{A Block} > Some text > <<label=sweave, include=TRUE, echo=TRUE>>> x<-rnorm(100,mean=100,sd=15) > print(x) > @ > \end{block} > \end{column} > \end{columns} > \end{frame} > \end{document} > but this doesn't work. Has anyone else done this ? Any ideas ?Even without Sweave in the picture, beamer has trouble with verbatim environments. You usually need \begin{frame}[fragile] No guarantees, but worth a try. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
r.ookie
2010-Aug-20  22:46 UTC
[R] Has anyone used Sweave with the Beamer poster macro for Latex ?
Good to be aware of this, thanks for mentioning it!
On Aug 20, 2010, at 12:58 PM, Paul wrote:
Hello,
I'm trying to make a poster in Latex using the beamer poster macro
(http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php), and use
Sweave to add in R output.
This works fine for adding graphics and tables, but if I want to put code in,
the file fails to build in Latex.
My Rnw file looks like
\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}
\mode<presentation> {
\usetheme{Berlin}
}
\usepackage{sweave}
\begin{document}
\begin{frame}
  \begin{columns}
     \begin{column}
        \begin{block}{A Block}
           Some text
<<label=sweave, include=TRUE,
echo=TRUE>>x<-rnorm(100,mean=100,sd=15)
print(x)
@
        \end{block}
     \end{column}
  \end{columns}
 \end{frame}
\end{document}
but this doesn't work.  Has anyone else done this ? Any ideas ?
Thanks
Paul.
______________________________________________
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.