Sign up ×
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.

Say, my .tex files are organized like this ~/Projects/proj_name/articles.tex.

After compiling with LaTeX Suite, I want the output PDF file to be proj_name.pdf instead of articles.pdf. Since I have several projects in ~/Projects/ I want a systematic configuration in .vimrc.

Here is my current solution

let g:Tex_CompileRule_pdf='pdflatex -interaction=nonstopmode -jobname=%:p:h:t $*'

This method is not satisfying since the name of .aux and .bbl are also changed to proj_name while Vim-LaTeX is still looking for articles.aux.

My question is, is there any other methods for doing this?

share|improve this question
Welcome to TeX.SX. – Claudio Fiandrino Jan 17 '13 at 15:55

2 Answers 2

You may use this command :

:!pdflatex articles.tex && mv articles.pdf proj_name.pdf

but you have to change manually the command for each case.

share|improve this answer

I know this is an old question but I ran into the same problem as the OP and had to solve it.

As a note to other users: the OP's "current solution" does not work well because latex-suite checks the aux and bbl files with the same name as the tex file to see if it needs to run bibtex or recompile the pdf; it won't find them, since the command used also names these files according to the jobname. Hence it never runs multiple compilations to get the bib.

That said, I found no easy solution so here is a shell script I use as the new compile rule (e.g. named tex2pdf):


# Get the passed file name

# Cut of the extension

# Get the name of the current dir

# The usual command
pdflatex -interaction=nonstopmode ${fullName}

# Rename the pdf
if [ -e ${fileName}.pdf ]
    mv ${filename}.pdf ${dirName}.pdf

Then use this as the compile rule:

let g:Tex_CompileRule_pdf='tex2pdf $*'
share|improve this answer
Welcome to TeX.SX! Even if you're a Vim user. :-D – egreg May 13 at 6:17

Your Answer


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.