add kableExtra_latex_packages
diff --git a/NAMESPACE b/NAMESPACE
index d20c746..d7e1c61 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -7,6 +7,7 @@
export(collapse_rows)
export(column_spec)
export(group_rows)
+export(kableExtra_latex_packages)
export(kable_as_image)
export(kable_styling)
export(landscape)
diff --git a/R/util.R b/R/util.R
index 7b7c158..9587bd1 100644
--- a/R/util.R
+++ b/R/util.R
@@ -77,3 +77,32 @@
kable_html <- read_html(as.character(x))
xml_child(xml_child(kable_html, 1), 1)
}
+
+#' LaTeX Packages
+#' @description This function shows all LaTeX packages that is supposed to be
+#' loaded for this package in a rmarkdown yaml format.
+#'
+#' @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_text <- paste0(
+ "header-includes:\n",
+ paste0(pkg_list, collapse = "\n")
+ )
+
+ cat(pkg_text)
+}
diff --git a/man/kableExtra_latex_packages.Rd b/man/kableExtra_latex_packages.Rd
new file mode 100644
index 0000000..79b65c4
--- /dev/null
+++ b/man/kableExtra_latex_packages.Rd
@@ -0,0 +1,12 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/util.R
+\name{kableExtra_latex_packages}
+\alias{kableExtra_latex_packages}
+\title{LaTeX Packages}
+\usage{
+kableExtra_latex_packages()
+}
+\description{
+This function shows all LaTeX packages that is supposed to be
+loaded for this package in a rmarkdown yaml format.
+}