devtools, vignettes and image files imported by LaTeX

72 views
Skip to first unread message

alec....@gmail.com

unread,
Jan 9, 2013, 8:12:09 PM1/9/13
to rdev...@googlegroups.com
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 <return>  for immediate help
Using draft setting for this image.
In addition: Warning message:
running command '"C:\PROGRA~1\MIKTEX~1.9\miktex\bin\texi2dvi.exe" --quiet --pdf "mypkg-vignette.tex"  -I "c:/PROGRA~1/R/R-215~1.1/share/texmf/tex/latex" -I "c:/PROGRA~1/R/R-215~1.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
devtools vignettes building.zip

Hadley Wickham

unread,
Jan 10, 2013, 2:38:22 PM1/10/13
to alec....@gmail.com, rdev...@googlegroups.com
Hi Alec,

Would you mind filing at bug at https://github.com/hadley/devtools/issues?

Thanks!

Hadley
--
Chief Scientist, RStudio
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages