mat_tex_to_png: tex to pdf: Convert tex to png

View source: R/table_to_pdf.R

mat_tex_to_pngR Documentation

tex to pdf

Convert tex to png

Description

This is a wrapper for mat_table_to_pdf and mat_pdf_to_png

Usage

mat_tex_to_png(
  path,
  path_out = gsub("\\.tex$", ".png", path),
  correct_grayscale = TRUE,
  step1_args = list(),
  step2_args = list()
)

Arguments

path

Path for the .tex on disk

path_out

Where to save .png

correct_grayscale

Arguments passed to mat_pdf_to_png

step1_args, step2_args

Lists of arguments passed to mat_table_to_pdf and mat_pdf_to_png.

See Also

mat_table_to_pdf, mat_pdf_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)

##
tmp_file <- tempfile()
print(xtable::xtable(tab), file = tmp_file)
mat_tex_to_png(tmp_file, "table_as_image.png")

## Pass other argumetns to mat_table_to_pdf or mat_pdf_to_png
mat_tex_to_png(tmp_file, "table_as_image.png", step1_args = list(quiet=FALSE))
mat_tex_to_png(tmp_file, "table_as_image.png", step2_args = list(echo=FALSE))

## remove file
file.remove("table_as_image")

## End(Not run)

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