根据下面包含的 .bib 文件,我想在我的 LaTeX 脚本正文中添加类似“[..] Grubbs' (1969) 测试 [...]”的内容,即在作者姓名和出版年份之间插入撇号。到目前为止,我想出了以下(可重现的)示例:
\documentclass{article}
\usepackage[authoryear]{natbib}
\usepackage{filecontents}
%% .bib file contents
\begin{filecontents}{\jobname.bib}
@Article{Grubbs1969,
author = {Grubbs, F.},
title = {{Procedures for Detecting Outlying Observations in Samples}},
year = {1969},
volume = {11},
number = {1},
pages = {1--21},
doi = {10.1080/00401706.1969.10490657},
file = {:Grubbs - 1969.pdf:URL},
owner = {fdetsch},
timestamp = {2016-10-20}
}
\end{filecontents}
\begin{document}
%% body text
\citeauthor{Grubbs1969}' (\citeyear{Grubbs1969}) test
%% bibliography incl. style
\bibliography{\jobname.bib}
\bibliographystyle{plainnat}
\end{document}
首先,这会产生所需的结果:
但是,我想知道是否有更方便的方法来临时修改传递给 的作者年份分隔符\citet
。目前,涉及两个单独的超链接 - 一个与“Grubbs”相关联,另一个与“1969”相关联,而撇号和圆括号根本无法点击(这与所有其他通过 创建的即标准内联引用不同\citet
)。
答案1
如果您只需要一篇文章,您可以使用citealias
。这需要您定义文本,但整个引用将被超链接。
\documentclass{article}
\usepackage[authoryear]{natbib}
\usepackage{hyperref}
\usepackage{filecontents}
%% .bib file contents
\begin{filecontents}{\jobname.bib}
@Article{Grubbs1969,
author = {Grubbs, F.},
title = {{Procedures for Detecting Outlying Observations in Samples}},
year = {1969},
volume = {11},
number = {1},
pages = {1--21},
doi = {10.1080/00401706.1969.10490657},
file = {:Grubbs - 1969.pdf:URL},
owner = {fdetsch},
timestamp = {2016-10-20}
}
\end{filecontents}
\defcitealias{Grubbs1969}{Grubbs' (1969)}
\begin{document}
\citetalias{Grubbs1969}
%% body text
\citetext{\citeauthor{Grubbs1969}' (\citeyear{Grubbs1969})} test
%% bibliography incl. style
\bibliography{\jobname.bib}
\bibliographystyle{plainnat}
\end{document}