I use LaTeX to generate all of the documents for my courses and as a result I have a lot of small documents in a given directory, which can then be hard to navigate due to all of the files generated when the .tex files are compiled. I have tried moving the output using output-directory and making an individual directory for each document but neither of these options have been entirely satisfactory. So my question is what methods of file management have worked for you with respect to LaTeX file management? Thanks.


5 Answers 5


This won't answer your question exactly, but it has worked for me.

I'm using Cornerstone, a subversion (version control) client that lets you manage you files (if you don't know what version control is, look it up!).

You can tell cornerstone to ignore all files of a specific file type so I set mine to ignore .aux .log .pdf etc. This way my repository won't get cluttered up. The working version does tend to get totally cluttered, but is isn't a problem since I only open .tex files from the main cornerstone window which doesn't display the ignored files.

Version control is also godsent for anyone working on big projects etc. Cornerstone is for mac and isn't free but there are free subversion clients for both mac, linux and windows.

  • Thanks for the suggestion, I don't have a lot of experience with version control (although I should use it for my manuscripts) but do you find that this system is effective even for documents that will likely have very few versions (like a brief class assignment)?
    – DQdlM
    Apr 2, 2011 at 13:30
  • OK well I have spent the last couple hours looking into svn and it looks like it may offer some nice advantages wrt this problem and some others... so down the rabbit hole I go.
    – DQdlM
    Apr 2, 2011 at 18:41

You can use git or any other distributed version control system (Mercury/hg).

Using a distributed version control system will allow you to create repository in place without maintaining a server, which is required for SVN.

  • If it's not git, it isn't version control!
    – Skillmon
    Apr 18, 2017 at 13:21

One directory per document, or set of documents with the same source.

For my lectures I put the sources in a docstrip file, and docstrip splits them into the sources of the various documents I'll use (my lecture notes, student handouts, slides, worksheets, etc.). This can be 50 files for one lesson with all the auxiliary files created. But even without so many derivative and auxiliary files I think it's still cleaner to use lots of directories.

If you have files that need to be included into your class files, put them in your local texmf tree.


I just keep all of the files in the same directory with a figures/ and images/ subdirectories.

In order to deal with the extra generated files, I compile in a separate directory by using the TEXINPUTS and friends environmnental variables.

Here is a shell script for that. It uses xelatex, but it works with other engines too. If you main file is called main.tex, it creates a directory .main.tex_files and compiles everything there. It is easy to tell your version control system to ignore that directory (in git, you list it in the .gitignore file).


function build() {
  mkdir -p .$input.tex_files
  cd .$input.tex_files
  TEXINPUTS=.:..:../images/:../figures/: xelatex $input
  BSTINPUTS=:..: BIBINPUTS=:..:.: biber $input
  makeindex $input
  cp $input.pdf ..
  cd ..
build main

When you use a source control client, you can use source control's ignore mechanism. Mercurial (hg), GIT, subversion all of them provide such mechanism. For an example look at latex.gitignore file in github. It ignores most of the latex generated files. You can use this file as a template to write a script which will remove all generated files.

You must log in to answer this question.

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