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

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

<sup>Originally posted by **harrelfe** June 17, 2022</sup>
I specify cap-location: margin in my Quarto book yaml.  For the few figures that have multiple panels this causes the figures to no longer be rendered in a matrix but rather as larger individual plots.  Is there a way to override cap-location for one code chunk?  Here's some test code:

---
title: "Test"
format:
  html:
    self-contained: true
    cap-location: margin
---


```{r}
#| label: fig-test
#| fig.width: 8
#| fig.height: 8
#| fig.scap: 'Four examples of residual plots'
#| fig.cap: 'Using residuals to check some of the assumptions of the simple linear regression model.'
#| fig-subcap:
#|   - "Non-constant $\\sigma^2$, which might call for transforming $y$"
#|   - "Constant $\\sigma^2$ but systemic failure of the linearity assumption"
#|   - "Ideal situation of white noise (no trend, constant variance)"
#|   - "$q-q$ plot demonstrating approximate normality of residuals, for a sample of size $n=50$.  Horizontal reference lines are at zero, which is by definition the mean of all residuals."
#| layout-ncol: 2
plot(rnorm(20)); plot(runif(20)); hist(rnorm(100)); hist(rexp(100))
```
</div>
dragonstyle
2022-06-23T17:26:23Z
jjallaire
Future
closed
How to override format: html: cap-location: margin
https://github.com/quarto-dev/quarto-cli/issues/1211