Skip to content
Prev 6386 / 21312 Next

[Bioc-devel] BiocStyle on windows with spaces in path names

On 10/6/2014 2:44 PM, James W. MacDonald wrote:
It would be great for BiocStyle to return a functional path under all circumstances.

I'm not sure that MikTex handles ~ in paths? or at least not the way BiocStyle 
currently uses this, as

\RequirePackage{C:/PROGRA~1/R/R-31~1.0/library/BiocStyle/sty/Bioconductor}

When I try to mock this up it looks like the ~ are being processed as latex -- 
there is a latex file not found error with the ~ replaced by \unhbox\voidb at x 
\penalty \@m \{}.

I thought there might be some hints with the Sweave sty file use by all 
vignettes. This is found with

         styfile <- file.path(R.home("share"), "texmf", "tex", "latex", "Sweave")
         if (.Platform$OS.type == "windows")
             styfile <- chartr("\\", "/", styfile)
         if (length(grep(" ", styfile)))
             warning(gettextf("path to %s contains spaces,\n", sQuote(styfile)),
                     gettext("this may cause problems when running LaTeX"),
                     domain = NA)

but R.home() (eventually find.package()) uses .Library for the special case when 
the path to a single package from the base distribution is being sought

 > find.package("stats")
[1] "C:/PROGRA~1/R/R-31~1.1/library/stats"
 > find.package(c("stats", "stats"))[1]
[1] "C:/Program Files/R/R-3.1.1/library/stats"

So I'm not sure how to get at a working path to Bioconductor.sty in the face of 
spaces in the installed path name (the warning hints that R has similar problems).