New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build_vignettes and Latex Imports #231

Closed
ghost opened this Issue Jan 11, 2013 · 2 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Jan 11, 2013

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

@hadley

This comment has been minimized.

Member

hadley commented Jan 14, 2013

This is a problem because recent versions of devtools avoid leaving latex build artefacts in your latex directory. It does this by setting the latex working directory to a temporary directory, which obviously means it can't find your images. It might be better to use -output-directory=DIR rather than modifying the working directory.

@hadley

This comment has been minimized.

Member

hadley commented Jan 14, 2013

Or even better (maybe) just do a fake/partial package install and copy back in, a la compile_dll

@hadley hadley closed this in 064090c Apr 1, 2013

@lock lock bot locked and limited conversation to collaborators Sep 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.