### Bug description



So I have some issues with including pictures in a quarto project, and it seems to be persisent even in very simple examples, so I think it's a bug. As this is  concerned with folder structure, the issue is a bit hard to reproduce. Bear with me, and please ask  and I'll happy to clarify. 



Let's start with something that does work:


 I have a project structure like this:

```
.
├── img
│

 └── test.png
├── index.qmd
├── _quarto.yml
└── test.qmd



```

e.g. a yaml, a directory called img with an image 'test.png', an index.qmd 

the yaml contains this:


```
project:
  type: book

book:
  title: "this is a title"
  chapters:
    - index.qmd

``` 

the index.qmd contains this (I put forward brackes on the backticks to not mess with the formatting in here, but in the file the forward slashes are of course not present)

```

this works

\```{r}
library(knitr)
include_graphics('img/test.png')


\```

``` 

ok, so this works.  test.qmd in the qmd-directory contains the the same content as index.qmd. 


However, suppose I want to keep my qmd-files in a subdirectory, and have the img folder in the project dir. That would look Like this:



```
.
├── img
│

 └── test.png
├── index.qmd
├── qmd
│

 └── test.qmd
└── _quarto.yml



``` 



the yaml now looks like this, as I include a subfolder called 'qmd' with quarto files.


``` 
project:
  type: book

book:
  title: "this is a title"
  chapters:
    - index.qmd
    - qmd/test.qmd
``` 


index.qmd have the same content as before. test.qmd in the qmd-directory contains the the same content as index. 

When I run quarto preview, the image is displayed in the index.qmd file. However, the file test.qmd gives cause to the following error






``` 
Error in include_graphics("img/test.png") :
  Cannot find the file(s): "img/test.png"
``` 

I cannot seem to get around this. including this in the yaml:



``` 
output-dir: _output
execute-dir: project
``` 

does not work. Neither does Setting this in the chunk:


``` 
knitr::opts_chunk$set(root.dir = normalizePath("img"))  
knitr::opts_chunk$get("root.dir")  
```

I also tried making an _eviroment file in the root dir with the following content:

``` 
QUARTO_PROJECT_DIR='path-to-project-dir'
```

still no dice. 
 
the strange thing about it is that non-image related inputs, like using read.csv() works fine (e.g. putting a csv file in the img folder and loading that works. it's only related to images, as fas as I can tell, where the project dir fails.)

this also applies to markdown style images .  It tries to find the folder under 'qmd' no matter how I try to change it (also: putting the img-folder under the 'qmd' folder also fails, which you would think it wouldn't.


I updated to version 1.2.237 of quarto  to see if using the project envir variables would work. I'm on Manjaro linux w. i3, fully updated.

I use the cli version of quarto, not thru Rstudio. 














### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.b
cderv
2022-11-08T16:45:23Z
emilBeBri
bug needs-repro file-systems stale
v1.4
open
putting qmd-files in a subdir causes image-rendition to fail, wether it's markdown style or with knitr::include_graphics()
https://github.com/quarto-dev/quarto-cli/issues/3245