我一直在尝试获取 Harsanyi (1967-68),但我得到的是 Harsanyi (7 68),这是参考书目中除“-”之外的年份项目的最后 4 位数字。这是我的 MWP 和 bibitem,提前感谢任何帮助。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{harsanyi67,
title = {Games with Incomplete Information Played by Bayesian Players,{Parts I,II,III}},
author = {John C. Harsanyi},
year = {1967-68},
journal = {Management Science},
volume = {14},
pages = {159--182, 320--334, 486--502},
}
\end{filecontents}
\usepackage{natbib}
\begin{document}
\cite{harsanyi67}
\bibliographystyle{apalike}
\bibliography{\jobname}
\end{document}
答案1
可以修改apalike.bst
参考书目样式,使其对年份标签不那么挑剔。复制该.bst
文件并为其指定另一个名称。这里我使用了apalike-hyphen-year.bst
。在.bst
文件中,您将找到以下函数:
FUNCTION {calc.label}
{ type$ "book" =
type$ "inbook" =
or
'author.editor.key.label
{ type$ "proceedings" =
'editor.key.label % apalike ignores organization
'author.key.label % for labeling and sorting
if$
}
if$
", " % these three lines are
* % for apalike, which
year field.or.null purify #-1 #4 substring$ % uses all 4 digits
*
'label :=
}
更换线路
year field.or.null purify #-1 #4 substring$ % uses all 4 digits
内容如下:
year field.or.null #-1 #8 substring$ % modified to allow arbitrary years up to 8 chars
保存文件。这将使你的奇数年参考能够发挥作用。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{harsanyi67,
title = {Games with Incomplete Information Played by Bayesian Players,{Parts I,II,III}},
author = {John C. Harsanyi},
year = {1967-68},
journal = {Management Science},
volume = {14},
pages = {159--182, 320--334, 486--502},
}
\end{filecontents}
\usepackage{natbib}
\begin{document}
\citep{harsanyi67}
\citet{harsanyi67}
\bibliographystyle{apalike-hyphen-year}
\bibliography{\jobname}
\end{document}
答案2
根据设计,只有使用 apalike 样式时,您才会获得作者姓名和四位数年份。因此,您必须使用年份 = 四位数,而不是 1967-68。如果使用两年,您将仅获得作者姓名和 7 68。