我正在使用 biblatex 来格式化我的参考文献,并且我想按照以下格式进行格式化
<LastName> <FirstNameInitial>, <LastName> <FirstNameInitial>
等等。为了删除首字母后的标准点/句号,我尝试使用 修改 biblatex 的 authortitle 中的姓氏名字分隔符
这里的问题是,它只按照所需的标准格式化了第一作者。下面给出了一个最小工作示例(从上面的问题中复制)。我几乎可以肯定,这是链接问题中给出的答案的一小部分需要更改,但我的 biblatex 编码技能很低。上面链接的问题中显示了输出代码的图片,但我无法在此处发布它。
\RequirePackage{filecontents}
\begin{filecontents}{sample.bib}
@ARTICLE{liu:11,
author = {Peter Fox and Richard Rabbit and Franc Bird},
title = {Animals are the better humans},
journal = {Horse and Hound},
year = {2011},
volume = {10},
pages = {11--15}
}
\end{filecontents}
\documentclass[a4paper,ngerman]{scrartcl}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[style=authortitle,firstinits=true]{biblatex}
\makeatletter
\def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@i#1..\@nil}
\def\mkbibnamefirst@i#1.#2.#3\@nil{#1}
\renewbibmacro*{name:last-first}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}{}{%
\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}}%
\ifpunctmark{'}{}{\addhighpenspace}}%
\mkbibnamelast{#1}\isdot
\ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%
\ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#2}}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
\ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%
% \ifblank{#2#3}{}{\addcomma}%
\ifblank{#2}{}{\addlowpenspace\MKbibnamefirst{#2}}%
% \ifblank{#3}{}{\addlowpenspace\mkbibnameprefix{#3}\isdot}
}}
\makeatother
\bibliography{sample}
\begin{document}
Samplecite~\cite{liu:11}.
\printbibliography
\end{document}
答案1
正如奥黛丽 (Audrey) 在评论中指出的那样,人们应该通过设置terseinits=true
和调整\DeclareNameAlias
名称排序顺序来修改 OP 评论中链接的解决方案。
\documentclass{article}
\usepackage[style=authortitle,firstinits=true,terseinits=true]{biblatex}
\makeatletter
\renewbibmacro*{name:last-first}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifblank{#3}{}{%
\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
\ifpunctmark{'}{}{\bibnamedelimc}}%
\mkbibnamelast{#1}\isdot
\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
% \ifblank{#2}{}{\addcomma\bibnamedelimd\mkbibnamefirst{#2}\isdot}}% DELETED
\ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}}% NEW
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
% \ifblank{#2#3}{}{\addcomma}% DELETED
\ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}%
\ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}
\makeatother
\DeclareNameAlias{sortname}{last-first}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{liu:11,
author = {Peter Fox and Richard Rabbit and Franc Bird},
title = {Animals are the better humans},
journal = {Horse and Hound},
year = {2011},
volume = {10},
pages = {11--15}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}