[Bioc-devel] texmf error on 7 packages on devel winXP build nodes

Gordon Smyth smyth at wehi.EDU.AU
Sun Aug 27 10:42:40 CEST 2006

Hi Herve, Seth and Martin,

I agree with all you say, in principle, but I 
think that you are forgetting the reason why some 
of packages include the line \usepackage{Sweave} 
in the first place. If the solution of removing 
this line from the Sweave vignette worked in all 
operating systems, then we would have done it years ago.

Here's the problem: the default value for R_HOME 
in the english version of Windows is a character 
string which includes a space character ("Program 
Files"). The space character is not allowable 
syntax in LaTeX. This means that when Sweave adds 
the location of the Sweave.sty to the vignette 
the result is a .tex file which cannot be processed by LaTeX.

There are only two solutions in Windows. Either 
(i) install R into a non-standard location which 
doesn't have a space in the path-name or (ii) 
include \usepackage{Sweave} in the vignette and 
copy Sweave.sty to the LaTeX search path. This 
situation is explained in Appendix A.12 of the Sweave User Manual at


Configuring MikTeX to find the "correct" version 
of Sweave.sty in R_HOME is not a viable option, 
because R_HOME changes everytime one installs a 
new version of R, and most of us run multiple versions of R at any time anyway.

Neither solution (i) or (ii) is ideal, but we 
have so far taken the approach that (ii) is the less drastic of the two.

If we take the approach that you suggest of 
removing \usepackage{Sweave} then we get packages 
which will pass Rcmd check under Windows but 
which cannot be built, assuming that R has been 
installed in the default (recommended) location.

Maybe things have changed over the last few 
years, but I've just experimented a bit with R 
2.4.0dev under Windows XP, and all the above still seems to be true.


>[Bioc-devel] texmf error on 7 packages on devel winXP build nodes
>Herve Pages hpages at fhcrc.org
>Thu Aug 24 18:19:50 CEST 2006
>Seth Falcon wrote:
> > Martin Morgan <mtmorgan at fhcrc.org> writes:
> >> To make things work, you can remove \usepackage{Sweave} from your
> >> vignette (but then you won't be able to build the vignette except by
> >> building the R package). Alternatively, you can configuring tex to
> >> find Sweave.sty. How to actually configure tex depends on your
> >> installation. On Windows using MiKTeX there's a graphical interface to
> >> set MiKTeX options. You can add a 'Root' path to point to the file
> >> system location where R has a copy of Sweave.sty (R_HOME\share\texmf)
> >> and then 'Refresh' the file name data base. On linux the strategy is
> >> usually to define an environment variable TEXINPUTS to include the
> >> path.
> >
> > The preferred fix, IMO, is to remove the \usepackage{Sweave} line from
> > the vignettes. Why?
> >
> > Well, if we let R find/set the path to Sweave.sty, we will always get
> > the latest version of it and do not have to change any additional
> > configuration on the build systems when we upgrade R.
>I vote for this fix too (i.e. removing the \usepackage{Sweave}) because:
>   - The Sweave.sty is not part of the "standard" MikTeX distribution.
>     By removing \usepackage{Sweave} then everybody can easily
>     build the vignette without having to play with TEXINPUTS or copying
>     R_HOME\share\texmf\Sweave.sty around.
>   - Better consistency and reproducibility: by having all vignettes in the
>     1.9 builds using the same Sweave.sty file (the "official" one) we are
>     more consistent. Also other people can try to re-build the vignettes on
>     their own machine and expect to get the same thing. Eventually, it makes
>     tracking down build problems easier.
> >
> > For example, on lemming, are we sure that we are getting the "right"
> > Sweave.sty?
>No we are not. Packages that don't include \usepackage{Sweave} get
>the "right" one (R_HOME\share\texmf\Sweave.sty) but packages that
>include it get C:\localtexmf\tex\Sweave.sty instead.
>And of course, they are different (the diff shows a few changes
>between the files).
> > Granted, the style file does not change often, but I'm
> > concerned about it because Robert and I have recently discussed some
> > additions to it.
> >
> > OTOH, perhaps Herve will have a clever way to automate/trick the
> > configuration such that we always get the right Sweave.sty when R is
> > upgraded.
>Easy: let's remove C:\localtexmf\tex\Sweave.sty so we break
>packages that include \usepackage{Sweave} on lemming too ;-)
>Hervé Pagès
>E-mail: hpages at fhcrc.org
>Phone: (206) 667-5791
>Fax: (206) 667-1319

More information about the Bioc-devel mailing list