I just want to have a .tex
file which I compile with pdflatex
and end up with a .pdf
file. I don\'t want all the other .aux
For people on Linux the equivalent to -aux-directory
appears to be -output-directory
, unfortunately it doesn't play nicely with \include{...}
(included files' .aux
files still get dumped in the current directory).
See also: the man page.
IIRC \nofiles
in your file suppresses the .aux
output.
Use pdflatex
with -enable-write18
option and write at the end of your LaTeX file
\write18{del *.aux}
\write18{del *.log}
\write18{del *.gz}
or more pricise
\write18{del \jobname.aux}
\write18{del \jobname.log}
\write18{del \jobname.synctex.gz}
\write18{del \jobname.toc}
\write18{del \jobname.loc}
del
is a DOS-function. Use rm
for UNIX.
Write a shell-script wrapper which removes the files:
#!/bin/sh
pdflatex "$@" && rm -f *.aux *.log *.synctex.gz
Bonus-assignment: modifying the script to only remove the files actually created by pdflatex.