Hi,
I am struggling to understand how I can reference to a gt table in my Rmarkdown file while outputting to PDF.
My current code takes a tibble, performs some gt() wrangling, and outputs the gt table in latex format.
table %>%
gt::gt() %>%
gt::as_latex()
Calling this simple code in a code chunk wihtin my Rmarkdown file gives me a super nice table as shown below.
However, I can't figure out how to add a reference to the table such as "Table 1.1: Socioeconomics", which I can then refer to within the text in the Rmarkdown file.
I have been trying to search the web for help, but so far without any luck.
The function kable,
knitr::kable()
let me at a reference, but it overwrites all my gt() wrangling, leaving me with the original table instead. It does not seem to be able to handle the issue.
Does anyone know if this is doable as of now?
Thank you.