10

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.

2 Answers2

16

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.

pst
  • 4,674
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

moewe
  • 175,683