![在 biblatex 中操作 sortname 字段](https://linux22.com/image/238480/%E5%9C%A8%20biblatex%20%E4%B8%AD%E6%93%8D%E4%BD%9C%20sortname%20%E5%AD%97%E6%AE%B5.png)
我为某些书目条目提供了选项,以frg
实现与其他条目略有不同的格式。除其他事项外,我希望按编辑者而不是作者对它们进行排序。我的想法是自动将字段复制editor
到sortname
字段以实现此目的,因此我在文件中使用了以下代码bbx
:
\newbool{cbx:frg}
\DeclareEntryOption{frg}[true]{\csuse{bool#1}{cbx:frg}}%
\AtDataInput{%
\ifbool{cbx:frg}{%
\savename*{editor}{\bbx@blah}%
\restorename{sortname}{\bbx@blah}%
}{}%
}%
但这似乎不起作用。
答案1
要忽略author
排序字段(并使用editor
resp.title
代替),只需添加options = {useauthor=false},
到相应的参考书目条目即可。有关详细信息,请参阅 biblatex 手册第 3.3.3.1 节。
\documentclass{article}
\usepackage{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
options = {useauthor=false},
author = {Author, A.},
editor = {Zuthor, Z.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
editor = {Yuthor, Y.},
year = {2002},
title = {Bravo},
}
@misc{C03,
author = {Cuthor, C.},
editor = {Xuthor, X.},
year = {2003},
title = {Charlie},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}