LaTeX warning "Label `sec:intro' multiply defined": cause and fix

Warning Label `sec:intro' multiply defined

Two \label commands use the same name. A \ref to that name gets the number of the last one in the document, so some references point to the wrong place. The warning appears from the second run on, when LaTeX reads the labels from the .aux file.

Why it happens

How to fix it

A document that produces the message

\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
Text.
\section{Method}\label{sec:intro}
See Section~\ref{sec:intro}.
\end{document}

Open in the editor

Tools run in this order: pdflatex → pdflatex.

The corrected document

\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
Text.
\section{Method}\label{sec:method}
See Section~\ref{sec:intro}.
\end{document}

Open in the editor

Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.

Finding the line in the editor

The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.

Related pages