3

When I change something in my bib file, click save and run Latexmk command, it always says:

Latexmk: This is Latexmk, John Collins, 4 Apr. 2023. Version 4.80. Latexmk: Nothing to do for './main.tex'. Latexmk: All targets (main.pdf) are up-to-date

I'm using biblatex with biber backend. I want Latexmk to detect changes in bib files. I've tried to add -recorder` flag for Latexmk as suggested in this post but it doesn't work.

Also I've checked main.fls and can't find my bib file. Only files like main.bbl and main.bcf show up there. I think this may indicate Latexmk is not tracking the bib file, but why?


Edit

I'm on Ubuntu 22.04.3 LTS (Hyper-V virtual machine, if it matters). tex --version shows

TeX 3.141592653 (TeX Live 2023)

and I'm compiling using the command latexmk -xelatex main.tex.


Edit 2

In the file main.fdb_latexmk, following ["biber, there are:

["biber main"] 1701360730 "main.bcf" "main.bbl" "main" 1701360782 0
"main.bcf" 1701360782 107749 d415e9cf25de5307100d1c0ac845400a "xelatex"
(generated)
"main.bbl"
"main.blg"
(rewritten before read)

bib files are not contained in these lines. Also bib files are not shown after running latexmk -dependents -xelatex.

Here's the example I'm working on:

% main.tex
\documentclass{article}
\usepackage{biblatex}
\bibliography{refs.bib}
\begin{document}
  \nocite{*}
  \printbibliography
\end{document}
% refs.bib
@article{worldHello,
  title = {Hello},
  author = {World},
}
8
  • 1
    "Also I've checked main.fls" that file just lists files input by latex (which never reads a .bib file) Nov 30, 2023 at 14:00
  • 1
    No issues for my Ubuntu 22.04 with upstream TeXLive 2023. latexmk recompiles if I change somehing in the bib file.
    – daleif
    Nov 30, 2023 at 14:24
  • 1
    Like @daleif, I find that latexmk reruns biber if the bib file changes. Some possibilities (a) You've got more than one bib file of the same name; you edited one of them, but biber used a different one. (b) You've set $bibtex_use to 0 in a latexmkrc file, which prohibits the running of bibtex and biber. (c) You changed the bib file only by changing its time stamp, e.g., by applying touch to it, but made no change in the contents of the file. Nov 30, 2023 at 15:20
  • 1
    A diagnostic: Look at the file main.fdb_latexmk, which contains latexmk's information about dependencies. It should contain a line starting ["biber , followed by lines showing what files biber read, including the bib file(s). Is that the case? You can also run latexmk -dependents; does the output include the name of the bibfile(s)? Nov 30, 2023 at 15:29
  • 2
    I see the problem: You've specified the bib file by using the \bibliography macro instead of \addbibresource. (Note that the biblatex documentation deprecates \bibliography.) That triggers a subtle bug in the dependency detection by latexmk, which I'll need to correct. For now, change\bibliography to \addbibresource. Nov 30, 2023 at 18:19

1 Answer 1

2

In the document, the command \bibliography{refs.bib} was used to specify the .bib file instead of \addbibresource{refs.bib}. In this situation, latexmk (up to its current version 4.81) does not detect the dependency. Note that the biblatex documentation deprecates \bibliography.

The easiest solution is just to switch to using \addbibresource.

The next release of latexmk (probably 4.82) will correct this bug (and a number of other problems with the use of biblatex and biber).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .