Cross referencing gt table when knitting to PDF in Markdown

Hi, I am writing a thesis in Bookdown and knitting it to PDF. Is there any way to cross reference gt table? I tried using tab_caption() but it doesn't work. I am wondering if I am doing something wrong or if there is a workaround this problem.
With Thanks

There's a thread from a few years ago that is still relevant.

I prefer to work either in HTML or pdf, depending on the destination requirements, without mixing the two. Here's an example of what's possible using xtable to output.

which is produced with

fm1sc <- aov(tlimth ~ sex + ethnicty + grade, data = tli)
fm1sc.table <- xtable(fm1sc,
  caption = c("ANOVA Model with Predictors Sex, Ethnicity, and Grade",
    "ANOVA: Sex, Ethnicity, Grade"),
  label = "TAAS")
print(fm1sc.table, comment = FALSE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.