2

I am trying to match a bibliography style with biblatex-philosophy. The format I need for a multi-editor work is as follows: Target

By default, biblatex-philosophy with the philosophy-modern outputs this:

Attempt

The code being as follows:

\documentclass[11pt, parskip=false]{scrartcl}

% Bibliography preamble
\usepackage[giveninits=true,style=philosophy-modern, yearleft=true]{biblatex}
\addbibresource{testbib.bib}

\DeclareFieldFormat[online]{title}{#1}

\renewcommand{\postsep}{% Add comma to end of author section
\addcomma
\null\par\nobreak\vskip\postnamesep%
\hskip-\bibhang\ignorespaces}

\begin{document}
Sentence containing citation \parencite{example2018}.

\printbibliography
\end{document}

with this .bib file:

@book{example2018,
Edition = {4},
Publisher = {Penguin},
Title = {All Aboard the Good Ship Merriweather},
date = {1964},
Editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}

How can the (eds.) be stripped of parentheses and period, and be moved to the end of the editors section as required?

Looking into the guts of biblatex and biblatex-philosophy left me none the wiser, as it seems particularly fiddly and beyond my ability to influence.

  • You will get into trouble with that though, if the same people are authors of another work. Suppose Anne Elk is author of 'On the Theory of Brontosauruses' and editor of 'Dinosaur Theory: An Overview'. What should happen then? Should she appear in the 'heading' position twice? What happens if there are even more works as editor and as author. In that case you may even have to change the sorting based on the role (I don't think this is supported at the moment). – moewe Feb 23 '18 at 11:12
  • I see what you mean, and I suspect the reasoning for the style isn't well thought out (I didn't create it, but am obliged to use it). For the sake of argument, if authors\editors appearing in the heading multiple times were acceptable, are formatting changes to move the (eds.) drastic ones? – anunlikelypseudonym Feb 23 '18 at 11:31
  • The formatting changes should be easy (I'm saying that not having had a look at the code yet). But the problem is with the heading appearing multiple times and/or sorting. – moewe Feb 23 '18 at 11:38
  • If you've got a moment it'd be great if you could have a crack, your expertise in my last few questions has been greatly appreciated. Worst case scenario from your attempt is I can take some feedback to the style creators as to why they may want to change it. – anunlikelypseudonym Feb 23 '18 at 11:49

1 Answers1

4

The following works well as long as the same set of authors does not double as authors for one work and editors for another. If you want to remove the dot for 'eds', you will have to redefine the bibstrings in \DefineBibliographyStrings{english}. Have a look at english.lbx for all the other strings you may have to redefine if you use them, there are compiler, redactor, reviser and many other roles.

\documentclass[11pt, parskip=false]{scrartcl}

% Bibliography preamble
\usepackage[giveninits=true,style=philosophy-modern, yearleft=true, uniquename=init]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{example2018,
Edition = {4},
Publisher = {Penguin},
Title = {All Aboard the Good Ship Merriweather},
date = {1964},
Editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat[online]{title}{#1}

\renewcommand{\postsep}{% Add comma to end of author section
\addcomma
\null\par\nobreak\vskip\postnamesep%
\hskip-\bibhang\ignorespaces}

\DefineBibliographyStrings{english}{%
  editor           = {ed},
  editors          = {eds},
}

\DeclareFieldFormat{editortype}{#1}
\DeclareDelimFormat{editortypedelim}{\addcomma\space}
\DeclareFieldFormat{translatortype}{#1}
\DeclareDelimFormat{translatortypedelim}{\addcomma\space}

\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{%
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }%
  {\usebibmacro{bbx:dashcheck}%
     {}%
     {\printnames{editor}%
      \usebibmacro{bbx:savehash}%
      \setunit{\printdelim{editortypedelim}}%
      \usebibmacro{#1}%
      \clearname{editor}%
      \postsep}%
   \usebibmacro{date+extradate}}%
  {\global\undef\bbx@lasthash
   \usebibmacro{date+extradate}}}%

\renewbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{%
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }%
  {\usebibmacro{bbx:dashcheck}%
     {}%
     {\printnames{translator}%
      \usebibmacro{bbx:savehash}%
      \setunit{\printdelim{translatortypedelim}}%
      \usebibmacro{#1}%
      \clearname{translator}%
      \postsep}%
   \usebibmacro{date+extradate}}%
  {\global\undef\bbx@lasthash
   \usebibmacro{date+extradate}}}
\makeatother

\begin{document}
Sentence containing citation \parencite{example2018,sigfridsson,knuth:ct:a,knuth:ct:b}.

\printbibliography
\end{document}

enter image description here

With much more effort we can make the above safe for different roles by the same list of authors. This still does not take care of sorting, though.

\documentclass[australian, 11pt, parskip=false]{scrartcl}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[giveninits=true,style=philosophy-modern, yearleft=true, uniquename=init]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{example2018,
Edition = {4},
Publisher = {Penguin},
Title = {All Aboard the Good Ship Merriweather},
date = {1964},
Editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}
@book{example2019,
Publisher = {Penguin},
Title = {Another Ship},
date = {2017},
author = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}
@book{example2020,
Publisher = {Penguin},
Title = {Bnunb},
date = {1960},
author = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}
@book{example2021,
Publisher = {Penguin},
Title = {Znub},
date = {1961},
author = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}

@book{example2022,
Publisher = {Penguin},
Title = {Znub},
date = {2018},
author = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}


@book{example2023,
Publisher = {Penguin},
Title = {Znub},
date = {2023},
tramslator = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}


@book{example2024,
Publisher = {Penguin},
Title = {Znub},
date = {2024},
translator = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}

@book{example2025,
Publisher = {Penguin},
Title = {Znub},
date = {2025},
translator = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
editor = {Stewart, Bryce and Karl Popper and Samantha Elizabeth O'Grady},
Location = {London}}

@online{blogWithoutAuthor,
date = {2018},
title = {Historians in the News},
maintitle = {History Matters},
organization = {The University of Sydney},
url = {http://blogs.usyd.edu.au/historymatters/2018/02/historians_in_the_news_2018.html},
urldate = {2018-02-23}
}

@online{blogWithAuthor,
date = {2018},
title = {Historians in the News},
maintitle = {History Matters},
organization = {The University of Sydney},
url = {http://blogs.usyd.edu.au/historymatters/2018/02/historians_in_the_news_2018.html},
urldate = {2018-02-23},
author = {McDonnell, Mike}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat[online]{title}{#1}

\renewcommand{\postsep}{% Add comma to end of author section
\addcomma
\null\par\nobreak\vskip\postnamesep%
\hskip-\bibhang\ignorespaces}

\DefineBibliographyStrings{english}{%
  editor           = {ed},
  editors          = {eds},
}

\DeclareFieldFormat{editortype}{#1}
\DeclareDelimFormat{editortypedelim}{\addcomma\space}
\DeclareFieldFormat{translatortype}{#1}
\DeclareDelimFormat{translatortypedelim}{\addcomma\space}


\makeatletter
\newbibmacro*{editorstrg:gettempa}{%
  \iffieldundef{editortype}
    {\ifboolexpr{
       test {\ifnumgreater{\value{editor}}{1}}
       or
       test {\ifandothers{editor}}
     }
       {\def\abx@tempa{editors}}
       {\def\abx@tempa{editor}}}
    {\ifbibxstring{\thefield{editortype}}
       {\ifboolexpr{
          test {\ifnumgreater{\value{editor}}{1}}
          or
          test {\ifandothers{editor}}
        }
          {\edef\abx@tempa{\thefield{editortype}s}}
          {\edef\abx@tempa{\thefield{editortype}}}}
       {\edef\abx@tempa{\thefield{editortype}}}}}

\renewbibmacro*{editorstrg}{%
  \usebibmacro{editorstrg:gettempa}%
  \printtext[editortype]{%
    \ifbibxstring{\abx@tempa}
      {\bibstring{\abx@tempa}}
      {\abx@tempa}}}

\newbibmacro*{editor+othersstrg:gettempa}{%
  \iffieldundef{editortype}
    {\ifboolexpr{
       test {\ifnumgreater{\value{editor}}{1}}
       or
       test {\ifandothers{editor}}
     }
       {\def\abx@tempa{editors}}
       {\def\abx@tempa{editor}}}
    {\ifboolexpr{
       test {\ifnumgreater{\value{editor}}{1}}
       or
       test {\ifandothers{editor}}
     }
       {\edef\abx@tempa{\thefield{editortype}s}}
       {\edef\abx@tempa{\thefield{editortype}}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{editor}{translator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{translator}}}
    {}%
  \ifnamesequal{editor}{commentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{commentator}}}
    {\ifnamesequal{editor}{annotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{annotator}}}
       {}}%
  \ifnamesequal{editor}{introduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{introduction}}}
    {\ifnamesequal{editor}{foreword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{foreword}}}
       {\ifnamesequal{editor}{afterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{afterword}}}
          {}}}}

\renewbibmacro*{editor+othersstrg}{%
  \usebibmacro{editor+othersstrg:gettempa}%
  \ifbibxstring{\abx@tempa}
    {\printtext[editortype]{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{editorstrg}}}

\newbibmacro*{translatorstrg:gettempa}{%
  \ifboolexpr{
    test {\ifnumgreater{\value{translator}}{1}}
    or
    test {\ifandothers{translator}}
  }
  {\def\abx@tempa{translators}}
  {\def\abx@tempa{translator}}}

\renewbibmacro*{translatorstrg}{%
  \usebibmacro{translatorstrg:gettempa}%
  \printtext[translatortype]{%
    \ifbibxstring{\abx@tempa}
      {\bibstring{\abx@tempa}}
      {\abx@tempa}}}

\newbibmacro*{translator+othersstrg:gettempa}{%
  \ifboolexpr{
    test {\ifnumgreater{\value{translator}}{1}}
    or
    test {\ifandothers{translator}}
  }
    {\def\abx@tempa{translators}}
    {\def\abx@tempa{translator}}%
  \ifnamesequal{translator}{commentator}
    {\appto\abx@tempa{co}%
     \clearname{commentator}}
    {\ifnamesequal{translator}{annotator}
       {\appto\abx@tempa{an}%
        \clearname{annotator}}
       {}}%
  \ifnamesequal{translator}{introduction}
    {\appto\abx@tempa{in}%
     \clearname{introduction}}
    {\ifnamesequal{translator}{foreword}
       {\appto\abx@tempa{fo}%
        \clearname{foreword}}
       {\ifnamesequal{translator}{afterword}
          {\appto\abx@tempa{af}%
           \clearname{afterword}}
          {}}}}

\renewbibmacro*{translator+othersstrg}{%
  \usebibmacro{translator+othersstrg:gettempa}%
  \printtext[translatortype]{\bibstring{\abx@tempa}}}

\renewbibmacro*{bbx:dashcheck}[2]{%
  \ifboolexpr{
    test {\iffieldequals{fullhash}{\bbx@lasthash}}
    and
    not test \iffirstonpage
    and
    (
       not bool {bbx@inset}
       or
       test {\iffieldequalstr{entrysetcount}{1}}
    )
    and test {\ifcsstrequal{bbx@thisnametype}{bbx@lastnametype}}
  }
    {#1}
    {#2}}

\renewbibmacro*{author}{%
  \global\def\bbx@thisnametype{author}%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
  {\usebibmacro{bbx:dashcheck}
     {}%
     {\usebibmacro{bbx:savehash}%
      \printnames{author}%
      \iffieldundef{nameaddon}
        {}%
        {\setunit{\addspace}%
         \printfield{nameaddon}}%
      \iffieldundef{authortype}
        {}%
        {\usebibmacro{authorstrg}%
         \printtext{\addcomma\space}}
      \global\def\bbx@lastnametype{author}%
      \postsep}%
   \usebibmacro{date+extradate}}%
    {\global\undef\bbx@lasthash
     \global\undef\bbx@lastnametype
     \usebibmacro{date+extradate}}}

\renewbibmacro*{bbx:editor}[1]{%
  \begingroup
  \usebibmacro{#1:gettempa}%
  \global\edef\bbx@thisnametype{\abx@tempa}%
  \endgroup
  \ifboolexpr{%
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }%
  {\usebibmacro{bbx:dashcheck}%
     {}%
     {\printnames{editor}%
      \usebibmacro{bbx:savehash}%
      \setunit{\printdelim{editortypedelim}}%
      \usebibmacro{#1}%
      \global\edef\bbx@lastnametype{\abx@tempa}%
      \global\edef\bbx@cleanup{\abx@tempb}%
      \postsep}%
   \clearname{editor}%
   \bbx@cleanup
   \usebibmacro{date+extradate}}%
  {\global\undef\bbx@lasthash
   \global\undef\bbx@lastnametype
   \usebibmacro{date+extradate}}}%

\renewbibmacro*{bbx:translator}[1]{%
  \begingroup
  \usebibmacro{#1:gettempa}%
  \global\edef\bbx@thisnametype{\abx@tempa}%
  \endgroup
  \ifboolexpr{%
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }%
  {\usebibmacro{bbx:dashcheck}%
     {}%
     {\printnames{translator}%
      \usebibmacro{bbx:savehash}%
      \setunit{\printdelim{translatortypedelim}}%
      \usebibmacro{#1}%
      \global\edef\bbx@lastnametype{\abx@tempa}%
      \global\edef\bbx@cleanup{\abx@tempb}%
      \postsep}%
   \clearname{translator}%
   \bbx@cleanup
   \usebibmacro{date+extradate}}%
  {\global\undef\bbx@lasthash
   \global\undef\bbx@lastnametype
   \usebibmacro{date+extradate}}}
\makeatother


\begin{document}
Sentence containing citation \parencite{example2018, sigfridsson, knuth:ct:a, knuth:ct:b, example2019, example2020, example2021, example2022, example2023, example2024, example2025}.

\parencite{blogWithoutAuthor, blogWithAuthor, westfahl:frontier, westfahl:space}

\printbibliography
\end{document}

enter image description here

moewe
  • 175,683
  • I have snyched this up with my answer to https://tex.stackexchange.com/a/416889/35864 – moewe Feb 23 '18 at 18:11
  • Just amazing. Thanks so much for such a comprehensive answer. I'm going to go through the code and pick up as much as I can. Thanks again for the attention you've given this. – anunlikelypseudonym Feb 24 '18 at 01:19
  • My OCD is kicking in - the cases where there is an "ed", "eds", "trans" etc, an extra space is present before the title. You've already gone above and beyond the call of duty, but if you could point out what might be affecting that I'll attempt a fix myself. Thanks again! – anunlikelypseudonym Feb 24 '18 at 03:04
  • @anunlikelypseudonym Well spotted! Somehow I convinced myself that the slight misalignment I saw as only due to the letter shape and italics. But there were indeed unnecessary punctuation commands causing this, I removed them. – moewe Feb 24 '18 at 06:36
  • Fantastic, thanks so much. Everything is working perfectly. – anunlikelypseudonym Feb 24 '18 at 21:42