[Tex/LaTex] What does ‘Label multiply defined’ mean

compilingwarnings

I'm trying to compile this book https://forja.rediris.es/projects/guia-wxmaxima/ I'm using MiKTeX, TeXstudio, and in the build options I have the default compiler pdfLaTeX.
So my question is, why there are a lot of errors that say Label '...' multiply defined?

Best Answer

Because the author hasn't been paying attention to the labels he has used, or to the compile warnings.

The warning means that the same label has been used several times in the same document. For example, he has \label{chap:aritmetica} in three separate chapters, algebra.tex, aritmetica.tex and calculo.tex. This can potentially lead to wrong cross references.

There are two things to do to fix the problem:

  1. Find out which labels are used several times (read the log), and modify all but one of them, so all labels are unique.

  2. Find where those labels are used, and make sure the cross references point to the correct chapter (or whatever it is). To avoid reading the whole thing, use the fact that TeXstudio lets you search in all open documents. Open all the chapter-files in TeXstudio at the same time, go to Edit --> Searching --> Find dialog, and choose Open documents instead of Current document. Then search for the label in questions, for example chap:aritmetica, and see where it has been used in a \ref (or similar command).

(I got a lot of other errors, and the document wouldn't compile at all, but you asked only about the labels.)

Related Question