我在生成参考文献时遇到了麻烦。对于某些引文,文件会生成问号而不是作者姓名。我尝试了本论坛中的建议,并且已经知道了“编译 - 双重编译”过程,但没有进展。
有人能帮我吗?
这是我的代码的部分内容
\documentclass[a4paper]{article}
\usepackage[hmargin=2.5cm,vmargin=1cm]{geometry}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage[pdftex]{graphicx}
\usepackage{xcolor}
\usepackage{setspace}
\setstretch{2}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{textcomp}
\usepackage{float}
\usepackage[round]{natbib}
\usepackage[hidelinks,colorlinks,urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
\begin{document}
\section{Introduction}
For a survey see \citet{Perotti2008} who...
A leading example is \citet{Papageorgiou2012} who
\newpage
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}
书目文件包含以下条目
@TECHREPORT{ Perotti2008,
title = {In Search of the Transmission Mechanism of Fiscal Policy},
author = {Hill, Scott and Wootters, William K.}
booktitle = {NBER Macroeconomics Annual 2007",}
volume = {22},
publisher = {National Bureau of Economic Research}
year = {1997},
}
@ARTICLE{Papageorgiou2012,
author = {Papageorgiou Dimitris},
title = {Fiscal Policy Reforms in General Equilibrium: The case of Greece},
journal = {Journal of Macroecnomics},
year = {2012},
volume = {34},
pages = {504-522},
owner = {Minamar},
timestamp = {2012.08.03}
}
答案1
正如 Ulrike 在她的评论中所说,您的bib
文件中存在一些错误。
稍微解释一下:bib
文件的每个条目都必须像这样构建:
@literature{key,
name = {value(s)},
name1 = {value(s)},
...
namen = {value(s)}
}
literature
可以是book
,article
等等,key
是引用键,name
代表字段条目的名称,如author
,title
等等,并value(s)
表示字段条目的值、作者姓名、书名等。每行都必须以逗号结尾(} 之外),除了最后一行,您可以在那里写逗号或不写逗号。如果不写逗号,添加新行时通常会导致错误。
因此,您修正的文件部分bib
经过了一些漂亮的打印,看起来应该像您在更新的 MWE 中看到的那样。
更新:
以下 MWE 在我的系统上运行没有任何错误或警告:
\RequirePackage{filecontents} % allows overwriting of file
\begin{filecontents*}{\jobname.bib}
@TECHREPORT{Perotti2008,
title = {In Search of the Transmission Mechanism of Fiscal Policy},
author = {Hill, Scott and Wootters, {William K.}},
booktitle = {NBER Macroeconomics Annual 2007},
volume = {22},
publisher = {National Bureau of Economic Research},
institution = {National Bureau of Economic Research??????},
year = {1997},
}
@ARTICLE{Papageorgiou2012,
author = {Papageorgiou, Dimitris},
title = {Fiscal Policy Reforms in General Equilibrium: The case of Greece},
journal = {Journal of Macroecnomics},
year = {2012},
volume = {34},
pages = {504--522},
owner = {Minamar},
timestamp = {2012.08.03},
}
@ARTICLE{Edenber1999,
author = {Edenberg, Wendy and Martin Eichenbaum and DM Fischer},
title = {Understanding the Effects of Shocks to Government Purchases},
journal = {Review of Economic Dynamics},
year = {1999},
pages = {166--206},
owner = {Minamar},
timestamp = {2012.03.03}
}
@UNPUBLISHED{Leeper2008,
author = {Leeper, E. M. and Walker, {T. B.} and S.-C S.Yang},
title = {Fiscal foresight: Analytics and econometrics},
month = {May},
year = {2008},
owner = {Minamar},
timestamp = {2012.08.05}
}
\end{filecontents*}
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[round]{natbib}
\usepackage{hyperref}
\begin{document}
\section{Introduction}
For a survey see \citet{Perotti2008} who~\dots
A leading example is \citet{Papageorgiou2012} who~\dots
%\nocite{*} % all entrys in bibliography to test the bib file
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}
使用此示例测试您的bib
输入。只需复制一进入 MWE 并再次运行(记住:三次)。
更新 2:
我在 MWE 中添加了两条更正过的参考书目条目。文章条目的Edenber1999
作者字段有很多问题。我尝试更正它。请自行检查。条目Leeper2008
显示了另一个问题:将作者写成“姓名,名字”或“名字名称”。不要混淆。最好包括作者的完整名字。查看作者杨(空白缺失:S. Yang
?)。不要使用\&
而不是and
。