quarto-dev / quarto-dev/quarto-cli
Wide table with column: page does not fill the page width in PDF
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
Wide tables do not stretch beyond the body column in PDFs.
(For HTML, it is working:)
Steps to reproduce
---
title: Example
format:
pdf:
papersize: a4
fontsize: 9pt
geometry:
- showframe
html:
fontsize: 9pt
---
```{python}
# | label: tbl-official-overview
# | tbl-cap: Official overview.
# | column: page
# | echo: false
from IPython.display import Markdown
import pandas as pd
md = pd.read_csv("table.csv", sep=";").to_markdown(index=False)
print("\n".join(md.split("\n")[:4]))
Markdown(md)
```
table.csv:
region;city;kpop;cap?;reg?;obs?;2015;2016;2017;2018;2019;2020;2021;2022
Baden-Württemberg;Karlsruhe;283; ;x; ; ; ; ; ; ; ;490;467
Bayern;München;1,260;x;x; ; ; ; ;1,145;1,170;1,364;1,983;1,169
Berlin;Berlin;3,426;x;x;x; ; ; ;4,290;5,405;5,890;6,207;6,442
Brandenburg;Potsdam;182;x;x; ; ; ; ; ;214;238;287;326
Bremen;Bremen;546;x; ; ; ; ; ; ;654;631;623;721
Hamburg;–;–; ; ; ; ; ; ; ; ; ; ;
Hessen;Wiesbaden;278;x;x; ; ; ; ; ;159;235;304;256
Mecklenburg-Vorpommern;–;–; ; ; ; ; ; ; ; ; ; ;
Niedersachsen;–;–; ; ; ; ; ; ; ; ; ; ;
Nordrhein-Westfalen;Köln;963; ;x; ; ; ; ;1,037; ; ; ;1,551
Nordrhein-Westfalen;Wuppertal;360; ;x; ; ; ; ; ; ; ; ;209
Rheinland-Pfalz;Mainz;217;x;x; ; ; ; ;255;248;305;312;411
Saarland;–;–; ; ; ; ; ; ; ; ; ; ;
Sachsen;Dresden;556;x;x; ; ; ; ; ; ;164;292;405
Sachsen-Anhalt;Magdeburg;235;x;x;x;215;167;135;175;222;312;411;435
Schleswig-Holstein;Kiel;246;x;x; ; ; ; ; ; ; ;272;341
Thüringen;Erfurt;213;x; ; ; ; ; ; ;305;285;331;351
;sum;8,771;10;11;2;215;167;135;6,902;8,377;9,424;11,512;13,084
Markdown that is produced as intermediate step:
| region | city | kpop | cap? | reg? | obs? | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 |
|:-----------------------|:----------|:-------|:-------|:--------|:--------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|:-------|
| Baden-Württemberg | Karlsruhe | 283 | | x | | | | | | | | 490 | 467 |
| Bayern | München | 1,260 | x | x | | | | | 1,145 | 1,170 | 1,364 | 1,983 | 1,169 |
| Berlin | Berlin | 3,426 | x | x | x | | | | 4,290 | 5,405 | 5,890 | 6,207 | 6,442 |
| Brandenburg | Potsdam | 182 | x | x | | | | | | 214 | 238 | 287 | 326 |
| Bremen | Bremen | 546 | x | | | | | | | 654 | 631 | 623 | 721 |
| Hamburg | – | – | | | | | | | | | | | |
| Hessen | Wiesbaden | 278 | x | x | | | | | | 159 | 235 | 304 | 256 |
| Mecklenburg-Vorpommern | – | – | | | | | | | | | | | |
| Niedersachsen | – | – | | | | | | | | | | | |
| Nordrhein-Westfalen | Köln | 963 | | x | | | | | 1,037 | | | | 1,551 |
| Nordrhein-Westfalen | Wuppertal | 360 | | x | | | | | | | | | 209 |
| Rheinland-Pfalz | Mainz | 217 | x | x | | | | | 255 | 248 | 305 | 312 | 411 |
| Saarland | – | – | | | | | | | | | | | |
| Sachsen | Dresden | 556 | x | x | | | | | | | 164 | 292 | 405 |
| Sachsen-Anhalt | Magdeburg | 235 | x | x | x | 215 | 167 | 135 | 175 | 222 | 312 | 411 | 435 |
| Schleswig-Holstein | Kiel | 246 | x | x | | | | | | | | 272 | 341 |
| Thüringen | Erfurt | 213 | x | | | | | | | 305 | 285 | 331 | 351 |
| | sum | 8,771 | 10 | 11 | 2 | 215 | 167 | 135 | 6,902 | 8,377 | 9,424 | 11,512 | 13,084 |
The rendered table (just to show that the Markdown is correct):
| region | city | kpop | cap? | reg? | obs? | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Baden-Württemberg | Karlsruhe | 283 | x | 490 | 467 | ||||||||
| Bayern | München | 1,260 | x | x | 1,145 | 1,170 | 1,364 | 1,983 | 1,169 | ||||
| Berlin | Berlin | 3,426 | x | x | x | 4,290 | 5,405 | 5,890 | 6,207 | 6,442 | |||
| Brandenburg | Potsdam | 182 | x | x | 214 | 238 | 287 | 326 | |||||
| Bremen | Bremen | 546 | x | 654 | 631 | 623 | 721 | ||||||
| Hamburg | – | – | |||||||||||
| Hessen | Wiesbaden | 278 | x | x | 159 | 235 | 304 | 256 | |||||
| Mecklenburg-Vorpommern | – | – | |||||||||||
| Niedersachsen | – | – | |||||||||||
| Nordrhein-Westfalen | Köln | 963 | x | 1,037 | 1,551 | ||||||||
| Nordrhein-Westfalen | Wuppertal | 360 | x | 209 | |||||||||
| Rheinland-Pfalz | Mainz | 217 | x | x | 255 | 248 | 305 | 312 | 411 | ||||
| Saarland | – | – | |||||||||||
| Sachsen | Dresden | 556 | x | x | 164 | 292 | 405 | ||||||
| Sachsen-Anhalt | Magdeburg | 235 | x | x | x | 215 | 167 | 135 | 175 | 222 | 312 | 411 | 435 |
| Schleswig-Holstein | Kiel | 246 | x | x | 272 | 341 | |||||||
| Thüringen | Erfurt | 213 | x | 305 | 285 | 331 | 351 | ||||||
| sum | 8,771 | 10 | 11 | 2 | 215 | 167 | 135 | 6,902 | 8,377 | 9,424 | 11,512 | 13,084 |
Expected behavior
The table should fill both the body column and the margin.
Actual behavior
In the PDF, the table only fills the body column. The table caption is too far at the left.
In the HTML, things work.
https://quarto.org/docs/authoring/article-layout.html#pdflatex-layout states that PDF does not support all layout options in PDF, but to my understanding this one should work.
Your environment
- IDE: VSCode, but this is an issue with quarto-cli
- OS: MacOS 13.4
Quarto check output
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.361
Path: /Applications/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.10
Path: /Users/david/Repositories/protest-impact/.venv/bin/python
Jupyter: 5.3.0
Kernels: ir, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.2.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
knitr: 1.39
rmarkdown: 2.14
[✓] Checking Knitr engine render......OK
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.