[texworks] Sweave support

Duncan Murdoch murdoch.duncan at gmail.com
Thu Oct 28 18:23:48 CEST 2010


On 28/10/2010 10:38 AM, Stephen Eglen wrote:
> Has anyone got support for Sweave files in texworks under Windows?

I wrote up some instructions on this for our students.  You can read the 
tutorial here:

http://www.stats.uwo.ca/faculty/murdoch/computing/

(it's the last tutorial listed).  I haven't used it much myself, so 
there may be errors or omissions.  (I just noticed one:
it talks about the previewer Yap rather than the Texworks previewer.)

> (Sweave is a way of combining R code within latex.  See e.g.
>
> http://www.damtp.cam.ac.uk/user/sje30/talks/estimate.Rnw
>
> for an example file.  R code is included within chunks using
> <<>>=
> R code here
> @
> )
>
> Together with the instructions on
> http://cddesjardins.wordpress.com/2010/07/31/texworks-with-sweave/
> we can get the Sweave document compiled into a .tex file.  One problem
> on windows however is that when 'estimate.Rnw' is loaded, texworks
> called the file 'estimate.Rnw.tex'.  This confuses latex and Sweave
> (when the Sweave is generating figures, the figures have strange
> extensions that latex does not like.)

I haven't seen this.  Are you sure the name changed when you loaded it, 
not when you created the file?  Windows hides extensions by default.
(You should turn off the hiding; it's one of the Explorer options, but I 
forget how you get to it in current Windows releases.)

Duncan Murdoch

> Strangely though on linux, (ubuntu 10.10), loading estimate.Rnw into
> texworks does not add the .tex suffix.
>
> Best wishes, Stephen Eglen
>
>



More information about the texworks mailing list