Skip to content

Commit

Permalink
Update index.Rmd
Browse files Browse the repository at this point in the history
Use longtable if 10 or more rows
  • Loading branch information
szimmer authored Aug 22, 2024
1 parent 96573ea commit 3bdb239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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, ")}")
Expand Down Expand Up @@ -145,4 +145,4 @@ if (knitr:::is_html_output()){
}
rm(citation_text)
```
```

0 comments on commit 3bdb239

Please sign in to comment.