![Biblatex - Shortauthor 长度问题](https://linux22.com/image/307620/Biblatex%20-%20Shortauthor%20%E9%95%BF%E5%BA%A6%E9%97%AE%E9%A2%98.png)
我在工作中多次引用 Android 开源项目。因此,我多次声明同一个 shortauthor,如下所示:
@ONLINE{online_android_apiguides_services,
TITLE = {Android API Guides - Services},
AUTHOR = {{Android Open Source Project}},
SHORTAUTHOR = {AOSP},
URL = {http://developer.android.com/guide/components/services.html},
URLDATE = {2015-03-12}
}
@ONLINE{online_android_reference_service,
TITLE = {Android Reference - Service},
AUTHOR = {{Android Open Source Project}},
SHORTAUTHOR = {AOSP},
URL = {http://developer.android.com/reference/android/app/Service.html},
URLDATE = {2015-03-12}
}
期望输出为“[AOSPa]”和“[AOSPb]”。但实际输出为“[AOSa]”和“[AOSb]”。
一般来说,我想要 3 个字符的形式(就像当它自动对姓氏执行此操作时一样),但是当我明确声明一个简短的作者时,我不希望它被缩短。
提前致谢!
编辑
我这样声明参考书目:
\usepackage[backend=bibtex8,
style=alphabetic]{biblatex}
\bibliography{mybib}
答案1
您可以使用该label
字段。biblatex
文档称,这label
是“[a] 引用样式用来替代常规标签的指定,如果生成常规标签所需的任何数据缺失”(第 20 页biblatex
文档)。幸运的是,由于alphabetic
的样式label
优先于labelname
,因此它也可以完整使用。
因此
\documentclass{article}
\usepackage[backend=bibtex,
style=alphabetic]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ONLINE{online_android_apiguides_services,
TITLE = {Android API Guides - Services},
AUTHOR = {{Android Open Source Project}},
label = {AOSP},
URL = {http://developer.android.com/guide/components/services.html},
URLDATE = {2015-03-12}
}
@ONLINE{online_android_reference_service,
TITLE = {Android Reference - Service},
AUTHOR = {{Android Open Source Project}},
label = {AOSP},
URL = {http://developer.android.com/reference/android/app/Service.html},
URLDATE = {2015-03-12}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
完全符合您的要求。
如果您使用 Biber,则评论中所建议的方法shorthand
同样有效;但是,使用 BibTeX(8) 则不会消除歧义。
\documentclass{article}
\usepackage[backend=biber,
style=alphabetic]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ONLINE{online_android_apiguides_services,
TITLE = {Android API Guides - Services},
AUTHOR = {{Android Open Source Project}},
shorthand = {AOSP},
URL = {http://developer.android.com/guide/components/services.html},
URLDATE = {2015-03-12}
}
@ONLINE{online_android_reference_service,
TITLE = {Android Reference - Service},
AUTHOR = {{Android Open Source Project}},
shorthand = {AOSP},
URL = {http://developer.android.com/reference/android/app/Service.html},
URLDATE = {2015-03-12}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}