15

How do I find unresolved references? Does LaTeX tell me this somewhere? Is it in a log file? The LaTeX output just says I have unresolved references, but it doesn't tell me what they are, or does it? thanks

Geremia
  • 2,201
  • 1
    Have you seen my answer to this question http://tex.stackexchange.com/questions/128405/references-used-in-article/132150#132150 ? – Mensch Oct 08 '13 at 14:39

1 Answers1

16

Yes. If you compile the following document that contains an unlabelled reference:

\documentclass{article}
\begin{document}
\ref{abc}
\end{document}

your .log will contain (amongst other things):

LaTeX Warning: Reference `abc' on page 1 undefined on input line 3.

It will also end (almost as a summary) with:

LaTeX Warning: There were undefined references.

notifying you that something is amiss. You also know where these are by searching for ?? in your document - the default definition given to undefined (or unresolved) references - as can be seen by the definition of \ref (from latex.ltx):

\def\@setref#1#2#3{%
  \ifx#1\relax
   \protect\G@refundefinedtrue
   \nfss@text{\reset@font\bfseries ??}%
   \@latex@warning{Reference `#3' on page \thepage \space
             undefined}%
  \else
   \expandafter#2#1\null
  \fi}
\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}}
\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname
                                   \@secondoftwo{#1}}

Of course, you need to compile at least twice to make there actually is undefined references.

Werner
  • 603,163
  • 1
    note that you need to search for ?? in the output of your document -- the log tells you what page(s) to look on. searching in the input would be fruitless (and frustrating). – barbara beeton Oct 08 '13 at 13:09