Replies: 5 comments 2 replies
-
|
In Quarto, you should only use YAML syntax. ```{r fig.show="hold", out.width="49%"}
#| label: fig-proj-vectors
#| code-fold: true
```should be (even in Rmarkdown): ```{r}
#| label: fig-proj-vectors
#| code-fold: true
#| fig-show: "hold"
#| out-width: "49%"
```This being said, I suggest to take a look at https://quarto.org/docs/authoring/figures.html#computations.
Try to make your code small and simple, when asking for help. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks. What I was missing was the Also, it's not entirely clear to me how layout relates to But the following gives three figure numbers, each with the same caption |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I'll use a quarto playground in future... But, in this case I want ONLY ONE figure number and ONE figure caption. From my code, Quarto generated THREE fig numbers, and they al use the same caption |
Beta Was this translation helpful? Give feedback.
-
|
For the record: @mcanouil 's explanation was very helpful in understanding the way Quarto wants to do things like this, but I prefer in many cases to compose images side-by-side and have a single caption without the sub labels (a), (b), ...
Here is a In a code chunk, I don't need to save the final image, I can just use Is there a way to do this without using temp files? In my usage, I don't want to show the code in my document this way. |
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
-
Description
My env: Quarto 1.3.450 / R version 4.3.2
For a book project using Quarto I'm trying to place figures side-by-side from R code.
This always worked perfectly with
knitr/rmarkdownusingfig.show="hold", out.width="49%"The Quarto documentation https://quarto.org/docs/authoring/figures.html shows
examples using
:::divs and{#fig-surus}, but not for code blocks.What am I doing wrong?
I'm currently rendering to HTML, but whatever I do has to work for PDF.
But I get two separate figures, each with it's own caption. I want only a single figure number and caption for this example.
As well, the figure numbering doesn't work. I get:
I also tried using
include_graphics()with the figures generated from the previous code block. But this produces no output.As it is, all I can do is to combine the two figures in an image editor.
Beta Was this translation helpful? Give feedback.
All reactions