![如何删除 BibTeX 中姓氏前的“,和”?](https://linux22.com/image/431497/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%20BibTeX%20%E4%B8%AD%E5%A7%93%E6%B0%8F%E5%89%8D%E7%9A%84%E2%80%9C%EF%BC%8C%E5%92%8C%E2%80%9D%EF%BC%9F.png)
我正在使用 BibTeX 和参考书目样式 alpha。我的一个参考书目条目有多达 7 位作者。我想将他们全部列在参考书目中。我制作了以下 bibtex 条目:
@Book{Gemoll,
title = {Gemoll, griechisch-deutsches Schul- und Handwörterbuch},
publisher = {Oldenbourg},
year = {2019},
author = {Therese Aigner and Josef Bedrac and Renate Oswald and Jörg Schönbacher and Clemens Schuster and Rudolf Wachter and Franz Winter},
}
我希望参考书目中没有“and”,名称之间只用逗号分隔。有人能帮我实现吗?
以下是 MWE:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman, greek]{babel}
\usepackage{hyperref}
\usepackage[a4paper, width=160mm,top=20mm,bottom=20mm, bindingoffset=6mm]{geometry}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\begin{document} \selectlanguage{ngerman}
\cite{Gemoll}
\bibliography{Biblio_UE}
\bibliographystyle{alpha}
\end{document}
答案1
bst
文件是相当硬编码的,所以唯一的办法bibtex
就是复制alpha.bst
,更改名称,然后进行编辑。
在我的系统上,命令
> kpsewhich alpha.bst
返回
/usr/share/texmf/bibtex/bst/base/alpha.bst
现在将此文件复制到当前工作目录或本地texmf
树中,将其名称更改为例如alpha-noand.bst
,并查找出现的次数" and "
(在我的情况下为作者的第 203 行),然后将其更改为" "
。
放在上下文中,这发生在函数的定义中format.names
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * }
'skip$
if$
t "others" =
{ " et~al." * }
(现在是编辑后的行 - 在编辑之前它是{ " and " * t * }
)
{ " " * t * }
(其余保持不变)
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
然后当然使用
\bibliographystyle{alpha-noand}
在您的文档中。
完整示例:
\begin{filecontents*}{Biblio_UE.bib}
@Book{Gemoll,
title = {Gemoll, griechisch-deutsches Schul- und Handwörterbuch},
publisher = {Oldenbourg},
year = {2019},
author = {Therese Aigner and Josef Bedrac and Renate Oswald and Jörg Schönbacher and Clemens Schuster and Rudolf Wachter and Franz Winter},
}
\end{filecontents*}
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman, greek]{babel}
\usepackage{hyperref}
\usepackage[a4paper, width=160mm,top=20mm,bottom=20mm, bindingoffset=6mm]{geometry}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
\begin{document} \selectlanguage{ngerman}
\cite{Gemoll}
\bibliography{Biblio_UE}
\bibliographystyle{alpha-noand}
\end{document}
答案2
尝试使用 biblatex (biber) 代替 bibtex。这有效(我运行了 pdflatex <filename.tex> 2 次,然后运行了 biblatex,然后又运行了 pdflatex 2 次)。
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman, greek]{babel}
\usepackage{hyperref}
\usepackage[a4paper, width=160mm,top=20mm,bottom=20mm, bindingoffset=6mm]{geometry}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}
%Using biblatex (biber) instead of bibtex
\usepackage[backend=biber, citestyle=numeric, maxbibnames=99]{biblatex}
\addbibresource{Biblio_UE.bib}
\renewcommand*{\finalnamedelim}{\addcomma\addspace}
\addbibresource{\jobname.bib}
\begin{document} \selectlanguage{ngerman}
\cite{Gemoll}
%Disabled because now using biblatex
%\bibliography{Biblio_UE}
%\bibliographystyle{alpha}
\printbibliography
\end{document}
灵感来自Mico,#193388