natbib 不显示年份

natbib 不显示年份

我使用natbibplainnat作为参考书目样式。

\documentclass[a4paper,12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[round]{natbib}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\begin{document}
\citet{DIJKSTRA1959}   
\bibliographystyle{plainnat}
\bibliography{mybib}
\end{document}

其中mybib.bib包含

@article{DIJKSTRA1959,
   author    = {Dijkstra, E. W.},
   title     = {A note on two problems in connection with graphs},
   journal   = {Numer. Math.},
   pages     = {269-271}
   year      = {1959},
   volume    = 1
}

我不知道为什么\citet{DIJKSTRA1959}不打印年份。结果是:

迪克斯特拉

EW Dijkstra。关于与图表相关的两个问题的注释。Numer.Math.,第 269 至 271 页。

文章标题中的“注意”一词有问题吗?

答案1

当你这样做

pdflatex file
bibtex file

你收到来自 BibTeX 的错误:

The style file: plainnat.bst
Database file #1: mybib.bib
I was expecting a `,' or a `}'---line 6 of file mybib.bib
 :    
 :    year      = {1959},
(Error may have been on previous line)
I'm skipping whatever remains of this entry
Warning--empty year in DIJKSTRA1959
Warning--empty year in DIJKSTRA1959

事实上.bbl文件显示

\bibitem[Dijkstra()]{DIJKSTRA1959}
E.~W. Dijkstra.
\newblock A note on two problems in connection with graphs.
\newblock \emph{Numer. Math.}, pages 269--271.

pages但仅仅是因为错误。如果你在字段末尾添加缺失的逗号

@article{DIJKSTRA1959,
   author    = {Dijkstra, E. W.},
   title     = {A note on two problems in connection with graphs},
   journal   = {Numer. Math.},
   pages     = {269-271},
   year      = {1959},
   volume    = 1
}

BibTeX 不会出现错误,.bbl文件将具有

\bibitem[Dijkstra(1959)]{DIJKSTRA1959}
E.~W. Dijkstra.
\newblock A note on two problems in connection with graphs.
\newblock \emph{Numer. Math.}, 1:\penalty0 269--271, 1959.

这样就natbib可以给出正确的引用结果,即

在此处输入图片描述

并供参考

在此处输入图片描述

道德

文件中的字段始终.bib以逗号结束。

相关内容