책 기사에서 biblatex 옵션 "useeditor=true"가 무시되는 이유는 무엇입니까?

책 기사에서 biblatex 옵션 "useeditor=true"가 무시되는 이유는 무엇입니까?

다음 MWE를 고려하십시오. 볼 수 있듯이 해당 항목에 대한 옵션 useeditor=true은 무시되며 @incollection실제로는 와 동일하게 처리됩니다 useeditor=false. 왜? 그리고 어떻게 하면 그것이 그것에 관심을 가지게 할 수 있을까요?

\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@INCOLLECTION{beatles1970a,
    BOOKTITLE = "Let it be (a)",
    EDITOR = "The Beatles",
    TITLE = "Maggie Mae",
    YEAR = "1970",
    PAGES = "17--18",
    OPTIONS = "useeditor=true"}
@BOOK{beatles1970b,
    TITLE = "Let it be (b)",
    EDITOR = "The Beatles",
    YEAR = "1970",
    OPTIONS = "useeditor=true"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

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

답변1

editor댓글에서 작품의 , translator및 친구는 가 아닌 @in동봉을 참조한다고 논의되었습니다 .booktitletitle

의 편집자, 번역자 등을 참조하는 새 이름을 만들 수 있습니다. 우리는 그들을 , , ... title이라고 부릅니다 .ineditorintranslator

.dbx먼저 새로운 데이터 모드를 가진 파일이 필요합니다 . 그런 다음 editor, , translator에 대한 모든 매크로를 복사하면 됩니다 . MWE에서는 다음 사항만 필요합니다.ineditorintranslator

\renewbibmacro*{author/translator+others}{\usebibmacro{author/ineditor+others/intranslator+others}} %% this is an ad hoc for this particular application

그리고 가도 좋아

\documentclass{article}
\usepackage{filecontents}
\usepackage{xpatch}
\begin{filecontents}{innames.dbx}
\ProvidesFile{innames.dbx}[2015/11/01 more field for @in types]
\RequireBiber[3]
% new translator etc.  fields for "inner" work, that is translator of title (not booktitle) in @in...
\DeclareDatamodelFields[type=list,datatype=name]{ineditor, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\DeclareDatamodelEntryfields[inbook,incollection,inproceedings,inreference]{ineditor, intranslator, inannotator, incommentator, inintroduction, inforeword, inafterword}
\end{filecontents}

\usepackage[style = authoryear-comp, datamodel=innames]{biblatex}

\begin{filecontents}{\jobname.bib}
@INCOLLECTION{beatles1970a,
    BOOKTITLE = "Let it be (a)",
    inEDITOR = {{The Beatles}},
    TITLE = "Maggie Mae",
    YEAR = "1970",
    PAGES = "17--18",
    OPTIONS = "useineditor=true"}
@BOOK{beatles1970b,
    TITLE = "Let it be (b)",
    EDITOR = {{The Beatles}},
    YEAR = "1970",}
\end{filecontents}
\addbibresource{\jobname.bib}

\makeatletter
\newbibmacro*{ineditorstrg}{%
  \printtext[ineditortype]{%
    \iffieldundef{ineditortype}
      {\ifboolexpr{
         test {\ifnumgreater{\value{ineditor}}{1}}
         or
         test {\ifandothers{ineditor}}
       }
         {\bibstring{editors}}
         {\bibstring{editor}}}
      {\ifbibxstring{\thefield{ineditortype}}
         {\ifboolexpr{
            test {\ifnumgreater{\value{ineditor}}{1}}
            or
            test {\ifandothers{ineditor}}
          }
            {\bibstring{\thefield{ineditortype}s}}
            {\bibstring{\thefield{ineditortype}}}}
         {\thefield{ineditortype}}}}}

\newbibmacro*{ineditor+othersstrg}{%
  \iffieldundef{ineditortype}
    {\ifboolexpr{
       test {\ifnumgreater{\value{ineditor}}{1}}
       or
       test {\ifandothers{ineditor}}
     }
       {\def\abx@tempa{editors}}
       {\def\abx@tempa{editor}}}
    {\ifboolexpr{
       test {\ifnumgreater{\value{ineditor}}{1}}
       or
       test {\ifandothers{ineditor}}
     }
       {\edef\abx@tempa{\thefield{ineditortype}s}}
       {\edef\abx@tempa{\thefield{ineditortype}}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{ineditor}{intranslator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{intranslator}}}
    {}%
  \ifnamesequal{ineditor}{incommentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{incommentator}}}
    {\ifnamesequal{ineditor}{inannotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{inannotator}}}
       {}}%
  \ifnamesequal{ineditor}{inintroduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{inintroduction}}}
    {\ifnamesequal{ineditor}{inforeword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{inforeword}}}
       {\ifnamesequal{ineditor}{inafterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{inafterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext[ineditortype]{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{ineditorstrg}}}

\newbibmacro*{intranslatorstrg}{%
  \printtext[intranslatortype]{%
    \ifboolexpr{
      test {\ifnumgreater{\value{intranslator}}{1}}
      or
      test {\ifandothers{intranslator}}
    }
      {\bibstring{translators}}
      {\bibstring{translator}}}}

\newbibmacro*{intranslator+othersstrg}{%
  \ifboolexpr{
    test {\ifnumgreater{\value{intranslator}}{1}}
    or
    test {\ifandothers{intranslator}}
  }
    {\def\abx@tempa{translators}}
    {\def\abx@tempa{translator}}%
  \ifnamesequal{intranslator}{incommentator}
    {\appto\abx@tempa{co}%
     \clearname{incommentator}}
    {\ifnamesequal{intranslator}{inannotator}
       {\appto\abx@tempa{an}%
        \clearname{inannotator}}
       {}}%
  \ifnamesequal{intranslator}{inintroduction}
    {\appto\abx@tempa{in}%
     \clearname{inintroduction}}
    {\ifnamesequal{intranslator}{inforeword}
       {\appto\abx@tempa{fo}%
        \clearname{inforeword}}
       {\ifnamesequal{intranslator}{inafterword}
          {\appto\abx@tempa{af}%
           \clearname{inafterword}}
          {}}}%
  \bibstring{\abx@tempa}}


\newbibmacro*{ineditor+others}{%
  \ifboolexpr{
    test \ifuseineditor
    and
    not test {\ifnameundef{ineditor}}
  }
    {\printnames{ineditor}%
     \setunit{\addcomma\space}%
     \usebibmacro{ineditor+othersstrg}%
     \clearname{ineditor}}
    {}}

\newbibmacro*{intranslator+others}{%
  \ifboolexpr{
    test \ifuseintranslator
    and
    not test {\ifnameundef{intranslator}}
  }
    {\printnames{intranslator}%
     \setunit{\addcomma\space}%
     \usebibmacro{intranslator+othersstrg}%
     \clearname{intranslator}}
    {}}

\newbibmacro*{author/ineditor+others/intranslator+others}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{author}}
    {\ifboolexpr{
       test \ifuseineditor
       and
       not test {\ifnameundef{ineditor}}
     }
       {\usebibmacro{ineditor+others}}
       {\usebibmacro{intranslator+others}}}}

\newbibmacro*{byineditor}{%
  \ifnameundef{ineditor}
    {}
    {\usebibmacro{bytypestrg}{ineditor}{editor}%
     \setunit{\addspace}%
     \printnames[byineditor]{ineditor}%
     \newunit}%
  \usebibmacro{byineditorx}}

\newbibmacro*{byineditorx}{%
  \ifnameundef{ineditora}
    {}
    {\usebibmacro{bytypestrg}{ineditora}{editor}%
     \setunit{\addspace}%
     \printnames[byineditora]{ineditora}%
     \newunit}%
  \ifnameundef{ineditorb}
    {}
    {\usebibmacro{bytypestrg}{ineditorb}{editor}%
     \setunit{\addspace}%
     \printnames[byineditorb]{ineditorb}%
     \newunit}%
  \ifnameundef{ineditorc}
    {}
    {\usebibmacro{bytypestrg}{ineditorc}{editor}%
     \setunit{\addspace}%
     \printnames[byineditorc]{ineditorc}%
     \newunit}}

\newbibmacro*{byintranslator}{%
  \ifnameundef{intranslator}
    {}
    {\bibstring{bytranslator}%
     \setunit{\addspace}%
     \printnames[byintranslator]{intranslator}}}

\newbibmacro*{byineditor+others}{%
  \ifnameundef{ineditor}
    {}
    {\usebibmacro{byineditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[byineditor]{ineditor}%
     \clearname{ineditor}%
     \newunit}%
  \usebibmacro{byineditorx}%
  \usebibmacro{byintranslator+others}}

\newbibmacro*{byintranslator+others}{%
  \ifnameundef{intranslator}
    {}
    {\usebibmacro{byintranslator+othersstrg}%
     \setunit{\addspace}%
     \printnames[byintranslator]{intranslator}%
     \clearname{intranslator}%
     \newunit}}

\newbibmacro*{byineditor+othersstrg}{%
  \iffieldundef{ineditortype}
    {\def\abx@tempa{byeditor}}
    {\edef\abx@tempa{by\thefield{ineditortype}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{ineditor}{intranslator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{intranslator}}}
    {}%
  \ifnamesequal{ineditor}{incommentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{incommentator}}}
    {\ifnamesequal{ineditor}{inannotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{inannotator}}}
       {}}%
  \ifnamesequal{ineditor}{inintroduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{inintroduction}}}
    {\ifnamesequal{ineditor}{inforeword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{inforeword}}}
       {\ifnamesequal{ineditor}{inafterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{inafterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{bytypestrg}{ineditor}{editor}}}

\newbibmacro*{byintranslator+othersstrg}{%
  \def\abx@tempa{bytranslator}%
  \ifnamesequal{intranslator}{incommentator}
    {\appto\abx@tempa{co}%
     \clearname{incommentator}}
    {\ifnamesequal{intranslator}{inannotator}
       {\appto\abx@tempa{an}%
        \clearname{inannotator}}
       {}}%
  \ifnamesequal{intranslator}{inintroduction}
    {\appto\abx@tempa{in}%
     \clearname{inintroduction}}
    {\ifnamesequal{intranslator}{inforeword}
       {\appto\abx@tempa{fo}%
        \clearname{inforeword}}
       {\ifnamesequal{intranslator}{inafterword}
          {\appto\abx@tempa{af}%
           \clearname{inafterword}}
          {}}}%
  \bibstring{\abx@tempa}}
\makeatother    


\renewbibmacro*{author/translator+others}{\usebibmacro{author/ineditor+others/intranslator+others}} %% this is an ad hoc for this particular application

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

예제 출력


어쩌면 정반대의 접근 방식이 더 논리적이라고 생각할 수도 있습니다(특히 가 의 이라는 bookauthor점 을 고려하면 ). 따라서 , , ... 필드가 를 참조하는 것처럼 가장하고 , , ...에 대한 새로운 , , ...을 생각해낼 수도 있습니다.authorbooktitleeditortranslatortitlebookeditorbooktranslatorbooktitle 수도 있습니다 .이 접근 방식은 엄밀히 말하면 표준 데이터 모델과 호환되지 않습니다.

파일 .dbx 은 약간 다르며 대부분의 이름 매크로는 by.... MWE의 경우에는 다음만 필요합니다.

\renewbibmacro*{author/translator+others}{\usebibmacro{author/editor+others/translator+others}} %% this is an ad hoc for this particular application

\xpatchbibdriver{inbook}
  {\usebibmacro{byeditor+others}}
  {\usebibmacro{bybookeditor+others}}
  {\typeout{yes inbook}}{\typeout{no inbook}}

\xpatchbibdriver{incollection}
  {\usebibmacro{byeditor+others}}
  {\usebibmacro{bybookeditor+others}}
  {\typeout{yes incollection}}{\typeout{no incollection}}

MWE

\documentclass{article}
\usepackage{filecontents}
\usepackage{xpatch}
\begin{filecontents}{booknames.dbx}
\ProvidesFile{booknames.dbx}[2015/11/01 more field for @in types]
\RequireBiber[3]
\DeclareDatamodelFields[type=list,datatype=name]{bookeditor, booktranslator, bookannotator, bookcommentator, bookintroduction, bookforeword, bookafterword}
\DeclareDatamodelEntryfields[inbook,incollection,inproceedings,inreference]{bookeditor, booktranslator, bookannotator, bookcommentator, bookintroduction, bookforeword, bookafterword}
\end{filecontents}

\usepackage[style = authoryear-comp, datamodel=booknames]{biblatex}

\begin{filecontents}{\jobname.bib}
@INCOLLECTION{beatles1970a,
    BOOKTITLE = "Let it be (a)",
    EDITOR = {{The Beatles}},
    bookeditor = {James Joyce},
    booktranslator = {James Joyce},
    TITLE = "Maggie Mae",
    YEAR = "1970",
    PAGES = "17--18",
    OPTIONS = "useeditor=true"}
@BOOK{beatles1970b,
    TITLE = "Let it be (b)",
    EDITOR = {{The Beatles}},
    YEAR = "1970",}
\end{filecontents}
\addbibresource{\jobname.bib}

\makeatletter
\newbibmacro*{bybookeditor}{%
  \ifnameundef{bookeditor}
    {}
    {\usebibmacro{bytypestrg}{bookeditor}{bookeditor}%
     \setunit{\addspace}%
     \printnames[bybookeditor]{bookeditor}%
     \newunit}}


\newbibmacro*{bybooktranslator}{%
  \ifnameundef{booktranslator}
    {}
    {\bibstring{bytranslator}%
     \setunit{\addspace}%
     \printnames[bybooktranslator]{booktranslator}}}

\newbibmacro*{bybookeditor+others}{%
  \ifnameundef{bookeditor}
    {}
    {\usebibmacro{bybookeditor+othersstrg}%
     \setunit{\addspace}%
     \printnames[bybookeditor]{bookeditor}%
     \clearname{bookeditor}%
     \newunit}%
  \usebibmacro{bybooktranslator+others}}

\newbibmacro*{bybooktranslator+others}{%
  \ifnameundef{booktranslator}
    {}
    {\usebibmacro{bybooktranslator+othersstrg}%
     \setunit{\addspace}%
     \printnames[bybooktranslator]{booktranslator}%
     \clearname{booktranslator}%
     \newunit}%
  \usebibmacro{withbookothers}}


\newbibmacro*{bybookeditor+othersstrg}{%
  \iffieldundef{bookeditortype}
    {\def\abx@tempa{byeditor}}
    {\edef\abx@tempa{by\thefield{bookeditortype}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{bookeditor}{booktranslator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{booktranslator}}}
    {}%
  \ifnamesequal{bookeditor}{bookcommentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{bookcommentator}}}
    {\ifnamesequal{bookeditor}{bookannotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{bookannotator}}}
       {}}%
  \ifnamesequal{bookeditor}{bookintroduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{bookintroduction}}}
    {\ifnamesequal{bookeditor}{bookforeword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{bookforeword}}}
       {\ifnamesequal{bookeditor}{bookafterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{bookafterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext{\bibstring{\abx@tempa}}\abx@tempb}
    {\usebibmacro{bytypestrg}{bookeditor}{bookeditor}}}

\newbibmacro*{bybooktranslator+othersstrg}{%
  \def\abx@tempa{bytranslator}%
  \ifnamesequal{booktranslator}{bookcommentator}
    {\appto\abx@tempa{co}%
     \clearname{bookcommentator}}
    {\ifnamesequal{booktranslator}{bookannotator}
       {\appto\abx@tempa{an}%
        \clearname{bookannotator}}
       {}}%
  \ifnamesequal{booktranslator}{bookintroduction}
    {\appto\abx@tempa{in}%
     \clearname{bookintroduction}}
    {\ifnamesequal{booktranslator}{bookforeword}
       {\appto\abx@tempa{fo}%
        \clearname{bookforeword}}
       {\ifnamesequal{booktranslator}{bookafterword}
          {\appto\abx@tempa{af}%
           \clearname{bookafterword}}
          {}}}%
  \bibstring{\abx@tempa}}

\newbibmacro*{withbookcommentator}{%
  \ifnameundef{bookcommentator}
    {}
    {\bibstring{withcommentator}%
     \setunit{\addspace}%
     \printnames[withbookcommentator]{bookcommentator}}}

\newbibmacro*{withbookannotator}{%
  \ifnameundef{bookannotator}
    {}
    {\bibstring{withannotator}%
     \setunit{\addspace}%
     \printnames[withbookannotator]{bookannotator}}}

\newbibmacro*{withbookintroduction}{%
  \ifnameundef{bookintroduction}
    {}
    {\bibstring{withintroduction}%
     \setunit{\addspace}%
     \printnames[withbookintroduction]{bookintroduction}}}

\newbibmacro*{withbookforeword}{%
  \ifnameundef{bookforeword}
    {}
    {\bibstring{withbookforeword}%
     \setunit{\addspace}%
     \printnames[withbookforeword]{bookforeword}}}

\newbibmacro*{withbookafterword}{%
  \ifnameundef{bookafterword}
    {}
    {\bibstring{withafterword}%
     \setunit{\addspace}%
     \printnames[withbookafterword]{bookafterword}}}

\newbibmacro*{withbookothers}{%
  \usebibmacro{withbookcommentator}%
  \clearname{bookcommentator}%
  \newunit
  \usebibmacro{withbookannotator}%
  \clearname{bookannotator}%
  \newunit
  \usebibmacro{withbookintroduction}%
  \clearname{bookintroduction}%
  \newunit
  \usebibmacro{withbookforeword}%
  \clearname{bookforeword}%
  \newunit
  \usebibmacro{withbookafterword}%
  \clearname{bookafterword}}
\makeatother

\renewbibmacro*{author/translator+others}{\usebibmacro{author/editor+others/translator+others}} %% this is an ad hoc for this particular application

\xpatchbibdriver{inbook}
  {\usebibmacro{byeditor+others}}
  {\usebibmacro{bybookeditor+others}}
  {\typeout{yes inbook}}{\typeout{no inbook}}

\xpatchbibdriver{incollection}
  {\usebibmacro{byeditor+others}}
  {\usebibmacro{bybookeditor+others}}
  {\typeout{yes incollection}}{\typeout{no incollection}}

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

관련 정보