2

This question already has an answer here:

I have a problem in citing references with \cite, I have only the year as a link. I want to display the author and year as a single link. I don't know where the problem is?!

  \documentclass{article}
   \usepackage{filecontents}%
   %\usepackage[style=authoryear,natbib]{biblatex}
   \usepackage[style=apa,backref=true,backend=biber,natbib=true,hyperref=true]    {biblatex} 
  \usepackage[american]{babel}
  \DeclareLanguageMapping{american}{american-apa}

  \begin{filecontents*}{apabibli1.bib}
  @article{Sampson1989,
  author = {Sampson, R J and Groves, W B},
  year = {1989},
  title = {Community structure and crime: testing social-disorganization theory},
  volume = {94},
  number = {4},
  journal = {Am J Soc},
  pages = {774}
  }
 @book{Rijsbergen1979,
 author = {Rijsbergen, C V},
 year = {1979},
 title = {Information retrieval},
 address = {London},
 publisher = {Butter Worths}
 }
\end{filecontents*}
\addbibresource{apabibli1.bib}
  \renewcommand*{\labelnamepunct}{\addspace}
  \usepackage{xpatch}
  \xpatchbibmacro{author}
 {%
 \newunit\newblock
  }
  {%
  \setunit{\addspace}\newblock
   }{}{}
   \xpatchbibmacro{name:apa:last-first}
   {%
   \addcomma\addlowpenspace\mkbibnamefirst{#3}\isdot
   }
 {%
 \addlowpenspace\mkbibnamefirst{#3}\isdot
 }{}{}
 \renewbibmacro*{journal+issuetitle}{%
 \usebibmacro{journal}%
 \setunit*{\addspace\thinspace}%
 \iffieldundef{series}
 {}
 {\newunit
 \printfield{series}
  \setunit{\addspace}}%
   \printfield{volume}%
  \printfield{number}%
  \setunit{\addspace}\newblock
   \usebibmacro{issuename}%
   \newunit}
   \AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
   \ifthenelse{\value{listcount}>\maxprtauth}
   {}
   {\ifthenelse{\value{liststop}>2}
   {\addcomma\space}%
   {\addcomma\space}}}}
   \renewcommand\bibinitperiod{}
   \renewcommand\bibinitdelim{}
    \renewcommand\bibpagespunct{\addcolon\space}
    \DeclareFieldFormat{journaltitle}{#1} 
    \DeclareFieldFormat[article]{volume}{\apanum{#1}}
    \DeclareFieldFormat{title}{\iffieldequalstr{titleisdescription}{true}
     {\mkbibbrackets{#1}}{#1\isdot}}

   \renewcommand*{\finentrypunct}{\relax}
  \setlength{\bibhang}{1.2em}
  \usepackage[colorlinks]{hyperref}
  \usepackage{hyperref}
  \hypersetup{
   colorlinks   = true,
   citecolor    = blue,
   linkcolor = blue,
   urlcolor=blue
   }
   \begin{document}
   \citealt{Sampson1989, Rijsbergen1979}\\
   \citet{Sampson1989, Rijsbergen1979}\\
   \citep{Sampson1989, Rijsbergen1979}\\
   \citeauthor{Sampson1989}
   \nocite{*}
   \printbibliography
   \end{document} 

marked as duplicate by moewe, Masroor, user31729, Svend Tveskæg, user13907 Feb 15 '15 at 10:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    I checked this has nothing to see with the patching of apa. You should remove the patching code in order to have a minimal example. – Bernard Nov 16 '14 at 17:55
  • Any help please ? I need the solution to submit my paper. – Sam Faith Nov 18 '14 at 12:56
  • latex-community.org/forum/… – Johannes_B Nov 22 '14 at 10:58

Browse other questions tagged or ask your own question.