Skip to content

Commit

Permalink
fix: stopped rendering an empty footer (#32)
Browse files Browse the repository at this point in the history
* stopped rendering an empty row in cases where the footer passed to
  `gentlg` is of length 0 or NA

Closes #31
  • Loading branch information
kpagacz authored Apr 25, 2024
1 parent 72d806a commit caadd73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions R/gentlg_single.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ gentlg_single <- function(huxme = NULL,
function(x) arglist[[x]] <<- eval(rlang::sym(x))
})
check_gentlg(arglist)
if (identical(footers, NA) || length(footers) == 0) {
footers <- NULL
}

if (!is.null(title_file)) {
title_df <- readxl::read_excel(title_file,
Expand Down Expand Up @@ -746,7 +749,7 @@ gentlg_single <- function(huxme = NULL,
if (dev.cur() == 1) {
# If there is no graphics dev available. Create a NULL PDF device
pdf(NULL)
filin <- round(
round(
1440 / graphics::strwidth(
expression(huxtable::bold(paste0(file, ":"))),
family = "serif",
Expand All @@ -758,7 +761,7 @@ gentlg_single <- function(huxme = NULL,
# Close the device
dev.off()
} else {
filin <- round(
round(
1440 / graphics::strwidth(
expression(huxtable::bold(paste0(file, ":"))),
family = "serif",
Expand All @@ -769,8 +772,6 @@ gentlg_single <- function(huxme = NULL,
)
}



# Make repeated header on each page
ht <- add_header(ht, paste0(
"\\pnhang\\trhdr\\fi-1152", "\\li1152\\keepn",
Expand Down
1 change: 0 additions & 1 deletion R/quick_rtf_jnj.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ custom_to_rtf <- function(ht, fc_tables = rtf_fc_tables(ht), watermark,
tc <- huxtable::text_color(ht)

## MAKE CELLX DEFINITIONS ----

left_merge <- ifelse(huxtable::colspan(ht) > 1, "\\clmgf", "")
top_merge <- ifelse(huxtable::rowspan(ht) > 1, "\\clvmgf", "")
dc <- display_cells(ht, all = TRUE)
Expand Down

0 comments on commit caadd73

Please sign in to comment.