Open Huttsa opened 1 month ago
@Huttsa thanks for the report. please make sure your example is usable by formatting it properly, i.e., we can't use your example if you remove the backticks for the code blocks.
Also keep it simple. Do we really need the whole tidyverse and ggolot2 figures? I believe a simple plot(1)
is enough.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````
.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.
@Huttsa thanks for the report. please make sure your example is usable by formatting it properly, i.e., we can't use your example if you remove the backticks for the code blocks.
Also keep it simple. Do we really need the whole tidyverse and ggolot2 figures? I believe a simple
plot(1)
is enough.If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four
````
. See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.
Oh yes, sorry about that, tried to edit it to be more simple and have the correct amount of backticks.
Thanks I can reproduce the error.
But to me the issue is not really or not only about the embed of a code cell with two plots.
When I remove the code cell from index.qmd
all works as expected.
Note that the error does not occur outside of Manuscript.
https://github.com/user-attachments/assets/dd4e2ac2-2ad3-4f59-b1bf-2aedae8caff8
For future us, this is the intermediate .md we get from internal .qmd to .ipynb conversion for the embed feature
---
title: "Subfig"
keep-md: true
---
::: {#cell-fig-onefig .cell}
```{.r .cell-code .hidden}
#| label: fig-onefig
#| fig-cap: "A plot with a single cap"
# Calculate bill ratio
plot(1)
::: {.cell-output-display} {#fig-onefig} ::: :::
::: {#fig-twofig .cell}
#| label: fig-twofig
#| fig-cap: First caption
#| fig-subcap:
#| - "A"
#| - "B"
plot(2)
plot(3)
::: {.cell-output-display} {#fig-twofig-1} :::
::: {.cell-output-display} {#fig-twofig-2} :::
First caption :::
We are in the case of subfloats handling in this part of the Lua code
https://github.com/quarto-dev/quarto-cli/blob/0d87b08a5c1b25ec6c6573e0bed793cd67eb6687/src/resources/filters/customnodes/floatreftarget.lua#L932-L946
Probably need to add support to it.
Probably need to add support to it.
I am not sure to follow or understand what is "it". Sub float is supported.
Input | Output |
---|---|
- `_quarto.yml` ```yml project: type: manuscript ``` - `child` ````qmd --- title: "child" --- ```{r} #| label: fig-twofig #| fig-cap: "First caption" #| fig-subcap: #| - "A" #| - "B" plot(2) plot(3) ``` ```` - `main` ````qmd --- title: main --- {{< embed child.qmd#fig-twofig >}} ```` |
But it is not supported when there is a code cell in the main document (in default type project, that's not an issue).
Input | Output |
---|---|
- `_quarto.yml` ```yml project: type: manuscript ``` - `child` ````qmd --- title: "child" --- ```{r} #| label: fig-twofig #| fig-cap: "First caption" #| fig-subcap: #| - "A" #| - "B" plot(2) plot(3) ``` ```` - `main` ````qmd --- title: main --- ```{r} 1 + 1 ``` {{< embed child.qmd#fig-twofig >}} ```` |
Nice finding ! Removing the codeblock in main doc solves it ! I'll hide my previous post as your examples are better. thank you !
Look at the screen recording ;) https://github.com/quarto-dev/quarto-cli/issues/10344#issuecomment-2241723984
Thanks for the added examples, @mcanouil. That makes the bug sufficiently loud to me that I'll try to fix in 1.6.
Bug description
I am not sure if this a bug or if manuscripts have been planned to work certain way, but here is report anyway. Hopefully it is helpful!
Steps to reproduce
I have two .qmds, the index and penguins.qmd. The index.qmd is;
Embedding single plot cell
{{< embed notebooks/penguins.qmd#fig-onefig >}}
Some other text here
{{< embed notebooks/penguins.qmd#fig-twofig >}}
Trying to embed the cell labeled fig-charts with two ggplots causes issue.
Expected behavior
The two plots are embedded into the index.qmd and rendered.
Actual behavior
Your environment
RStudio "Chocolate Cosmos" Release (e4392fc9, 2024-06-05) for windows Quarto Quarto 1.6.3, also tested with 1.5 and could repo the issue
Quarto check output
also gives the warning WARN: Error removing file and more spefically (os error 32) about removing a file because it used by another process, the message is in system language so didnt include it here