TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run xelatex (or other compilers), I always end up with many log files in a single folder. This gets difficult to manage. I could create a script which moves them into various folders (e.g. one for glossary-related logs, one for bibliography-related logs), but then the compiler would not find them the next time they compile. Is there a simple way to tell xelatex to put the logs into specific folders?

share|improve this question
xelatex creates only one logfile. I suppose that you mean additional runs by bibtex/biber or similar or files like .aux and so on. – Herbert Dec 5 '11 at 13:07
up vote 4 down vote accepted

There are some directory related switches you can pass to XeLaTeX. Theses are:

  • --aux-directory=aux-directory
  • --include-directory=include-directory
  • --output-directory=output-directory

These were taken from the XeTeX manual on the MiKTeX homepage.
XeLaTeX will not create these directories, so they have to be created before compilation. On Windows, you cannot use aux as directory name.
You might also want to read this related question regarding pdflatex & Texmaker.

share|improve this answer
I find that doesn't work for me (I have the 2009 TeX Live that come in Ubuntu). The command xelatex --aux-directory=aux fn results in fn.aux appearing in the current dir, whether or not aux is an existing directory, and whether or not I enable write18. – Jim Hefferon Dec 6 '11 at 19:22
Not sure what the problem is. Have you tried --aux-directory=aux-directory as well as -aux-directory=aux-directory? – matth Dec 6 '11 at 19:31
Could you try a name other than aux for the folder? Not sure about Linux, but on Windows you cannot have folders named aux. – matth Dec 6 '11 at 19:41
I'm not sure we are allowed to have this conversation, but no, changing to -aux-directory=fred or --aux-directory=fred or other nearby variants does nothing that I can see. On the other hand, --output-directory get everything, including the .pdf. – Jim Hefferon Dec 6 '11 at 20:54
The first two of these flags are specific to MikTeX and will not work with TeXLive. – Martin Schröder Sep 6 '12 at 21:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.