BibTex LaTex 引用错误

BibTex LaTex 引用错误

我是 LaTex 新手。我在 LaTex 中引用 Bibtex .bib 文件中的文献时遇到了困难。我使用 Texmaker 作为 LaTex 编辑器,使用 JabRef 作为参考书目管理器。在这里,我在 Texmaker 中创建了一个示例 LaTex 文件和一个 BibTex 文件:

\RequirePackage{filecontents}
\begin{filecontents}{myreferences.bib}
@misc{Linusson2013,
author  = "Henrik Linusson",
title   = "Multi-Output Random Forests",
howpublished = "University of Borås",
year    = "2013",
}
\end{filecontents}

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{natbib}
\usepackage{amssymb}
\usepackage{graphicx}
\author{Tanmoy}
\title{XYZ}
\begin{document}
\maketitle
\section{Introduction}
dajhgdahbsdkfjhsdhsdjknsdnsdjkl 
\subsection{A}
ahbshbcsdgcjbhcjh ~\cite{Linusson2013}
\bibliographystyle{unsrtnat}
\bibliography{myreferences}
\end{document}

我在 Texmaker 配置中的 Quick Build 中启用了“Pdflatex + Biblatex + Pdflatex(x2) + view PDF”。但是,每次编译 PdfLaTex 后,我都会收到“警告”-“第 1 页上的引用‘Linusson2013’未定义”。紧接着是第二个“警告”-“存在未定义的引用”。在从 JabRef 中生成的 .bib 文件导入参考文献时,除了上述错误外,状态栏还显示“没有文件 abc.bbl”。PS:我也尝试过“\citep{}”,但出现同样的错误。PPS:我也尝试过通过终端启用“Pdflatex + Biblatex + Pdflatex(x2) + view PDF”,但出现错误-“我无法打开文件名 abc.bib.aux”。

答案1

如果我创建两个单独的文件,它对我来说是有效的:

来自以下来源的 {documentname}.tex 文件:

\documentclass[11pt,a4paper]{article} ... \end{document}

myreferences.bib 文件仅包含以下内容:

@misc{Linusson2013,
author  = "Henrik Linusson",
title   = "Multi-Output Random Forests",
howpublished = "University of Borås",
year    = "2013",
}

按照 Mico 建议运行:Pdflatex + BibTex + Pdflatex + Pdflatex + 内部 Pdf 查看器

如果您有大量参考文献,在两个不同的文档中使用 BibTex 会带来很多好处。如果您只有少量参考文献,请考虑在脚本中使用参考书目,如下所示:

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
%\usepackage{natbib} No need for this package
\usepackage{amssymb}
\usepackage{graphicx}
\author{Tanmoy}
\title{XYZ}

\begin{document}
\maketitle
\section{Introduction}
dajhgdahbsdkfjhsdhsdjknsdnsdjkl 
\subsection{A}
ahbshbcsdgcjbhcjh ~\cite{Linusson2013}

\begin{thebibliography}{9}
    \bibitem{Linusson2013} 
    Henrik Linusson. 
    \textit{Multi-Output Random Forests}. 
    University of Borås, 2013.
\end{thebibliography}

\end{document}

相关内容