Learn R Programming

TexExamRandomizer (version 1.2.7)

CompileLatexDir: Compiling function

Description

This function calls latexmk, which must be part of the system commands, a directory where tex files are found and outputs their pdf and other things in the pdf.dir.out The functions CompileLatexDirEXAM and CompileLatexDirHW are identical wrappers of the same function, CompileLatexDir. Do not use them, they are just kept for "backwards" compatibility

Usage

CompileLatexDir(
  pdf.dir.out,
  latex.dir.in,
  engine = "xelatex",
  compile.dir = NULL,
  extracmdoptions = NULL
)

CompileLatexDirEXAM( pdf.dir.out, latex.dir.in, engine = "xelatex", compile.dir = NULL, extracmdoptions = NULL )

CompileLatexDirHW( pdf.dir.out, latex.dir.in, engine = "xelatex", compile.dir = NULL, extracmdoptions = NULL )

Value

None

Arguments

pdf.dir.out

Directory where the pdf output will be sent to

latex.dir.in

Directory where all the tex files are found.

engine

Engine to use when compiling. Currently the options are xelatex, lualatex, latex and pdflatex

xelatex is the default value. However, if the value is not recognized, pdflatex is used instead.

compile.dir

Directory from which compilation is invoked, if not specified, it defaults to the latex.dir.in.

Author

Alejandro Recuenco alejandrogonzalezrecuenco@gmail.com

Details

Write the tex files relative paths to other files as to be read from the directory in which latex.dir.in is found This function is intended to be use to compile a bunch of files which are stemmed from an original one. That is why the directory

Examples

Run this code

input_folder <- system.file(
    "extdata",
    "ExampleTexDocuments",
    package = "TexExamRandomizer")


TexExamRandomizer::CompileLatexDir(
    pdf.dir.out = tempdir(),
    engine= "pdf",
    latex.dir.in = input_folder,
    extracmdoptions = "-C")
    # The "-C" option makes sure we simulate we use the command, but the command
    # doesnt run compiling the document, it only tries to clean up

Run the code above in your browser using DataLab