![仅为编辑器启用 biblatex 中的“firstinits”](https://linux22.com/image/289231/%E4%BB%85%E4%B8%BA%E7%BC%96%E8%BE%91%E5%99%A8%E5%90%AF%E7%94%A8%20biblatex%20%E4%B8%AD%E7%9A%84%E2%80%9Cfirstinits%E2%80%9D.png)
biblatex
有一个选项firstinits
,可以在参考书目中缩写名字和中间名。有没有办法将此行为editor
仅限于该字段,以便它不会缩写author
字段中的名字?
在下面的例子中,作者应该显示为Lennon, John
,但编辑应该显示为P. McCartney, J. Lennon, G. Harrison, and R. Starkey
。
\documentclass{article}
\usepackage[style = authoryear-comp, maxnames = 99]{biblatex}
\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}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
那里使用的名称格式是byeditor
,所以只需使用
\DeclareNameAlias{byeditor}{first-last-inits}
\DeclareNameFormat{first-last-inits}{%
\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}%
\usebibmacro{name:andothers}}
平均能量损失
\documentclass{article}
\usepackage[style = authoryear-comp, maxnames = 99]{biblatex}
\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{byeditor}{first-last-inits}
\DeclareNameFormat{first-last-inits}{%
\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}%
\usebibmacro{name:andothers}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}