1

I am formatting a bibliography for a journal that insists on lots of stupid changes to standard styles, using biblatex. The closest to what they want is AuthorYear, so I am starting from that. I have got most of it done, but two things remain. I am putting them in separate questions as they are sufficiently different.

For InCollection entries, I currently get:

Eaton, A. W. (2016). Taste in Bodies and Fat Oppression. In Body Aesthetics. Ed. by Sherri Irvin. Oxford University Press, 37–59.

What I need is:

Eaton, A. W. (2016). Taste in Bodies and Fat Oppression. In Sherri Irvin (Ed.), Body Aesthetics (37–59). Oxford University Press.

How do I get the edited volume information correct? (I realise that what they want here is much closer to APA than to AuthorYear, but what they want for most entries is much closer to AuthorYear than APA)

Here is an MWE:

\documentclass{article}

\usepackage[bibstyle=authoryear, citestyle=authoryear]{biblatex}

%deletes colon from in for collections \renewcommand*{\intitlepunct}{% \ifentrytype{incollection} {\addspace} {\addcolon\space}}

%deletes location from books \AtEveryBibitem{\clearlist{location}}

\usepackage{filecontents}

\begin{filecontents}{ref.bib} @InCollection{eaton2016, author = {A. W. Eaton}, date = {2016}, title = {Taste in Bodies and Fat Oppression}, booktitle = {Body Aesthetics}, editor = {Sherri Irvin}, location = {Oxford}, pages = {37--59}, publisher = {Oxford University Press}, crossref = {irvin2016}, } } \end{filecontents}

\addbibresource{ref.bib}

\begin{document} \textcite{eaton2016}

\printbibliography

\end{document}

  • 1
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – samcarter_is_at_topanswers.xyz Oct 05 '23 at 11:39
  • Seemed like a question that didn't require a MWE, but OK, sure. – Quiddity Oct 05 '23 at 13:53
  • Btw: You don't need to load package filecontents. It's part of the kernel. – lukeflo Oct 05 '23 at 15:40
  • @lukeflo ah OK. TBH I never actually use it anyway (separate bib file)---it was just here to make the MWE work. – Quiddity Oct 05 '23 at 18:17

1 Answers1

2

You can use xpatch to patch the incollection driver. There you go:

\documentclass{article}

\usepackage[bibstyle=authoryear, citestyle=authoryear]{biblatex} \usepackage{xpatch}

%deletes colon from in for collections \renewcommand*{\intitlepunct}{% \ifentrytype{incollection} {\addspace} {\addcolon\space}}

%deletes location from books \AtEveryBibitem{\clearlist{location}}

\newbibmacro*{byeditor:in}{% \ifnameundef{editor} {} {\printnames[byeditor]{editor}% \addspace\bibsentence% \mkbibparens{\usebibmacro{editorstrg}}% \clearname{editor}% \printunit{\addcomma\space}}}

\xpatchbibdriver{incollection}{ \usebibmacro{in:}% \usebibmacro{maintitle+booktitle}% \newunit\newblock \usebibmacro{byeditor+others}% }{ \usebibmacro{in:}% \usebibmacro{byeditor:in}% \newunit\newblock \usebibmacro{maintitle+booktitle}% }{}{}

\DeclareFieldFormat[incollection]{pages}{\mkbibparens{#1}}

\renewbibmacro*{chapter+pages}{% \printfield{chapter}% \setunit{\bibpagespunct}% \printfield{eid}% \setunit{\bibpagespunct}% \printfield{pages}% \newunit}

\xpatchbibdriver{incollection}{ \printfield{note}% \newunit\newblock \usebibmacro{publisher+location+date}% \newunit\newblock \usebibmacro{chapter+pages}% }{ \setunit{\addspace} \printfield{pages}% \newunit\newblock \printfield{note}% \newunit\newblock \usebibmacro{publisher+location+date}% }{}{}

\begin{filecontents}[overwrite]{ref.bib} @InCollection{eaton2016, author = {A. W. Eaton}, date = {2016}, title = {Taste in Bodies and Fat Oppression}, booktitle = {Body Aesthetics}, editor = {Sherri Irvin}, location = {Oxford}, pages = {37--59}, publisher = {Oxford University Press}, crossref = {irvin2016}, } \end{filecontents}

\addbibresource{ref.bib}

\begin{document} \textcite{eaton2016}

\printbibliography

\end{document}

The idea of defining a new bibmacro byeditor:in is borrowed from moewes answer here.

Inserting pages directly via \printfield and preceding \setunit (which somehow overwrites the standard \newunit\newblock) is kind of a hack. There surely is a more elegant way to edit the bibmacro which I do not have the leisure to track at the moment.. But for your case this seems to work.

new reference

lukeflo
  • 1,555
  • Good enough for me! Thanks! I'm gradually learning how to do all the fiddling myself, but this one was beyond me. – Quiddity Oct 05 '23 at 18:18
  • Actually, one tweak was necessary: adding [incollection] after the pages bit:

    \DeclareFieldFormat[incollection]{pages}{\mkbibparens{#1}}

    otherwise all page numbers for all entry types end up in parentheses. Why the journal only wants page numbers for one entry type this way, and the others another... only they know.

    – Quiddity Oct 06 '23 at 08:26
  • Thanks, edited. Its easy to overlook such things if you're only working on a MWE with one ref. – lukeflo Oct 06 '23 at 08:59