Skip to content

Commit

Permalink
fix: fix missing top hhline when header is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
huaixv committed Jul 14, 2021
1 parent 8db03e5 commit fe4a834
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions R/latex_str.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,9 @@ augment_part_separators <- function(z) {
}

augment_top_borders <- function(properties_df) {
first_level <- head(levels(properties_df$part), 1)

hhline_top_data <- properties_df[
properties_df$ft_row_id %in% 1 & properties_df$part %in% first_level,
properties_df$ft_row_id %in% 1 &
as.numeric(properties_df$part) == min(as.numeric(properties_df$part)),
list(
hhline_top = paste0("\\hhline{", paste0(.SD$hhlines_top, collapse = ""), "}")
),
Expand All @@ -260,7 +259,7 @@ augment_borders <- function(properties_df) {
),
latex_hhline(w = .SD$border.width.bottom, cols = .SD$border.color.bottom),
fcase(.SD$ft_row_id %in% 1 &
.SD$part %in% head(levels(.SD$part), 1),
as.numeric(.SD$part) == min(as.numeric(.SD$part)),
latex_hhline(w = .SD$border.width.top, cols = .SD$border.color.top),
default = ""
)
Expand Down

0 comments on commit fe4a834

Please sign in to comment.