alphabetic
在 biblatex 中为样式生成引用标签时,如何使用出版物中的组织来替代作者或编辑?
我知道我可以使用该label
字段手动分配标签,但自动解决方案就更好了。
梅威瑟:
\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
of中使用它\DeclareLabelalphaTemplate
。