Simple bibliography with vim-latex (latex-suite)

bibtexvim-latex

I have recently switched from using Overleaf to writing my documents in Vim with the vim-latex plugin, also known as latex-suite. For the most part everything is working smoothly, but I cannot get bibliography/references to work.

To keep it simple I tried to set up bibliography management the same way I did in Overleaf, with BibTex. So I have a file refs.bib containing, at the moment, a single entry:

@article{berntson2020multi,
  ...
}

My main.tex file contains a citation

\cite{berntson2020multi}

and ends with

...

\bibliographystyle{plain}
\bibliography{refs.bib}

\end{document}

Both files are in the same directory. This worked in Overleaf, but when I try to compile via vim-latex I get the error message

LaTeX Warning: Citation `berntson2020multi' on page 3 undefined on input line 1
84.

No file main.bbl.
[3] (./main.aux)

LaTeX Warning: There were undefined references.

So, what is a minimal setup to get this to work? The answers I find online seem to all be for complicated specialized setups; I just want something simple that works.

If it is simpler to use BibLaTeX instead I am open to that as well. I tried for a bit myself but couldn't get it to work.

Oh, and my .vimrc contains the following lines related to vim-latex:

" Recommended settings for vim-latex
filetype plugin on
filetype indent on
let g:tex_flavor='latex'

" Compile .pdf instead of .dvi
let g:Tex_DefaultTargetFormat='pdf'

Best Answer

vim-latex's mechanism to manage repeated/bibtex/etc compilations is tied explicitly to the file format that is being produced, rather than simply being active or not.

Whether these additional compilation runs are attempted depends on whether g:Tex_DefaultTargetFormat (or possibly also any format specified within the associated g:Tex_FormatDependency_<fmt>) is found in the g:Tex_MultipleCompileFormats.

By default this is only set to apply to dvi, and it is necessary to put pdf in there, e.g. by setting let g:Tex_MultipleCompileFormats='pdf' in vim to only apply multiple compilations to the vim-latex pdf format.

Related Question