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.

Fails
\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}
Fixed
\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.

Fails
\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}
Fixed
\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

Every example on this page was compiled with pdfLaTeX and BibTeX to check that it fails and is fixed as described. All LaTeX errors