Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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}
share|improve this answer
    
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 1 '11 at 13:34
    
@Christopher: Edit your original question to include informations about the style you use and other possible redefinitions. –  lockstep Oct 1 '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 1 '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 1 '11 at 14:44
    
Try my minimal example without any changes. –  lockstep Oct 1 '11 at 14:54
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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