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.
Help centre › LaTeX errors › References and bibliography · Warning: the document still compiles
What the log says
LaTeX Warning: Label `fig:setup' multiply defined.
...
LaTeX Warning: There were multiply-defined labels.Also printed as: LaTeX Warning: There were multiply-defined labels.
What it means
The same label name was defined twice. LaTeX keeps the last definition, so references meant for the first one silently print the wrong number. The warning appears from the second run on, when the .aux file holds both definitions.
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. A figure, table or section was copied and its label not changed
Search the source for the label named in the warning. Give each copy its own name and check which \ref commands should point to which.
\documentclass{article}
\begin{document}
\section{Setup}\label{sec:setup}
\section{Calibration}\label{sec:setup}
Section~\ref{sec:setup} describes the calibration.
\end{document}\documentclass{article}
\begin{document}
\section{Setup}\label{sec:setup}
\section{Calibration}\label{sec:calibration}
Section~\ref{sec:calibration} describes the calibration.
\end{document}2. The same file is \input twice
A file that holds a figure or table with a label can be included only once. Remove the second \input, or refer to the first one instead of repeating the material.
\begin{filecontents*}[overwrite]{fig-setup.tex}
\begin{figure}[h]
\centering\rule{4cm}{2cm}
\caption{The experimental setup}\label{fig:setup}
\end{figure}
\end{filecontents*}
\documentclass{article}
\begin{document}
\input{fig-setup}
Figure~\ref{fig:setup} shows the setup.
\input{fig-setup}
\end{document}\begin{filecontents*}[overwrite]{fig-setup.tex}
\begin{figure}[h]
\centering\rule{4cm}{2cm}
\caption{The experimental setup}\label{fig:setup}
\end{figure}
\end{filecontents*}
\documentclass{article}
\begin{document}
\input{fig-setup}
Figure~\ref{fig:setup} shows the setup.
\end{document}3. A command or environment you defined contains a fixed \label
A \label written inside \newcommand is defined again every time the command is used. Pass the label name as an argument instead, for example \newcommand\result[2]{… \label{#1} …}.
In Manulyx
The editor lists the warning with the compile's other warnings; search the project for the label it names to find both definitions.
Write in Manulyx for free · Journal templates
More in references and bibliography
- LaTeX Warning: Citation `<key>' on page <n> undefinedA \cite key has no entry in the built bibliography: a key typo, a missing \bibliography line, a broken .bib entry, or BibTeX has not run yet.
- 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.
- 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.
- Repeated entry---line <n> of file <name>.bibTwo .bib entries share one citation key. BibTeX keeps the first and skips the other. Delete the duplicate or give it its own key.
- I was expecting a `,' or a `}'---line <n> of file <name>.bibA .bib entry is malformed, most often a missing comma between fields or a space in the key. BibTeX skips the rest of the entry.
Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors