# biblatex : authoryear style and \cite redefined = error with multiple citations

With the help of a great answer to http://tex.stackexchange.com/a/50706/13904 I was able to redefine the \cite command as:

\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
%     \usebibmacro{cite:labelyear+extrayear}}% DELETED
{\usebibmacro{cite:shorthand}}}


But a problem appears when one has multiple citations of a same author.

\cite{Hembree88,Hembree90}


gives

HEMBREE 1988HEMBREE 1990

HEMBREE [1988; 1990]

Any idea how to solve this?

Here is a working example:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[style=authoryear-icomp]{biblatex}
\makeatletter
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\printnames{labelname}%
\setunit{\nameyeardelim}}%
{\usebibmacro{cite:shorthand}}}
\makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{A02,
author = {Author, A.},
year = {2002},
title = {Alpha},
}
\end{filecontents}
\begin{document}
\cite{A01,A02}
\printbibliography
\end{document}

-
You're using the authoryear-icomp citation style, but the code snipppet from the linked answer is suited for the authoryear style. But more important, you didn't describe in detail the results you want to achieve. Do you just want to replace parentheses with brackets, or is it something more complex? – lockstep Apr 30 '12 at 22:33

Based on your given information you should use the command \textcite instead of \cite. This command does your request with the parentheses () So you can change this inside the declaration of \textcite. The separation of the years is set by the command \compcitedelim.

\documentclass{article}
\usepackage[english]{babel}
\usepackage[style=authoryear-icomp]{biblatex}
\DeclareCiteCommand{\textcite}
{\usebibmacro{cite:init}}
{%
\let\bibopenparen\bibopenbracket%
\let\bibcloseparen\bibclosebracket%
\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\usebibmacro{textcite:postnote}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{A02,
author = {Author, A.},
year = {2002},
title = {Alpha},
}

@misc{A03,
author = {Author, A.},
year = {2003},
title = {Alpha},
}
\end{filecontents}