5

I need to change the order of the fields in my bibliography. Currently, any entry for a book I have is displayed as:

City: Publisher.

I want to change it to

Publisher: City.

Given a tex file as follows:

\documentclass{article}
\usepackage[style=numeric, firstinits=true, maxbibnames=99, minbibnames=1, backend=bibtex8]{biblatex}

\bibliography{mybib}

\begin{document}

hello world \cite{Ab_Steg}

\printbibliography

\end{document}

And the .bib file as follows:

@BOOK{Ab_Steg,
 author = "M. Abramowitz and I. A. Stegun",
 title = {Handbook of mathematical functions},
 publisher = "Dover publications",
 year = "1965",
 language="English",
 address="New York"
 }

The result is:

enter image description here

I want the position of "Dover publications" and "New York" to switch.

  • 1
    What biblatex style do you use? – Paul Stanley Mar 27 '14 at 18:04
  • A self-contained minimal working example (MWE) would be really helpful here. And welcome to TeX.SX! – Adam Liter Mar 27 '14 at 18:16
  • I am using numeric. – pypmannetjies Mar 27 '14 at 20:59
  • Added the exampple. – pypmannetjies Mar 27 '14 at 21:10
  • I'm a bit curious. Is there a background behind this request? Are there any circumstances when this "backwards style" is correct? – pst Mar 27 '14 at 21:58
9

Insert this after loading biblatex:

% let "publisher" and "location" change place
\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \iflistundef{location}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

This is from standard.bbx in Biblatex, with only those two interchanged.

If only books should be affected, a straightforward method is to not change the macro as above, but instead define a new one, \newbibmacro{location+publisher+date} with the definition as above. And then you copy the whole \DeclareBibliographyDriver{book} part from standard.bbx into your file, but exchange the \usebibmacro call to use the alternative macro instead.

  • Do you mean after the \usepackage{biblatex} command? Thanks, this works perfectly! Next time I will have a look at standard.bbx. – pypmannetjies Mar 27 '14 at 21:34
  • Is there a way to restrict this change to only references that are books, not conferences as well? – pypmannetjies Mar 27 '14 at 21:39
  • 1
    I don't know how to best do that, but I've added a rather dumb but straightforward way. – pst Mar 27 '14 at 22:22
2

We can use \ifentrytype{book} to change the macro only for @books.

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

MWE

\documentclass{article}
\usepackage[style=numeric, firstinits=true, maxbibnames=99, minbibnames=1, backend=biber]{biblatex}

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

\bibliography{biblatex-examples.bib}

\begin{document}
  \cite{cicero,wilde}

  \printbibliography
\end{document}

enter image description here

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.