Skip to content

Build_vignettes and Latex Imports #231

Closed
@ghost

Description

The latest version of build_vignettes() in devtools causes LaTeX to be unable to find imported files (such as imported image file) placed in vignettes/ package folder. My earlier email posted to the devtools Google Group provides more details. A zipfile was also attached to that Groups post, with a simple reproduceable example.

Hi,

I'm a huge fan of devtools - well done, and thanks to Hadley!

I'm having an issue building a vignette with devtools build_vignettes() function. A reproduceable (I hope) example is attached.

I wish to import a pdf image into the pdf produced by LaTeX, via LateX's 'graphicx' package and the '\includegraphics' command.

The image.pdf file I have placed in the vignettes/ subfolder along with my .Rnw file - but with the latest version of devtools, LaTeX is no longer able to find the image file:

$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

require(devtools)
Loading required package: devtools
Warning message:
package 'devtools' was built under R version 2.15.2
build_vignettes("mypkg")
Building mypkg vignettes
Error: running 'texi2dvi' on 'mypkg-vignette.tex' failed

LaTeX errors:
ex:18: Package pdftex.def Error: File `image.pdf' not found.

See the pdftex.def package documentation for explanation.
Type H for immediate help
Using draft setting for this image.
In addition: Warning message:
running command '"C:\PROGRA1\MIKTEX1.9\miktex\bin\texi2dvi.exe" --quiet --pdf "mypkg-vignette.tex" -I "c:/PROGRA1/R/R-2151.1/share/texmf/tex/latex" -I "c:/PROGRA1/R/R-2151.1/share/texmf/bibtex/bst"' had status 1

$%$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

I imagine I could specify a full path in my LaTeX file as a work-around, but this would surely cause problems if others try to rebuild the package from my source?

An earlier version of devtools did not have this issue. Is there a more appropriate place for me to put extra files like image/pdf, or can build_vignettes() be tweaked to allow LaTeX to find such files placed in vignettes?

Also, now that the vignette build is done in a temporary directory to avoid cluttering up the vignettes folder (nice!), I wonder if it would be helpful for build_vignettes to report the location of this temp directory, in case one wishes to check the log file produced by LaTeX (esp in case of LaTeX problems)?

I am using MiKTeX 2.9, devtools 0.8 and R2.15.1 (not, admittedly, 2.15.2)

Thanks

Alec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions