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'm trying to make biblatex work with Vim-Latex (a.k.a Latex-Suite). Using bibtex as a backend works fine but using biber doesn't. I'm using Miktex 2.9 and have the following in my .vimrc file:

" Latex configuration
set shellslash
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
let g:Tex_BibtexFlavor = 'biber'
let g:Tex_CompileRule_pdf = 'pdflatex --synctex=-1 -src-specials -interaction=nonstopmode -file-line-error-style $*'
let g:Tex_DefaultTargetFormat='pdf'  
let g:Tex_MultipleCompileFormats='pdf'

I've also tried setting:

let g:Tex_CompileRule_bib = 'biber $*'

But I still get the "There were undefined references" warning.

share|improve this question
    
Do you setup biblatexcorrect with backend=biber? Did you delete old auxiliary files? –  Marco Daniel Nov 21 '12 at 19:14
    
Yes, I did all that. When setting biblatex with backend=bibtex it works fine but with biber it doesn't. Using biber in texmaker works perfectly so I believe the issue is related to the way vim is configured. –  petobens Nov 21 '12 at 19:28
    
The difference is probably that bibtex runs on the .aux file but biber uses the .bcf file. Perhaps vim is always calling the bib backend with file.aux? biber also accepts it if you call it with just the base file name file with no extension so perhaps there is a way to configure it to do this? –  PLK Nov 25 '12 at 21:57
1  
May I suggest that you have a look at latexmk, if available on your system? It takes care of compiling LaTeX documents and supports biber as bibliographic back-end. Also, you might want to have a look at the LaTeX-Box Vim plugin. –  joelpet Jan 4 '13 at 4:37
    
@joelpet I'm using windows so I can't use Latex-Box with latexmk. –  petobens Mar 11 '13 at 1:19

2 Answers 2

up vote 3 down vote accepted

As MarcoDaniel suggested, one possibility is to use the amazing arara tool. In order to make it work with Vim-Latex, the compiler settings in the vimrc must be:

let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_CompileRule_pdf = 'arara -v $*'

To be to able to jump to the error location in the source window by pressing enter in the "QuickFix" window you must pass the "file-line-error-style" flag to arara, for instance like this:

% arara: pdflatex: {options: "-file-line-error-style"}

To use biber then simply add the directive: % arara: biber

share|improve this answer

What I did was in the vim-latex plugin, in ~/.vim/ftplugin/latex-suite/texrc, I changed:

TexLet g:Tex_BibtexFlavor = 'bibtex'

to

TexLet g:Tex_BibtexFlavor = 'biber'

Then, like was mentioned by @PLK, you want biber to execute on the .bcf file (see section 3.11.1.1 of the biblatex manual), so in ~/.vim/ftplugin/latex-suite/compiler.vim around like 568, I changed

let bibFileName = mainFileName_root.'.bbl'

to

let bibFileName = mainFileName_root.'.bcf'

Let me know if that works for you.

share|improve this answer
    
Unluckily that doesn't work for me. –  petobens Jun 8 '13 at 14:55
    
This solution didn't work for me on its own, but with one more step, it worked. Just above the "let bibFileName" line in compiler.vim, there is a line "if runCount == 0 && Tex_IsPresentInFile('\\bibdata', mainFileName_root.'.aux')". You need to change the '\\bibdata' to a word that will actually be in your aux file if biber needs to be run. I used 'cite' instead but other things would probably work. –  Louisa Grey Dec 30 '13 at 18:08
    
@LouisaGrey, good catch. I had also edited that line. However, all I took out were the two \\ before bibdata and then change the extension at the end to bcf. bibdata still occurs as a word in the bcf file, so for me that still causes it to execute biber on the file. –  Paul Jan 9 at 18:48
    
You should edit the texrc and should add these things to .vimrc Otherwise, it will be overwritten on an update. –  lvleph 2 days ago

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.