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?

  • 1
    xelatex creates only one logfile. I suppose that you mean additional runs by bibtex/biber or similar or files like .aux and so on.
    – user2478
    Commented Dec 5, 2011 at 13:07

1 Answer 1


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.

  • 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. Commented Dec 6, 2011 at 19:22
  • Not sure what the problem is. Have you tried --aux-directory=aux-directory as well as -aux-directory=aux-directory?
    – matth
    Commented Dec 6, 2011 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
    Commented Dec 6, 2011 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. Commented Dec 6, 2011 at 20:54
  • 2
    The first two of these flags are specific to MikTeX and will not work with TeXLive. Commented Sep 6, 2012 at 21:42

You must log in to answer this question.

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