Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using natbib and unsrtnat style for numerical citation with hyperref package.

\documentclass{article}  
\usepackage[square, super, sort]{natbib} 
 \usepackage[dvips,
             bookmarks,
             bookmarksopen = true,
             bookmarksnumbered = true,
             breaklinks = true,
             linktocpage,
             pagebackref,
             colorlinks = true,
             linkcolor = blue,
             urlcolor  = blue,
             citecolor = red,
             anchorcolor = green,
             hyperindex = true,
             hyperfigures]{hyperref}

 \begin{document}
 \bibliographystyle{unsrtnat}
  some text...\citet{ref1}
   other text
   \end{document}

  % some bibliography file
  % test.bib
  @Article {ref1, author = Author1, title = Title1, year = 2010}

\citet{ref1} results in Author1 et al. [1] where only [1] is hyperlinked to the reference. I would like that name part of citation (Author1 et al.) is also hyperlinked. How to make that work?

share|improve this question
add comment

1 Answer

Under numeric citation labels natbib sets names with the \NAT@test command, defined in natbib.sty. Using etoolbox you can patch \NAT@test to mark the name list with an additional hyperlink.

\documentclass{article}
\usepackage[square,super,sort]{natbib}
\usepackage[colorlinks]{hyperref}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\NAT@test}{\else \NAT@nm}{\else \NAT@hyper@{\NAT@nm}}{}{}
\makeatother

\begin{filecontents}{\jobname.bib}
@Book{companion,
  author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
  title = {The LaTeX Companion},
  edition = {1},
  publisher = {Addison-Wesley},
  location = {Reading, Mass.},
  year = {1994}}
@Book{adams,
  title = {The Restaurant at the End of the Universe},
  author = {Douglas Adams},
  series = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year = {1980}}
\end{filecontents}

\begin{document}
\citet{adams}, \citet{companion}, \citet{adams,companion}
\bibliographystyle{unsrtnat}
\bibliography{\jobname}
\end{document}

enter image description here

share|improve this answer
    
What bibliography-style is this ?(I use BiBTeX in scientific workplace) –  Nick Nov 19 '13 at 13:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.