Fix item 3 in #480
diff --git a/R/row_spec.R b/R/row_spec.R
index ff95c0e..cc8978e 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -198,7 +198,9 @@
                                      underline, strikeout,
                                      color, background, align, font_size, angle,
                                      hline_after, extra_latex_after)
-    temp_sub <- ifelse(i == 1 & table_info$tabular == "longtable", gsub, sub)
+    temp_sub <- ifelse(i == 1 & (table_info$tabular == "longtable" |
+                                   !is.null(table_info$repeat_header_latex)),
+                       gsub, sub)
     if (length(new_row) == 1) {
       out <- temp_sub(target_row, new_row, out, perl = T)
       table_info$contents[i] <- new_row
diff --git a/R/util.R b/R/util.R
index 12cc526..26d593d 100644
--- a/R/util.R
+++ b/R/util.R
@@ -117,20 +117,6 @@
 
 # Fix duplicated rows in LaTeX tables
 fix_duplicated_rows_latex <- function(kable_input, table_info) {
-  # dup_items <- table(table_info$contents)
-  # dup_items <- dup_items[dup_items != 1]
-  #
-  # for (di in seq(length(dup_items))) {
-  #   dup_row <- names(dup_items[di])
-  #   di_index <- which(table_info$contents == dup_row)
-  #   for (i in seq(dup_items[di])) {
-  #     new_row <- str_replace(
-  #       dup_row, "(?<=\\s)([\\S]+[\\s]*)$",
-  #       paste0("\\\\\\\\vphantom\\\\{", i, "\\\\} \\1"))
-  #     kable_input <- sub(dup_row, new_row, kable_input)
-  #     table_info$contents[di_index[i]] <- new_row
-  #   }
-  # }
   # Since sub/string_replace start from beginning, we count unique value from
   # behind.
   rev_contents <- rev(table_info$contents)