parenciteauthor コマンドを作成しようとすると、skipbib と skipbiblist の動作が異なります

parenciteauthor コマンドを作成しようとすると、skipbib と skipbiblist の動作が異なります

私の目標は、複数のソースを (日付なし) で引用しshortauthor、引用を括弧で囲むことです。 コマンドがないため\parenciteauthor、 に依存するコマンドを定義しました\citeauthor

skipbib=trueさらに、またはオプションを使用して、これらのエントリを参照リストから除外したいと思いますskipbiblist=true

私のアプローチは、シングル残念ながら、引用元を記載する際には、この2つの要件のうち1つしか満たすことができません。複数ソース。

オプション を使用するとskipbiblist=true、両方のソースを一度に引用できます (出力の 2 行目を参照)。ただし、エントリは参照リストに引き続き表示されます。代わりに オプション を使用するとskipbib=true、エントリは参照リストから正常に省略されます。単一のソースを引用することも正常に機能します (出力の 3 行目)。ただし、一度に複数のソースを引用すると、引用の括弧が空になります (出力の 4 行目)。

両方の要件を同時に達成する方法はありますか? を使用する場合、括弧が空なのはなぜですかskipbib=true?

出力は次のようになります:

MEW出力

ミュウ:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[style=authoryear-icomp,
  backend=biber, 
  bibstyle=authoryear
  ]{biblatex}

\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}

\begin{filecontents*}[overwrite]{publist.bib}

@misc{test1,
author = {Author1},
shortauthor = {T1},
title = {Paper 1},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbiblist=true}
}

@misc{test2,
author = {Author2},
shortauthor = {T2},
title = {Paper 2},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbiblist=true}
}

@misc{test3,
author = {Author3},
shortauthor = {T3},
title = {Paper 3},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbib=true}
}

@misc{test4,
author = {Author4},
shortauthor = {T4},
title = {Paper 4},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbib=true}
}

\end{filecontents*}

\addbibresource{publist.bib}



\begin{document}

Cite paper 1 \parenciteauthor{test1} and paper 2 \parenciteauthor{test2}, both with the option skipbiblist=true.

Cite paper 1 and 2 together: \parenciteauthor{test1,test2}. % This is how I want to output to look like. Unfortunately, the sources still show up in the list of references.

Cite paper 3 \parenciteauthor{test3} and paper 4 \parenciteauthor{test4}, both with the option skipbib=true.

Cite paper 3 and 4 together: \parenciteauthor{test3,test4}. % The sources are omitted from the list of references as desired, but the citation does not work.

\printbibliography

\end{document}

答え1

アップデート

ここで見つかったバグは、biblatexv3.18 (2022-06-22) で解決されました。この問題が引き続き発生する場合は、システムを更新してください。


この問題は、定義が原因ではありません。おそらく、次のバグが原因ですbiblatex:https://github.com/plk/biblatex/issues/1225


今すぐに動作させる必要がある場合は、修正プログラムを含めることができます。https://github.com/plk/biblatex/issues/1225下記の通りです。更新後は\makeatletter ... \makeatother必ずブロックを削除してください。biblatex

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[
  backend=biber,
  style=authoryear-icomp,
]{biblatex}

\makeatletter
\protected\def\blx@bbl@endentry{%
  \csuse\blx@bbl@data
  \ifcsundef{blx@pref@\the\c@refsection @\abx@field@entrykey}
    {}
    {\blx@addpageref{\abx@field@entrykey}}%
  \nottoggle{blx@setonly}
    {}
    {\global\toggletrue{blx@addset}%
     \toggletrue{blx@skipbib}%
     \toggletrue{blx@skipbiblist}%
     \toggletrue{blx@skiplab}}%
  \expandafter\ifstrequal\expandafter{\blx@dlist@type}{entry}
    {\listcsxadd{blx@type@\the\c@refsection @\abx@field@entrytype}{\abx@field@entrykey}%
     \ifdef\abx@field@entrysubtype
       {\listcsxadd{blx@subt@\the\c@refsection @\abx@field@entrysubtype}{\abx@field@entrykey}}
       {}%
     \nottoggle{blx@setonly}
       {\listcsxadd{blx@dlist@centry@\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
       {}%
     \nottoggle{blx@skipbib}
       {\listcsxadd{blx@dlist@entry@\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
       {}}%
    {}%
  \nottoggle{blx@skipbiblist}
    {\expandafter\ifstrequal\expandafter{\blx@dlist@type}{list}
      {\blx@bbl@labelfields
        \listcsxadd{blx@dlist@\blx@dlist@type @\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
      {}}%
    {}%
  \nottoggle{blx@skiplab}
    {\iftoggle{blx@labelnumber}
       {\blx@bbl@labelnumber}
       {}%
     \iftoggle{blx@labelalpha}
       {\blx@bbl@labelalpha}
       {}%
     \iftoggle{blx@labeltitle}
       {\blx@bbl@labeltitle}
       {}%
     \iftoggle{blx@labeltitleyear}
       {\blx@bbl@labeltitleyear}
       {}%
     \iftoggle{blx@labeldateparts}
       {\blx@bbl@labeldate}
       {}%
     \blx@bbl@labelname}
    {}%
  \blx@bbl@titles
  \blx@bbl@hooks
  \endgroup}
\makeatother

\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}

\begin{filecontents*}[overwrite]{\jobname.bib}
@misc{test1,
  author       = {Author1},
  title        = {Paper 1},
  year         = {2010},
  options      = {skipbiblist=true},
}
@misc{test2,
  author       = {Author2},
  title        = {Paper 2},
  year         = {2010},
  options      = {skipbiblist=true}
}
@misc{test3,
  author       = {Author3},
  title        = {Paper 3},
  year         = {2010},
  options      = {skipbib=true}
}
@misc{test4,
  author       = {Author4},
  title        = {Paper 4},
  year         = {2010},
  options      = {skipbib=true}
}
\end{filecontents*}
\addbibresource{\jobname.bib}


\begin{document}
Cite paper 1 \parenciteauthor{test1}
and paper 2 \parenciteauthor{test2}, both with the option skipbiblist=true.

Cite paper 1 and 2 together: \parenciteauthor{test1,test2}.
Cite paper 3 \parenciteauthor{test3} and paper 4 \parenciteauthor{test4},
both with the option skipbib=true.

Cite paper 3 and 4 together: \parenciteauthor{test3,test4}. 

\printbibliography
\end{document}

論文 1 (Author1) と論文 2 (Author2) を、両方ともオプション skip-biblist=true で引用します。論文 1 と 2 を一緒に引用します: (Author1; Author2)。論文 3 (Author3) と論文 4 (Author4) を、両方ともオプション skipbib=true で引用します。論文 3 と 4 を一緒に引用します: (Author3; Author4)。


上で述べたように、この問題はあなたの定義によって生じたものではありませんが、

\DeclareCiteCommand{\parenciteauthor}[\mkbibparens]
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printnames{labelname}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

より慣用的な表現になるだろうが、確かに長くなるだろう

\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}

関連情報