# [tex4ht] make output of tex4ht go to sub-folder without leaving temporary and intermediate files in the current folder?

Mon Feb 11 14:21:10 CET 2013

On Mon, Feb 11, 2013 at 5:23 PM, Nasser M. Abbasi <nma at 12000.org> wrote:

> On 2/11/2013 5:46 AM, Radhakrishnan CV wrote:
>
>  True, aux and other scratch files still remain in your working directory.
>> In order to move all files to your target directory, you need to provide
>> \Needs{} directive in your source document. For example, I will modify
>> your
>> example document to the following manner:
>>
>> --- foo-changed.tex ----------
>> \documentclass{article}%
>> \usepackage{graphics}
>>
>> \begin{document}
>>
>> \includegraphics{a.png}
>>
>> \Needs{"find ./ -maxdepth 1 -mindepth 1 -type f -not -name \jobname.tex
>> -exec mv '{}' A \string\; "}
>>
>> \end{document}
>> -------------------------
>>
>> \Needs{...} directive is operating system dependent. The one I have given
>> above is for bash in linux or unix like operating systems.  You might
>> provide the one fit for your OS.
>>
>>
> Thanks, that is useful. But is it possible to put this \Needs
> command in my .cfg file somehow? The reason is, I have one common
> .cfg file, and if this can be used in .cfg file, then I do not
> have to edit all my .tex file and add this command to each. I
> have 1,000's of small .tex files, and they all use the same .cfg file.
>

That is quite possible. You might add the following line in your *.cfg:

\AtEndDocument{\Needs{...}}

Let that be the last directive in \jobname.lg file which is read by t4ht
binary.

Best regards
--