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:
%\VignetteIndexEntry{Vignette of "myPackage" package} %\VignettePackage{myPackage} %\VignetteEngine{knitr::knitr} % To compile this document % library('knitr'); rm(list=ls()); knit('myPackage.Rnw') \documentclass{article}\usepackage[]{graphicx}\usepackage[usenames,dvipsnames]{color} %% maxwidth is the original width if it is less than linewidth %% otherwise use linewidth (to make sure the graphics do not exceed the margin) \makeatletter \def\maxwidth{ % \ifdim\Gin@nat@width>\linewidth \linewidth \else \Gin@nat@width \fi } \makeatother \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345} \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}% \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}% \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}% \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}% \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}% \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}% \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}% \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}% \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}% \let\hlipl\hlkwb \usepackage{framed} \makeatletter \newenvironment{kframe}{% \def\at@end@of@kframe{}% \ifinner\ifhmode% \def\at@end@of@kframe{\end{minipage}}% \begin{minipage}{\columnwidth}% \fi\fi% \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep \colorbox{shadecolor}{##1}\hskip-\fboxsep % There is no \\@totalrightmargin, so: \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}% \MakeFramed {\advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize \@setminipage}}% {\par\unskip\endMakeFramed% \at@end@of@kframe} \makeatother \definecolor{shadecolor}{rgb}{.97, .97, .97} \definecolor{messagecolor}{rgb}{0, 0, 0} \definecolor{warningcolor}{rgb}{1, 0, 1} \definecolor{errorcolor}{rgb}{1, 0, 0} \newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX \usepackage{alltt} \RequirePackage{C:/Program Files/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor} \AtBeginDocument{\bibliographystyle{C:/Program Files/R/R-3.3.2/library/BiocStyle/resources/tex/unsrturl}} \author{first auth} \affil{Center;} \author{second auth} \affil{Center;} \author{third auth} \affil{Center;} \title{myPackage: this is my new package} \IfFileExists{upquote.sty}{\usepackage{upquote}}{} \begin{document} \maketitle \bibliography{library} \end{document}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?
\RequirePackage{"C:\Program Files\R\R-3.3.2\library\BiocStyle\resources\tex\Bioconductor"}\RequirePackage{{C:\Program Files\R\R-3.3.2\library\BiocStyle\resources\tex\Bioconductor}}No Andrzej, nothing changes. But I tried to comment in .tex file:
%\RequirePackage[]{C:/Program Files/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor2} %\AtBeginDocument{\bibliographystyle{C:/Program Files/R/R-3.3.2/library/BiocStyle/resources/tex/unsrturl}}and
%\author{first auth} %\affil{Center;} %\author{second auth}%\affil{Center;} %\author{third auth} %\affil{Center;}And TexLive creates PDF file.