I am usgin latex-suit for gvim.
I want to use the output-dir option.
I defined:
let g:Tex_MultipleCompileFormats='pdf'
let g:Tex_CompileRule_pdf = 'pdflatex --output-directory=output --synctex=-1 -src-specials -interaction=nonstopmode $*'
The problem is that with the --output-directory options latex-suit does not compile multiple times if it necesary, only once. And, I have to compile it manually if references changes.
How can I configure latex-suit multiple compile options with the --output-directory?
You have two options: use a makefile (which I would recommend) or run the command several times inside
g:Tex_CompileRule_pdf.Use a Makefile
LaTeX documents, when they become big, may be troublesome to manage:
{draft}mode,\inputdocuments.If you try to manage that with a single command line it will quickly become impossible to maintain. Using a Makefile allows for better dependency checking between files and also Vim can compile the LaTeX document with
:make(with the default:makeprg, which is set tomake). An example Makefile could be like the following:This Makefile runs
pdflatextwo times by default: once to build the sections and page numbers and a second time to make proper cross references. If a reference changes the.auxfile will be changed andpdflatexwill be run three times.If you do not use BibTeX you do not need the parts about
%.bblfiles.Put several commands into
g:Tex_CompileRule_pdfI'll once again warn that this will quickly become unmaintainable. Tracking dependencies between files through a very long command line is very difficult.
Anyhow, you can use
$*several times inside an external command in Vim. In essence you can do this:And it will run
pdflatextwice (note the semicolon) when you press<leader>ll.Extra note: we do have the vi.SE section of the website for Vim specific questions. It is often faster to get Vim related answers there.