我使用biblatex
+biber
进行一些自定义排序。特别是,我希望当前文档的参考书目样式非常简练,因为它的页数非常有限——基本上是一份拨款提案。我已经能够设置我想要的字段并按照我想要的顺序排列。但我不知道如何做两件事。
- 删除首字母:我希望它
Anonymous Person
不要显示为,而是简单地显示为。A. Person
Person
- 去掉
and
连词。我想Smith and Thomas
成为Smith, Thomas
。
我使用giveninits=true
作为一个可选参数,它会导致Anonymous
简化为A.
。我猜需要对此进行一些调整才能解决1.
。一个非常 hacky 的方法\renewcommand{\mkbibnamegiven}[1]{}
是删除首字母,然而它确实用一个空格替换了它们。我想我可以通过进一步破解来删除一个空格。2.
但这似乎不是解决问题的正确方法。
我已经在 SE 上查看过,并且通过我们的朋友biblatex 文档,但无济于事。这似乎是
\renewbibmacro{author}{%
\usebibmacro{name:family}
}
应该可以。但实际上不行。我收到“错误:参考书目宏‘\isdot’未定义”且未打印任何名称。
我包括最小我敢说我会尝试 MWE---我不想冒险删除可能产生影响的更多自定义命令。
\documentclass[]{article}
\usepackage[doi=false,isbn=false,url=false,
hyperref=auto,
sorting=nyt,
maxnames=10,
maxcitenames=4,
backend=biber,
texencoding=auto,
giveninits=true,
block=space,
style = numeric,
% style = alphabetic,
% style = authoryear-comp,
% citestyle = authoryear-comp
]{biblatex}
\DeclareNameAlias{sortname}{labelname}
\DeclareDelimFormat{finalnamedelim}{\addcomma\space} % works on biblatex 3.7
%\DeclareDelimAlias{finalnamedelim}{multinamedelim} % doesn't work on 3.7
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{{#1\isdot}}
\DeclareFieldFormat
[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished, online]
{date}{\mkbibparens{#1}}
\DeclareFieldFormat
[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]
{volume}{\mkbibbold{#1}}
\DeclareFieldFormat
% [article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]
{pages}{\mkbibparens{#1}}
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\addspace}%
\usebibmacro{date}%
\newunit\newblock
\usebibmacro{title}%
\usebibmacro{finentry}%
}
\usepackage{filecontents}
\begin{filecontents}{foo.bib}
@article{paper,
author = {Me, Andrew and Myself, Bethany and I, Charlie},
title = {BREAKTHROUGH MATHS},
year = {2025}
}
\end{filecontents}
\addbibresource{foo.bib}
\begin{document}
Citation: \cite{paper}
\printbibliography
\end{document}
答案1
删除首字母(针对标准样式):
\DeclareNameAlias{sortname}{labelname}
删除作者之间的“和”:
\DeclareDelimFormat{finalnamedelim}{\addcomma\space}
感谢@moewe(参见下面的评论),提供了一个更好的解决方案:
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
这是一个最小的工作示例:
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\DeclareNameAlias{sortname}{labelname}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}%thanks to @moewe
%\DeclareDelimFormat{finalnamedelim}{\addcomma\space}
\begin{document}
\nocite{*}
\printbibliography[title=Collections,type=collection]
\printbibliography[title=Books,type=book]
\printbibliography[title=Articles,type=article]
\printbibliography[title=Articles,type=article]
\printbibliography[title=Incollections,type=incollection]
\end{document}