writeTexToPDF: Create a pdf file from a tex string and tex template.

View source: R/writeTexToPDF.R

writeTexToPDFR Documentation

Create a pdf file from a tex string and tex template.

Description

Function to create a pdf file from tex.

Usage

writeTexToPDF(
  template_tex_str = NULL,
  template_tex_file = NULL,
  tex_str = NULL,
  tex_file = NULL,
  insertion_point = "&&tex_str",
  pdf_name = NULL,
  cleanup = TRUE
)

Arguments

template_tex_str
  • character string of tex template

template_tex_file
  • name of text file with tex template

tex_str
  • the tex string to insert into the template

tex_file
  • the name of a tex file with the tex string

insertion_point
  • string identifying point at which to insert the tex string into the template

pdf_name
  • the desired name for the resulting pdf file

cleanup
  • flag to clean up intermediate files

Details

This function inserts a tex string (in tex_str or tex_file) into a string version of a tex template (template_tex_str) or file (template_tex_file) and then converts the resulting tex file to a pdf. The insertion point in the template must be indicated by the value of insertion_point.

To use a 'template' without a '&&tex_str' insertion marker, leave tex_str and tex_file as NULLs.

The intermediate files are named "tex_DUMMY_TEX_FILE" with extensions .tex, .aux, .log, and .pdf. The pdf file is copied to the file given by pdf_name (which defaults to the tex_file name with a pdf extension, or 'tex_str.pdf' if tex_file is NULL).

Value

Invisibly, the tex string used to create the pdf document.


wStockhausen/wtsUtilities documentation built on March 16, 2024, 10:38 a.m.