Skip to content

Support -scap in Float crossrefs consistently across formats and input options #3498

@BradyAJohnston

Description

@BradyAJohnston

Bug description

Minor issues with the fig-scap: when there are multiple subfigures. When using subfigures and subcaptions, the fig-scap is no longer used in the list of figures, instead the full caption is used and the scap is ignored.

---
title: "scratch"
toc: true
format: 
  pdf:
    table-of-contents: true
    lof: true
---

```{r}
#| fig-cap: "Long caption 1."
#| fig-scap: "Short1"
#| echo: false
plot(mtcars)
```

```{r}
#| layout-ncol: 2
#| label: fig-charts
#| echo: false
#| fig-cap: "Overall longer caption."
#| fig-scap: "Short2"
#| fig-subcap: 
#|   - "Long caption 2."
#|   - "Long caption 3."
plot(mtcars)
plot(cars)
```

Related to this as well is the potential for using scap in divs for markdown figures, ![](). Not necessarily a bug as I'm unsure if scap is supported for HTML output.

RStudio Build 576. MacOS 12.6, Intel Macbook Pro 15-inch (2017).

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions