super
我想使用包中的选项显示超链接的作者年份引用,natbib
如下所示:
\citet
:Lancaster 等人(1999 年) (19)
\citep
:(Lancaster 等人,1999) (19)
对于\usepackage[round,super]{natbib}
,仅显示引用编号(例如:(19)
\citet
) 是超链接。无论我使用文本 ( ) 还是括号 ( \citep
) 引用, 我都希望在作者年份和编号上显示超链接。
以下是 MWE:
\documentclass[12pt,a4paper,english,french]{article} %% use 'article' so that output fits on one page
\usepackage{filecontents}
\begin{filecontents}{Bibliob.bib}
@article{Lancaster99,
title={A new approach to {MSEs} Management},
author={Lancaster, James R. and Drauster, Mikael F. and Logan, Richard},
journal={Journal of International Research on Management},
volume={74},
number={2},
pages={132-157},
year={1999},
publisher={JSTOR}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[round,super]{natbib}
\usepackage[colorlinks=true, linkcolor=blue, citecolor=blue]{hyperref}
\begin{document}
Textual citation:~\citep{Lancaster99}
Parenthesized citation:~\citet{Lancaster99}
\bibliographystyle{plainnat}
\bibliography{Biblio}
\end{document}
这样可以得到我想要的显示效果吗?
答案1
解决方案分为两部分。首先,为了使名称和年份信息成为超链接的一部分,我们添加了@Audrey 在其帖子的回答中提供的代码如何使用 natbib numeric 和 hyperref 超链接 \citet 中的名称部分其次,我们定义两个新的宏,分别称为(恐怕不是很有创意)\mycitet
和,它们模仿作者年份引用样式中的和\mycitep
的行为,但增加了上标的条目编号。\citet
\citep
\documentclass[12pt,a4paper,english,french]{article} %% use 'article' so that output fits on one page
\usepackage{filecontents}
\begin{filecontents}{Bibliob.bib}
@article{Lancaster99,
title={A new approach to {MSEs} Management},
author={Lancaster, James R. and Drauster, Mikael F. and Logan, Richard},
journal={Journal of International Research on Management},
volume={74},
number={2},
pages={132-157},
year={1999},
publisher={JSTOR}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[round,super]{natbib}
%% The following lines are straight from https://tex.stackexchange.com/a/76075/5001
\usepackage{etoolbox}
\makeatletter
\patchcmd{\NAT@test}{\else \NAT@nm}{\else \NAT@hyper@{\NAT@nm}}{}{}
\makeatother
\usepackage[colorlinks=true, citecolor=blue]{hyperref}
%% Provide custom macros to mimic the look created by \citet and \citep
\newcommand{\mycitet}[1]{\citeauthor{#1} (\citeyear{#1}) \citep{#1}}
\newcommand{\mycitep}[1]{(\citeauthor{#1}, \citeyear{#1}) \citep{#1}}
\begin{document}
\mycitet{Lancaster99}
\mycitep{Lancaster99}
\bibliographystyle{plainnat}
\bibliography{Biblio}
\end{document}