Add save_kable and as_image vignette
diff --git a/R/as_image.R b/R/as_image.R
index 245ecb1..cbae4ec 100644
--- a/R/as_image.R
+++ b/R/as_image.R
@@ -36,7 +36,6 @@
}
include_graphics(temp_png, dpi = img_dpi)
- return(NULL)
}
diff --git a/R/kable_as_image.R b/R/kable_as_image.R
index 4876db0..ffe18be 100644
--- a/R/kable_as_image.R
+++ b/R/kable_as_image.R
@@ -1,23 +1,6 @@
-#' Convert a LaTeX table to an image and place it in a rmarkdown document
+#' Deprecated
#'
-#' @description This is a LaTeX-only function. This function will render the
-#' raw LaTeX code (could be codes generated by other table packages like
-#' `xtable`) to generate a table, convert it to an image and put it back to a
-#' rmarkdown environment. It is a "better than nothing" solution to print high
-#' quality tables in rmarkdown Word document. By using this, you need to take
-#' the responsibility of explaining to your collaborators why they can't make
-#' edits to the tables in Word.
-#'
-#' Also, if a filename is provided, user has the option to "save" the table to
-#' an image file like `ggplot2::ggsave()`.
-#'
-#' Note that, if you are using this function on a Windows computer, you need
-#' to install Ghostscript before you can use this feature. It is essential for
-#' magick to read PDFs on Windows. Website for Ghostscript: https://ghostscript.com/
-#'
-#' The idea of this function was coming from [this StackOverflow question](https://stackoverflow.com/questions/44711313/save-rmarkdowns-report-tables-and-figures-to-file).
-#' The approach was learned and adopted from the [texpreview](https://github.com/metrumresearchgroup/texPreview)
-#' package, which allows you to preview the results of TeX code in the Viewer panel.
+#' @description deprecated
#'
#' @param kable_input Raw LaTeX code to generate a table. It doesn't have to
#' came from `kable` or `kableExtra`.
diff --git a/R/save_kable.R b/R/save_kable.R
index 6edc7c4..9921eb3 100644
--- a/R/save_kable.R
+++ b/R/save_kable.R
@@ -95,7 +95,6 @@
"\\setmainlanguage{$mainlang$}",
latex_pkg_list(),
"\\usepackage{graphicx}",
- "\\usepackage{mathspec}",
"\\usepackage{xltxtra,xunicode}",
latex_header_includes,
"\\begin{document}",
@@ -111,7 +110,7 @@
owd <- setwd(dirname(temp_tex_file))
- system(paste0("xelatex ", temp_tex_file))
+ system(paste0("xelatex -interaction=batchmode ", temp_tex_file))
if (!keep_tex) {
temp_file_delete <- paste0(file_no_ext, c(".tex", ".aux", ".log"))
unlink(temp_file_delete)