使用以下代码
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\adddot\nopunct\isdot}
我可以删除标题周围的标点符号,并以点结束字段。但是,扩展这个想法以尝试在作者列表和年份之间插入逗号没有效果,即:
\DeclareFieldFormat
[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]
{author}{#1\addcomma\isdot}
如能得到任何帮助我将非常感激。
梅威瑟:
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[a4paper,twoside]{memoir}
% Unix options
\isopage
\usepackage{xpatch,etex,setspace,excludeonly,ifthen,etoolbox,logreq,makeidx,cals,graphicx}
\usepackage[english]{babel}
\usepackage[style=british]{csquotes}
\usepackage[style=philosophy-classic,firstinits=true,uniquename=init,natbib=true,backend=biber,indexing=true,defernumbers=true]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\addbibresource{thesis.bib}
% Bibliography customisation
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{#1\adddot\nopunct\isdot}
\DeclareFieldFormat
[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]
{author}{#1\addcomma\isdot}
\renewbibmacro{in:}{%
\printtext{\bibstring{In}\addcolon\space}%
}
% Remove parentheses from year
\renewbibmacro*{date+extrayear}{%
\begingroup%
\clearfield{month}%
\clearfield{day}%
\ifboolexpr{%
test {\iffieldundef{date}}
and
test {\iffieldundef{year}}
}%
{\iftoggle{bbx:nodate}{\printtext{%
\midsentence\bibstring{nodate}}}{}}%
{\printtext{\printdateextra}}%
\endgroup}%
% Dot after year
\renewcommand{\labelnamepunct}{\adddot\space}
% Put number in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
% \setunit*{\adddot}% DELETED
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\begin{document}
\printbibliography
\end{document}
答案1
该方法不能直接工作。作者的类型不是,field
而是list
姓名。的格式author
由控制\DeclareNameFormat
。此指令依次格式化列表中的每个姓名。因此,它需要更复杂的定义,您可以在姓名列表中的最后一个元素上使用技巧。这是一个简化的定义
\DeclareNameFormat{author}{%
\ifnumequal{\value{listcount}}{1}
{\ifnumequal{\value{liststop}}{1}
{#1\addcomma\addspace #4\addcomma\isdot}
{#1\addcomma\addspace #4}}
{\ifnumless{\value{listcount}}{\value{liststop}}
{\addcomma\addspace #1\addcomma\addspace #4}
{\addcomma\addspace\bibstring{and} #1\addcomma\addspace #4\addcomma\isdot}%
}%
}