mat_table_to_pdf: Convert a table to direct pdf

View source: R/table_to_pdf.R

mat_table_to_pdfR Documentation

Convert a table to direct pdf

Description

Use tools::texi2pdf

Usage

mat_table_to_pdf(
  x,
  filename = NULL,
  quiet = TRUE,
  is_path_x = FALSE,
  clean_tex = TRUE,
  clean_rest = TRUE,
  copy.mode = TRUE,
  stop_on_error = FALSE,
  plus =
    "\\usepackage{booktabs}\n\\usepackage{dcolumn}\n\\usepackage{underscore}"
)

table_to_pdf(x)

Arguments

x

the table input

filename

output name

quiet

passed to tools::texi2pdf

is_path_x

whether x is a file on disk

clean_tex, clean_rest

Should remove other files, and tex too?

copy.mode

Argument passed to file.copy to override or not permissions

stop_on_error

should it sotp on each error?

plus

additional LaTeX stuff. If contains %ADD, %ADD will be replaced by default

See Also

mat_pdf_to_png, mat_tex_to_png

Examples

## Not run: 
tab <-  data.frame(variable= c("A", "B"), stat = c("mean"), value = 1:2)
tab_xt <- print(xtable::xtable(tab), print.results = FALSE)

mat_table_to_pdf(tab_xt, filename = "filename_test.pdf")
file.remove("filename_test.pdf")
## case 2: file is already on disk, use is_path_x
tmp_file <- tempfile()
print(xtable::xtable(tab), file = tmp_file)
mat_table_to_pdf(tmp_file, filename = "filename_test2.pdf", is_path_x = TRUE)
file.remove("filename_test2.pdf")

## End(Not run)

MatthieuStigler/matPkg documentation built on Nov. 13, 2023, 7:53 p.m.