Latexmk: Citation 'XXX' on page YY undefined [closed]

When I compile my document using `latexmk.pl` I get warning for every citation:

``````Latexmk: Citation 'XXX' on page YY undefined
``````

The citation appears in the References at the end of the document, but at the place of \cite only the (?) is shown.

The document is divided into many files in different directories, but same happens in master tex file, the bib file is in root folder along with master tex file.

-

closed as too localized by Joseph Wright♦Sep 6 '11 at 7:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Usually, these errors occur because the LaTeX compiler needs to run over the document more than once to get everything right, since it uses auxiliary files for keeping track of equations, citations etc.

If you're using BiBTeX, the recommended compile procedure is

1. `pdflatex yourdocument.tex`
2. `bibtex yourdocument.aux` (note the file ending)
3. `pdflatex yourdocument.tex`
4. `pdflatex yourdocument.tex`

but if you're not changing the order or location (within sections) of references, only a single run of `pdflatex yourdocument.tex` is usually necessary.

The reason for this is simply that `pdflatex` reads information from its auxiliary files on-the-fly, and at the same time updates them. Without running through this entire compile procedure, you can't be sure that all files are updated all the way until before the fourth step.

-
As I use `latexmk` this is done automatically I suppose. – liborw Apr 27 '11 at 6:53

Fixed: The problem were probably related to the `harvard` package, everything is fine after I comment the `\usepackage[abbr,dcucite]{harvard}`

-
Feel free to accept this answer as it solved your problem! – doncherry Sep 5 '11 at 21:50