6

I have a document composed of several subfiles and so have used the -aux-directory command to put all of the temporary files in a subfolder, 'auxdir', to keep my working folder clear (and me sane).

I now, however, can't use the multiple compile feature of Vim LaTeX-Suite, presumably because the algorithm it follows (here) will only run BibTeX if it finds a \bibdata line in the aux file, which it can't seem to do if the aux file isn't in the same directory.

The result is that the bibliography isn't compiled at all unless I turn off the -aux-directory option, or unless I manually run BibTeX on the aux file. I'm hoping there's a simpler way someone could point out to me!

4
  • 1
    Welcome to TeX.sx! You don't have to sign with your name since it automatically appears in the lower right corner of your post.
    – lockstep
    Commented Nov 1, 2011 at 12:01
  • You should probably switch to a different compilation mechanism, as vim-latex is not well suited for compiling multiple files.
    – bodo
    Commented Aug 27, 2012 at 13:18
  • @simick: I want to suggest the alternative compilation tool arara. Commented Mar 9, 2013 at 7:45
  • @MarcoDaniel Perhaps you might answer, saying that vim-latex is not the best tool here?
    – Joseph Wright
    Commented Jul 7, 2013 at 6:47

1 Answer 1

2

There are several tools which can can help you.

arara

The cool tool arara provides several rules to specify all compilation steps from inside the document.

For example you want to compile with pdflatex+bibtex+pdflatex you need the following lines in the preamble of the main document:

% arara: pdflatex
% arara: bibtex
% arara: pdflatex

After this specifications you can compile your document with

arara myfile.tex

Options to the rules can be given too.

% arara: pdflatex: { options: { -aux-directory=auxdir }  }
% arara: bibtex: { files: [auxdir/filename1, auxdir/filename2] }

TrY

Another but equal method is the tool TrY. It works only for Unix systems and instead of rules you can type complete small scripts.

The adapted example from above with TrY is:

%$ pdflatex myfile.tex
%$ bibtex myfile.aux
%$ pdflatex myfile.tex

and the compilation step is:

try myfile.tex
2
  • Hm... AFAIU the intend of the OP is to use the -aux-directory=auxdir option, which puts all output files but the PDF into auxdir. (This option is, unfortunately, only available for MikTex, but pretty similar to -output-directory, which is available on all platforms.) Maybe you can extend your example for that case? I guess, the major issue is how the various tools find their intermediate files (now in another directory) and how vim-latex parses the log file and finds the resulting PDF to open the viewer.
    – Daniel
    Commented Jul 7, 2013 at 12:20
  • @Daniel: Than TrY is a bad choise ;-). Thanks. But arara should work. Commented Jul 7, 2013 at 12:22

You must log in to answer this question.

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