From 3bdb2390eb2e89d37ea8abd8ae87e50288c4a7dc Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Wed, 21 Aug 2024 21:37:03 -0400 Subject: [PATCH] Update index.Rmd Use longtable if 10 or more rows --- index.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.Rmd b/index.Rmd index 2caaff4..b11240b 100644 --- a/index.Rmd +++ b/index.Rmd @@ -40,7 +40,7 @@ library(prettyunits) book_colors <- c("#0b3954", "#087e8b", "#bfd7ea", "#ff8484", "#8d6b94") as_latex_with_caption <- function(gtobj, chunk_label) { - lt <- nrow(gtobj[["_data"]]) > 2 + lt <- nrow(gtobj[["_data"]]) >= 10 gt_l <- gtobj %>% tab_options(latex.use_longtable=lt, latex.tbl.pos="!htb") %>% gt::as_latex() caption <- paste0( "\\caption{\\label{tab:", chunk_label, "}(ref:", chunk_label, ")}") @@ -145,4 +145,4 @@ if (knitr:::is_html_output()){ } rm(citation_text) -``` \ No newline at end of file +```