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.

Fails
\documentclass{article}
\begin{document}
\section{Setup}\label{sec:setup}
\section{Calibration}\label{sec:setup}
Section~\ref{sec:setup} describes the calibration.
\end{document}
Fixed
\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.

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

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