我将 natbib 与 apalike 一起使用,发现没有日期的引用显示(在文中):Ulzheimer(nd)解释了为什么一个人的信用评分在三个信用局之间有所不同。
但在参考文献列表中,它显示:Ulzheimer,J.(nd)。为什么我的信用评分在不同的信用机构之间有所不同?Experian,https://tinyurl.com/h2p9u6ss. 访问日期: 2021-3-8.
有什么办法可以让它在文本中也显示为 Ulzheimer (nd) 吗?
代码如下:
@misc{experiancs,
Author={Ulzheimer, John},
title = {Why do my credit scores differ across the credit bureaus?},
howpublished = {Experian, https://tinyurl.com/h2p9u6ss},
publisher={Experian},
year={{n.d.}},
note = {Accessed: 2021-3-8}
}
我尝试将年份留空,但由于某种原因,作者年份引用变成了编号引用。
答案1
该apalike.bst
文件会从引文标签中删除非字母数字字符。如果您希望n.d.
在引文标注中包含这些字符,则需要复制apalike.bst
并按以下方式进行修改:
您应该在第 896 行找到以下函数{calc.label}
:
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 four digits
*
'label :=
}
在第 909 行,删除purify$
负责删除非字母数字字符的命令。您的新函数应如下所示:
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 #-1 #4 substring$ % uses all four digits
*
'label :=
}
用新名称保存此副本,例如。现在您的引文标注将完全按照文件字段中apalike-impure.bst
显示的方式显示。year
.bib
\documentclass{article}
\begin{filecontents}[overwrite]{\jobname.bib}
@misc{experiancs,
Author={Ulzheimer, John},
title = {Why do my credit scores differ across the credit bureaus?},
howpublished = {Experian, https://tinyurl.com/h2p9u6ss},
publisher={Experian},
year={n.d.},
note = {Accessed: 2021-3-8}
}
\end{filecontents}
\usepackage{natbib}
\bibliographystyle{apalike-impure}
\begin{document}
\citet{experiancs}
\bibliography{\jobname}
\end{document}