-
Notifications
You must be signed in to change notification settings - Fork 205
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
Cross-referencing gt tables does not work when knitting to PDF #818
Comments
I don't get a caption or table number in this MWE:
... and the LaTeX generated:
|
Here is a workaround - specifically for
|
You are likely to be better off using Quarto LaTeX output. The support for cross-references is done natively. |
the development version of gt now includes a fix for this, thanks to @nielsbock, in case people want to try it out! pak::pak("rstudio/gt") We'd love to receive your feedback so please open a new issue if something is not working as expected. |
Hi,
Thanks a lot for making progress on the gt package to allow cross referencing within bookdown documents. However, I have the impression that it still does not work for PDFs. In the reproducible example below, cross-reference did not work when knitting to bookdown::pdf_document2 (resulting in "Table ??"). It only worked when knitting to bookdown::html_document2 (resulting in "Table 1"). Could you please let me know if there is a trick to make it work with PDF, or whether cross-ref for PDF is planned to be developed in the near future?
I am now referencing Table \@ref(tab:label)
```{r label }
df = data.frame(A = c(1,2,3), B = c(4,5,6))
gt(df, caption = "this is the caption")
```
Originally posted by @camillebelmin in #115 (comment)
The text was updated successfully, but these errors were encountered: