From c8265f7aae3519a5c7d7383c711f84a579a1f944 Mon Sep 17 00:00:00 2001 From: Aaron Gullickson Date: Sun, 25 Feb 2024 11:58:55 -0800 Subject: [PATCH] Fix bug with floating table and no table notes --- R/utils_render_latex.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/utils_render_latex.R b/R/utils_render_latex.R index cd9df7d168..6f931c4a98 100644 --- a/R/utils_render_latex.R +++ b/R/utils_render_latex.R @@ -848,7 +848,7 @@ create_table_end_l <- function(data) { "\\bottomrule\n", ifelse(dt_options_get_value(data = data, option = "latex_use_longtable"), "\\end{longtable}\n", - "\\end{tabular}\n"), + "\\end{tabular}"), collapse = "" ) } @@ -861,7 +861,10 @@ create_footer_component_l <- function(data) { # If there are no footnotes or source notes, return an empty string if (nrow(footnotes_tbl) == 0 && length(source_notes_vec) == 0) { - return("") + return(ifelse(dt_options_get_value(data = data, + option = "latex_use_longtable"), + "", + "\\end{table}\n")) } # Get the multiline and separator options for footnotes and source notes