![biblatex 中特定条目类型的排序方案](https://linux22.com/image/275164/biblatex%20%E4%B8%AD%E7%89%B9%E5%AE%9A%E6%9D%A1%E7%9B%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E6%8E%92%E5%BA%8F%E6%96%B9%E6%A1%88.png)
我正在使用nty
排序方案,但我需要@proceedings
和条目按之前和之前进行@inproceedings
排序。顺序应该是→ → → → →eventtitle
booktitle
@inproceedings
title
@proceedings
author
title
eventtitle
number
booktitle
date/year
(这是因为我必须在条目中将eventtitle
s放在booktitle
s前面@[in]proceedings
)
我设法用 实现了一些目标\DeclareSortingScheme
,但它会干扰其他条目类型(例如匿名文章)的排序。
不工作的 MWE
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@proceedings{A,
eventtitle = {Symposium of Given Field},
number = {2},
venue = {London},
title = {Annals of the Second Symposium of Given Field},
date = {2000},
location = {London},
publisher = {Publisher},
}
@proceedings{B,
eventtitle = {Congress of Another Field},
number = {10},
venue = {Paris},
title = {Proceeding of the 10\textsuperscript{th} Congress of Another Field},
date = {2013},
}
@article{C,
title = {The anonymous article},
journal = {Journal},
date = {2013-09-10},
}
\end{filecontents}
\usepackage[style=authortitle,sorting=nyt,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSortingScheme{mysort}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
% \field{sorttitle}
% \field{title}
}
\sort{
\field{eventtitle}
\field{number}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}
}
}
\begin{document}
\nocite{*}
\printbibliography[sorting=nyt,title={\texttt{nyt}-sorted Bibliography}]
\printbibliography[sorting=mysort,title={\texttt{mysort}-sorted Bibliography}]
\end{document}
答案1
我不确定这是否是你想要实现的:
MWE(我只是稍微改变了一下你的自定义排序方案)
\documentclass{article}
\begin{filecontents}{\jobname.bib}
@proceedings{A,
eventtitle = {Symposium of Given Field},
number = {2},
venue = {London},
title = {Annals of the Second Symposium of Given Field},
date = {2000},
location = {London},
publisher = {Publisher},
}
@proceedings{B,
eventtitle = {Congress of Another Field},
number = {10},
venue = {Paris},
title = {Proceeding of the 10\textsuperscript{th} Congress of Another Field},
date = {2013},
}
@article{C,
title = {The anonymous article},
journal = {Journal},
date = {2013-09-10},
}
\end{filecontents}
\usepackage[style=authortitle,sorting=nyt,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSortingScheme{mysort}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{eventtitle}
\field{number}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}
}
}
\begin{document}
\nocite{*}
\printbibliography[sorting=nyt,title={\texttt{nyt}-sorted Bibliography}]
\printbibliography[sorting=mysort,title={\texttt{mysort}-sorted Bibliography}]
\end{document}