2

I am using this custom bibliography driver for incollection (based on standard.bbx):

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{byeditor+others}%
  \newunit\addcomma
%  \usebibmacro{maintitle+booktitle}%
  \printtext[booktitle]{%
    \printfield[titlecase]{booktitle}%
    \setunit{\subtitlepunct}%
    \printfield[titlecase]{booksubtitle}} (\printfield{pages})%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
%  \newunit\newblock
%  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

I modified it to

  • separate byeditor+others and maintitle+booktitle with a comma instead of a period
  • print the pages of the section in the title block (before the period after title/subtitle)

The first thing works, the second doesn't. It produces something like

In <editors>, <title> (. S. 23–38).

Obviously, there is a dot I don't want, it should look like this:

In <editors>, <title> (S. 23-38).

What am I doing wrong? \printfield{pages} seems to finish the last block (or unit?) and inserts a dot. How can I solve this?

1 Answer 1

2

You need to create a new unit with your desired punctuation before the pages appear:

\setunit{\addspace} % New unit with space added

The formatting of the pages themselves is most appropriately done with a new \DeclareFieldFormat to add the parentheses to the original format declaration.

This is all wrapped together as:

\documentclass[]{article}

\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}

% Make a special format for pages in parentheses
\DeclareFieldFormat{parpages}{\mkbibparens{\mkpageprefix[bookpagination]{#1}}}
\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{byeditor+others}%
  \newunit\addcomma
%  \usebibmacro{maintitle+booktitle}%
  \printtext[booktitle]{%
    \printfield[titlecase]{booktitle}%
    \setunit{\subtitlepunct}%
    \printfield[titlecase]{booksubtitle}}
    \setunit{\addspace} % Make new unit by just adding space
    \printfield[parpages]{pages}% Use new parpages format
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
%  \newunit\newblock
%  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\begin{document}

\cite{brandt}

\printbibliography

\end{document}

The citation would appear as:

pic

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .