fix a bug in column_spec, fix kable_as_image in windows
diff --git a/R/column_spec.R b/R/column_spec.R
index 615a22e..97dcd06 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -183,7 +183,7 @@
color <- sprintf("\\\\color{%s}", color)
}
- if (!is.null(color)) {
+ if (!is.null(background)) {
background <- sprintf("\\\\columncolor{%s}", background)
}
diff --git a/R/kable_as_image.R b/R/kable_as_image.R
index 48e47a4..4eabca3 100644
--- a/R/kable_as_image.R
+++ b/R/kable_as_image.R
@@ -59,6 +59,7 @@
)
temp_tex <- paste(temp_tex, collapse = "\n")
temp_file <- paste0("table_", format(Sys.time(), "%Y-%m-%d_%H:%M:%S"))
+ file.create(paste0(temp_file, ".tex"))
write_file(temp_tex, paste0(temp_file, ".tex"))
system(paste0("xelatex -interaction=batchmode ", temp_file, ".tex"))
temp_file_delete <- paste0(temp_file, c(".tex", ".aux", ".log"))