Improve latex package listing method
diff --git a/R/util.R b/R/util.R
index 9587bd1..27f7d57 100644
--- a/R/util.R
+++ b/R/util.R
@@ -85,19 +85,7 @@
 #' @export
 kableExtra_latex_packages <- function() {
 
-  pkg_list <- c(
-    "  - \\usepackage{booktabs}",
-    "  - \\usepackage{longtable}",
-    "  - \\usepackage{array}",
-    "  - \\usepackage{multirow}",
-    "  - \\usepackage[table]{xcolor}",
-    "  - \\usepackage{wrapfig}",
-    "  - \\usepackage{float}",
-    "  - \\usepackage{colortbl}",
-    "  - \\usepackage{pdflscape}",
-    "  - \\usepackage{tabu}",
-    "  - \\usepackage{threeparttable}"
-  )
+  pkg_list <- paste0("  - ", latex_pkg_list())
 
   pkg_text <- paste0(
     "header-includes:\n",
@@ -106,3 +94,19 @@
 
   cat(pkg_text)
 }
+
+latex_pkg_list <- function() {
+  return(c(
+    "\\usepackage{booktabs}",
+    "\\usepackage{longtable}",
+    "\\usepackage{array}",
+    "\\usepackage{multirow}",
+    "\\usepackage[table]{xcolor}",
+    "\\usepackage{wrapfig}",
+    "\\usepackage{float}",
+    "\\usepackage{colortbl}",
+    "\\usepackage{pdflscape}",
+    "\\usepackage{tabu}",
+    "\\usepackage{threeparttable}"
+  ))
+}