### Bug description

The following file seems to return an error (LaTeX Error: Not in outer par mode) only with `echo:false`. Tested on MacOS and Windows.

````
---
format: pdf
---

::: {#fig-12 layout-ncol=2}

```{r}
#| fig-cap: "f1"
#| echo: false
plot(1)
```

```{r}
#| fig-cap: "f2"
plot(2)
```

Figure
:::
````

### 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.
cscheid
2023-02-15T18:43:17Z
AQLT
bug
v1.4
open
PDF side-by-side figure with caption error with echo: false
https://github.com/quarto-dev/quarto-cli/issues/4370