4

I want to achieve something like this:

Kafka, Franz: Die Verwandlung. Stuttgart: Philipp Reclam 2001 (Universal-Bibliothek Nr. 9900).

Whereas "Universal-Bibliothek" is the series and "Nr. 9900" is the number.

I really looked everywhere for a solution but came up with nothing :-( I can post a MWE but thought that such basic stuff does not really asks for it. But I can post how I achieved the parentheses etc.:

\renewbibmacro*{series+number}{%
    \iffieldundef{series}%
    {}
    {\printtext[parens]{%
        \printfield{series}%
        \iffieldundef{number}%
            {}
            {\setunit{\space}%
            %\bibstring{volume}~
            \printfield{number}}%
        %\adddot
        }}}

With that it looks like this:

Kafka, Franz: Die Verwandlung. (Reclams Universal-Bibliothek Nr. 9900). Stuttgart: Philipp Reclam 2001.

Thanks four help in advance :-)

P.S.: This the .bib entry:

@Book{Kafka.2001,
  Title                    = {Die Verwandlung},
  Author                   = {Kafka, Franz},
  Publisher                = {Philipp Reclam},
  Year                     = {2001},
  Address                  = {Stuttgart},
  Number                   = {Nr. 9900},
  Series                   = {Reclams Universal-Bibliothek}
}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248
Sickboy
  • 239
  • 2
  • 8

1 Answers1

2

Reordering fields in the bibliography drivers is not always very easy, but with the help of the xpatch package we can speed up the process quite a bit.

First we need to wrap the series and number in parentheses

\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\printtext[parens]{%
       \printfield{series}%
       \setunit*{\addspace}%
       \printfield{number}%
       \newunit}}}

And then we define a new command to get rid of the series+number macro and then add it in later.

\newcommand*\patchseries[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{series+number}}
    {}
    {}
    {\typeout{Warning: Failed to remove series+number from driver #1.}}
  \xpatchbibdriver{#1}
    {\usebibmacro{publisher+location+date}}
    {\usebibmacro{publisher+location+date}%
     \setunit{\addspace}%
     \usebibmacro{series+number}}
    {}
    {\typeout{Warning: Failed to add series+number to driver #1.}}}

Then you just use

\patchseries{book}\patchseries{inbook}
\patchseries{collection}\patchseries{incollection}
\patchseries{proceedings}\patchseries{inproceedings}

for those types you want patched.

MWE

\documentclass[ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authortitle]{biblatex}
\usepackage{microtype}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Kafka.2001,
  Title                    = {Die Verwandlung},
  Author                   = {Kafka, Franz},
  Publisher                = {Philipp Reclam},
  Year                     = {2001},
  Address                  = {Stuttgart},
  Number                   = {9900},
  Series                   = {Reclams Universal-Bibliothek}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\usepackage{xpatch}

\renewbibmacro*{series+number}{%
  \iffieldundef{series}
    {}
    {\printtext[parens]{%
       \printfield{series}%
       \setunit*{\addspace}%
       \printfield{number}%
       \newunit}}}

\newcommand*\patchseries[1]{%
  \xpatchbibdriver{#1}
    {\usebibmacro{series+number}}
    {}
    {}
    {\typeout{Warning: Failed to remove series+number from driver #1.}}
  \xpatchbibdriver{#1}
    {\usebibmacro{publisher+location+date}}
    {\usebibmacro{publisher+location+date}%
     \setunit{\addspace}%
     \usebibmacro{series+number}}
    {}
    {\typeout{Warning: Failed to add series+number to driver #1.}}}

\patchseries{book}\patchseries{inbook}
\patchseries{collection}\patchseries{incollection}
\patchseries{proceedings}\patchseries{inproceedings}

\DeclareFieldFormat{number}{\bibstring{number}~#1}

\begin{document}
\blockcquote{Kafka.2001}{Als Gregor Samsa eines Morgens aus unruhigen Träumen erwachte, fand er sich in seinem Bett zu einem ungeheueren Ungeziefer verwandelt.}.

\nocite{sigfridsson,worman,brandt,baez/article}

\printbibliography
\end{document}

example output

moewe
  • 175,683