Search
Question: Error occurred, creating Vignette in LateX style 2.0
0
24 months ago by
Mattia10
Milano
Mattia10 wrote:

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() @

tidy=FALSE,
dev="png",
fig.show="hide",
fig.width=4, fig.height=4.5,
fig.pos="tbh",
cache=TRUE,
message=FALSE)
@
•  And finally I compiled the document.

Now, PDF is generated without any errors or warnings.

Mattia.

Please note that this solution is not portable and will only work on machines which have the directory containing Bioconductor2.sty added to the LaTeX PATH. `In particular, your vignette will fail to compile on Bioconductor builders once you submit the package for review.

See my answer below for a more robust approach.