我正在写论文,我使用\include{}
命令,这样我就可以单独编写每个章节,然后将它们合并到主文档中以获得更清晰的结构。但是,我发现章节文本中的引用显示 [?]。下面是一个简单的示例。
这是主要文件
\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}
这是“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}
}
可以看出,我在其他文件中写了 chapter1 和 chapter2,并在主文档中使用 将它们合并\include{}
。
第一章的文本为Text for Chapter 1 \cite{reference1, reference2}.
,第二章的文本为Text for Chapter 2 \cite{reference3, reference4}.
。为了比较,我还直接在主文档中添加了一段简短的文本\par Text in the main document \cite{reference5, reference6}.
。
编译后,chapter1和chapter2中的引用都显示为“?”
和
似乎我已经定义了所有引用,但它们无法通过文本识别\include{}
?因此,我可以咨询如何修复章节中的引用以使其显示正确的参考文献数量吗?