5

I am trying to customize biblatex to the needs of the requirements. At this point I am working on the book-class.

The status quo is based on the MWE below. As I indicated in the title, I would like to have it like this:

Smith, J. (2012):
The Random Booktitle, 3rd ed., Springer, Berlin.

Or if the edition were the 1st edition:

Smith, J. (2012):
The Random Booktitle, Springer, Berlin.

I tried to use the \newbibmacro command as suggested, but I am pretty much just doing some t&e runs at the whole thing. So far I got this:

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

I think I could add some stuff for the edition to this macro, but there would be no use to it. It rather "destroys" what I've achieved so far.

Please click here for a MWE.

7
  • 1
    Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. May 8, 2013 at 13:21
  • Ok, did it. I just edited the opening post.
    – henry
    May 8, 2013 at 14:59
  • Let's start with an advice: If you want to change all title you can use the star version of \DeclareFieldFormat. : \DeclareFieldFormat*{title}{#1}. Next: The first mandatory argument of \DeclareFieldFormat doesn't accept a list. So \DeclareFieldFormat{booktitle,journaltitle,i... is wrong. With this knowledge please reduce your MWE. May 8, 2013 at 16:49
  • Ok, here is an updated MWE.
    – henry
    May 8, 2013 at 19:31
  • You may get more and more helpful answers if you (1) try to condense your MWE down to something that only shows the point you are concerned with and (2) stick quite strictly to one question per question. May 8, 2013 at 22:17

1 Answer 1

4

I get the impression that you are attempting to make rather extensive changes to the standard authoryear style. Can I focus on the problem you raise as the most immediate, which is the publisher and location point.

You were basically on the right track. The relevant macro is actually called publisher+location+date (though, for reasons that don't matter now, it doesn't end up printing the date in the authoryear style. Your redefinition would basically work, but (since you've already redefined the \newunitpunct) you can make it still simpler

\renewbibmacro*{publisher+location+date}{%
\newunit
\printlist{publisher}%
\newunit
\printlist{location}%
\newunit}

As far as your edition point is concerned, the edition is handled considerably earlier in the driver -- it usually follows the title. I suspect that this is really what you want (it will, in the ordinary case, mean that the edition is followed by publisher and location). If you want to move it so that it is always handled immediately before the publisher you will need to rewrite drivers. But please find an example with reasonable data that is printing the edition wrong before trying that, because I suspect there is actually no problem.


UPDATE

As to not printing of the edition if it is "1", the following redefinition of the field format will do it, I think. Note that it only "catches" (and does not print) the precise "1": "1st" or "First" would be printed.

\DeclareFieldFormat{edition}{%
  \ifstrequal{#1}{1}
     {}
     {\ifinteger{#1}
       {\mkbibordedition{#1}~\bibstring{edition}}
       {#1\isdot}}}

But please think again about this! Granted it is not normally the practice to include the edition information in the .bib file if the edition is the first. But if such information is included, why should it not be printed? What will happen if you/your user wishes to cite both the first and the second edition of a particular work?

2
  • Thank you very much, this worked. Also, thanks for the little additional note to not worry about the inclusion of date in the macro. About the edition being printed, see the new MWE in the op please. I set the edition value to 1 and it is being printed.
    – henry
    May 9, 2013 at 7:54
  • In regards to your update: I am just trying to fulfill some very specific requirements, so... although I see your point, I can of course just check that there are no entries for the edition if it is the first. I reckon it is easier this way rather than to code it? But ever since I tested my mwe I saw it is printing ordinal numbers which I want to use anyway. So it's ok, I'll be leaving the info out because of the requirement.
    – henry
    May 9, 2013 at 11:41

You must log in to answer this question.

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