1

I am following the Manchester Harvard referencing style and is trying to recreate its formatting. Somehow my current code isn't following what I've desired. I'm quite new to LaTeX so it'd be greatly appreciated if someone can help.

This is my code for demonstration:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[style=authoryear,backend=biber,maxbibnames=99,giveninits=true,dashed=false]{biblatex} \bibliography{test.bib}

%Last-First name order \DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{default}{family-given} % Put editor string in parentheses \DeclareFieldFormat{editortype}{\mkbibparens{#1}} % Print editors before "in" title \renewbibmacro{in:}{% \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}% \usebibmacro{byeditor+others}% \newunit \clearname{editor}}

\begin{document}

test \cite{Coxall1999} \cite{EducationalRole1999} \cite{HG1999Diversity}

\printbibliography

\end{document}

The exported references are shown as below:

Coxall, H. (1999). “Museum Text as Mediated Message”. In: ed. by Hooper-Greenhill, E. The Educational Role of the Museum. 2nd. London: Routledge, pp. 215–222.

Hooper-Greenhill, E. (1999a). “Museums and Cultural diversity in Contemporary Britain”. In: ed. by Hooper-Greenhill, E. The Educational Role of the Museum. 2nd. London: Routledge, pp. 288–294.

Hooper-Greenhill, E., (ed.) (1999b). The Educational Role of the Museum. 2nd. London: Routledge.

I want the editor fields in the incollection entries (first two) to be the same as the collection one (the last one). On top of that, I want the editor to be followed by a comma:

Hooper-Greenhill, E. (1999a). “Museums and Cultural diversity in Contemporary Britain”, in Hooper-Greenhill, E. (eds.) The Educational Role of the Museum. 2nd. London: Routledge, pp. 288–294.

Is there anyway I can fix this? Apologies if this is asked somehow, but I couldn't figure out how I can incorporate the renewcommands and macro commands into my case.

FYI: the following is what test.bib contains. I exported the entries from Zotero.

@incollection{Coxall1999,
    location = {London},
    edition = {2nd},
    title = {Museum Text as Mediated Message},
    pages = {215--222},
    booktitle = {The Educational Role of the Museum},
    publisher = {Routledge},
    author = {Coxall, Helen},
    editor = {Hooper-Greenhill, Eilean},
    date = {1999},
}

@incollection{HG1999Diversity, location = {London}, edition = {2nd}, title = {Museums and Cultural diversity in Contemporary Britain}, pages = {288--294}, booktitle = {The Educational Role of the Museum}, publisher = {Routledge}, author = {Hooper-Greenhill, Eilean}, editor = {Hooper-Greenhill, Eilean}, date = {1999}, }

@collection{EducationalRole1999, location = {London}, edition = {2nd}, title = {The Educational Role of the Museum}, publisher = {Routledge}, editor = {Hooper-Greenhill, Eilean}, date = {1999}, }

  • Welcome to TeX.SE. – Mico Feb 10 '22 at 07:07
  • Off-topic: Use of \bibliography is somewhat deprecated under biblatex. I'd replace \bibliography{test.bib} with \addbibresource{test.bib}. – Mico Feb 10 '22 at 07:55
  • 1
    @Mico I've just updated, thanks for the suggestion. I stuck with \bibliography cuz \addbibresource somehow used to crash my entire PDF rendering. It's not happening anymore so I'll convert back to \addbibresource. – madguy224488 Feb 11 '22 at 03:20

1 Answers1

1

I would not patch into the in: bibmacro to print the editor name before the booktitle. Instead I suggest you use biblatex-ext's innamebeforetitle option. See Move names of editors followed by (Ed./Eds.) and a comma before title in biblatex for more details.

In fact the MWE from Move names of editors followed by (Ed./Eds.) and a comma before title in biblatex already comes pretty close to what you need, we just need to redefine innametitledelim and modify in: so that we get a comma before the "in".

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[ backend=biber, style=ext-authoryear, maxbibnames=99, giveninits=true, innamebeforetitle=true, dashed=false, ]{biblatex}

\DeclareNameAlias{sortname}{family-given} \DeclareNameAlias{default}{family-given}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}} \DeclareDelimFormat{editortypedelim}{\addspace}

\DeclareFieldAlias{translatortype}{editortype} \DeclareDelimAlias{translatortypedelim}{editortypedelim}

\renewbibmacro*{in:}{% \setunit{\addcomma\space}% \bibstring{in}% \printunit{\intitlepunct}}

\DeclareDelimFormat[bib]{innametitledelim}{\addspace}

\begin{filecontents}[force]{\jobname.bib} @incollection{Coxall1999, title = {Museum Text as Mediated Message}, pages = {215--222}, author = {Coxall, Helen}, crossref = {EducationalRole1999}, } @incollection{HG1999Diversity, title = {Museums and Cultural diversity in Contemporary {Britain}}, pages = {288--294}, author = {Hooper-Greenhill, Eilean}, crossref = {EducationalRole1999}, } @collection{EducationalRole1999, location = {London}, edition = {2}, title = {The Educational Role of the Museum}, publisher = {Routledge}, editor = {Hooper-Greenhill, Eilean}, date = {1999}, } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document}

test \cite{Coxall1999} \cite{EducationalRole1999} \cite{HG1999Diversity}

\printbibliography

\end{document}

Hooper-Greenhill, E. (1999a). “Museums and Cultural diversity in Contemporary Britain”, in: Hooper-Greenhill, E. (ed.) The Educational Role of the Museum. 2nd ed. London: Routledge, pp. 288–294.

moewe
  • 175,683