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" ) {
$bib_program = 'biber';
}
Result: The modified latexmk correctly determines when to use Biber instead of BibTeX. (When switching from Biber to BibTeX, remnant bcf-files must be deleted manually.)
So: Have I discovered a bug in latexmk 4.22b or have I missed something obvious involving my system/TeX distribution/editor?
EDIT: To make my question more focussed: I'm interested to hear if other users of latexmk observe the same behaviour (latexmk never calling Biber). If so, I'd be happy if someone suggested a solution that -- unlike my "quick fix" -- doesn't involve redundant Biber runs.
EDIT 2: Herbert pointed out that Perl may behave differently in Windows vs. Linux. I will report my observations to the author of latexmk after the end of the bounty period; I'm still interested in reports from other users.
$generated_log{..}
really do?latexmk.pl
.$generated_log{..}
could do this job to controll changes or not in the bcf file. But from your description it does nothing special, the reason why your -e should do the better job. But this is only a guess, a closer look into the code is needed.-e
by trial and error), so my "description" what$generated_log
does may be a comment snippet not relevant for the question at hand.-diagnostics
option to see if there is a path problem somewhere?