From murdoch at stats.uwo.ca  Thu May 13 16:19:50 2010
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 13 May 2010 10:19:50 -0400
Subject: [Rd] Using Sweave in hostile environments
Message-ID: <4BEC0A86.4030906@stats.uwo.ca>

I'm trying to put together a poster using the LaTeX a0poster package and 
including some things from pstricks to get gradient shading, etc.

The problem is that the default environments used by Sweave don't work 
where I need them.  A simple code chunk like

<<eval=FALSE>>=
x <- 1
@

buried in a minipage within a psshadowbox gives the error

Runaway argument?
 > x <- 1 \end {Sinput} \end {Schunk} and the resulting variable would\ETC.
D:/test.tex:302: Paragraph ended before \FV@
BeginScanning was complete


Has anyone solved this problem?  One way I see that might work is to put 
the code chunk outside the environment and use SaveVerbatim to save it, 
then just put \BUseVerbatim or \LUseVerbatim in place where I need it.  
But because I'm using Sweave, I somehow need to redefine the Sinput, 
Soutput and maybe the Schunk environments to do that, and I don't see 
how to do so. 

Duncan Murdoch



[Rd] Using Sweave in hostile environments
Duncan Murdoch