30

pdflatex provides a possibility to specify the output directory:

-output-directory=DIR use DIR as the directory to write files to

I would like to set the output file so that

pdflatex file.tex create a foo.pdf instead of file.pdf

Is that possible?

Viesturs
  • 7,895

1 Answers1

34

According to the command line help (pdflatex -help), pdflatex is to be invoked as

pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]

with all options preceeding the source file argument.

In addition to changing the output directory, the default output file name can be altered by modifying the internal \jobname register through command option -jobname=STRING:

pdflatex -output-directory=DIR -jobname=STRING FILE

The order of options does not matter here, but FILE comes last.

AlexG
  • 54,894