Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Possibly related question: Directory organization with multiple papers that share files –  Christian Lindig Apr 1 '11 at 21:11
add comment

5 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
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)? –  KennyPeanuts Apr 2 '11 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. –  KennyPeanuts Apr 2 '11 at 18:41
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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).

#!/usr/bin/zsh

function build() {
  input=$1
  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
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.