-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom table label conflict with gt
table
#11653
Comments
@cscheid Which version of gt are you using ? > packageVersion("gt")
[1] ‘0.11.1’ I can repo ERROR:
compilation failed- error
LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.229 \fontsize
{12.0pt}{14.4pt}\selectfont
````
Intermediate .md is
````
::: {#stb-demo}
::: {.cell}
```{.r .cell-code}
data.frame(x = 1:3, y = 1:3) |>
gt::gt()
```
::: {.cell-output-display}
\begin{table}
\fontsize{12.0pt}{14.4pt}\selectfont
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}rr}
\toprule
x & y \\
\midrule\addlinespace[2.5pt]
1 & 1 \\
2 & 2 \\
3 & 3 \\
\bottomrule
\end{tabular*}
\end{table}
:::
:::
Caption
::: Another problem with gt package not emitting the right latex ? I remember something about begin{table} not being supported in float maybe ? @mingsu Workaround : Use gt to produce HTML table that Quarto will parse and know how to write LaTeX table ---
crossref:
custom:
- kind: float
key: stb
reference-prefix: "Table S"
space-before-numbering: false
caption-prefix: "Table S"
latex-env: stb
latex-list-of-file-extension: lost
latex-list-of-description: Supplementary Table
format: pdf
keep-md: true
---
::: {#stb-demo}
```{r}
data.frame(x = 1:3, y = 1:3) |>
gt::gt() |> gt::as_raw_html()
```
Caption
:::
````
![Image](https://github.com/user-attachments/assets/518faa53-c129-4f15-b6b1-08db376cf326)
|
Hm, I'm using an older version:
My
|
In latest version there was some change regarding latex output: @rich-iannone did you test the new version with Quarto ? I think this is something too look into in gt first so that in Quarto context, gt does produce a valid output. |
Thanks all, there seems to be a few gt regressions w.r.t. Quarto so I'm going to get some fixes in place and release shortly thereafter. |
I can reproduce. As a short-term workaround, you can restore the previous behavior by using the
and the PDF output is this: There was a push to move to a floating table (away from longtable) in v0.11.1 (see https://github.com/rstudio/gt/releases/tag/v0.11.1 for changes). Tests have been performed with these changes but not with @cderv could we meet soon and talk about how floating tables could work well with custom crossrefs? |
@rich-iannone the trick is GT shouldn't generally be emitting
Quarto needs to be in charge of the floating environment, and I don't think there's any reason for GT to emit |
Bug description
I can not generate pdf format with custom table table using
gt
table.Steps to reproduce
Expected behavior
No response
Actual behavior
Your environment
MacOS:
IDE: NVim
Quarto check output
The text was updated successfully, but these errors were encountered: