특정 저자가 한 명 포함된 경우 참고문헌의 "et al"을 변경합니다.

특정 저자가 한 명 포함된 경우 참고문헌의 "et al"을 변경합니다.

et~al을 바꾸려고 합니다. 추가(et~al) 저자 안에 @LawrenceCrosby의 답변을 사용하여 참고문헌에 굵게 표시하려는 저자가 있는 경우 참고문헌에 표시됩니다.여기

내 코드는 다음과 같습니다

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{MyBibliography.bib}
  @article{cite1,
    author={Konstantinos Leledakis},
    title={An Article},
    year={2019},
    journal={Some Journal}
  }
  @article{cite2,
    author={Another Author and Konstantinos Leledakis},
    title={A Book},
    year={2017},
    journal={A publisher}
  }
  @book{cite3,
    author={Another SomeAuthor and One AnotherAuthor and SomeOther UnKnownAuthor and Konstantinos Leledakis},
    title={A Book},
    year={1988},
    publisher={Someone}
    }
  @book{cite4,
    author={Another Author and An UnknownAuthor and SomeOther UnKnownAuthor},
    title={A Book},
    year={2015},
    publisher={A publisher}
  }
\end{filecontents}

\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,maxnames=2, minnames=2]{biblatex}
\usepackage{etoolbox}


\DefineBibliographyStrings{english}{andothers={\ifthenelse{\boolean{bold}}{et~al(including Leledakis, K.)}{et~al}\adddot}}


\newboolean{bold}
\newcommand{\makeauthorbold}[1]{%
  \setboolean{bold}{false}
  \DeclareNameFormat{author}{%
    \ifthenelse{\value{listcount}=1}
    {%
      {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\setboolean{bold}{true}\mkbibbold{\namepartfamily\addcomma\addspace \namepartgiveni}}{\namepartfamily\addcomma\addspace \namepartgiveni}}
      %
    }{\ifnumless{\value{listcount}}{\value{liststop}}
        {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\setboolean{bold}{true}\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni}}
        {\expandafter\ifstrequal\expandafter{\namepartfamily}{#1}{\setboolean{bold}{true}\mkbibbold{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}{\addcomma\addspace \namepartfamily\addcomma\addspace \namepartgiveni\addcomma\isdot}}%
      }
    \ifthenelse{\value{listcount}<\value{liststop}}
    {\addcomma\space}
  }
}

%\makeauthorbold{Leledakis}


\DefineBibliographyStrings{english}{andothers={et~al}} % To translate "et al."

\ExecuteBibliographyOptions{firstinits=true, uniquename=init}

\addbibresource{MyBibliography.bib}
\renewcommand*{\nameyeardelim}{\addcomma\addspace} % Should add the comma, but somehow doesn't work

\begin{document}
\nocite{*}

\printbibliography
\end{document}

여기에는 두 가지 문제가 있습니다.

  1. 주석 처리된 명령을 주석 처리하면(활성화를 의미) %\makeauthorbold{Leledakis}이를 활성화합니다. 결과는 다음과 같습니다.

여기에 이미지 설명을 입력하세요

(일부 et~al이 포함되어 있음)은 다음과 같습니다.

여기에 이미지 설명을 입력하세요

이름은 이미 강조 표시되어 있지만 et~al. 부분이 전혀 빠져있습니다.

추신: 변경 사항 없이 코드를 테스트했지만 여전히 et가 누락되었습니다. 알. 부분.

답변1

이는 \DeclareNameFormat{author}몇 가지 아쉬운 점을 남기는 원래 이름 형식의 수정입니다.

  1. "von" 부분과 "Jr." 부분은 처리할 수 없습니다. 부속.
  2. 표준에 대한 호출이 없기 때문에 "et al."을 처리할 수 없습니다 \usebibmacro{name:andothers}.
  3. 최신 biblatex버전에서는 구문 오류로 인해 오류가 발생하기도 합니다. (마지막\ifthenelse 빠졌네요거짓나뭇가지. 또한보십시오https://github.com/plk/biblatex/issues/874.)

더 강력한 버전 중 하나를 사용하여 이름을 굵게 표시하는 것이 좋습니다.biblatex를 사용하여 특정 저자를 굵게 표시. 내가 볼 수 있는 한 해결책 중 "et al."을 굵게 표시한 솔루션은 없습니다. 관련 이름이 즉시 "포함"되어 있으면 추가할 수 있습니다.

내가 사용하고있는 기초로내 대답해시를 사용하지만 해시를 검색할 수 있는 편리한 인터페이스를 허용합니다. 까다로운 부분은 "et al."이 있는지 확인하는 것입니다. 강조표시할 이름도 포함되어 있습니다. \indexnames그렇지 않으면 아무 것도 인쇄하지 않는 나머지 모든 이름을 반복하여 이를 수행합니다 .

\documentclass{article}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,
            maxnames=2, minnames=2,
            giveninits=true, uniquename=init]{biblatex}

\makeatletter
% setup for auxiliary bib file
\def\hlblx@bibfile@name{\jobname -boldnames.bib}
\newwrite\hlblx@bibfile
\immediate\openout\hlblx@bibfile=\hlblx@bibfile@name

\newcounter{hlblx@name}
\setcounter{hlblx@name}{0}

% write names to auxiliary bib file and push hash to bold list
\newcommand*{\hlblx@writenametobib}[1]{%
  \stepcounter{hlblx@name}%
  \edef\hlblx@tmp@nocite{%
    \noexpand\AfterPreamble{%
      \noexpand\setbox0\noexpand\vbox{%
        \noexpand\hlblx@getmethehash{hlblx@name@\the\value{hlblx@name}}}}%
  }%
  \hlblx@tmp@nocite
  \immediate\write\hlblx@bibfile{%
    @misc{hlblx@name@\the\value{hlblx@name}, author = {\unexpanded{#1}}, %
          options = {dataonly=true},}%
  }%
}

\AtEndDocument{%
  \closeout\hlblx@bibfile}

\addbibresource{\hlblx@bibfile@name}

% extract hashes from bib file
\newcommand*{\hlbxl@boldhashes}{}
\DeclareNameFormat{hlblx@hashextract}{%
  \xifinlist{\thefield{hash}}{\hlbxl@boldhashes}
    {}
    {\listxadd{\hlbxl@boldhashes}{\thefield{fullhash}}}}

\DeclareCiteCommand{\hlblx@getmethehash}
  {}
  {\printnames[hlblx@hashextract][1-999]{author}}
  {}
  {}

% add and reset list of bold names
\newcommand*{\addboldnames}{\forcsvlist\hlblx@writenametobib}
\newcommand*{\resetboldnames}{\def\hlbxl@boldhashes{}}

\newcommand*{\mkboldifhashinlist}[1]{%
  \xifinlist{\thefield{hash}}{\hlbxl@boldhashes}
    {\mkbibbold{#1}}
    {#1}}

\newtoggle{boldnameincluded}
\newbibmacro*{name:flagbold}{%
  \def\do##1{\iffieldequalstr{hash}{##1}{\global\toggletrue{boldnameincluded}\listbreak}{}}%
  \dolistloop{\hlbxl@boldhashes}%
}

\DeclareNameWrapperFormat{boldifhashinlist}{%
  \renewcommand*{\mkbibcompletename}{\mkboldifhashinlist}%
  #1}

\DeclareNameWrapperAlias{sortname}{default}
\DeclareNameWrapperAlias{default}{boldifhashinlist}

\DeclareIndexNameFormat{flagbold}{%
  \usebibmacro{name:flagbold}}

\newcounter{boldflagcount}
\newcommand*{\mkbibboldandothers}[2]{%
  \iftoggle{boldnameincluded}
    {\mkbibbold{#2#1}}
    {#2}}

\renewbibmacro*{name:andothers}{%
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \global\togglefalse{boldnameincluded}%
     \ifnumgreater{\value{listtotal}}{\value{listcount}}
       {\defcounter{boldflagcount}{\value{listcount}+1}%
        \expandafter\def\expandafter\hlblx@currname\expandafter{\currentname}%
        \indexnames[flagbold][\the\value{boldflagcount}-\the\value{listtotal}]{\hlblx@currname}}%
       {}%
     \printdelim{andothersdelim}%
     \bibstring[\mkbibboldandothers{ (incuding K.~Leledakis)}]{andothers}}
    {}}
\makeatother


\addboldnames{Konstantinos Leledakis}


\begin{filecontents}{\jobname.bib}
@article{cite1,
  author  = {Konstantinos Leledakis},
  title   = {An Article},
  year    = {2019},
  journal = {Some Journal},
}
@article{cite2,
  author  = {Another Author and Konstantinos Leledakis},
  title   = {A Book},
  year    = {2017},
  journal = {A publisher},
}
@book{cite3,
  author    = {Another SomeAuthor and One AnotherAuthor
               and SomeOther UnKnownAuthor and Konstantinos Leledakis},
  title     = {A Book},
  year      = {1988},
  publisher = {Someone},
}
@book{cite4,
  author    = {Another Author and An UnknownAuthor
               and SomeOther UnKnownAuthor},
  title     = {A Book},
  year      = {2015},
  publisher = {A publisher},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

저자, A. 및 **K. 렐레다키스** (2017). “책”. In: 출판사.//저자, A., A. UnknownAuthor, et al. (2015). 책. 출판사.//**Leledakis, K.** (2019). “기사”. In: Some Journal.//SomeAuthor, A., O. AnotherAuthor, **et al. (K. Leledakis 포함)** (1988). 책. 누구.

이력서에 대한 출판물 목록의 형식을 지정하려는 경우 다음을 살펴보는 것이 좋습니다.biblatex-publist.

편집됨전체 이름의 형식을 지정하기 위해 보다 우아한 버전을 사용합니다. 각각 v3.12(2018-10-30) 및 v3.13(2019-08-17) 에서만 사용할 수 있습니다 \DeclareNameWrapperFormat. 이전 버전을 사용하시는 경우 편집 이력을 참고하시기 바랍니다 .\mkbibcompletenamebiblatexbiblatex

관련 정보