![每章参考书目:引文仅在正文中显示 [??],但每个参考书目中都会出现适当的参考资料](https://linux22.com/image/440011/%E6%AF%8F%E7%AB%A0%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%EF%BC%9A%E5%BC%95%E6%96%87%E4%BB%85%E5%9C%A8%E6%AD%A3%E6%96%87%E4%B8%AD%E6%98%BE%E7%A4%BA%20%5B%3F%3F%5D%EF%BC%8C%E4%BD%86%E6%AF%8F%E4%B8%AA%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E4%B8%AD%E9%83%BD%E4%BC%9A%E5%87%BA%E7%8E%B0%E9%80%82%E5%BD%93%E7%9A%84%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99.png)
我正在写一篇硕士论文,需要每章都列出参考文献。我使用单个 .bib 文件作为参考书目,使用 \include{chap1} 等将每章都包含在主 .tex 文件中,每个 chap.tex 文件都有 \bibliography{thesis.bib} 作为参考书目。
当我构建 PDF 时,每个参考书目都正确显示并包含每个章节中出现的正确参考文献,但文内引用仅显示为 [??],并且我收到错误:“第 2 页上的引用‘Diels2006’未定义”。
我正在使用 chapterbib 作为我的参考书目。
这是我的 MWE:
\documentclass[12pt]{report}
\usepackage{mathrsfs,amsmath} %need this for math modes
\usepackage{indentfirst}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{graphbox}
\usepackage[font=small]{caption}
\usepackage{float}
\usepackage
[
a4paper,% other options: a3paper, a5paper, etc
left=1.5in,
right=1in,
top=1in,
bottom=1in,
]
{geometry}
\usepackage{lipsum}
\usepackage{setspace}
\usepackage{braket}
\usepackage{siunitx}
\usepackage{hyperref,}
\usepackage{lscape}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage[justification=centering]{caption}
\usepackage{titlesec}
\usepackage[list=true,listformat=simple]{subcaption}
\usepackage{tocloft}
\usepackage[sectionbib]{chapterbib} % this is where I use chapterbib for my bibliography
\renewcommand{\cfttoctitlefont}{\hspace*{5.5cm}\bfseries}
\renewcommand\cftloftitlefont{\hspace*{5.5cm}\bfseries}
\setcounter{secnumdepth}{4}
\doublespace
\hypersetup{
colorlinks=true,
citecolor = blue,
urlcolor=blue,
}
\setlength\parindent{1cm}
\DeclareMathOperator{\sech}{sech}
\DeclareUnicodeCharacter{2009}{\,}
\DeclareUnicodeCharacter{03C3}{\\sigma}
\renewcommand{\vec}[1]{\mathbf{#1}}
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\bibname}{References}
\begin{document}
\pagenumbering{roman}
\include{frontmatter}
\newpage
{
\hypersetup{linkcolor=black}
\tableofcontents
}
\newpage
\hypersetup{linkcolor = black}
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\pagenumbering{arabic}
\include{chap1}
\include{chap2}
\include{chap3}
\include{chap4}
\include{chap5}
\newpage
\end{document}
以下是 chap.tex 文件的示例:
\chapter{The Experiment}
Example of body text.
Example of text needing citation \cite{Diels2006}.
\newpage
\bibliographystyle{ieeetr}
\bibliography{thesis.bib}