# Setting filenames and paths of auto-pst-pdf

When one has a lot of documents for a single project, it gets important not to lose the overview. I use \usepackage{auto-pst-pdf} together with pdflatex and it works fine in principal. However, the images are always created in the same folder as my .tex files (with the suffix "-pics.pdf") and I seem not able to change this default behavior. This makes my main folder really crowded. My question is: How can I change where my "temporary" .pdf files are saved and how they are called when I use \usepackage{auto-pst-pdf}?

For \usepackage{pst-pdf} there exists an option \edef\PDFcontainer{...}, with which one can define such a file name and path. Nevertheless, this does not work for the auto version, where there appear to be other definitions like \edef\pics{...} and \def\suffix{}, but those dont work as expected. I am sure it is pretty easy to solve my question, but I do not seem to get it.

Additional note: The option \usepackage[cleanup={log,dvi,ps,pdf}]{auto-pst-pdf} deletes all temporary files except for the temporary .pdf files "*-pics.pdf".

-
how can your main folder "really crowed" when you have one additional file? – Herbert Nov 28 '11 at 18:46
I have a small workaround: add \makeatletter\app@remove@container\makeatother after every \end{pspicture}. It deletes the temporary files of this picture. This command seems not to be evoked after the compilation and I consider it a bug that the cleanup does not work properly. – Hendrik Nov 28 '11 at 19:23
the cleanup is the default and there will be no additional file other than the container file. – Herbert Nov 28 '11 at 19:55
Right, but I dont want a container file. How can I get auto-pst-pdf to delete this file automatically? – Hendrik Nov 28 '11 at 20:00
sorry, still no output file when using \usepackage[crop=off,pspdf={-sOutputFile=/tmp/\jobname-pics.pdf}]{auto-pst-pdf}‌​ and \edef\PDFcontainer{/tmp/\jobname-pics.pdf}. The folder "tmp" exists of course. The error message "File ..../tmp/...-pics.pdf not found." is being shown. – Hendrik Nov 29 '11 at 10:29

## 1 Answer

For example if the file should be saved in /tmp/

\usepackage[pspdf={-sOutputFile=/tmp/\jobname-pics.pdf}]{auto-pst-pdf}
\edef\PDFcontainer{/tmp/\jobname-pics.pdf}

-