Is it possible to hide .aux and .log files? If so, what would be the most low-maintenance/simple way of doing so? They create quite a bit of clutter. I have a folder where I'm tending to a bunch of tex files, and ideally I'd like it so that I just see the .tex and output .pdf files.

ADDENDUM: I am using Windows 7.

  • Sort them by type? :P
    – percusse
    Jun 30, 2012 at 21:35
  • 1
    Related (duplicate?) question: Need *.aux files in separate folder.
    – Alan Munn
    Jun 30, 2012 at 21:43
  • 1
    latexmk has three options that allow you to clean up as you go: -c, -C, -c1. This seems easier (and to a large degree safer) than fiddling with sending the various created files to non-standard places.
    – jon
    Nov 16, 2012 at 10:01

4 Answers 4


If you have a web2c based system you can experiment with TEXMFOUTPUT

My copy of texmf.cnf has

% Write .log/.dvi/etc. files here, if the current directory is unwritable.

However it's probably not a good idea to do this. .aux files for example need to be read back in by LaTeX so if you manage to move them you need to configure latex to find them in the non standard place. Similar considerations apply to other auxiliary files such as .bib, .bbl, bookmark files written by hyperref etc. Even log files which are not (usually) read back by latex are often parsed by editors and GUI etc so that they can report and step through errors etc.

  • if the comment is correct then using this var wouldn't help much as the job input dir is normally writable (for good reasons). Jul 1, 2012 at 15:23
  • yes true although it wouldn't be if you went chmod a-w . I was sure that I remembered TEXMFOUTPUT originally affecting all output, but perhaps it changed over the years, that's the only relevant one I could see now, but that's essentially why I left in that comment (from a TL2011 cygwin distribution texmf.cnf) Jul 1, 2012 at 20:12

Here is a simple patch of the LaTeX kernel that moves most auxillary files to a sub directory (which needs to exist). The .log file stays on top and I do not gurantee that I patched everything necessary :-). Specify \DeclareAuxDir{directory/} if you want directory to hold your files.





% \document can't be patched using etoolbox so this is done manually here
% regexpatch would work but I have to run, so this is the direct version for now

    \@latex@warning@no@line{Unused global option(s):^^J%
  \@colroom\textheight \vsize\textheight
    \advance\columnwidth -\columnsep
    \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
  \hsize\columnwidth \linewidth\hsize
    \global \let \@multiplelabels \relax
  \let\glb@currsize\@empty  %% Force math initialization.
  \let \@refundefined \relax
  \ifdim\topskip<1sp\global\topskip 1sp\relax\fi
  \gdef\do##1{\global\let ##1\@notprerr}%
  \global\let \@nodocument \relax

  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\@partaux #1.aux}
  {\@partaux \AuxDir#1.aux}
  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\endcsname \jobname}
  {\endcsname \AuxDir\jobname}
  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

  {\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

% one could also patch \bibliography to load the .bbl file from the dir but I consider a .bbl more as part of a doc 
% so not done



test for \ref{foo}



% declaring the subdir to be used for aux/toc/...
% need to exist




\section{foo} \label{foo}



Perhaps the .bbl file should be moved there too ... not done.

  • 1
    I'd never thought that this would be possible on the (La)TeX level... Having this as a "real" package (tested and working with all standard classes, up to beamer, which tends to create a ton of aux files) would be just ... great!
    – Daniel
    Jul 1, 2012 at 16:30
  • What about \edef\jobname{\AuxDir\jobname}? That could save you a bunch of redefinitions, I think. Jul 1, 2012 at 16:39
  • @Daniel I wouldn't see this being a big issue. The worst problem is the fact that for certain file operations LaTeX2e doesn't offer official interfaces so that some poackage might exist that add their own aux file handling for additional files types. Jul 1, 2012 at 16:41
  • 1
    @Bruno most likely true, would need some chekcing though, it could have side effects. And then you may not want all files be treated like this. For example I didn't move the bbl file because I consider this part of the document (I rather send my bbl file to somebody instead of my bib files) Jul 1, 2012 at 16:43
  • @Frank, Ah, you're right. For a package, I would personally go for brutally redefining \@@input to do a slow \futurelet-based parsing of the file name (see e.g., my morewrites package which parses file names for \openout), then runs some regexes on that file name to decide where it should go. Jul 1, 2012 at 17:22

If you use Linux then the Gummi IDE leaves you with just the tex file and PDF file. The Windows version is unstable at this time.

The drawback is that Gummi gives you a live preview of your document so large documents slow down the performance.


Run > CMD

attrib +h *.aux /s

Makes .aux a hidden file type. I did it for .synctex.gz, .nav, .out, .snm, and .toc. Pretty nice. At first I got the pdfLaTeX error "I cannot write on the file." I'm not sure why but I went and deleted all of these files and now the new ones that are generated are able to be written on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .