I am writing my thesis, and I use \include{} command so I could write each chapter separately and then combine them in the main document to have a more clear structure.
However, I find that the citations in the chapter texts show [?]. Below is a simple example.
Here is the main document
\input{setup/preamble.tex}% package inclusion and set up of the document
\input{setup/hyphenations.tex}%
\input{setup/macros.tex}% my new macros
\begin{document}
%frontmatter
\frontmatter
\pagestyle{empty} %disable headers and footers
\pagenumbering{roman} %use roman page numbering in the frontmatter
\input{frontmatter/frontpage}
\input{frontmatter/colophon}
\input{frontmatter/cv}
\input{frontmatter/abstract}
\cleardoublepage
\pdfbookmark[0]{Contents}{label:contents}
\pagestyle{fancy} %enable headers and footers again
\tableofcontents
\listoftodos
\input{frontmatter/preface}
\cleardoublepage
%mainmatter
\mainmatter
\include{chapters/chapter1}
\include{chapters/chapter2}
\par Text in the main document \cite{reference5, reference6}.
\bibliographystyle{IEEEtran.bst}
\bibliography{references/mybib.bib}
\end{document}
Here is the "mybib.bib".
@article{reference1,
title={Title of Reference1},
author={Author 1},
journal={Journal1},
volume={x},
pages={x},
year={x},
publisher={x}
}
@article{reference2,
title={Title of Reference2},
author={Author 2},
journal={Journal2},
volume={x},
pages={x},
year={x},
publisher={x}
}
@article{reference3,
title={Title of Reference3},
author={Author 3},
journal={Journal3},
volume={x},
pages={x},
year={x},
publisher={x}
}
@article{reference4,
title={Title of Reference4},
author={Author 4},
journal={Journal4},
volume={x},
pages={x},
year={x},
publisher={x}
}
@article{reference5,
title={Title of Reference5},
author={Author 5},
journal={Journal5},
volume={x},
pages={x},
year={x},
publisher={x}
}
@article{reference6,
title={Title of Reference6},
author={Author 6},
journal={Journal6},
volume={x},
pages={x},
year={x},
publisher={x}
}
It can be seen that I write chapter1 and chapter2 in other files, and combined them in the main document using \include{}.
The text for chapter1 is Text for Chapter 1 \cite{reference1, reference2}. and the text for chapter2 is Text for Chapter 2 \cite{reference3, reference4}.. For comparison, I also add a short text directly in the main document \par Text in the main document \cite{reference5, reference6}..
After compiling, the citations in chapter1 and chapter2 all show as "?"
and
And the TeXstudio says that the citations in the texts are undefined.

Only the citations in the text directly written in the main document show correctly.

However, all the referred documents appear correctly in the "References".

It seems that I have defined all the citations, but they could not be identified by the texts in \include{}?
Hence, could I consult how could I fix the citations in the chapters to make them show the correct number of referred documents?

