Saturday, 25 May 2013

Delimiter for comments in text citations in biblatex

Delimiter for comments in text citations in biblatex

In the question Biblatex: No \postnotedelim for citations that aren't numerals, I learned how to remove a postnote delimiter when the citation doesn't contain a numeral, by adding this to the preamble:
\renewcommand{\postnotedelim}{\iffieldnums{postnote}{\addcolon}{\addspace}}
However, this also removes the delimiter between a regular citation and a "comment" style citation (such as "p.c.") (cf. Add custom information to text citations with biblatex).
Below you can see the effect of adding the command above. The question is, how do I put the comma back in before the "comment" when I have this command in my premable?
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\DeclareFieldFormat{postnote}{#1}
%\renewcommand{\postnotedelim}{\iffieldnums{postnote}{\addcolon}{\addspace}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
    AUTHOR = "John Lennon",
    TITLE = "Who did what in the Beatles",
    YEAR = "1972"}
@book{starkey1994,
    AUTHOR = "Richard Starkey",
    TITLE = "I'm the drummer",
    YEAR = "1994"}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
I know from books and people I have talked to that George Harrison played the guitar in the Beatles \parencites(Paul McCartney p.c.)[48]{lennon1972}[103]{starkey1994}
\end{document}

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\DeclareFieldFormat{postnote}{#1}
\renewcommand{\postnotedelim}{\iffieldnums{postnote}{\addcolon}{\addspace}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{lennon1972,
    AUTHOR = "John Lennon",
    TITLE = "Who did what in the Beatles",
    YEAR = "1972"}
@book{starkey1994,
    AUTHOR = "Richard Starkey",
    TITLE = "I'm the drummer",
    YEAR = "1994"}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
I know from books and people I have talked to that George Harrison played the guitar in the Beatles \parencites(Paul McCartney p.c.)[48]{lennon1972}[103]{starkey1994}
\end{document}

No comments:

Post a Comment