parenciteauthor 명령을 만들려고 하면 Skipbib 및 Skipbiblist가 다르게 동작합니다.

parenciteauthor 명령을 만들려고 하면 Skipbib 및 Skipbiblist가 다르게 동작합니다.

shortauthor내 목표는 날짜 없이 여러 출처를 인용 하고 인용 내용을 괄호 안에 넣는 것입니다. 명령어 가 없기 때문에 \parenciteauthor에 의존하는 명령어를 정의했습니다 \citeauthor.

skipbib=true또한 또는 옵션을 사용하여 해당 항목을 참고문헌 목록에서 제외하고 싶습니다 skipbiblist=true.

내 접근 방식은 내가 인용할 때마다 효과가 있습니다.하나의원천. 불행하게도 제가 인용할 때 이 두 가지 요구 사항 중 하나만 작동하도록 할 수 있습니다.다수의소스.

옵션을 사용하면 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(저자 1)과 논문 2(저자 2)를 인용합니다. 둘 다 Skip-biblist=true 옵션을 사용합니다. 논문 1과 2를 함께 인용합니다: (저자1; 저자2). 논문 3(Author3)과 논문 4(Author4)를 인용합니다. 둘 다 Skipbib=true 옵션을 사용합니다. 논문 3과 4를 함께 인용합니다: (저자3; 저자4).


위에서 언급했듯이 문제는 귀하의 정의로 인해 발생하는 것은 아니지만

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

약간 더 관용적일 것입니다.

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

관련 정보