quarto-dev / quarto-dev/quarto-cli

`*cap-location` at code cell level is not respected without label

Open
#11,342 4 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Nov 8, 2024.

bug crossref figures tables triaged-to
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

*cap-location at code cell level is not respected without label. (tested on 28bfc55761810dda69b47db801058161ca1fa8bc)

It seems related to a previous fix:

But It seems the fix did not make it all the way in 1.5 regarding the issue.

Adding a label makes the code cell option work.

Note: both fig and tbl are impacted.

InputOutput
---
title: "Untitled"
format: html
---

```{r}
#| tbl-cap: MTCARS
#| tbl-cap-location: top
library(gt)
mtcars[1:5, ] |> gt()
```

```{r}
#| tbl-cap: MTCARS
#| tbl-cap-location: bottom
library(gt)
mtcars[1:5, ] |> gt()
```

image
---
title: "Untitled"
format: html
---

```{r}
#| label: tbl-one
#| tbl-cap: MTCARS
#| tbl-cap-location: top
library(gt)
mtcars[1:5, ] |> gt()
```

```{r}
#| label: tbl-two
#| tbl-cap: MTCARS
#| tbl-cap-location: bottom
library(gt)
mtcars[1:5, ] |> gt()
```

image

Originally posted by @mcanouil in https://github.com/quarto-dev/quarto-cli/discussions/11341#discussioncomment-11188545

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.