Repository navigation
Closed
Labels
bugSomething isn't workingcrossrefregressionFunctionality that used to work but now is broken.tablesIssues with Tables including the gt integration
Milestone
Description
Bug description
Perhaps this is intended behavior, but it seems to me that the tbl-cap-location option has no effect unless the table is labelled. I couldn't find any mention of this in the documentation.
Steps to reproduce
In the following example,
---
title: Table caption location
format: html
tbl-cap-location: top
---
| Col1 | Col2 | Col3 |
|------|------|------|
| A | B | C |
| E | F | G |
: A non-labelled table with a caption
| Col1 | Col2 | Col3 |
|------|------|------|
| A | B | C |
| E | F | G |
: A labelled table with a caption {#tbl-letters}
Expected behavior
I would expect the caption to be placed on top in both examples.
Actual behavior
It is only placed on top for the second example, where the table is labelled.
Your environment
- IDE: nvim 0.10.0
- Distro: Fedora 40
Quarto check output
Quarto 1.4.554
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.4.554
Path: /opt/quarto-1.4.554/bin
[✓] Checking tools....................OK
TinyTeX: v2024.05
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/gerd-jln/.TinyTeX/bin/x86_64-linux
Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.1
Path: /home/gerd-jln/.pyenv/versions/3.12.1/bin/python3
Jupyter: 5.7.2
Kernels: auroc, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.4.0
Path: /usr/lib64/R
LibPaths:
- /home/gerd-jln/R/x86_64-redhat-linux-gnu-library/4.4
- /usr/lib64/R/library
- /usr/share/R/library
knitr: 1.46
rmarkdown: 2.26
[✓] Checking Knitr engine render......OK
Activity
mcanouil commentedon May 21, 2024
Thanks for the report.
That's a regression from 1.3.
cscheid commentedon May 21, 2024
In 1.3, the only control for table caption location was through CSS (eg
caption-side: bottom), and that was injected whentbl-cap-locationwas used. This didn't work well in other formats, like PDF:In 1.4, we switched most of the treatment to FloatRefTarget. But that only comes up when labels are present, as mentioned in the report.
Unfortunately, I don't think there's a general satisfactory solution we can adopt for all formats for the case of captions without labels.
Consider the following argument. We either defer to Pandoc's writers for the Table node or we don't:
cscheid commentedon May 21, 2024
I'm just going to fix the HTML case; the LaTeX case is already a nightmare because of longtable.
There is a way to make the caption appear below the bottom rule for longtables, but it will break multi-page longtable rendering and it's more regex wrangling of LaTeX code. I'm deciding against it: if LaTeX users insist on bottom captions for tables, they will have to emit their own raw LaTeX.
jolars commentedon May 22, 2024