Skip to content

Commit

Permalink
Fix top line before variable output
Browse files Browse the repository at this point in the history
Was not working when first variable was part of a packed variable group.
  • Loading branch information
kbrevoort committed Jan 12, 2020
1 parent 95856d5 commit 19547b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/print-tabler-objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ tabler2kable <- function(tblr_obj, format = NULL) {
kableExtra::row_spec(get_last_coefficient_row(body_dt),
hline_after = TRUE,
extra_latex_after = '\\addlinespace[0.5em]') %>%
add_midrule(tblr_obj$theme$booktabs) %>%
do_packing(pack_detail) %>%
add_header_rows(header_dt) %>%
clean_errant_codes() %>%
add_midrule(tblr_obj$theme$booktabs)
clean_errant_codes()
}

add_midrule <- function(in_kable, booktabs) {
#last_header_text <- dplyr::last(attr(in_kable, 'kable_meta')$new_header_row)
first_var <- paste0('\n', attr(in_kable, 'kable_meta')$rownames[1])
#first_var <- paste0('\n', attr(in_kable, 'kable_meta')$rownames[1])
first_var <- attr(in_kable, 'kable_meta')$contents[[1]]

if (booktabs) {
paste_string <- '\n\\\\midrule \\\\addlinespace[0.5em]'
Expand Down

0 comments on commit 19547b5

Please sign in to comment.