This may be a job easily done with the help of your tex editor. With winedt, it is done like this (for miktex only ):
Go to winedt menu Options ---> Execution Modes
. In the window that opens choose TeX Options
:

Make the modifications as shown in the picture. Give OK
and come out. Now all the auxiliary files will be stored inside a folder TeXAux
inside your main folder. If you uncheck the box, the directory TeXAux
will be created if it doesn't exist already. Hence your main directory will not get cluttered.
Similar options may be available for other editors also, but unfortunately I don't have much idea about them :-(
Addendum
Following a personal mail from Karl Koeller (who is a great contributor for winedt and its macros):
I just wanted you to notice that WinEdt (starting with the latest 6
builds) uses its own algorithm (written by myself) to manage auxiliary
files in TeXAux folder. In other words, it does not use
--aux-directory command line switch provided by some miktex applications (see 'Auxiliary folder' in the WinEdt manual index).
That means that this feature does NOT depend on the TeX System you
use. TeX Live users can take advantage of this feature, too.
Hence, this feature is available for texlive also from winedt 6 onwards.
Texmaker
Go to Options ---> Configure Texmaker
to get the window:

Check the box as shown in the picture, press OK
and come out. Now ALL output files (unfortunately including pdf file) will be stored inside a folder build
inside the main folder.
Easy cleaning of auxiliary files
If every thing boils down to cleaning the auxiliary files, one may settle with Arara. It's excellent manual is a worth reading for details. You have to add the clean
directive as
% arara: clean: {files: [yourfile.aux, yourfile.idx, yourfile.ilg, yourfile.ind, yourfile.log, yourfile.bbl, yourfile.bcf, yourfile.ist, yourfile.blg, yourfile.run.xml]}
You can add the files to be cleaned at your will. A normal set of directive may look like:
% arara: pdflatex: {synctex: yes}
% arara: makeindex
% arara: biber
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}
% arara: clean: {files: [yourfile.aux, yourfile.idx, yourfile.ilg, yourfile.ind, yourfile.log, yourfile.bbl, yourfile.bcf, yourfile.ist, yourfile.blg, yourfile.run.xml]}
%\documentclass{article}
.
.
.
Then compile your document by issuing arara yourfile
. You have to make sure that the arara is installed and is in system path.
-output-directory
directive and point out to a hidden folder to store the auxilliary files but I am not knowledgeable enough to tell whether it would be discoverable by the system. – percusse Dec 21 '12 at 1:51.
doesn’t hide them, thoughattrib +H \jobname.\ext
does set the “hidden” flag. – Qrrbrbirlbel Dec 21 '12 at 2:06.bat
file, or a special Editor setup that does something before and after callingpdflatex
? – Qrrbrbirlbel Dec 21 '12 at 2:17