2

I couldn't figure out why I was getting the errors LaTeX warning: Citation '...' on page X undefined on input line Y and empty bibliography on line Z in a document I was working on. I kept removing code until all that was left was the minimum for generating references and the problem was still there.

I have narrowed it down to this:

The following MWE compiles correctly (shows reference table with link from citation in text to table).

\documentclass[a4paper]{scrartcl}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
publisher = {Clarendon Press},
keywords = {physics}
}
\end{filecontents*}

\usepackage[backend=biber]{biblatex}
\addbibresource{\jobname}

\begin{document}

\section{test}

this is a reference. \cite{dirac}   

\printbibliography 

\end{document}

however, if I add the key year = {1981} to the bibliography entry so it reads:

@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
publisher = {Clarendon Press},
keywords = {physics},
year = {1981}
}

the document does not compile with references any more!

I get these warnings:

LaTeX Warning: Citation 'dirac' on page 1 undefined on input line 23.

LaTeX Warning: Empty bibliography on input line 25.

I am using the commands

xelatex main.tex
biber main
xelatex main.tex
xelatex main.tex

to compile, but I get the same problem using pdflatex too.

This is the output of biber when the year key is not present (references compiled correctly):

INFO - This is Biber 2.14
INFO - Logfile is 'main.blg'
INFO - Reading 'main.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Globbing data source 'main'
INFO - Globbed data source 'main' to main
INFO - Looking for bibtex format file 'main' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source './main.tex'
WARN - BibTeX subsystem: /var/folders/0v/640gnlsn7757klpyxs64hlz00000gn/T/biber_tmp_Nl1z/main.tex_18596.utf8, line 4, warning: 93 characters of junk seen at toplevel
INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Sorting list 'nty/global//global/global' of type 'entry' with template 'nty' and locale 'en-US'
INFO - No sort tailoring available for locale 'en-US'
INFO - Writing 'main.bbl' with encoding 'UTF-8'
INFO - Output to main.bbl
INFO - WARNINGS: 1

and here is the output of biber when the year key is present (references broken):

INFO - This is Biber 2.14
INFO - Logfile is 'main.blg'
INFO - Reading 'main.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Globbing data source 'main'
INFO - Globbed data source 'main' to main
INFO - Looking for bibtex format file 'main' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source './main.tex'

(I have updated tex live manager with tlmgr update --self --all and tried "rm -rf `biber --cache`" but the problem is still there)

4
  • 2
    I can't reproduce your problem, but I'm on windows and have a newer biber. There was a bug report about something similar but without conclusive solution: github.com/plk/biber/issues/312 Jun 9, 2021 at 15:07
  • Works ok here, too (TeXLive2021, although I also have that strange warning) (PS: nice well done first question!)
    – Rmano
    Jun 9, 2021 at 15:08
  • 2
    Ah, your input is wrong. You should use \addbibresource{\jobname.bib}, with your input you are actually reading the tex-file. Jun 9, 2021 at 15:25
  • The actual issue is a duplicate of tex.stackexchange.com/q/579291/35864, but as Ulrike explains the additional problem with the MWE is that with \addbibresource{\jobname}, Biber tries to parse the .tex file as data source, which leads to junk warnings. \addbibresource{\jobname.bib} would have been correct.
    – moewe
    Jun 9, 2021 at 18:08

1 Answer 1

0

Removing the biber cache files actually did solve the problem (fix confirmed here thanks @ulrike). I initially thought it hadn't worked because I ran "rm -Rf `biber --cache`" in fish not bash and it failed silently because backticks are not executed in fish.

Running rm -Rf (biber --cache) in fish solved the problem.

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