quarto-dev / quarto-dev/quarto-cli
Subcaption issues with and without labels with KableExtra
Open
@cderv is already working on this.
Since May 6, 2024.
crossref
enhancement
third-party
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
I'm not sure if this issue belongs to quarto or kableExtra, but leaving the report here. Please let me know if this should be reported to kableExtra.
Please see below for reprex.
Edit: The issue is related to pdf output.
---
title: "test_quarto"
format: pdf
---
Knitr
Without label
#| tbl-cap: "Example1"
#| tbl-subcap:
#| - "Cars"
#| - "Pressure"
#| layout-ncol: 1
knitr::kable(head(iris))
knitr::kable(tail(iris))
Works fine
With label
#| label: tbl-example1
#| tbl-cap: "Example2"
#| tbl-subcap:
#| - "Cars"
#| - "Pressure"
#| layout-ncol: 1
knitr::kable(head(iris))
knitr::kable(tail(iris))
Works fine
KableExtra
Without label
It generates two additional empty labels: (a),(b),(c),(d)
#| tbl-cap: "Example3"
#| tbl-subcap:
#| - "Cars"
#| - "Pressure"
#| layout-ncol: 1
kableExtra::kable(head(iris))
kableExtra::kable(tail(iris))
With label
#| label: tbl-example4
#| tbl-cap: "Example4"
#| tbl-subcap:
#| - "Cars"
#| - "Pressure"
#| layout-ncol: 1
kableExtra::kable(head(iris))
kableExtra::kable(tail(iris))
Works now.
Running on RStudio build 353 / R4.2.2
Checklist
- 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.
- Please format your issue 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?
- Please document the operating system you're running. If on Linux, please provide the specific distribution.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.