# [Tex/LaTex] Using Biber with latexmk

biberlatexmkmiktex

With version 4.22, latexmk claims to

[s]upport the use of biber (with the biblatex package) as an alternative to bibtex for generating bibliographies, with automatic determination of whether to use bibtex or biber.

I decided to give it a go. I'm using Windows 7, Strawberry Perl, MiKTeX 2.8 (including latexmk 4.22b), Biber 0.7.3 (registered in the PATH environment variable) and TeXworks r.670 (which includes settings for latexmk). Result: While latexmk generally seemed to work fine, it always called BibTeX as bibliography backend even when the preamble of my LaTeX file embodied \usepackage[backend=biber]{biblatex}. (In contrast, Biber works fine under texify, the MikTeX equivalent to latexmk.) At first, I thought that I had missed something obvious (I'm still open for the possibility), but then I looked at latexmk.pl. Here are code lines 4204–4207:

    my $bib_program = 'bibtex'; if ( exists$generated_log{"$bbl_base.bcf"} ) {$bib_program = 'biber';
}


So Biber should be called if some condition involving a bcf-file (biblatex/Biber control file) is satisfied. In a copy of latexmk.pl in my local texmf tree, I replaced the above code with a test for the existence (or so I think) of said bcf-file:

    my $bib_program = 'bibtex'; if ( -e "$bbl_base.bcf" ) {