アルファベットスタイルのラベルに著者または編集者がいない場合は、組織を使用します。

アルファベットスタイルのラベルに著者または編集者がいない場合は、組織を使用します。

alphabeticBiblaTex でスタイルの引用ラベルを生成するときに、著者または編集者の代わりに出版物内の組織を使用するにはどうすればよいですか?

labelフィールドを使用してラベルを手動で割り当てることができることはわかっていますが、自動ソリューションがあれば便利です。

MWE:

\documentclass{article}

\usepackage{filecontents}

\usepackage[style=alphabetic,backend=biber]{biblatex}
\bibliography{test}

\begin{filecontents}{test.bib}
@online{Wikipedia2017,
 date = {2016-12-20},
 organization = {Wikipedia},
 title = {Resource contention},
 url = {https://en.wikipedia.org/w/index.php?oldid=755891262},
 urldate = {2017-04-26}
}
@techreport{Volpe2000,
 author = {Volpe, Richard and Nesnas, Issa A. D. and Estlin, Tara and Mutz, Darren and Petras, Richard and Das, Hari},
 date = {2000},
 institution = {Jet Propulsion Laboratory, California Institute of Technology},
 location = {Pasadena, California},
 title = {{CLARAty}: Coupled Layer Architecture for Robotic Autonomy}
}
\end{filecontents}

\begin{document}
This is a test~\autocite{Wikipedia2017}. And this works as expected~\autocite{Volpe2000}.

\printbibliography{}
\end{document}

ここに画像の説明を入力してください

代わりに、次のようなラベルを表示したいと思いますWik16

答え1

試す

\DeclareSourcemap{
  \maps[datatype=bibtex]{
     \map{
       \step[fieldsource=organization, final]
       \step[fieldset=usera, origfieldval]
     }
  }
}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field[strwidth=3,strside=left,ifnames=1]{labelname}
    \field[strwidth=1,strside=left]{labelname}
    \field[strwidth=3]{usera}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}    
  }
}

organizationはリストなので\DeclareLabelalphaTemplate、適切に処理できません。そのため、内容をリストではないフィールドにコピーする必要があります (usera新しいデータモデルを定義する必要はありません)。その後、 で使用でき\labelelementます\DeclareLabelalphaTemplate

関連情報