Subtables increment table counter in cross-referenceable tables in `format: pdf`

Open
#11,867 0 comments 0 reactions 2 assignees View on GitHub

@cderv is already working on this.

Since Jan 9, 2026.

Assessment

This issue has not been assessed yet.

Description

bug latex tables
Bug description

A #tbl- element with two tables inside increments the table counter by 3, rather than 1.

Possibly a variation of the problem in #7267.

Steps to reproduce
---
title: "Tables with weird numbering"
format: pdf
keep-md: true
keep-tex: true
---

::::: {#tbl-dfs layout="[[1, 1]]"}

::: {}
| Col1 | Col2 |
|------|------|
|      |      |
:::

::: {}
| Col1 | Col2 |
|------|------|
|      |      |
:::

dfs test
:::::


::: {#tbl-two}
| Col1 | Col2 |
|------|------|
|      |      |

Caption
:::


Expected behavior

Tables captions should be Table 1 and Table 2

Actual behavior

Table captions are Table 1 and Table 4.

Image

(Side note: the tables seem to be getting different positioning treatment as well, probably because one in a \table and one a \longtable, might be something else to fix.)

Your environment
  • IDE: Positron
  • Mac OS X 15.2
Quarto check output
quarto check
Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/charlottewickham/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 7d809d78aa828ba4d4e4cc061432ba4723ab66a2
      Path: /Users/charlottewickham/Documents/posit/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.03.13
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/charlottewickham/Library/TinyTeX/bin/universal-darwin
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.1
      Path: /Users/charlottewickham/Documents/posit/quarto-web/.venv/bin/python
      Jupyter: 5.7.2
      Kernels: julia-1.10, ark, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources
      LibPaths:
        - /Users/charlottewickham/Library/R/arm64/4.3/library
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.28

[✓] Checking Knitr engine render......OK
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

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.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.