Replies: 5 comments 1 reply
-
|
Could you properly format your post using code blocks for code and terminal outputs? Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
I tried @mcanouil but I honestly don't spend too much time filing quarto bugs. The example is hopefully straightforward enough that trying it should be easy to see. It is a surprising result to have the gt table land in a completely different section in the doc I was working on. This example came from Claude Code recreating the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Read the guidelines about formatting.
@tareefk Be aware that providing bad code from AIs goes against the Code of Conduct. |
Beta Was this translation helpful? Give feedback.
-
|
Also, the issue template clearly asks few things from you:
A very quick search shows: The list is not exhaustive. |
Beta Was this translation helpful? Give feedback.
-
Finally, this does not look like a bug but rather an opinion about what should be the default. With all the above, I'm going to move this to discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have:
Bug description
Description: When rendering gt tables to PDF, they don't appear where placed in the document unless tbl-pos: "H" is
explicitly set
setting already in the YAML)
It is worth noting that the document already has fig-pos: "H" in the YAML header for figures, but there's no
equivalent default for tables.
title: "gt Table Float Issue" format: pdf: documentclass: report --- ## Section One This is some text before the table. ```{r} library(gt) library(tibble) tibble( A = c("X", "Y", "Z"), B = c(1, 2, 3), C = c(4, 5, 6) ) |> gt() |> tab_header(title = "My Table") This text should appear immediately after the table, but in the PDF the table floats to a different location. Section Two More content here. **Expected Behavior:** The table should appear between "This is some text before the table" and "This text should appear immediately after the table" - matching its position in the source document. **Actual Behavior:** The table floats to the top of the page or a different page entirely, separating it from the surrounding text. **Workaround:** Adding `#| tbl-pos: "H"` to the code chunk forces the table to stay in position: ```r #| tbl-pos: "H" Notes: - The fig-pos: "H" YAML option works for figures but there's no equivalent default for tables - This appears to be specific to gt tables in PDF output; HTML output positions correctly - Tested with Quarto 1.x and gt packageSteps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Your environment
No response
Quarto check output
Quarto 1.8.24
[✓] Checking environment information...
Quarto cache location: /Users/tareef/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.24
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2024.07.03
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/tareef/Library/TinyTeX/bin/universal-darwin
Version: 2024
[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Source: MacOS known location
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.8
Path: /Users/tareef/.pyenv/versions/3.12.8/bin/python3
Jupyter: 5.7.2
Kernels: python3
(|) Checking Jupyter engine render....Traceback (most recent call last):
File "/Applications/quarto/share/jupyter/jupyter.py", line 20, in
from notebook import notebook_execute, RestartKernel
File "/Applications/quarto/share/jupyter/notebook.py", line 19, in
import nbformat
ModuleNotFoundError: No module named 'nbformat'
WARN: Should not have arrived here:
Beta Was this translation helpful? Give feedback.
All reactions