[Tex/LaTex] How to get rid of “multiply defined” label warning

cross-referencingwarnings

I have used \label{rt} command 7 times in my manuscript for seven figures. It is showing a warning message of "LaTeX warning: Label '{rt}' multiply defined". How to remove the warning?

Best Answer

\labels are meant to provide identifiers, that can be then referred to via commands such as \ref. After compilation (usually twice), latex replaces the \ref by a printed representation of the value of the counter captured by \label. As \ref can be used anywhere within the document, each identifier should be unique. Latex thus warns if the same identifier is defined twice.

A good scheme for generating identifiers is to use some abbreviation for the type of thing being labelled followed some memorable word or two that will remind you of what you are labelling. E.g. as Harish Kumar suggests above you might use

 \label{fig:laser-schematic}

for a label on a figure providing a schematic representation of a laser. You would then refer to this via \ref{fig:laser-schematic}.

Sample output

\documentclass{article}

\begin{document}

\begin{figure}[htp]
  \centering
  \rule{2cm}{2cm}
  \caption{Schematic view of laser}
  \label{fig:laser-schematic}
\end{figure}

Some text.

In Figure~\ref{fig:laser-schematic} we see a schematic representation
of the laser.

Some text.
\end{document}