14

I use biblatex-apa citation style. I also use hyperref with colour links, rather than ugly coloured boxes. When I use \textcite the author name and year are both part of the link, but the right parenthesis is not. Like this: Jones (2000). Is there a way to fix this? I want either both or neither parenthesis linked...

One way round this is to use citestyle=authoryear as an option. This means that only the year is linked, so it's not a perfect solution. Is there a better way to solve this problem?

2
  • 2
    I've uploaded version 2.3 to CTAN which should fix this.
    – PLK
    Nov 4, 2010 at 21:10
  • @PLK I have had a ridiculous week. I'll check this out this weekend. All maintainers of CTAN packages should know about this site...
    – Seamus
    Nov 5, 2010 at 0:32

2 Answers 2

16
+100

Greetings, I'm the author of biblatex-apa. I know what the problem is with this and I should have a fix and new release of biblatex-apa tomorrow on CTAN.

6
  • 4
    I suspect this has to be the 'correct' answer :-)
    – Joseph Wright
    Nov 1, 2010 at 19:55
  • 2
    At least, I pointed Seamus to the "correct" answer. ;-)
    – lockstep
    Nov 1, 2010 at 20:07
  • meta.tex.stackexchange.com/q/615/215
    – Seamus
    Nov 2, 2010 at 11:34
  • Well, it is now solved but is this the right behaviour of two in-text citings of one author? “The following description is mainly based on OECD (1997b), (2005) …” It was “OECD (1997b, 2005)” before the update with above-mentioned bugfix.
    – josefec
    Nov 6, 2010 at 8:29
  • According to Wikipedia (goo.gl/PvdLK), the behaviour before bugfix is right.
    – josefec
    Nov 6, 2010 at 8:38
12

A minimal example would have been appreciated. ;-) (I'm working with the standard biblatex styles and didn't know about biblatex-apa's \DeclareLanguageMapping.)

I regard the following solution as rather "hackish" because a) I don't know the functioning of this particular \textcite command b) other commands besides \textcite might be in need of change as well c) the additional \printtext[bibhyperref] wrappers seem to point at the right entry in the bibliography, but that was only luck on my part. In the long run, you should send a feature request to Philip Kime, the author of biblatex-apa.

\documentclass{article}

\usepackage[american]{babel}
\usepackage[style=apa]{biblatex}
\usepackage{csquotes}
\DeclareLanguageMapping{american}{american-apa}
\usepackage[colorlinks=true]{hyperref}

\DeclareCiteCommand{\textcite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{textcite}}}%
  {}
  {\iffieldundef{postnote}
     {\ifbool{cbx:parens}
%        {\bibrightparen}% DELETED
        {\printtext[bibhyperref]{\bibrightparen}}% NEW
  {}}
%     {\ifbool{cbx:parens}% DELETED (FOR POSTNOTE)
     {\printtext[bibhyperref]{\ifbool{cbx:parens}% NEW (FOR POSTNOTE)
        {\postnotedelim}
  {\addspace\bibleftparen}%
%      \printfield{postnote}\bibrightparen}}% DELETED (FOR POSTNOTE)
      \printfield{postnote}\bibrightparen}}}% NEW (FOR POSTNOTE)

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{a01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}

@misc{b02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\bibliography{\jobname}

\begin{document}

Some Text \textcite{a01}. Some more text \textcite[A postnote]{b02}.

\printbibliography

\end{document}
2
  • Sorry about that. I got caught out by the \DeclareLanguageMapping thing too, should have thought to mention it...
    – Seamus
    Nov 1, 2010 at 15:41
  • After more than 6 years, is there a more compact way to make the entire citation (author and year) clickable?
    – Diaa
    Feb 5, 2017 at 3:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .