#34
diff --git a/R/kable_styling.R b/R/kable_styling.R
index b034d36..bb9cd4c 100644
--- a/R/kable_styling.R
+++ b/R/kable_styling.R
@@ -292,12 +292,14 @@
     continue_line <- paste0("\\caption[]{", repeat_header_text, "}\\\\")
   }
 
+  x <- x[x != "\\bottomrule"]
   x <- c(
     x[1:header_rows_end],
     "\\endfirsthead",
     continue_line,
     x[header_rows_start:header_rows_end],
     "\\endhead",
+    "\\bottomrule\\endlastfoot",
     x[(header_rows_end + 1):length(x)]
   )
   x <- paste0(x, collapse = "\n")
diff --git a/tests/visual_tests/longtable.Rmd b/tests/visual_tests/longtable.Rmd
index 2653dc1..4e6a064 100644
--- a/tests/visual_tests/longtable.Rmd
+++ b/tests/visual_tests/longtable.Rmd
@@ -16,7 +16,7 @@
 library(knitr)
 library(kableExtra)
 
-dt <- rbind(mtcars, mtcars) 
+dt <- rbind(mtcars[1:30,], mtcars) 
 
 # kable(dt, "latex", longtable = T, caption="test table") %>%
 #   add_header_above(c(" ", "a" = 6, "b" = 5)) %>%