Sometimes (especially with margin layout), it is useful to place the outputs of a code chunk side by side. To accomplish this, the outputs needs to come from the same chunk (e.g. a table of data and a plot of that data). It would be nice to be able to specify the labels for a chunk as an array, allowing something like:

`````

```{r}
#| label: [tbl-cars, fig-cars]
#| fig-cap: "Cars fig"
#| tbl-cap" "Cars tbl"
#| tbl-column: margin
  
mtcars2 <- mtcars
mtcars2$am <- factor(
  mtcars$am, labels = c('automatic', 'manual')
)

knitr::kable(
  mtcars[1:6, 1:6]
)

library(ggplot2)
ggplot(mtcars2, aes(hp, mpg, color = am)) +
  geom_point() +  geom_smooth(formula = y ~ x, method = "loess") +
  theme(legend.position = 'bottom')

```


`````


### Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1201

<div type='discussions-op-text'>

<sup>Originally posted by **mvwestendorp** June 22, 2022</sup>
Is it possible to switch the figure and table in this [example](https://quarto.org/docs/authoring/article-layout.html#multiple-outputs)?  That is, the table in the margin and figure in the body.

Using `#| tbl-column: margin` does not seem to work in this case.</div>
2022-06-27T13:29:08Z
dragonstyle
Future
open
Allow Different Types of Cross Reference-able Outputs from a Single Code Chunk
https://github.com/quarto-dev/quarto-cli/issues/1229