diff --git a/R/save_kable.R b/R/save_kable.R
index 5a5cbc0..85ed54a 100644
--- a/R/save_kable.R
+++ b/R/save_kable.R
@@ -4,35 +4,59 @@
 #' kableExtra
 #' @param file save to files. If the input table is in HTML and the output file
 #' ends with `.png`, `.pdf` and `.jpeg`, `webshot` will be used to do the
-#' conversion
-#'
+#' conversion.
 #' @param bs_theme Which Bootstrap theme to use
 #' @param self_contained Will the files be self-contained?
-#' @param ... Additional variables being passed to `webshot::webshot`.`
+#' @param extra_dependencies Additional HTML dependencies. For example,
+#' `list(`
+#' @param ... Additional variables being passed to `webshot::webshot`. This
+#' is for HTML only.
+#' @param latex_header_includes A character vector of extra LaTeX header stuff.
+#' Each element is a row. You can have things like
+#' `c("\\\\usepackage{threeparttable}", "\\\\usepackage{icons}")`  You could
+#' probably add your language package here if you use non-English text in your
+#' table, such as `\\\\usepackage[magyar]{babel}`.
+#' @param keep_tex A T/F option to control if the latex file that is initially created
+#' should be kept. Default is `FALSE`.
 #'
 #' @export
 save_kable <- function(x, file,
-                       bs_theme = "simplex", self_contained = TRUE, ...) {
+                       bs_theme = "simplex", self_contained = TRUE,
+                       extra_dependencies = NULL, ...,
+                       latex_header_includes = NULL, keep_tex = FALSE) {
   if (attr(x, "format") == "latex") {
-    return(save_kable_latex(x, file))
+    return(save_kable_latex(x, file, latex_header_includes, keep_tex))
   }
-  return(save_kable_html(x, file, bs_theme, self_contained, ...))
+  return(save_kable_html(x, file, bs_theme, self_contained,
+                         extra_dependencies, ...))
 }
 
-save_kable_html <- function(x, file, bs_theme, self_contained, ...) {
-  html_header <- htmltools::tags$head(
+save_kable_html <- function(x, file, bs_theme, self_contained,
+                            extra_dependencies, ...) {
+  dependencies <- list(
     rmarkdown::html_dependency_jquery(),
     rmarkdown::html_dependency_bootstrap(theme = bs_theme),
     html_dependency_kePrint()
   )
+  if (!is.null(extra_dependencies)) {
+    dependencies <- append(dependencies, extra_dependencies)
+  }
+
+  html_header <- htmltools::tag("head", dependencies)
   html_table <- htmltools::HTML(as.character(x))
   html_result <- htmltools::tagList(html_header, html_table)
 
   # Use webshot if necessary
   if (tools::file_ext(file) %in% c("png", "jpg", "jpeg", "pdf")) {
+    message("Putting together a HTML file...")
     file_html <- paste0(tools::file_path_sans_ext(file), ".html")
     htmltools::save_html(html_result, file = file_html)
+    message("Converting HTML to ", tools::file_ext(file), "...")
     webshot::webshot(file_html, file, ...)
+    message("Done. ")
+    if (tools::file_ext(file) == "pdf") {
+      message("Note that HTML color may not be displayed on PDF properly.")
+    }
     unlink(file_html)
     unlink("lib", recursive = TRUE)
   } else {
@@ -44,6 +68,53 @@
   }
 }
 
-save_kable_latex <- function(x, file) {
+save_kable_latex <- function(x, file, latex_header_includes, keep_tex) {
+  temp_tex <- c(
+    "\\documentclass[border=1mm, preview]{standalone}",
+    "\\usepackage[active,tightpage]{preview}",
+    "\\usepackage{varwidth}",
+    "\\usepackage{amssymb, amsmath}",
+    "\\usepackage{ifxetex,ifluatex}",
+    "\\usepackage{fixltx2e}",
+    "\\usepackage{polyglossia}",
+    "\\setmainlanguage{$mainlang$}",
+    latex_pkg_list(),
+    "\\usepackage{graphicx}",
+    "\\usepackage{mathspec}",
+    "\\usepackage{xltxtra,xunicode}",
+    latex_header_includes,
+    "\\begin{document}",
+    solve_enc(x),
+    "\\end{document}"
+  )
+  temp_tex <- paste(temp_tex, collapse = "\n")
 
+  temp_tex_file <- tools::file_path_sans_ext(file)
+  writeLines(temp_tex, temp_tex_file, useBytes = T)
+  system(paste0("xelatex -interaction=batchmode ", temp_tex_file))
+  if (!keep_tex) {
+    temp_file_delete <- paste0(tools::file_path_sans_ext(file),
+                               c(".tex", ".aux", ".log"))
+    unlink(temp_file_delete)
+  }
+
+  table_img_pdf <- try(magick::image_read(paste0(temp_file, ".pdf"),
+                                          density = density),
+                       silent = T)
+  if (class(table_img_pdf) == "try-error") {
+    stop("Ghostscript is required to read PDF on windows. ",
+         "Please download it here: https://ghostscript.com/")
+  }
+  if (!keep_pdf) {
+    unlink(paste0(temp_file, ".pdf"))
+  }
+  table_img <- magick::image_convert(table_img_pdf, file_format)
+  if (!is.null(filename)) {
+    temp_img <- paste0(filename, ".", file_format)
+  } else {
+    temp_img <- tempfile(fileext = paste0(".", file_format))
+  }
+  magick::image_write(table_img, temp_img)
+
+  include_graphics(temp_img)
 }
