无法从参考书目文件中读取引文

无法从参考书目文件中读取引文

我正在使用 latex 文件撰写报告。所述 latex 文件要求我将不同的章节和情节放在不同的文件夹中。当我尝试从此 latex 文件生成 pdf 输出时,我遇到错误,提示为Citation 'citation name' on page 1 undefined.。简而言之,latex 编译无法读取我的参考书目文件 ( references.bib) 的条目。

这是所述乳胶文件的骨架(test.tex

\include{macpap2}

\documentclass[12pt]{ociamthesis} 

\usepackage{amsfonts,amssymb}
\usepackage{amsmath,graphics}
\usepackage{import}
\usepackage[pdftex]{graphicx} 
\usepackage{booktabs} 

\usepackage{wrapfig} 
\usepackage{appendix} 
\usepackage[nottoc]{tocbibind} 
\usepackage[sort]{natbib} 
\usepackage[biblabels]{authorindex} 
\usepackage{minitoc} 
    \setcounter{minitocdepth}{3} 

\setlength{\headheight}{15pt}

\title{Title Name}
\author{Firstname Lastname}
\college{College Name}
\renewcommand{\submittedtext}{\textit{Write something.}}
\degree{Degree name}
\degreedate{December 2018} 
\renewcommand{\crest}{\beltcrest}

\begin{document}

\baselineskip=18pt plus1pt

\begin{frontpages} 
\setcounter{secnumdepth}{1}
\setcounter{tocdepth}{2}

\maketitle

\end{frontpages}
\begin{romanpages}
\tableofcontents
\end{romanpages}

\input{chapter/chapter1}

%% BIBLIOGRAPHY %%
%
%\citeindexfalse % to stop indexing citations
%uncommnent next line to change bibliography name to references
%\renewcommand{\bibname}{References}
%\begin{flushleft} % This is to left-justify the bibliography

\bibliography{references.bib} % Full path to bibtex bibliography file (e.g. "references.bib")
%   \adjustmtc %! To prevent tocbibind interfering with minitoc
%\bibliographystyle{agsm} % This one is modeled on the standard year/date referencing standard
%\end{flushleft}

\end{document}

本文件仅有一章(chapter1.tex)。这是 的骨架chapter1.tex

chapter{\label{ch:chapter1}Chapter1}

\section{Preliminaries}
I want to cite these: \citep[][]{Caldwell2002, Daly2003}

\begin{figure}
    \includegraphics[width=0.41\textwidth]{Plots/dino2.png}
    \includegraphics[width=0.41\textwidth]{Plots/dino2.png}    
    \caption{Two dinos.}
    \label{fig:Dinos}
\end{figure} 

我的书目文件(references.bib)如下所示。

@article{Caldwell2002,
title = "A phantom menace? Cosmological consequences of a 
dark energy component with super-negative equation of state",
journal = "Physics Letters B",
volume = "545",
number = "1",
pages = "23 - 29",
year = "2002",
issn = "0370-2693",
doi = "https://doi.org/10.1016/S0370-2693(02)02589-3",
url = "http://www.sciencedirect.com/science/article/pii/S0370269302025893",
author = "R.R Caldwell"
}


@article{Daly2003,
  author={Ruth A. Daly and S. G. Djorgovski},
  title={A Model-Independent Determination of the Expansion and Acceleration Rates of the Universe as a Function of Redshift and Constraints on Dark Energy},
  journal={The Astrophysical Journal},
  volume={597},
  number={1},
  pages={9},
  url={http://stacks.iop.org/0004-637X/597/i=1/a=9},
  year={2003},
  abstract={abstract.}
}

我正在使用Texmaker 4.5。此 latex 包使用的所有文件(、、、*.tex图形等)都可以找到*.bib*.cls这里

我做错了什么?如何让这个 latex 包读取并执行我的参考书目文件的内容?

答案1

要使用源文件生成参考书目,bibtex应指定 (1) 至少一个bib文件,以及 (2) 要使用参考书目样式(例如\bibliographystyle{plainnat})。\bibliographystyle{...}缺少说明。

相关内容