I want to insert an image in a rmd file in a book project with bookdown. I also want to click it and a webpage will be popped up in a new tab on a browser.
I think what knitr::include_graphics() does is to 'copy' the image file under project/images folder and 'paste' it under project/_book/images folder. I do need knitr::include_graphics() for this purpose, but I don't want it to show the image.
As I said, I could simply put the image under project/_book/images folder manually and don't run knitr::include_graphics(). It would be a work-around solution. But I questioned myself that it is not a consistent approach and if it is a good practice.
It is not exactly this command that does that. I believe by using this command, it will output some content that is correctly parsed by rmarkdown to find the resource. Hence the copy. But the function does not copy.
So possibly this is a syntax parsing issue.
You can't just don't show the image when using knitr::include_graphics() because that is its sole purpose. This goes with the assumption of the function copying while its not. So you need to use another syntax or include resource manually
You are right this is now how it should work _book is a folder where files should be written by bookdown itself.
By the way, this could be written in Markdown this way: