我从以下代码中借用了这里。
\documentclass{article}
\usepackage{xpatch}
\usepackage[style = authoryear-comp, maxnames = 99]{biblatex}
\renewcommand*{\finalnamedelim}{\addspace\&\space}
\renewcommand*{\intitlepunct}{\space}
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1}
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@incollection{lennon1965,
author = {John Lennon},
booktitle = {A book with articles},
editor = {Paul McCartney and John Lennon and George Harrison and Richard Starkey},
title = {This is my article in this book},
year = {1965},
location = {Liverpool},
pages = {65--87},
publisher = {Cavern Club},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareNameAlias{editorin}{first-last}
\newbibmacro*{byeditor:in}{%
\ifnameundef{editor}
{}
{\printnames[editorin]{editor}%
\addspace\bibsentence%
\mkbibparens{\usebibmacro{editorstrg}}%
\clearname{editor}%
\printunit{\addcomma\space}}}
\xpatchbibdriver{inbook}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{byeditor:in}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
\xpatchbibdriver{incollection}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor}}
{}{}
\xpatchbibdriver{inproceedings}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{\usebibmacro{in:}%
\usebibmacro{byeditor:in}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}}
{}{}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
它给出以下输出:
而我需要的是:
列侬,约翰 (1965)。这是我在这本书中的文章。第 65-87 页。保罗·麦卡特尼、约翰·列侬、乔治·哈里森和理查德·斯塔基 (编辑),一本有文章的书. 利物浦:洞穴俱乐部。
任何帮助都将不胜感激。谢谢
答案1
由于你已经在使用,xpatch
你可以继续进一步修补驱动程序
\xpatchbibdriver{incollection}
{\usebibmacro{chapter+pages}}
{}
{}{}
\xpatchbibdriver{incollection}
{\usebibmacro{byauthor}}
{\usebibmacro{byauthor}\newunit\newblock\usebibmacro{chapter+pages}}
{}{}
\xpatchbibdriver{inbook}
{\usebibmacro{chapter+pages}}
{}
{}{}
\xpatchbibdriver{inbook}
{\usebibmacro{byauthor}}
{\usebibmacro{byauthor}\newunit\newblock\usebibmacro{chapter+pages}}
{}{}
\xpatchbibdriver{inproceedings}
{\usebibmacro{chapter+pages}}
{}
{}{}
\xpatchbibdriver{inproceedings}
{\usebibmacro{byauthor}}
{\usebibmacro{byauthor}\newunit\newblock\usebibmacro{chapter+pages}}
{}{}
你还需要
\DeclareFieldFormat[article, unpublished]{pages}{#1}
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace\midsentence}}
对于页面格式,而不是
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1}
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}}