14

How can I remove the comma before ed. or eds. and put this abbreviation in parentheses? I'm using biblatex.

For example this reference:

Dozy, Reinhart, ed.: Supplément aux dictionnaires arabes. 3rd ed. 2 vols. Leiden: Brill, 1967.

should look like this:

Dozy, Reinhart (ed.): Supplément aux dictionnaires arabes. 3rd ed. 2 vols. Leiden: Brill, 1967.

Moreover, I would like to have the "rd" of "3rd edition" in superscript. Is this possible?

EDIT: Here is a minimal example (with lockstep's solution for superscripts inluded, sorry for not having given an example the last time):

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper,12pt,final, oneside]{memoir}


% ********************************************************************
% Biblatex + Bibliography
% ********************************************************************

\usepackage[style=authortitle-ibid, sorting=nty, hyperref=auto]{biblatex}
\usepackage[english=british]{csquotes}
\bibliography{Bibliography}
\defbibheading{prim}{\subsection*{{Primary Sources}}}
\defbibheading{sec}{\subsection*{{Secondary Sources}}}
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\DeclareFieldFormat{postnote}{#1}%%keine Anzeige von S.
\renewcommand{\labelnamepunct}{\addcolon\addspace} %%Doppelpunkt nach Autor

%Serientitel in Klammern und nach der bibliographischen Angabe
\renewbibmacro*{series+number}{}
\renewbibmacro*{publisher+location+date}{%
 \printlist{location}%
  \iflistundef{publisher}%
   {\setunit*{\space}}%
    {\setunit*{\addcolon\space}}%
  \printlist{publisher}%
    \setunit*{\addcomma\space}%
  \printfield{year}%
  \setunit*{\space}%
  \iffieldundef{series}%
    {}%
    {\printtext[brackets]{%
      =\addnbspace%
      \printfield{series}%
      \setunit*{\addspace}%
      \printfield{number}}}%
 \newunit}


%%Ed. in parenthesis
\renewbibmacro*{editor}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
%     \setunit{\addcomma\space}% DELETED
%     \usebibmacro{editorstrg}% DELETED
     \setunit{\addspace}% ADDED
     \printtext[parens]{\usebibmacro{editorstrg}}% ADDED
     \clearname{editor}}
    {}}

\renewbibmacro*{editor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
%     \setunit{\addcomma\space}% DELETED
%     \usebibmacro{editor+othersstrg}% DELETED
     \setunit{\addspace}% ADDED
     \printtext[parens]{\usebibmacro{editor+othersstrg}}% ADDED
     \clearname{editor}}
    {}}


%Superscript for cardinal numbers before edition
\usepackage[super]{nth}
\AtBeginDocument{\renewcommand*{\mkbibordinal}[1]{\nth{#1}}}

\begin{document}

\printbibliography[heading=prim, keyword=prim, nottype=reference]
\printbibliography[heading=sec, notkeyword=prim, nottype=reference]


\end{document}
lockstep
  • 250,273
Christopher
  • 235
  • 1
  • 7

2 Answers2

8

Since you did not provide a minimal example, I'm assuming the default numeric style.

EDIT: Minimal exampe changed to style autortitle & friends.

\documentclass{article}

\usepackage[style=authortitle-ibid]{biblatex}

\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
%   \setunit{\addcomma\space}% DELETED
    \setunit{\addspace}% ADDED
    \usebibmacro{bbx:savehash}}%
%     \usebibmacro{#1}% DELETED
     \printtext[parens]{\usebibmacro{#1}}% ADDED
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}
\makeatother

\usepackage[super]{nth}
\AtBeginDocument{\renewcommand*{\mkbibordinal}[1]{\nth{#1}}}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@collection{A01,
  editor = {Author, A.},
  year = {2001},
  title = {Alpha},
  edition = {3},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}
lockstep
  • 250,273
  • Thank you for your fast reply! The superscript works perfectly. Unfortunately, for the redefinition of the editor format I get the response: \abx@macro@editor+others ->\ifboolexpr { test \ifuseeditor and not test {\if... – Christopher Oct 01 '11 at 13:34
  • @Christopher: Edit your original question to include informations about the style you use and other possible redefinitions. – lockstep Oct 01 '11 at 13:36
  • Thanks for changing your example to the authortitle-style, but I still get the same error message: ! Undefined control sequence. \abx@macro@bbx:editor #1->\ifboolexpr { test \ifuseeditor and not test {\ifn... – Christopher Oct 01 '11 at 14:42
  • Do I have to make some changes? I tried your minimal example and it causes the same error message. Maybe there is a typing error somewhere? – Christopher Oct 01 '11 at 14:44
  • 1
    Try my minimal example without any changes. – lockstep Oct 01 '11 at 14:54
  • If I change nothing, I get the message: ! Undefined control sequence. l.38 \addbibresource {\jobname.bib} I'am using XeLaTex on a Mac, maybe there is a difference? – Christopher Oct 01 '11 at 16:01
  • You seem to be using an outdated version of biblatex (<1.2, the current one is 1.6). Upgrade your TeX distribution – lockstep Oct 01 '11 at 16:03
  • Yes, I still had the TeX 2009distribution. It works now! – Christopher Oct 02 '11 at 16:36
  • Nowadays, one should use \AtBeginDocument{\renewcommand*{\mkbibordedition}[1]{\nth{#1}}} instead of the general \mkbibordinal. – Júda Ronén Sep 21 '17 at 11:29
8

With more recent versions of biblatex you only need

\DeclareDelimFormat{editortypedelim}{\addspace}

for the space between the editor name and "ed.". The same delimiter exists for translators

\DeclareDelimFormat{translatortypedelim}{\addspace}

You get the parentheses around "ed." and "trans." with

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareFieldFormat{translatortype}{\mkbibparens{#1}}

There is no need to redefine bbx:editor.

In practice it is recommended (because it is less redundant) to use aliases for the translator

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

% (ed.)/(eds.) for editors
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

% same for (trans.)
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
\DeclareFieldAlias{translatortype}{editortype}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{vizedom:related,westfahl:frontier}
\printbibliography
\end{document}
moewe
  • 175,683