compile_handouts.Rd
This function processes a list of LaTeX files, creates corresponding handout files using a specified template, compiles them into PDFs, and removes the intermediate handout files after successful compilation.
compile_handouts(file_list, template_path = "handout_tex/handout.tex")
This function does not return a value but compiles PDFs and deletes the temporary handout TeX files after compilation.
The function reads a template LaTeX file and loops over a user-provided list of TeX files. For each TeX file, the function generates a corresponding handout file by replacing a placeholder in the template, compiles the file into a PDF using tinytex::latexmk
, and then deletes the handout TeX file once the PDF is generated. If an error occurs during compilation, it skips to the next file.
if (FALSE) { # \dontrun{
tex_files <- list.files(pattern = "^Sta.*\\.tex")
compile_handouts(tex_files)
} # }