biblatex 参考编号与不同排序的子书目不匹配

biblatex 参考编号与不同排序的子书目不匹配

我想在主书目后添加一个子书目,并附上相应的数字参考。主书目应按出现顺序排序,sorting=none而子书目必须按 排序sorting=ydnt。参考的顺序没问题,但我无法使数字标签匹配,内联标签也取自子书目。我的错误在哪里?

我正在将 texlive2022 与 biblatex v3.18 和 biber v2.18 一起使用。

\documentclass{article}
\usepackage[%
backend=biber,%
style=numeric,%
sorting=none,%
defernumbers=true,%
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
    @book{A2000,
        keywords={own},
        author = {Author, A.},
        year = {2000},
        title = {Titel A},
        publisher = {Publisher},
    }
    @book{B1900,
        author = {Boathor, B.},
        year = {1900},
        title = {Titel B},
        publisher = {Publisher},
    }
    
    @book{C1950,
        keywords={own},
        author = {Coathor, C.},
        year = {1950},
        title = {Titel C},
        publisher = {Publisher},   
    } 
}
\end{filecontents}

\begin{document}
This is the first ref \cite{A2000}, and the second \cite{B1900} and the third \cite{C1950}.

\printbibliography[]
\newrefcontext[sorting=ydnt]
\printbibliography[keyword=own,heading=subbibliography,title={My Publications}]
\endrefcontext

\end{document}

在此处输入图片描述

答案1

您应该能够使用以下方法https://tex.stackexchange.com/a/663183/35864我们在本地恢复外部引用上下文里面參考文獻。

\documentclass{article}
\usepackage[%
  backend=biber,%
  style=numeric,%
  sorting=none,%
  defernumbers=true,%
]{biblatex}

\begin{filecontents}{\jobname.bib}
@book{A2000,
  keywords  = {own},
  author    = {Author, A.},
  year      = {2000},
  title     = {Titel A},
  publisher = {Publisher},
}
@book{B1900,
  author    = {Boathor, B.},
  year      = {1900},
  title     = {Titel B},
  publisher = {Publisher},
}
@book{C1950,
  keywords  = {own},
  author    = {Coathor, C.},
  year      = {1950},
  title     = {Titel C},
  publisher = {Publisher},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
This is the first ref \cite{A2000}, and the second \cite{B1900} and the third \cite{C1950}.

\printbibliography[]

\csletcs{saved@blx@refcontext@context}{blx@refcontext@context}
\newrefcontext[sorting=ydnt]
\makeatletter
\AtNextBibliography{%
  \def\blx@setdefaultrefcontext#1{}%
  \csletcs{blx@refcontext@context}{saved@blx@refcontext@context}}
\makeatother
\printbibliography[keyword=own,heading=subbibliography,title={My Publications}]
\endrefcontext
\end{document}

相关内容