### Bug description

When rendering a document using the margin layout with a full-width figure the HTML render makes a full-width caption, which is probably the desired layout. In the PDF layout, the figure is full-width, but the caption is limited to the text column, which is a bit hideous. Running Mac OS.


Example:

````md
---
format: 
  pdf:
    execute:
      echo: false
  html:
    code-fold: true
reference-location: margin
---


```{r}
#| label: fig-test
#| fig-column: page-right
#| fig-cap: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
#| warning: false
library(tidyverse)
data(iris)
iris %>% ggplot(aes(Sepal.Length, Sepal.Width, color = Species)) + geom_point()
```
````

![Screenshot by Dropbox Capture](https://user-images.githubusercontent.com/4469583/213337393-a51415d6-47b6-4d90-a7cf-8a06f6ed488c.png)


### 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.
- [ ] 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.
dragonstyle
2023-01-19T01:56:45Z
mikheyev
bug
closed
Figure caption width not the same when rendering HTML vs pdf in margin layout when using full-width figures
https://github.com/quarto-dev/quarto-cli/issues/4014