diff --git a/R/kable_styling.R b/R/kable_styling.R
index bf0bd53..b693b3b 100644
--- a/R/kable_styling.R
+++ b/R/kable_styling.R
@@ -44,6 +44,8 @@
 #' or replace the caption.
 #' @param stripe_color LaTeX option allowing users to pick a different color
 #' for their strip lines. This option is not available in HTML
+#' @param stripe_index LaTeX option allowing users to customize which rows
+#' should have stripe color.
 #' @param latex_table_env LaTeX option. A character string to define customized
 #' table environment such as tabu or tabularx.You shouldn't expect all features
 #' could be supported in self-defined environments.
@@ -79,6 +81,7 @@
                           repeat_header_method = c("append", "replace"),
                           repeat_header_continued = FALSE,
                           stripe_color = "gray!6",
+                          stripe_index = NULL,
                           latex_table_env = NULL,
                           protect_latex = TRUE) {
 
@@ -131,6 +134,7 @@
                             repeat_header_method = repeat_header_method,
                             repeat_header_continued = repeat_header_continued,
                             stripe_color = stripe_color,
+                            stripe_index = stripe_index,
                             latex_table_env = latex_table_env))
   }
 }
@@ -250,6 +254,7 @@
                              repeat_header_method,
                              repeat_header_continued,
                              stripe_color,
+                             stripe_index,
                              latex_table_env) {
 
   latex_options <- match.arg(
@@ -264,7 +269,7 @@
   table_info <- magic_mirror(kable_input)
 
   if ("striped" %in% latex_options) {
-    out <- styling_latex_striped(out, table_info, stripe_color)
+    out <- styling_latex_striped(out, table_info, stripe_color, stripe_index)
   }
 
   # hold_position is only meaningful in a table environment
@@ -329,9 +334,11 @@
   return(out)
 }
 
-styling_latex_striped <- function(x, table_info, color) {
-  striped_rows <- seq(1, table_info$nrow, 2)
-  row_spec(x, striped_rows, background = color)
+styling_latex_striped <- function(x, table_info, color, stripe_index) {
+  if (is.null(stripe_index)) {
+    striped_index <- seq(1, table_info$nrow, 2)
+  }
+  row_spec(x, striped_index, background = color)
 }
 
 styling_latex_hold_position <- function(x) {
diff --git a/R/save_kable.R b/R/save_kable.R
index 85ed54a..7870af7 100644
--- a/R/save_kable.R
+++ b/R/save_kable.R
@@ -24,7 +24,7 @@
                        bs_theme = "simplex", self_contained = TRUE,
                        extra_dependencies = NULL, ...,
                        latex_header_includes = NULL, keep_tex = FALSE) {
-  if (attr(x, "format") == "latex") {
+  if (!is.null(attr(x, "format")) && attr(x, "format") == "latex") {
     return(save_kable_latex(x, file, latex_header_includes, keep_tex))
   }
   return(save_kable_html(x, file, bs_theme, self_contained,
@@ -36,6 +36,7 @@
   dependencies <- list(
     rmarkdown::html_dependency_jquery(),
     rmarkdown::html_dependency_bootstrap(theme = bs_theme),
+    rmarkdown::html_dependency_font_awesome(),
     html_dependency_kePrint()
   )
   if (!is.null(extra_dependencies)) {
@@ -66,6 +67,8 @@
       unlink("lib", recursive = TRUE)
     }
   }
+
+  return(file)
 }
 
 save_kable_latex <- function(x, file, latex_header_includes, keep_tex) {
@@ -89,7 +92,7 @@
   )
   temp_tex <- paste(temp_tex, collapse = "\n")
 
-  temp_tex_file <- tools::file_path_sans_ext(file)
+  temp_tex_file <- paste0(tools::file_path_sans_ext(file), ".tex")
   writeLines(temp_tex, temp_tex_file, useBytes = T)
   system(paste0("xelatex -interaction=batchmode ", temp_tex_file))
   if (!keep_tex) {
@@ -98,23 +101,22 @@
     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 (tools::file_ext(file) != "pdf") {
+    table_img_pdf <- try(
+      magick::image_read(paste0(tools::file_path_sans_ext(file), ".pdf"),
+                         density = 300), silent = T)
+    if (class(table_img_pdf) == "try-error") {
+      stop("We hit an error when trying to use magick to read the generated ",
+           "PDF file. If you are using Windows, it could be possible that you",
+           " had not installed ghostscript (https://ghostscript.com/). ",
+           "Otherwise, you may check your magick installation and try to ",
+           "use magick::image_read to read the PDF file manually. ")
+    }
+    unlink(paste0(tools::file_path_sans_ext(file), ".pdf"))
+    table_img <- magick::image_convert(table_img_pdf,
+                                       tools::file_ext(file))
+    magick::image_write(table_img, file)
   }
-  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)
+  return(file)
 }
