I'm using R to run pdflatex from within the console and I have a wrapper written like the following:
pdflatex <- function(infile, outputdir=NULL, jobname=NULL) {
syscomm <- 'pdflatex "infile"'
syscomm <- sub('infile', infile, syscomm)
if (!is.null(outputdir))
syscomm <- paste(syscomm, ' --output-directory="', outputdir, '"', sep='')
if (!is.null(jobname))
syscomm <- paste(syscomm, ' --jobname=', jobname, sep='')
system(syscomm)
}
When the infile is in R's current working directory, it's able to successfully generate the PDF report. This even works when the infile is not in R's working dir. However, when I specify the output directory using the flag --output-directory=<path>, pdflatex can't find the aux file, gets angry at me, and then breaks down.
Are there more flags to the system command to indicate where to store and look for the aux files?
stracetool to see which files/directories are actually accessed. On Windows there's ProcMon from SysInternals. – krlmlr Oct 18 '12 at 23:19