我在参考书目中遇到了标签名称问题。我调整了作者年份样式,以便在参考文献开头显示标签名称和标签年份。我想显示最多两个作者姓名(姓氏)。如果作者姓名超过两个,则应显示第一个作者姓名并添加“et al.” 。也许它应该是一个计数器,如 maxlabelnames=2... 目前,标签名称仅在一个作者姓名后被截断。
\documentclass{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[style=authoryear, maxcitenames=2, firstinits=true, uniquename=init, backend=biber]{biblatex}
\usepackage{filecontents}
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}
\renewcommand*{\finalnamedelim}{\addsemicolon\space}
\renewcommand{\labelnamepunct}{\addcolon\space}
\DeclareFieldFormat{title}{#1\isdot}
\DeclareNameFormat{sortname}{
\iffirstinits
{\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}%
\usebibmacro{name:andothers}}
\renewbibmacro{begentry}{%
\textbf{\printnames[][-\value{liststop}]{labelname}~
\printfield{labelyear}%
\printfield{extrayear}}\\}
}
\DefineBibliographyStrings{ngerman}{andothers={et\ al\adddot}}
\DefineBibliographyStrings{ngerman}{and={\&}}
\begin{filecontents}{Label.bib}
@book{Bogelsack.1985,
author = {B{\"o}gelsack, G. and Kallenbach, Eberhard and Linnemann, Gerhard},
year = {1985},
title = {Roboter in der Ger{\"a}tetechnik},
address = {Heidelberg},
publisher = {A. H{\"u}thig},
isbn = {3778510428}
}
@book{Warnecke.1990,
author = {Warnecke, H.-J and Schraft, R. D.},
year = {1990},
title = {Industrieroboter: Handbuch f{\"u}r Industrie und Wissenschaft},
address = {Berlin [etc.]},
publisher = {Springer-Verlag},
isbn = {3540509348}
}
\end{filecontents}
\addbibresource{Label.bib}
\begin{document}
Test (\cite{Bogelsack.1985}).
Test 2 (\cite{Warnecke.1990}).
\printbibliography
\end{document}
Bögelsack 项没问题,但 Warnecke 项是错误的。应该是:
Warnecke & Schraft 1990
沃内克,H.-J.; Schraft, RD(1990):工业机器人:工业和科学手册。柏林[等]:Springer-Verlag。国际书号:3540509348。
有人有想法吗?
答案1
一个可能的解决方案是定义一个新的打印姓名规范。
首先我们创建一个计数器来存储名称的数量值(最多应该打印在标签上)。
\newcounter{maxlabelnames}
\setcounter{maxlabelnames}{2}
然后我们定义一种新颖的格式
\DeclareNameFormat{biblabel}{%
\ifthenelse{\value{listtotal}>\themaxlabelnames}
{\ifthenelse{\value{listcount}=1}
{#1 \bibstring{andothers}}
{}%
}
{
\ifthenelse{\value{listcount}=1}
{#1}
{\ifthenelse{\value{listcount}<\value{listtotal}}
{\multinamedelim #1}
{\addspace\bibstring{and}\addspace#1}%
}%
}%
}
begentry
最后在钩子中使用新格式
\renewbibmacro{begentry}{%
\textbf{\printnames[biblabel]{labelname}~%
\printfield{labelyear}%
\printfield{extrayear}}\\}
输出maxlabelnames=2
为
答案2
这是一个解决方案biblatex-ext
的introcite
特征。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[autostyle, german=quotes]{csquotes}
\usepackage[backend=biber,
style=ext-authoryear,
maxcitenames=2, giveninits=true, uniquename=init,
introcite=plain,]{biblatex}
\DeclareFieldFormat{bbx@introcite}{\mkbibbold{#1}}
\renewcommand*{\introcitepunct}{\newline}
\DeclareDelimFormat{finalnamedelim}{\addspace\&\space}
\DeclareDelimFormat[bib]{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias*[bib]{finalnamedelim}{multinamedelim}
\DeclareDelimFormat{nametitledelim}{\addcolon\space}
\DeclareFieldFormat{title}{#1\isdot}
\DeclareNameAlias{sortname}{family-given}
\DefineBibliographyStrings{german}{andothers={et\ al\adddot}}
\begin{filecontents}[force]{\jobname.bib}
@book{Bogelsack.1985,
author = {Bögelsack, G. and Kallenbach, Eberhard and Linnemann, Gerhard},
year = {1985},
title = {Roboter in der Gerätetechnik},
address = {Heidelberg},
publisher = {A. Hüthig},
isbn = {3778510428}
}
@book{Warnecke.1990,
author = {Warnecke, H.-J and Schraft, R. D.},
year = {1990},
title = {Industrieroboter: Handbuch für Industrie und Wissenschaft},
address = {Berlin [etc.]},
publisher = {Springer-Verlag},
isbn = {3540509348},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Test \autocite{Bogelsack.1985}
Test 2 \autocite{Warnecke.1990}.
\printbibliography
\end{document}
答案3
对此的修正是将\renewbibmacro{begentry}
Guido 的替换为以下内容:
\renewbibmacro{begentry}{%
\textbf{\printnames[][-\value{liststop}]{labelname}~
\printfield{labelyear}%
\printfield{extrayear}}
\qquad }