-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Rendering error for Rmd vignettes using knitr::include_graphics #1797
Comments
Should be fixed now. Thanks for the report! You may try the dev version for now: remotes::install_github('yihui/knitr') |
@yihui I also ran into this bug after updating to knitr 1.27. Then I updated to the dev version (1.27.2) and stumpled upon another issue I'd call a bug, too: It seems that knitr is always overwriting the file included through knitr::include_graphics(paste0(find.package(package = "knitr"), "/doc/knitr-refcard.pdf")) Since I've installed knitr through Michael Rutter's PPA (Ubuntu Linux), on my system the above is equivalent to: knitr::include_graphics("/usr/lib/R/site-library/knitr/doc/knitr-refcard.pdf") When I try to build this, the following error is thrown:
This is of course because knitr isn't run as root, but the file is owned by root and knitr doesn't have write permission: $ ls -1l /usr/lib/R/site-library/knitr/doc/knitr-refcard.pdf
-rw-r--r-- 1 root root 79531 Jan 19 04:04 /usr/lib/R/site-library/knitr/doc/knitr-refcard.pdf I verified this with a file knitr actually has write permission to – it gets overwritten when included through Addendum: I've just read about the I think it's fine that knitr automatically crops whitespace around the files specified in And is there a specific reason why |
Have you considered opening a new issue for that? |
I thought it might make sense to report it here since it seems closely related to the original issue you reported. But of course I can open a new issue if that's preferred... |
I think it's preferred, especially since the specific issue I reported here has been fixed and closed. Thanks! |
Ok then: #1800 |
@salim-b Your issue is slightly related to @hpages's issue. If you are unsure, it is always a good idea to file a new issue (so the original poster won't receive unnecessary notifications), and as a hint to the developers, you could mention that the new issue might be related to this issue. Thanks!
Because cropping images require additional software packages, and I tend to let users opt-in after they know how to install these packages, instead of "officially" supporting this feature. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
Hi,
Starting with knitr 1.27 we started to see new vignette errors in several Bioconductor packages in release (BioC 3.10, based on R 3.6) and devel (BioC 3.11, based on R 4.0).
Here is how to reproduce:
Create a minimalist Rmd vignette that uses
knitr::include_graphics
:Rendering the vignette with
rmarkdown::html_document
works fine:Rendering the vignette with
rmarkdown::pdf_document
triggers a non-fatal error:Output:
Trying to render the vignette again with
rmarkdown::html_document
after enabling cropping now produces a fatal error:Output:
magick is installed (see
sessionInfo()
below) so this is not the same as issue #1796Note that the issue was originally reported as a BiocStyle issue but the self-contained example above seems to exonerate BiocStyle.
Thanks,
H.
sessionInfo:
The text was updated successfully, but these errors were encountered: