# Change/clean biber citestyle and extend hyperref box

I have encountered two issues which might be related:

first of all I'm wondering if it is possible to have a better/clean solution to changing the intext cite style of biber. My required format is: (LAST_NAME YEAR) or (LAST_NAME YEAR: PAGENUMBER). I have achieved that by the following commands (using \parencite):

\DeclareFieldFormat{postnote}{#1} %remove p
\DeclareFieldFormat{multipostnote}{#1} %remove pp
\renewcommand*{\nameyeardelim}{\addspace} %just space between name and year


Is there a cleaner/better way to change the cite style in biber (probably my solution is bound to produce problems?)? In natbib there was \setcitestyle{notesep={: }} and \setcitestyle{aysep={}} but I need it in biber.

Secondly I would like to change the hyperref box to the WHOLE Cite, but currently it only extend to the year:

Is it possible (although probably not useful for multi-author-quotes) to extend the hyperref box to everything within the parenthesis?

Here the MWE:

\documentclass{scrartcl}
\usepackage[style=authoryear]{biblatex}
\usepackage{hyperref}

\DeclareFieldFormat{postnote}{#1} %remove p
\DeclareFieldFormat{multipostnote}{#1} %remove pp
\renewcommand*{\nameyeardelim}{\addspace} %just space between name and year

\begin{document}

\parencite[1--2]{aristotle:poetics}

\parencite{aristotle:poetics}

\newpage

\printbibliography

\end{document}


Cheers!

As you have there two questions, I'll give you different sorts of advice regarding each of them.

As to the first, the redefinition of delimiters. biblatex has two "types" of delimiters, some are context sensitive, others are not. nameyeardelim is one of those context sensitive ones. In biblatex.def you'll find its definitions as:

\DeclareDelimFormat{nameyeardelim}{\addspace}


You notice the definition is done for each of different types of context. Of course, the definition in this case, is the same. But the possibility of defining it separately is built-in. So, if you do:

\renewcommand*{\nameyeardelim}{\addspace}


It will work, but this context sensitivity characteristic of the delimiter is gone, and you probably are getting more than what you asked for. So, you should use instead the proper interface for context sensitive delimiters of biblatex. For example, if you want the change to apply to parencites:

\DeclareDelimFormat[parencite]{nameyeardelim}{\addspace}


supplying the contexts as the case may be.

\postnotedelim, on the contrary, is a "plain" delimiter, defined in biblatex.def as:

\newcommand*{\postnotedelim}{\addcomma\space}


So, here, clearly there is no harm in redefining it with \renewcommand*. It is actually the natural way to do it.

As to postnote and multipostnote, you are there in the right direction, \DeclareFieldFormat is the right tool for the job. But some improvement can be made. The original definition of those are (in a recent version of biblatex):

\DeclareFieldFormat{postnote}{\mkpageprefix[pagination][\mknormrange]{#1}}
\DeclareFieldFormat{multipostnote}{\mkpageprefix[pagination][\mknormrange]{#1}}


\mkpageprefix, as the name suggests, is indeed responsible for adding "p."/"pp." or similar, as the case may be. So, removing it is what you want. But the above field formatting directives are also doing a second job, with \mknormrange, which parses the postnote argument for page ranges and normalises them. So, you would get better results with:

\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}


Regarding your second question, of hyperlinking the whole citation, and not just the year, there are plenty of questions and corresponding solutions here on the site. See, for example:

hyperlink name with biblatex authoryear (biblatex 1.4b)