0

I need to change a bibliography entry/citation for the mvbook type. I'm using the biblatex-musuos package, which is based off authortitle.bbx/standard.bbx.

After a few punctuation changes, clearing a few fields and replacing the bibmacro maintitle+title from the bibliography driver book with the bibmacros maintitle and title, I get this:

this:

But I need it to look like this: Surname, Name, A title, Town 2000 (Maintitle, 6)

  1. I'm not sure why the translator and language is still being shown. I could just remove them from the bib-file, but I'd rather not, in case I need to use it for other purposes. How to remove them?
  2. If I try changing the field formats by something like \DeclareFieldFormat[mvbook]{maintitle}{\mkbibparens{#1}}, it obviously only works for one of the two fields I need in parenthesis. How do I put parenthesis around both maintitle and volume, while removing the unit punctuation before the parenthesis (or rather, change unit punctuation to a space)?
  3. Is there a more elegant way to ensure that punctuation between blocks is commas (except for the subtitlepunctuation, which should be a dot)? Are there any issues in my changes that I might have missed? And does \renewcommand*{\newblockpunct}{\addcomma\space} actually do anything? I saw that recommendation in other answers, tried it and saw no change. (I was also not sure where to put \iffieldundef{maintitle}part when rearranging the bookdriver. So I just put volumeand parton their own. Can that mess things up?)

EDIT: I found a workaround, but it seems very ugly to me. I'd be thankful about more elegant suggestions. Since just putting \mkbibparensaround the maintitle and volume fields also puts parenthesis around the punctuation after the last unit, I defined a new bibmacro that doesn't add a new unit and instead just adds a comma. See "New MWE". How can I improve on this "solution"?

Original MWE:

\begin{filecontents}{ref.bib}
@mvbook{test2000,
  author={Surname, Name},
  title={A title},
  maintitle={Maintitle},
  volume={6},
  location={Town},
  origlanguage={english},
  translator={Duderino, El},
  date={2000}
}
\end{filecontents}

\documentclass[12pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[babel=true]{csquotes}
\usepackage[T1]{fontenc}
\usepackage[style=musuos,backend=biber]{biblatex}
\addbibresource{ref.bib}

\DeclareFieldFormat[mvbook]{chapter}{Kap.\adddotspace\mkbibquote{#1}}

\renewcommand*{\newblockpunct}{\addcomma\space}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\subtitlepunct}{\adddot\space}
\renewcommand*{\labelnamepunct}{\addcomma\space}

% Clear unneeded stuff
\AtEveryBibitem{%
\clearlist{translator}%
}
\AtEveryCitekey{%
\clearlist{translator}%
}

% Remove comma between location and date
\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addspace}}%
    {\setunit*{\addcomma\space}}%
  \printlist{publisher}%
  \setunit*{\addspace}%
  \usebibmacro{date}%
  \newunit}

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  % \usebibmacro{maintitle+title}%
  \usebibmacro{title}% ADDED
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  % \iffieldundef{maintitle} % Not sure what to do with this
  %   {\printfield{volume}%
  %    \printfield{part}}
  %   {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock % ADDED
  \usebibmacro{maintitle}
  \printfield{volume}% ADDED
  \printfield{part}% ADDED
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \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}
\autocite*[][835]{test2000}
\nocite{*}
\printbibliography
\end{document}

New MWE:

\begin{filecontents}{ref.bib}
@mvbook{test2000,
  author={Surname, Name},
  title={A title},
  chapter={A chapter},
  maintitle={Maintitle},
  volume={6},
  location={Town},
  origlanguage={english},
  translator={Duderino, El},
  date={2000}
}
\end{filecontents}

\documentclass[12pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[babel=true]{csquotes}
\usepackage[T1]{fontenc}
\usepackage[style=musuos,backend=biber]{biblatex}
\addbibresource{ref.bib}

\DeclareFieldFormat[mvbook]{chapter}{Kap.\adddotspace\mkbibquote{#1}}

\renewcommand*{\newblockpunct}{\addcomma\space}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewcommand*{\subtitlepunct}{\adddot\space}
\renewcommand*{\labelnamepunct}{\addcomma\space}

\AtEveryBibitem{%
\clearlist{translator}%
}
\AtEveryCitekey{%
\clearlist{translator}%
}

\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addspace}}%
    {\setunit*{\addcomma\space}}%
  \printlist{publisher}%
  \setunit*{\addspace}%
  \usebibmacro{date}%
  \newunit}


% Ugly workaround for proper mvbook citations
\newbibmacro*{mvbook-publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addspace}}%
    {\setunit*{\addcomma\space}}%
  \printlist{publisher}%
  \setunit*{\addspace}%
  {\usebibmacro{date}\addspace}%
}

\DeclareFieldFormat[mvbook]{maintitle}{#1}
\DeclareFieldFormat[mvbook]{volume}{#1}

\DeclareBibliographyDriver{mvbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\printdelim{nametitledelim}}\newblock
  %\usebibmacro{maintitle+title}% Moved down
  \usebibmacro{title}
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \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{mvbook-publisher+location+date}%
  \mkbibparens{%
    \usebibmacro{maintitle}% ADDED
    \printfield{volume}% ADDED
    \printfield{part}}% ADDED
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \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}
\autocite*[][835]{test2000}
\nocite{*}
\printbibliography
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.