# A question mark instead of reference number appears when \cite is in a separate file inlcuded in the main file by \include

I am using the book style and each chapter is put in a separate file and included in the main file by \include. At the end of the main file, I put the following lines:

\bibliographystyle{plain}
\bibliography{D:/paper/Bibtex/refguo}


But when I cite a reference in Chapter 1, for instance, which is in a separate file, a question mark [?] appears instead of the right reference number. But at the end of the PDF file produced, the references are correctly listed.

I don't know how to fix this.

-
Can you provide an MWE? It would make it easier for people to help you. –  Anke Mar 15 '13 at 8:50
–  Claudio Fiandrino Mar 15 '13 at 9:09
Are you using \includeonly? –  egreg Mar 15 '13 at 9:19
@Anke right community tools are at meta.tex.sx, use them prudently, a newbie may not follow MWE –  texenthusiast Mar 15 '13 at 9:21
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Anke Mar 15 '13 at 9:28
add comment

## 1 Answer

Probably you just need another LaTeX run.

1. LaTeX writes a citation into the .aux files. In case of included files via \include it is the .aux file for the included file. If a citation \cite{xyz} is added, then you should see \citation{xyz} in the right .aux file after the next LaTeX run.

2. Then bibtex should be run. It collects all \citation statements from the .aux files and writes the bibliography.

3. In the next LaTeX run after bibtex the bibliography is present with the new reference. But LaTeX does not know yet, which references the bibliography will contain. It records this in the .aux file with \bibcite{xyz}{1} (the second argument is the citation form). Thus you get still [?] for the new citation.

4. Another LaTeX run is needed, at the beginning it reads the .aux files with \bibcite and knows, how to cite xyz and you get [1] for \cite{xyz}, for example.

In summary, the following runs are needed after a citation is added:

• 1 × LaTeX
• 1 × BiBTeX
• 2 × LaTeX
-
add comment