Fix #70
diff --git a/NAMESPACE b/NAMESPACE
index 6ec7c1e..d30b54e 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -31,6 +31,7 @@
 importFrom(stringr,str_extract_all)
 importFrom(stringr,str_match)
 importFrom(stringr,str_match_all)
+importFrom(stringr,str_replace)
 importFrom(stringr,str_replace_all)
 importFrom(stringr,str_split)
 importFrom(stringr,str_sub)
diff --git a/R/add_header_above.R b/R/add_header_above.R
index e716b69..62dd0e6 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -123,9 +123,9 @@
   new_header_split <- pdfTable_new_header_generator(header, table_info$booktabs,
                                                     bold, italic, monospace)
   new_header <- paste0(new_header_split[1], "\n", new_header_split[2])
-  out <- sub(hline_type,
-             paste0(hline_type, "\n", new_header),
-             enc2utf8(as.character(kable_input)))
+  out <- str_replace(enc2utf8(as.character(kable_input)),
+                     hline_type,
+                     paste0(hline_type, "\n", new_header))
   out <- structure(out, format = "latex", class = "knitr_kable")
   # new_header_row <- latex_contents_escape(new_header_split[1])
   if (is.null(table_info$new_header_row)) {
diff --git a/R/kableExtra-package.R b/R/kableExtra-package.R
index 5add5e5..9dc9689 100644
--- a/R/kableExtra-package.R
+++ b/R/kableExtra-package.R
@@ -56,7 +56,7 @@
 #' load related LaTeX packages manually.
 #'
 #' @importFrom stringr str_count str_split str_match str_detect str_match_all
-#' str_extract str_replace_all str_trim str_extract_all str_sub
+#' str_extract str_replace_all str_trim str_extract_all str_sub str_replace
 #' @importFrom xml2 read_xml xml_attr xml_has_attr xml_attr<- read_html
 #' xml_child xml_children xml_name xml_add_sibling xml_add_child xml_text
 #' xml_remove write_xml xml_text<-