### Bug description

# summary

**current behavior:**

- a code chunk that renders multiple plots with `#| fig-cap:` set duplicates the caption
- consequently, the figure counter is incremented twice

**expected/desired behavior:**

- sub-captions are optional: not specifying `#| fig-subcap:` gives a main caption only, without sub-panels being labeled (a)-(z)
- alternatively, there's a chunk option to mark figures as not/having labeled sub-panels
- an incorrect number of `#| fig-subcap:` items gives an error
- in either case, the figure counter is incremented once only (since there's one `#| fig-cap:` that can be cross-referenced)

# repex

**.qmd:**

````
```{r}
#| label: fig-histograms-1
#| fig-cap: "this caption is duplicated"
#| fig-show: hold
#| fig-width: 4
#| fig-height: 3
#| layout-nrow: 1
hist(runif(100))
hist(rnorm(100))
```

```{r}
#| label: fig-histograms-2
#| fig-cap: "this caption is unique"
#| fig-subcap: 
#|   - ""
#|   - ""
#| fig-show: hold
#| fig-width: 4
#| fig-height: 3
#| layout-nrow: 1
hist(runif(100))
hist(rnorm(100))
```
````

**output:**

![image](https://user-images.githubusercontent.com/14542264/187888988-12ce2d2b-2837-48e7-8d59-562da45c4129.png)

# software

- Quarto version 1.1.168
- macOS Monterey version 12.2
- RStudio IDE version "Prairie Trillium" Release  
(1db809b8, 2022-05-16) for macOS

### 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://yihui.org/issue/#please-format-your-issue-correctly) 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.
dragonstyle
2022-09-01T10:11:32Z
HelenaLC
bug crossref
v1.4
open
Float crossrefs with unlabeled subfloats
https://github.com/quarto-dev/quarto-cli/issues/2246