-
Notifications
You must be signed in to change notification settings - Fork 332
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
Generated figures from an included .qmd
are not found
#951
Comments
I tried using
But still producing the warning (and fig2-1.png is still not displayed): |
@cscheid I can repro this and I'm afraid this might imply that we need to not resolve images relatively within included files. What's happening is that we are "fixing up" the figures created by knitr to point to the "content/" directory. You can see this in the included One possible solution is that we could exclude computationally generated paths but I'm afraid this would be too confusing/inconsistent. I recall we had some debate about how to handle (and a "fixup" option to trigger the other behavior) and we thought it would be nice to resolve the images relatively. Here not so nice though :-) I'd propose we get rid of the special resolution for included files. What do you think? keep-md intermediate output: ---
title: 'quarto-dev/quarto-cli#951'
author: Mickaël Canouil, *Ph.D.*
format:
html:
self-contained: true
keep-md: true
---
## Figure
::: {.cell}
```{.r .cell-code}
plot(2)
```
::: {.cell-output-display}
![](index_files/figure-html/fig1-1.png){width=672}
:::
:::
`<!-- quarto-file-metadata: eyJpbmNsdWRlX2RpcmVjdG9yeSI6ImNvbnRlbnQifQ== -->`{=html}
```{=html}
<!-- quarto-file-metadata: eyJpbmNsdWRlX2RpcmVjdG9yeSI6ImNvbnRlbnQifQ== -->
```
::: {.cell}
```{.r .cell-code}
plot(2)
```
::: {.cell-output-display}
![](index_files/figure-html/fig2-1.png){width=672}
:::
:::
`<!-- quarto-file-metadata: eyJjbGVhcl9pbmNsdWRlX2RpcmVjdG9yeSI6dHJ1ZX0= -->`{=html}
```{=html}
<!-- quarto-file-metadata: eyJjbGVhcl9pbmNsdWRlX2RpcmVjdG9yeSI6dHJ1ZX0= -->
``` |
I do not know if it is exactly the same issue, but I believe it is. The following setup in the yaml, will result in slides without background.
See Version: Edit: After further tests, it appears that the |
We've disabled the "smart" fixing up of directories which was clearly broken in this case. Now, This behavior is simple to describe, but produces unintuitive results whe include files in different directories have relative links. Because of that, we recommend that you either keep includes in the same directory as the original files, or use root-relative ("absolute") links in includes. |
I'm going to go ahead and close this. If the issue persists for you, let me know and we'll reopen. |
The main issue is solved.
|
Figures are generated in the directory in which the
.qmd
lives.But in the context of a self-contained HTML, when including
.qmd
files from a subdirectory, images are not retrieved by the main document:[WARNING] Could not fetch resource content/index_files/figure-html/fig2-1.png
I tried setting
execute-dir: project
, but same result, i.e., the figure from the included.qmd
is not found.I found nothing in https://quarto.org/docs/authoring/includes.html, but I might have missed something.
Example: https://github.com/mcanouil/quarto-issues/tree/main/quarto-cli%23951
Version:
0.9.433
The text was updated successfully, but these errors were encountered: