Hi,
I created a package which I would submit in Bioconductor. I followed guidelines: regarding "code" I haven't got any errors or "warning" and each function seems to work perfectly. Then for each function, I created .Rd files, using Roxygen2. Again, no errors and no warning, when I "Build" and when I "Check".
However, I got errors when I tried to create vignettes in new Bioconductor LATEX Style 2.0.
I installed BiocStyle package, Miktek and Texlive for 'pdflatex'; I set the environment variable RSTUDIO_PDFLATEX=C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe; then I selected 'knitr' as Vignette Builder.
Since it's the first time I create a package, I used a small part of DESeq2.Rnw as example vignette. In particular, I adapted the first 50 lines (more or less). This is the content of 'myPackage.Rnw':
%\VignetteIndexEntry{Vignette of "myPackage" package}
%\VignettePackage{myPackage}
%\VignetteEngine{knitr::knitr}
% To compile this document
% library('knitr'); rm(list=ls()); knit('myPackage.Rnw')
\documentclass{article}
<<style, eval=TRUE, echo=FALSE, results="asis">>=
BiocStyle::latex2()
@
<<knitr, echo=FALSE, results="hide">>=
library("knitr")
opts_chunk$set(
tidy=FALSE,
dev="png",
fig.show="hide",
fig.width=4, fig.height=4.5,
fig.pos="tbh",
cache=TRUE,
message=FALSE)
@
\author{first auth}
\affil{Center;}
\author{second auth}
\affil{Center;}
\author{third auth}
\affil{Center;}
\title{myPackage: this is my new package}
\begin{document}
\maketitle
\bibliography{library}
\end{document}
So, when I compile clicking on "Compile PDF" button, a .tex file is created but an error occurs when it tries to run pdflatex.exe on 'myPackage.tex':
output file: myPackage.tex
[1] "myPackage.tex"
Running pdflatex.exe on myPackage.tex...failed
Issues: 2 errors:
! LaTeX Error: File `C:/ProgramFiles/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor2.sty' not found.
Of course, this is the same Error I obtain when I launch devtools::build():
"C:/PROGRA~1/R/R-33~1.2/bin/x64/Rcmd.exe" build "C:\Users\user\Desktop\myPackage" --no-resave-data --no-manual * checking for file 'C:\Users\user\Desktop\myPackage/DESCRIPTION' ... OK * preparing 'myPackage': * checking DESCRIPTION meta-information ... OK * installing the package to build vignettes * creating vignettes ... ERROR Warning: running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\x64\texify.exe" --quiet --pdf "myPackage.tex" --max-iterations=20 -I "C:/PROGRA~1/R/R-33~1.2/share/texmf/tex/latex" -I "C:/PROGRA~1/R/R-33~1.2/share/texmf/bibtex/bst"' had status 1 Error: running 'texi2dvi' on 'myPackage.tex' failed LaTeX errors: ! LaTeX Error: File `C:/ProgramFiles/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor2.sty' not found.
Bioconductor2.sty file is in that folder; so, what am I doing wrong?
Thanks in advance,
Mattia.
Is this specific to BiocStyle 2.0, or does it also occur with the lines below?
Andrzej it's exactly the same:
! LaTeX Error: File `C:/ProgramFiles/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor.sty' not found.
Ok, I see. It must be something specific to your system then, but I'm not sure what could be the problem here. BiocStyle is around for over 3 years now and we didn't receive any reports on similar problems in the past. Do you have a chance to test your package on another machine?
The file path looks suspicious, ' ProgramFiles' instead of 'Program Files' (which would probably cause LaTeX problems) or 'PROGRA~1'.
Good call Martin!
Mattia, can you maybe show us the header of the intermediate .tex file containing the relevant call to Bioconductor*.sty?
You are right Martin: it's strange. I'm going to check LateX options. Anyway: here my .tex file:
Here, path to .sty seems ok.
Thanks again.
Thanks Mattia! Can you please check whether substituting the line loading Bioconductor.sty by any of the following two lines circumvents the problem?
No Andrzej, nothing changes. But I tried to comment in .tex file:
and
And TexLive creates PDF file.