-
-
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
include_graphics should error if file doesn't exist #1717
Comments
The main reason I didn't do it because It can also include images from http resources if the output format is HTML. If the document is compiled to PDF, you should discover that the image is missing from the LaTeX error log. |
Only check if the path is not a url? (But there's no hint in the documentation that you can use urls, so I doubt many people rely on this behaviour) |
Done. Thanks! |
This is not a good idea! - If your child documents are in a subfolder and your images are in an other subfolder this would lead to an error even in pdflatex would handle it correctly! PLEASE use a default value for "error=..." which can be set to knitr to set it to FALSE or TRUE for a whole document! I have to replace several documents by hand ... |
…bal R option `knitr.graphics.error` by default #1717 (comment)
@NMarkgraf I just provided an global option (6daea79). You could override the function, e.g. include_graphics = function(...) {
knitr::include_graphics(..., error = FALSE)
} |
include_graphics() changed its default behavior in knitr 1.28: yihui/knitr#1717 (comment)
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. |
It would be useful if
include_graphics()
threw an error if the image did not exist. Otherwise it's easy to miss broken images.The text was updated successfully, but these errors were encountered: