I'm creating a manual for an R package using LaTeX, and I have to follow a specific latex style . So, I want to create PDF using well known pdflatex, starting form .tex file generated by 'knitr'. Every time I launched pdflatex, I got the same error:

LaTeX errors:
! LaTeX Error: File `C:/ProgramFiles/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor2.sty' not found.

And it always fails in this line of .tex:

\RequirePackage{C:/Program Files/R/R-3.3.2/library/BiocStyle/resources/tex/Bioconductor2}

Of course the file exists and it is in that folder.

I tried using both native R code, and TeX live or MikTek 2.9 (on Windows 7 and Windows 10 machines): always the same error. It seems that it cannot find Bioconductor2.sty because of the path to the file: see C:/ProgramFiles/... (in error message!) instead of C:/Program Files/... (in .tex file).

Why it happens? What am I doing wrong?

  • 2
    spaces are removed from that argument, so you can use \RequirePackage{pkg1 , pkg2 } but just as you do not use \documentclass{/usr/local/tex/whatever/article} you should not use a path in RequirePackage. Just use \RequirePackage{Bioconductor2} and ensure externally that that is in the tex path – David Carlisle Dec 16 '16 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.