软件包 natbib 警告:未定义引用警告

软件包 natbib 警告:未定义引用警告

经过几个小时的尝试,我终于决定寻求帮助。我查看了各种相关答案,但我是 Natbib 的新手,无法找出问题所在,希望您能帮忙。这是 tex 代码-

\documentclass{article}

\usepackage[preprint]{nips_2018}

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks
\usepackage{url}            % simple URL typesetting
\usepackage{booktabs}       % professional-quality tables
\usepackage{amsfonts}       % blackboard math symbols
\usepackage{nicefrac}       % compact symbols for 1/2, etc.
\usepackage{microtype}      % microtypography


\title{Whatever the title maybe}

\author{
  Writer Name\thanks{32nd Conference on Neural Information Processing Systems (NIPS 2018), Montréal, Canada. ---\emph{whatever it may be}.} \\
  Institution and University\\
  London,
  United Kingdom\\
  \texttt{bla-bla-bla} \\
}

\begin{document}


\maketitle

\begin{abstract}
  The abstract paragraph should be indented \nicefrac{1}{2}~inch
  (3~picas) on both the left- and right-hand margins. Use 10~point
  type, with a vertical spacing (leading) of 11~points.  The word
  \textbf{Abstract} must be centered, bold, and in point size 12. Two
  line spaces precede the abstract. The abstract must be limited to
  one paragraph.

\end{abstract}

\section{Heading 1}
   So, for example \citet{hasselmo} investigated that\dots

\section{Heading 2}

\section{Heading 3}

\section{Heading 4}

\subsubsection*{Acknowledgments}

Use unnumbered third level headings for the acknowledgments. All
acknowledgments go at the end of the paper. Do not include
acknowledgments in the anonymized submission, only in the final paper.of the margin problems come from figures positioned by hand using or other commands.   We suggest using the command from the
graphicx package.

Always specify the figure width as a multiple of the line width as in the example below

\section*{References}

References follow the acknowledgments. Use unnumbered first-level
heading for the references. Any choice of citation style is acceptable as long as you are consistent. It is permissible to reduce the font size to \verb+small+ (9 point) when listing the references. {\bf
  Remember that you can use more than eight pages as long as the
  additional pages contain \emph{only} cited references.}
\medskip

\small

[1] Alexander, J.A.\ \& Mozer, M.C.\ (1995) Template-based algorithms
for connectionist rule extraction. In G.\ Tesauro, D.S.\ Touretzky and
T.K.\ Leen (eds.), {\it Advances in Neural Information Processing
  Systems 7}, pp.\ 609--616. Cambridge, MA: MIT Press.

[2] Bower, J.M.\ \& Beeman, D.\ (1995) {\it The Book of GENESIS:
  Exploring Realistic Neural Models with the GEneral NEural SImulation
  System.}  New York: TELOS/Springer--Verlag.

[3] Hasselmo, M.E., Schnell, E.\ \& Barkai, E.\ (1995) Dynamics of
learning and recall at excitatory recurrent synapses and cholinergic
modulation in rat hippocampal region CA3. {\it Journal of
  Neuroscience} {\bf 15}(7):5249-5262.


\end{document}

我正在使用这个NIPS 2018 样式文件列在此处并且我有点困惑我是否需要以某种 author = {}、year = {} 等等格式提及作者,或者 natbib 是否已经能够让我理解这一点?

我确信这肯定是我的错误,因为在编译 natbib 时显示“未定义引用”并在输出 pdf 中输入“?”。

如果有帮助的话,我正在使用 TexMaker。

答案1

您应该阅读如何使用bibtexbiblatex使用 LaTeX 系统,这将为您提供很大的灵活性,可以对可以随时间增长的书目数据库进行排序、维护和使用。但是,如果您想在论文中手动输入书目,可以使用thebibliography环境(但我认为这样natbib做不会有任何用处……它会比您想象的更快变得难以管理)。但如果您想要它,这就是结构

\documentclass{article}

%\usepackage[preprint]{nips_2018}  % so I can compile without the nips format
\usepackage{natbib} % this is probably into you nips_2018 format file

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks
\usepackage{url}            % simple URL typesetting

\title{Whatever the title maybe}

\author{
  Writer Name\thanks{32nd Conference on Neural Information Processing Systems (NIPS 2018), Montréal, Canada. ---\emph{whatever it may be}.} \\
  Institution and University\\
  London,
  United Kingdom\\
  \texttt{bla-bla-bla} \\
}

\begin{document}
\maketitle

\section{Heading 1}
   So, for example \citet{hasselmo95} investigated that\dots

\begin{thebibliography}{99} 
  \bibitem[Alexander et al.(1995)]{Alexander95} Alexander, J.A.\ \& Mozer,  M.C.\ (1995) Template-based algorithms
   for connectionist rule extraction. In G.\ Tesauro, D.S.\ Touretzky and
   T.K.\ Leen (eds.), {\itshape Advances in Neural Information Processing
   Systems 7}, pp.\ 609--616. Cambridge, MA: MIT Press.
  \bibitem[Hasselmo et al.(1995)]{hasselmo95} Hasselmo, M.E., Schnell, E.\ \& Barkai, E.\ (1995) Dynamics of
    learning and recall at excitatory recurrent synapses and cholinergic
    modulation in rat hippocampal region CA3. {\itshape Journal of
    Neuroscience} {\bfseries 15}(7):5249-5262.
\end{thebibliography}
\end{document}

...请注意,natbib格式确实很挑剔bibitem...

在此处输入图片描述

答案2

我在 Neurips 格式中也遇到了同样的问题。我添加了 \bibliographystyle{plain},它成功了。因此,请确保也为 bib 使用样式。希望它能成功。

答案3

取消注释以下行:

\PassOptionsToPackage{numbers, compress}{natbib}

模板对我有用

相关内容