Repeated entry---line <n> of file <name>.bib
Two .bib entries share one citation key. BibTeX keeps the first and skips the other. Delete the duplicate or give it its own key.
Help centre › LaTeX errors › References and bibliography · Error: the build stops or the output is wrong
What the log says
Database file #1: refs.bib
Repeated entry---line 9 of file refs.bib
: @article{smith2020
: ,
I'm skipping whatever remains of this entry
(There was 1 error message)What it means
Every entry in the .bib files must have a unique key. BibTeX found a second entry with a key it had already read; it keeps the first one and ignores the rest of the second. Citations then point at the first entry, which may not be the paper you meant.
Causes and fixes
Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.
1. The same paper was added to the .bib file twice
Go to the line the message names and delete the duplicate entry, keeping the more complete one.
\begin{filecontents*}[overwrite]{refs.bib}
@article{smith2020,
author = {Smith, Jane},
title = {Measuring Things Carefully},
journal = {Journal of Measurement},
year = {2020}
}
@article{smith2020,
author = {Smith, Jane},
title = {Measuring Things Carefully},
journal = {Journal of Measurement},
year = {2020},
doi = {10.1000/xyz123}
}
\end{filecontents*}
\documentclass{article}
\begin{document}
As shown by \cite{smith2020}, the effect is small.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}\begin{filecontents*}[overwrite]{refs.bib}
@article{smith2020,
author = {Smith, Jane},
title = {Measuring Things Carefully},
journal = {Journal of Measurement},
year = {2020},
doi = {10.1000/xyz123}
}
\end{filecontents*}
\documentclass{article}
\begin{document}
As shown by \cite{smith2020}, the effect is small.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}2. Two different papers were given the same key
Keys built from surname and year collide easily (two Smith papers from 2020). Rename one, for example smith2020a and smith2020b, and update the \cite commands that mean the second paper.
\begin{filecontents*}[overwrite]{refs.bib}
@article{smith2020,
author = {Smith, Jane},
title = {Measuring Things Carefully},
journal = {Journal of Measurement},
year = {2020}
}
@article{smith2020,
author = {Smith, John},
title = {Counting Things Quickly},
journal = {Journal of Counting},
year = {2020}
}
\end{filecontents*}
\documentclass{article}
\begin{document}
Compare \cite{smith2020} with \cite{smith2020}.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}\begin{filecontents*}[overwrite]{refs.bib}
@article{smith2020a,
author = {Smith, Jane},
title = {Measuring Things Carefully},
journal = {Journal of Measurement},
year = {2020}
}
@article{smith2020b,
author = {Smith, John},
title = {Counting Things Quickly},
journal = {Journal of Counting},
year = {2020}
}
\end{filecontents*}
\documentclass{article}
\begin{document}
Compare \cite{smith2020a} with \cite{smith2020b}.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}3. The same entry is in two .bib files that are both listed
With \bibliography{refs,extra}, a key present in both files is a repeat. Remove it from one file, or stop listing the file you no longer use.
In Manulyx
Manulyx runs BibTeX when you compile and shows its messages in the problems list with the compile's own. A problem found in a file BibTeX wrote opens that file, with a note to fix the entry in your .bib.
Write in Manulyx for free · Journal templates
More in references and bibliography
- LaTeX Warning: Reference `<label>' on page <n> undefinedA \ref, \eqref or \pageref names a label LaTeX has not seen: a typo, a missing \label, or a part excluded by \includeonly. Prints ?? in the PDF.
- LaTeX Warning: There were undefined references.The end-of-run summary: some \ref or \cite did not resolve. Find the individual "Reference ... undefined" or "Citation ... undefined" lines above it.
- LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.Some label's number or page changed during this run, so references printed from the old .aux may be wrong. Compile again; if it never settles, look for a loop.
- LaTeX Warning: Label `<label>' multiply defined.Two \label commands use the same name, so every \ref to it shows whichever came last. Rename one, and update the \ref commands that meant it.
- I couldn't open database file <name>.bibBibTeX cannot find the .bib file named in \bibliography. Check the spelling and folder, and write the name without the .bib extension.
- I found no \bibdata commandBibTeX read the .aux file and found no \bibliography, no \cite or no \bibliographystyle. Add the missing command, or run biber for biblatex.
Every example on this page was compiled with pdfLaTeX and BibTeX to check that it fails and is fixed as described. All LaTeX errors