Skip to content
Discussion options

You must be logged in to vote

You can't do that with Quarto. It may have worked with R Markdown and knitr but probaby as a side effect because in some cases knitr will generate some LaTeX code directly (which will be mixed with yours).

here Quarto will always include image using Markdown syntax ![caption](path) So your are mixing markdown with LaTeX.

Quarto has all the tool you need to produce a figure environment with caption and cross reference from a chunk. You just need to use the right syntax.

```{r}
#| label: fig-cars
#| echo: false
#| eval: true
#| fig-align: center
#| out-width: 80%
#| message: false
#| warning: false
#| results: false
plot(cars)
```

will produce

\begin{figure}

{\centering \includegraphics[wi…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Niklewa
Comment options

@cderv
Comment options

cderv Sep 6, 2023
Maintainer

Answer selected by mcanouil
@Niklewa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants