0

When I run pdflatex on a tex file foo.tex it creates the following files

  • foo.aux
  • foo.log
  • foo.out
  • foo.pdf

and it always bothers me that the *.aux, *.out and *.log files mess up my directories.

Having this said the following questions arose to me:

  • What is the significance of the *.aux and *.out files?
  • Can I run pdflatex with some options to delete these files after the .pdf file is created or make it prefix them with a dot (like .foo.aux) so they are hidden on NIX-systems?
  • Can I make pdflatex store the *.log file somewhere in /var/log instead?
  • 1
  • 3
    they are not mess they are an essential part of latex's working, it is possible but highly inadvisable to move them as you then have to configure tex to find them – David Carlisle Apr 04 '15 at 23:47
  • Many of those files are written during one compilation, read on the next run or the run after next or whatever. If they are deleted when the PDF is produced, a correct PDF never will be compiled. You can delete them once your PDF is finalised but, if you make changes to your source, you will need additional runs to compile your PDF again. So you should delete them only when you are done making changes and your PDF is in its final form. – cfr Apr 04 '15 at 23:55
  • Since /var/log should be writeable only by root, you cannot write the log file there unless you are compiling as root which would be an exceptionally stupid thing to do. – cfr Apr 04 '15 at 23:56
  • I understand that they do speed up follow-up compilations. However, I much rather had them hidden from me (e.g. in a .foo directory since they make the directory look kind of messy.

    Also, I do not simply move them around manually but rather asked if pdflatex provides options to place them in a different fashion.

    /var/log was meant to be an example for "another place" on the system. For example in a /home/user/.log directory or so.

    – Simon Fromme Apr 05 '15 at 00:00
  • @siwica Some latex editors such as texmaker or texstudio allows you to delete the auxiliary files you hate so much for don't mess you anything. But keep in mind they're essential for a good compilation, so move them to another directory only make the compilation process more complex. Even conTeXt generate few of them. – Aradnix Apr 05 '15 at 00:02
  • Yes, I know. I am using Emacs/AUCTex to compile and I know of this possibility. But my main question is whether pdflatex provides a mechanism to store these files in a different fashion (name/location). – Simon Fromme Apr 05 '15 at 00:06
  • You have the compiler switch: -tex-aux= directory. The simplest is to use a subditectory of the current directory, e.g. TeXaux, if your system allows creating it on the fly when this directory does not exist. So you'll see only one directory in the current directory (+ the synchronisation files). – Bernard Apr 05 '15 at 00:09
  • I am using pdfTeX 3.1415926-2.5-1.40.14 which does not have this compiler switch. It is neither documented in the man page nor did it work when I tried. – Simon Fromme Apr 05 '15 at 00:19
  • @Bernard Isn't that MiKTeX specific? There is -output-directory but attempting to use it will complicate things enormously for very little gain. (Just because the files are written there, doesn't mean that they'll be found there.) – cfr Apr 05 '15 at 01:05
  • Doesn't (pdf) tex make a recursive search in subdirectories? I don't now if it's MiKTeX specific, but I've seen friends of mine compiling in directories with hundreds of auxiliary, and it's very painful to be looking for a specific .tex file when dozens of auxiliary files are in the same directory! I'm not sure it's MiKTeX specific… – Bernard Apr 05 '15 at 02:45
  • @Bernard: No pdftex doesn't make a recursive search in the current folder. -aux-directory=DIR is a miktex speciality but I never used it: It is easy to hide or filter out some file types in open dialogs and similar if one really don't want to see them (but hiding has drawbacks: it is difficult to support people if their overeager tex editor hides the log-file.) – Ulrike Fischer Apr 05 '15 at 10:45
  • @Ulrike Fischer: It's precidely this drawback that makes me prefer the solution of the TeXaux directory: to the eyes of the user, the auxiliary files are easy to find, but they're hidden in a container. – Bernard Apr 05 '15 at 10:52
  • @Bernard: Easy for a human, but not so easy for tools like biber or bibtex or makeindex. I would setup a filter for *.tex in the open dialog. – Ulrike Fischer Apr 05 '15 at 10:55

0 Answers0