TransWikia.com

What could be the reason for this 'citation undefined' error?

TeX - LaTeX Asked on March 30, 2021

I am working on a relatively large document with many citations.
Suddenly (or so it seems) I am getting the highly frustating ‘citation undefined’ error.
The MWE below also produces it

% !TEX program = xelatex
% !BIB program = biber

documentclass[a4paper,11pt]{article}
usepackage{biblatex}
bibliography{/PATH_TO_BIB/minbib.bib} 

begin{document}
I hate LaTeXcite{Dough}
printbibliography
end{document

Here is the (almost) minimal ‘minbib’ file

@book{Dough,
    title = {Latex is a pain in the ass},
    author = {John Doughnut},
    series = {International series of facepalms},
    year = {2021},
    publisher = {Suicidal Press},
    keywords = {frustation}
}

and I am getting the famous

Citation 'Dough' on page 1 undefined.

and the pdf is not produced.

Please note that my document compiled fine using xelatex and biber before and that I do not think I made other changes than adding more text in the main body of my document.

I am using vscode with the Latex Workshop extension.

I would be grateful if someone could try the same piece of code and tell me the results. Thank you very much.

One Answer

It's related to how you set the path for the bib file. You normally don't want to add a / at the beginning of your path. In my main.tex, I put minbib.bib inside the folder mybibfolder :

% !TEX program = xelatex
% !BIB program = biber

documentclass[a4paper,11pt]{article}
usepackage{biblatex}
bibliography{mybibfolder/minbib.bib} 

begin{document}
I hate LaTeXcite{Dough}
printbibliography
end{document}

For completeness, the parent folder of mybibfolder is the same as main.tex.

The result is as expected with your example : Compiled PDF

Answered by D. LaRocque on March 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP