使用字母样式更改 biblatex 中自动派生的 citekey

使用字母样式更改 biblatex 中自动派生的 citekey

我想biblatex在使用样式时更改自动生成的引用密钥alphabetic。到目前为止,我只知道通过字段的可能性shorthand。但我想让引用密钥自动从作者姓氏和年份中派生出来。如果有两位作者,则应为姓氏 1 和姓氏 2 以及年份。如果有两位以上的作者,则应为姓氏 1 等和年份。例如,是否有可能在 bibitem 中处理年份和姓氏(例如 `bibauthorlastname`),并执行类似

@article{articleA,
title={This is a long title of article A},
author={Albert Einstein},
journal={Some scienece journal},
volume={1},
number={4},
pages={42--125},
year=1950,
publisher={Hellsevier}, 
shorthand = {\bibauthorlastname \bibyear}
}

或者我必须以完全不同的方式来处理这个问题?

这是一个 MWE,其中 citekey 条目的格式应如此(但不是自动的)。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
\usepackage{filecontents}
\usepackage[                        
    backend=biber,                  
    bibencoding=utf8,               
    style=alphabetic        
]{biblatex}

\begin{filecontents*}{\jobname.bib}
@article{articleA,
title={This is a long title of article A},
author={Albert Einstein},
journal={Some scienece journal},
volume={1},
number={4},
pages={42--125},
year=1950,
publisher={Hellsevier}, 
shorthand = {Einstein 1950}
}

@article{articleB,
title={This is a long title of article B},
author={Ludwig Boltzmann and Erwin Schrödinger},
journal={Another science journal},
volume={42},
number={1},
pages={43--49},
year=1970,
publisher={Hellsevier},
shorthand = {Boltzmann and Schrödinger 1970}
}

@article{articleC,
title={This is a long title of article C},
author={Ludwig Boltzmann and Erwin Schrödinger and Werner Heisenberg},
journal={Another science journal},
volume={4},
number={1},
pages={10--50},
year=1980,
publisher={Hellsevier}, 
shorthand = {Boltzmann et al. 1980}
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\begin{document}
This is a test for citation \cite{articleA}. And here is another test \cite{articleB} and also \cite{articleC}.
\printbibliography
\end{document}

在此处输入图片描述

答案1

您所描述的风格是作者年份风格,因此以它为基础似乎style=authoryear比 更为直接style=alphabetic

如果你想保留引用的方括号和参考书目中引用标签的重复,我建议你看看biblatex-extext-authoryear风格。它的引文分隔符功能可以轻松获得方括号,而不是通常的圆括号(带有\DeclareOuterCiteDelims),它的introcite选项可以轻松在参考书目中重复引文标签。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ngerman]{babel}
\usepackage{csquotes}

\usepackage[
  backend=biber,
  style=ext-authoryear,
  maxcitenames=2, mincitenames=1,
  uniquelist=false,
  maxbibnames=999,
  introcite=label,
]{biblatex}

\DefineBibliographyStrings{german}{
  andothers = {et\addabbrvspace al\adddot},
}

\DeclareOuterCiteDelims{parencite}{\bibopenbracket}{\bibclosebracket}
\DeclareFieldFormat{bbx@introcite}{\mkbibbrackets{#1}}

\begin{filecontents*}{\jobname.bib}
@article{articleA,
  title     = {This is a long title of article A},
  author    = {Albert Einstein},
  journal   = {Some Science Journal},
  volume    = {1},
  number    = {4},
  pages     = {42--125},
  year      = 1950,
}
@article{articleB,
  title   = {This is a long title of article B},
  author  = {Ludwig Boltzmann and Erwin Schrödinger},
  journal = {Another Science Journal},
  volume  = {42},
  number  = {1},
  pages   = {43--49},
  year    = 1970,
}
@article{articleC,
  title   = {This is a long title of article C},
  author  = {Ludwig Boltzmann and Erwin Schrödinger and Werner Heisenberg},
  journal = {Another Science Journal},
  volume  = {4},
  number  = {1},
  pages   = {10--50},
  year    = 1980,
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
This is a test for citation \autocite{articleA}.
And here is another test \autocite{articleB}
and also \autocite{articleC}.

\printbibliography
\end{document}

这是引文测试 [Einstein 1950]。这是另一个测试 [Boltzmann und Schrödinger 1970] 以及 [Boltzmann et al. 1980]。

相关内容