Re: [Rd] R CMD Sweave versus Sweave() on Windows

From: Gabor Grothendieck <>
Date: Thu, 21 Apr 2011 09:30:56 -0400

On Thu, Apr 21, 2011 at 6:44 AM, Pfaff, Bernhard Dr. <> wrote:
> Dear list subscriber,
> I am quite puzzled by the behaviour of processing Sweave files within an R session, i.e.
> Sweave("foo.Rnw") versus R CMD Sweave foo.Rnw
> In the former the environmental variable 'SWEAVE_STYLEPATH_DEFAULT = TRUE' is obeyed (this is set in etc/ as well as under the users home directory in .Renviron). That is the hard-coded path to Sweave.sty is included in the resultant tex-file, whereas if the Sweave file is processed from cmd.exe as R CMD Sweave foo.Rnw, only \usepackage{Sweave} is included.
> Any pointers are much appreciated.
> Best,
> Bernhard
> Output of sessionInfo():
>> sessionInfo()
> R version 2.13.0 (2011-04-13)
> Platform: i386-pc-mingw32/i386 (32-bit)
> locale:
> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252
> [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
> [5] LC_TIME=German_Germany.1252
> attached base packages:
> [1] stats     graphics  datasets  grDevices utils     methods   base
> other attached packages:
> [1] fortunes_1.4-1

SWEAVE_STYLEPATH_DEFAULT is automatically set in Sweave.bat found here (its part of the batchfiles distribution but does not require any other batch file in order to run it):

This was only just added and has not been tested yet but if anyone would like to try it just put it anywhere on your Windows PATH (or current directory) and issue a command like this from the Windows console:

   Sweave myfile.Rnw

Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at

______________________________________________ mailing list
Received on Thu 21 Apr 2011 - 13:36:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Apr 2011 - 14:50:49 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive