我是 的新手biblatex
,想要完成以下任务:
通常显示为以下形式的参考:
Blastname N.、Alastname N. 和 Clastname N.,文章标题,Journal of Something,第 5-15 页,2012 年
我想重新定义显示如下:
文章标题,包含 Alastname N. 和 Blastname N.,Journal of Something,第 5-15 页,2012 年
(即,始终清除作者 Clastname N。)
答案1
使用biber
作为后端,您可以将从中获得的合著者列表映射author
到自定义字段。这可以通过(和 biblatex 2+)或通过文件namea
在文档序言中提供的源映射功能完成。以下是前一种方法的一个简单示例,该方法利用包中的命令来修改参考书目样式。\DeclareSourcemap
biber.conf
xpatch
\documentclass{article}
\usepackage[backend=biber,style=authortitle,firstinits,uniquename=init]{biblatex}
\usepackage{xpatch}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=author, match={Doe, John}, final]
\step[fieldset=namea, origfieldval]
\step[fieldsource=namea, match={and Doe, John}, replace={}]
\step[fieldsource=namea, match={Doe, John and}, replace={}]
}
}
}
\xpretobibmacro{author}{\ifnameundef{namea}{}{\clearname{author}}}{}{}
\xapptobibmacro{title}
{\ifboolexpr{
not test {\ifnameundef{namea}}
and
test {\ifnumgreater{\value{labelname}}{1}}
}
{\setunit{\addcomma\space with\addcolon\addspace}%
\printnames[last-first]{namea}}
{}}{}{}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{first,
author = {Doe, John and Brown, Anne and Smith, Jane},
title = {First author title},
journaltitle = {Journal title},
date = {2006}}
@Book{second,
author = {Brown, Anne and Doe, John and Smith, Jane},
editor = {Doe, Ed},
title = {Second author title},
date = {2009}}
@Book{last,
author = {Brown, Anne and Smith, Jane and Doe, John},
title = {Last author title},
date = {2010}}
@Article{only,
author = {Doe, John},
title = {Sole author title},
journaltitle = {Journal title},
date = {2006}}
@Book{none,
author = {Brown, Anne and Doe, Jane},
title = {No authorship title},
date = {2010}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
请注意,原始作者列表顺序将保留。若要强制执行其他顺序,您可以放弃源映射并namea
手动创建列表。
答案2
最好使用byauthor
宏而不是修补title
。对于简历中的简单使用(当所有参考书目项目都包括 John Doe 作为合著者时),以下代码就xpatch
足够了:
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=author, fieldset=namea, origfieldval]
\step[fieldsource=namea, match={and Doe, John}, replace={}]
\step[fieldsource=namea, match={Doe, John and}, replace={}]
\step[fieldsource=namea, match={Doe, John}, replace={}]
}}}
\renewbibmacro{author}{}
\renewbibmacro{translator+others}{}
\renewbibmacro{byauthor}{%
\ifnameundef{namea}{}
{\setunit{\addcomma\space with\addspace}%
\printnames{namea}}}
该软件包提供了更全面的 CV 解决方案biblatex-publist