I have a problem which is similar to this: Change citation delimiter between works of the same author (biblatex)
I want to change the delimiter between multiple citations by the same author depending on if there has been a postnote. If there is a post-note, citations should be separated with a semicolon, if there isn't one, with a comma. So what I have is:
Lennon 1971: 282; 1973; McCartney 1979; 1980
what I want is:
Lennon 1971: 282; 1973; McCartney 1979, 1980
MWE:
\documentclass{article}
\usepackage[style=authoryear, citestyle=authoryear-comp]{biblatex}
\DeclareFieldFormat{postnote}{#1}
\renewcommand{\postnotedelim}{\addcolon\addspace}
\renewcommand{\multicitedelim}{\addsemicolon\space}
\renewcommand{\compcitedelim}{\multicitedelim}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1971,
AUTHOR = "John Lennon",
TITLE = "My really long book on my life",
YEAR = "1971",
LOCATION = "Liverpool",
PUBLISHER = "Penny Lane Press"}
@BOOK{lennon1973,
AUTHOR = "John Lennon",
TITLE = "Music -- why I make it",
YEAR = "1973",
LOCATION = "London",
PUBLISHER = "Johnny Smith"}
@BOOK{mccartney1979,
AUTHOR = "Paul McCartney",
TITLE = "Penny Lane is still in my ears",
YEAR = "1979",
LOCATION = "New York",
PUBLISHER = "Peter Alden"}
@BOOK{mccartney1980,
AUTHOR = "Paul McCartney",
TITLE = "Penny Lane is not anymore my ears",
YEAR = "1980",
LOCATION = "New York",
PUBLISHER = "Peter Alden"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cites[282]{lennon1971}{lennon1973}{mccartney1979}{mccartney1980}
\printbibliography
\end{document}