# Make \citet show hyperref only in for the year [duplicate]

How can I hyperref only the year part of a \citet entry?

I am using \citet and the result is the author and year appear with hyperref blue link. I only wan the year to show like that.

example of the code is:

\documentclass[onecolumn]{svjour3}       % onecolumn (second format)
\usepackage[authoryear]{natbib}
\setcitestyle{aysep={}}
\usepackage{url}
\def\urlprefix{}
\urlstyle{rm}
\usepackage{etoolbox}
\makeatletter

% Patch case where name and year are separated by aysep
\patchcmd{\NAT@citex}
{\@citea\NAT@hyper@{%
\NAT@nmfmt{\NAT@nm}%
\NAT@date}}
{\@citea\NAT@nmfmt{\NAT@nm}%
\NAT@aysep\NAT@spacechar\NAT@hyper@{\NAT@date}}{}{}

% Patch case where name and year are separated by opening bracket
\patchcmd{\NAT@citex}
{\@citea\NAT@hyper@{%
\NAT@nmfmt{\NAT@nm}%
{\@citeb\@extra@b@citeb}%
\NAT@date}}
{\@citea\NAT@nmfmt{\NAT@nm}%
\NAT@spacechar\NAT@@open\if#1\else#1\NAT@spacechar\fi\NAT@hyper@{\NAT@date}}
{}{}

\makeatother
\begin{document}

\title{title title title
}

... and marine environmental monitoring programs \citep{GuptaandSingh2011}. \citet{ElderCollins} pointed out the convenience of using introduced species as monitoring organisms because of their physiological tolerance range and their wide...

\renewcommand*{\bibfont}{\footnotesize}
\bibliographystyle{spbasic}
\bibliography{RefLimnoBECT}

\end{document}


also the bibtex is:

@incollection{ElderCollins,
title={Freshwater molluscs as indicators of bioavailability and toxicity of metals in surface-water systems},
author={Elder, John F and Collins, Jerilyn J},
booktitle={Reviews of Environmental Contamination and Toxicology},
editor={Ware, GW},
pages={37--79},
year={1991},
publisher={Springer},
}


Thank you so much in advance for the help!

• I've voted to close this question as a duplicate, as the patch code you posted appears to be a verbatim copy of the patch code contained in Audrey B.'s answer posted back in September 2011. If you believe that this is not the case, i.e., if you believe that your patch code differs materially from what Audrey wrote back in 2011, please point out how your code differs materially from that in the earlier query and associated answer. – Mico Feb 28 at 9:53

I just worked it out, there was a mistake in the patch code when separated by opening bracket. I decided to leave this question with my answer in case it helps someone else.

the correct patch would be:

% Patch case where name and year are separated by opening bracket
\patchcmd{\NAT@citex}
{\@citea\NAT@hyper@{%
\NAT@nmfmt{\NAT@nm}%

• The use of the if*#1*\  instead of \if#1 was already suggested back in 2011 in this answer by @Audrey. – Mico Feb 29 at 9:08