<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reproducible Research Ideas &#187; LaTeX</title>
	<atom:link href="http://www.reproducibleresearch.net/blog/tag/latex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reproducibleresearch.net/blog</link>
	<description>Ideas, interesting papers and news items around reproducible research</description>
	<lastBuildDate>Sun, 29 Aug 2010 06:32:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reproducible presentations</title>
		<link>http://www.reproducibleresearch.net/blog/2008/07/25/reproducible-presentations/</link>
		<comments>http://www.reproducibleresearch.net/blog/2008/07/25/reproducible-presentations/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 18:11:46 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Beamer]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Sweave]]></category>

		<guid isPermaLink="false">http://reproducibleresearch.org/blog/?p=7</guid>
		<description><![CDATA[Yesterday I wrote about my experience trying out Beamer for writing presentations in LaTeX. Some of the images that I&#8217;m wanting to include in my presentations are plots produced in R, so one simplification would be to combine Beamer with Sweave. That way I could include code for producing the images directly in my presentation [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote about my experience trying out <a href="http://www.johndcook.com/blog/2008/07/24/latex-and-powerpoint-presentations/">Beamer for writing presentations in LaTeX</a>. Some of the images that I&#8217;m wanting to include in my presentations are plots produced in R, so one simplification would be to combine Beamer with Sweave. That way I could include code for producing the images directly in my presentation file rather than referencing external image files. Any change to the R code would be automatically reflected in my presentation.</p>
<p>One problem I had when turning a LaTeX Beamer file into a Sweave file was image sizes. When an Sweave file has <code>\documentclass{article}</code>, plots are modestly sized and centered. But when I tried including a plot with an Sweave file with <code>\documentclass{Beamer}</code>, the image was so large that it covered up other material on the slide. The solution was to include the following line immediately after the <code>\begin{document}</code> command:</p>
<pre>\setkeys{Gin}{width=0.6\textwidth}</pre>
<p>(See section 4.1.2, page 14 of the <a href="http://www.statistik.lmu.de/~leisch/Sweave/Sweave-manual.pdf">Sweave manual</a>.) This command made the image the size I wanted, but the image was no longer centered. To center the image, I added <code>\begin{center}</code> before and <code>\end{center}</code> after the Sweave figure command. This worked. A sketch of the code is included below.</p>
<pre>\documentclass{Beamer}
\begin{document}
<span style="color: #993300;">\setkeys{Gin}{width=0.6\textwidth}</span>

\begin{frame}
\frametitle{...}

Slide verbiage ...

<span style="color: #993300;">\begin{center}</span>
&lt;&lt;&amp;fig=TRUE, echo=FALSE&gt;&gt;=
# R code ...
@
<span style="color: #993300;">\end{center}</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.reproducibleresearch.net/blog/2008/07/25/reproducible-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
