1

I am aware of the fact that very similar problems have been discussed here before, but sadly I still can't figure out the following:

I need to customize the standard authoryear @book style to look like this:

Last Name, First Name (year): Title. Location, Publisher.

(all non-italic)

Could anyone help me out here with undoing the standard italic title and the colon after the location? Up until now, I only managed to change the period after (year) to a colon with:

\renewcommand*{\labelnamepunct}{\addcolon\space}
  • 1
    If your goal is as straightforward as it sounds, you're simply looking for \DeclareFieldFormat{<field>}{#1}, where <field> is things like title, booktitle, maintitle, journaltitle, and so on. If it's not that simple (I suspect it isn't), we'll need more information. – jon Apr 29 '14 at 22:56
  • What about the other entry types? Is there any modification to be applied to those? – moewe Apr 30 '14 at 5:01
3

The title formatting

You can reliably assume that the basic formatting applied to titles can be affected by \DeclareFieldFormat. In this case it's simple:

\DeclareFieldFormat[book]{title}{#1}

But you may well want to modify it for other entry types as well. In extreme cases you can clear all type-specific formatting with the starred version of the command; but in this case I've assumed you want to leave the formats for, e.g., article titles, unchanged.

The location and publisher

If you look at standard.bbx (which is in turn used by authoryear.bbx) you can work out pretty quickly from looking at the basic drivers that it is a bibmacro called publisher+location+date that formats these elements. If we look at that macro (in standard.bbx we find, in the middle of it, these lines:

 \iflistundef{publisher}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%

Immediately before the publisher is printed out. It's the second of these lines that prints our colon. So we can change that so that the entire bibmacro is defined as follows

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

Don't worry about the reference to the date: it won't be printed because the date bibmacro knows it already has been. But it's a basic rule of changing things in biblatex that you change as little as possible.

This change won't just affect the book entry type of course. But that's probably what you want: one expects consistency.

The punctuation

As you have worked out, the punctuation is changed with

\renewcommand{\labelnamepunct}{\addcolon\space}

In total

\documentclass{article}
\usepackage[style=authoryear,backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat[book]{title}{#1}

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

\renewcommand{\labelnamepunct}{\addcolon\space}
\begin{document}

\nocite{cotton}

\printbibliography[heading=none]

\end{document}

enter image description here

  • +1) You might also like to mention the starred version of \DeclareFieldFormat, it clears all type-specific formatting before applying the new one. – moewe Apr 30 '14 at 7:24
  • @moewe In this case I think the unstarred version is what's needed, but I'll make an edit. – Paul Stanley Apr 30 '14 at 7:27
  • Certainly if the change is only to apply to @book (there starred version does not even allow for the optional type argument), but if all titles are to be formatted as-is, the starred version comes in handy. – moewe Apr 30 '14 at 7:30
  • Thank you so much!! It really works like a charm! I even think, I understand the alternations made ;) However, naturally, I have more literature types to alter. Could you help me there once more? I'll post it as an answer to my original question. – Simon Beck Apr 30 '14 at 8:25
  • 1
    @SimonBeck If you have other questions, it's better to post a fresh question, preferably with a MWE -- you can adapt my answer, I expect, to provide one. – Paul Stanley Apr 30 '14 at 8:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.