latexrun
latexrun copied to clipboard
Latexrun+biber works incorrectly with \nocite{*}
Here goes minimal example.
blah.tex:
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}
\begin{document}
Hello world.
\nocite{*}
\printbibliography
\end{document}
refs.bib:
@inproceedings{ref01,
author={M. Pie},
title={A Bug in Latexrun},
booktitle={Github},
year={2018}
}
I do latexrun --bibtex-cmd biber blah
and I get a pdf file with no references section. This is wrong.
If I do pdflatex blah; biber blah; pdflatex blah
, the references section is there. This is how it's supposed to be.
I also have this problem.
Interestingly, just running latexrun again fixes the problem for me - even though it does not execute latex again (--verbose-cmds
does not print anything)
After running latexrun once, latex.out/xyz.pdf
is correct, but xyz.pdf
is some intermediate version, not the final one...
I uploaded a log here: https://gist.github.com/xqms/610a018e95251bcbc9b80c5927a900f5
The command I used was
latexrun --debug --verbose-cmds --latex-cmd "xelatex" --bibtex-cmd "biber" talk.tex
Note that "commiting latex.out/talk.pdf to talk.pdf" occurs only once after the first latex run, which seems wrong to me...
I also have this problem. Unlike @xqms running latexrun
again does not cause biber
to run, and hence does not fix the problem. From skimming the code I think the problem is that latexrun
tries to parse the aux file in order to determine whether biber
needs to be run. Use of \nocite{*}
messes up this logic. In my opinion, just like parsing of tex files should be left to latex
, parsing of biber
files should be left to biber (even if that requires running biber
"unnecessarily").
(Mind you, I see the attraction of trying to avoid running biber
. A common pattern is to have all your latex files reference the same bib file. A minor tweak to that bib file will then result in biber
needing to be run for all latex files in the repository. However I suspect avoiding this is hard.)
I found a fix for this. When using \nocite{*}
, an entry is generated in the .bcf
file. If latexrun is extended to also look there before concluding that no biber run is needed, then it correctly identifies that it needs to run another pass of biber.