biblatex で \cites コマンドを使用して引用を並べ替えるとエラーが発生する

biblatex で \cites コマンドを使用して引用を並べ替えるとエラーが発生する

\citesbiblatexのコマンドを使用して引用を並べ替えるbiblatex の \cites コマンドを使用して引用を並べ替える正常に動作していましたが、TexLive 2016 では動作しなくなりました。

Error produced with the minimal example of the above link:
! Undefined control sequence.
<argument> \cbx@sortkeys 

l.49 ...mpanion}{ctan}{markey}[10--11]{vangennep} \\

これは、初めて biber を実行したときに間違ったエラー メッセージが表示されるだけではありません。意図したソート\Citesおよび\citesコマンドの出力はありません。

新しい TexLive 2016 のコードを調整する方法を知っている人はいますか?

答え1

私も同じ問題を抱えていたので、古いファイルと新しいbiblatex.styファイル、関連ファイルを検索しました。

{\global\letcs{\cbx@sortkeys}
     {blx@slists@\the\c@refsection @entry@\blx@sorting}}% Biber

オードレーの解決策(biblatex の \cites コマンドを使用して引用を並べ替える) の由来です。ここで使用されている引数の一部は定義されていないため、実際の biblatex では機能しません。これらの行を実際の biblatex にある定義に置き換える必要がありました。

{\global\letcs{\cbx@sortkeys}
    {blx@slist@centry@\the\c@refsection @\blx@refcontext@context}}% Biber

これはまだ、biblatex の深い内部構造を使用する最もクリーンなソリューションではありませんが、私にとってはうまく機能します...

これが MWE です。これは、Audrey の素晴らしい回答にある MWE のパッチです (したがって、クレジットは依然として彼に帰属します)。

\documentclass{article}
\usepackage[style=authortitle,sorting=ynt,sortcites]{biblatex}

\makeatletter
% original definition of \cites
\DeclareMultiCiteCommand{\cbx@cites}{\cite}{\multicitedelim}

% new definition
\DeclareMultiCiteCommand{\cites}[\cbx@cite@wrapper\cbx@cites]{\cbx@cite}{}

% first pass saves keys, prenotes, postnotes
\DeclareCiteCommand{\cbx@cite}
  {\csxdef{prenote:\thefield{entrykey}}{\thefield{prenote}}}
  {\listxadd\cbx@savekeys{\thefield{entrykey}}}
  {}
  {\csxdef{postnote:\thefield{entrykey}}{\thefield{postnote}}}

% second pass outputs sorted citation list
\newrobustcmd{\cbx@cite@wrapper}[2]{%
  \def\cbx@savekeys{}%
  \def\cbx@citecall{#1}%
  #2\cbx@sortkeysinit\cbx@citesort\cbx@citecall}

% internal list of saved keys => sorted argument list
\def\cbx@citesort{%
  \def\do##1{%
    \ifinlist{##1}{\cbx@savekeys}
       {\protected@xappto\cbx@citecall{%
          [\csuse{prenote:##1}][\csuse{postnote:##1}]{##1}}}
       {}}%
  \dolistloop{\cbx@sortkeys}}

% internal list of sorted entry keys [patched to the original answer, new biblatex!]
\def\cbx@sortkeysinit{%
  \ifcsundef{blx@slist@centry@\the\c@refsection @\blx@refcontext@context}
    {}
    {\global\letcs{\cbx@sortkeys}{blx@slist@centry@\the\c@refsection @\blx@refcontext@context}}}
\def\cbx@sortkeys{}
\makeatother

\addbibresource{biblatex-examples.bib}
\newcommand{\cmd}[1]{\textbackslash\texttt{#1}}
\setlength{\parindent}{0pt}
\begin{document}
\cmd{cite}: \cite{companion,ctan,vangennep,markey} \\
\cmd{cites}: \cites[e.g.][10]{companion}{ctan}{markey}[10--11]{vangennep} \\
\cmd{Cites}: \Cites{ctan}{markey}[e.g.][5--10]{companion}[10--11]{vangennep}
\printbibliography
\end{document}

関連情報