# Change appearance of 'Series' + 'Number' entries in biblatex' bibliography

Following the style guidelines for an article I'm writing, I need to make sure that the title of the book series is printed in italics, preceded by an equal sign plus a space, and followed by a comma, the number within that series, and a period, and all of that enclosed in parentheses, and no period following the closing parenthesis. E.g.

Girvan, R. (1931). Angelsaksisch handboek. (= Oudgermaansche handboeken, 4.) Haarlem: H. D. Tjeenk & Zoon.

Note that it's only the series title that's italicized within the parentheses. The various symbols (=, ,, .) and the parentheses themselves are in an upright font.

What command(s) can I include in the preamble of my .tex file that will result in such a bibliography?

MWE:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@BOOK{girvan1931,
AUTHOR = "R. Girvan",
TITLE = "Angelsaksisch handboek",
YEAR = "1931",
LOCATION = "Haarlem",
NUMBER = "4",
PUBLISHER = "H. D. Tjeenk Willink \& Zoon",
SERIES = "Oudgermaansche handboeken"}
\end{filecontents}
\begin{document}
\nocite{girvan1931}
\printbibliography
\end{document}


You might like this redefinition of the bibmacro series+number. But before we do that, we make sure the series (is printed in italics [is emphasised]), at least for books, inbooks, collections and incollections.

\DeclareFieldFormat[book,inbook,incollection,collection]{series}{\mkbibemph{#1}}


We then define the series+number macro, so it does print the format "(= series, #)", but only if both the series and the number are defined, otherwise a slightly changed standard form of the macro is used.

\renewbibmacro*{series+number}{%
\ifboolexpr{not test {\iffieldundef{series}} and not test {\iffieldundef{number}}}
{\printtext[parens]{%
\printfield{series}%
\printfield{number}%
\nopunct}
{\printfield{series}%
\printfield{number}
\newunit}}


If you absolutely always want to see the series in "(= series)" even if no number is present, you might like this redefinition

\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printfield{series}%
\printfield{number}%
\nopunct}}


The MWE

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@BOOK{girvan1931,
AUTHOR = "R. Girvan",
TITLE = "Angelsaksisch handboek",
YEAR = "1931",
LOCATION = "Haarlem",
NUMBER = "4",
PUBLISHER = "H. D. Tjeenk Willink \& Zoon",
SERIES = "Oudgermaansche handboeken"}
\end{filecontents}

\DeclareFieldFormat[book,inbook,incollection,collection]{series}{\mkbibemph{#1}}
\renewbibmacro*{series+number}{%
\ifboolexpr{not test {\iffieldundef{series}} and not test {\iffieldundef{number}}}
{\printtext[parens]{%
\printfield{series}%
\printfield{number}%
\nopunct}
{\printfield{series}%
\printfield{number}
\newunit}}

\begin{document}
\nocite{girvan1931,wilde,cicero}
\printbibliography
\end{document}


yields

Note that the series for wilde is not wrapped into parentheses and preceded by a =, it just prints "English and American drama of the Nineteenth Century." with the redefinition, in the second redefinition it will print as "(= English and American drama of the Nineteenth Century.)" which appears slightly odd to me: If a number is present the = states that the title is in a way equivalent to the numberth book in the series, but if no number is present the = sign seems to suggest the title is equivalent to the whole series it appeared in, that, of course is nonsense.

A third possibility is to redefine the macro in the following way. Here, the equal sign is only displayed if a number is available (to avoid some kind of category mistake).

\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\iffieldundef{number}
{}

• You're making a very good point about the title of series when no number is available (my style guidelines say nothing about this, of course). BUT, I don't think it would be correct in those cases to italicize the title of the series, because then it looks to me like it is a part of the book title. I think the best in this case would be to just remove the equal sign, so that it says "The Importance of Being Earnest: A Trivial comedy for Serious People (English and American drama of the Nineteenth Century.)" – Sverre Nov 6 '13 at 20:54