我遵循曼彻斯特哈佛参考文献格式,并试图重新创建其格式。不知何故,我当前的代码不符合我的要求。我对 LaTeX 还很陌生,所以如果有人能帮忙,我将不胜感激。
这是我的演示代码:
\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}
导出的引用如下:
Coxall, H. (1999). “博物馆文本作为媒介信息”。收录于:由 Hooper-Greenhill, E. 编辑。博物馆的教育作用。第二版。伦敦:劳特利奇,第 215-222 页。
Hooper-Greenhill, E. (1999a)。“当代英国的博物馆和文化多样性”。收录于:由 Hooper-Greenhill, E. 编辑。博物馆的教育作用。第二版。伦敦:劳特利奇,第 288-294 页。
Hooper-Greenhill,E.,(编辑)(1999b)。《博物馆的教育作用》。第二版。伦敦:劳特利奇。
我希望条目中的编辑器字段 incollection
(前两个)与条目中的编辑器字段(最后一个)相同collection
。除此之外,我希望编辑器后面跟着一个逗号:
Hooper-Greenhill, E. (1999a)。“当代英国的博物馆和文化多样性”,载于 Hooper-Greenhill, E. (eds.)《博物馆的教育作用》。第 2 版。伦敦:劳特利奇,第 288-294 页。
有什么办法可以解决这个问题吗?如果有人问到这个问题,我很抱歉,但我不知道如何将renewcommands
和macro
命令合并到我的案例中。
仅供参考:以下内容test.bib
包含以下内容。我从 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},
}
答案1
我不会修补in:
bibmacro 以在 之前打印编辑器名称booktitle
。相反,我建议您使用biblatex-ext
的innamebeforetitle
选项。请参阅在 biblatex 中将编辑姓名后跟 (Ed./Eds.) 和标题前的逗号更多细节。
事实上,来自在 biblatex 中将编辑姓名后跟 (Ed./Eds.) 和标题前的逗号已经非常接近您的需要了,我们只需要重新定义innametitledelim
和修改in:
,以便在“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}