authoryear-comp の複数巻コレクションの省略形

authoryear-comp の複数巻コレクションの省略形

私はスタイルでshorthandを使用しようとしていますが、コマンドを使用するときに期待していたのは次のようになります。@mvcollectionauthoryear-comp\textcite

CAO(第1234号)

ただし、生成されるのは次のようになります。

ヴィルヘルム他(CAO、第1234号)

\cite一方、プレーンコマンドは、期待どおりに引用を生成します。

CAO、いいえ。 1234

この場合のは@mvcollection、番号順に並べられた中世ドイツの憲章と証書の 5 巻版です。各巻は個別にファイルに保存されています。ただし、個々のレコードの列挙は各巻ごとに再開されないため、ここではコレクション全体のエントリを参照しようとしていました。 を使用するときに、 をと一緒にではなく にyear置き換える理由がわかりません。shorthandeditoryear\textcite


MWE:

\documentclass{article}

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

\begin{filecontents*}{\jobname.bib}
@mvcollection{CAO,
    editor = {Friedrich Wilhelm and Richard Newald and Helmut {de Boor} and Diether Haacke and Bettina Kirschstein},
    gender = {pp},
    title = {{Corpus der altdeutschen Originalurkunden bis zum Jahr 1300}},
    shorthand = {CAO},
    sortkey = {CAO0},
    volumes = {5},
    publisher = {Moritz Schauenburg and Erich Schmidt},
    location = {Lahr and Berlin},
    year = {1932--2004},
    pagination = {number},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\textcite[1234]{CAO}
\end{document}

答え1

\textcite変更するのは少し面倒です。次のコードでは、shorthand何よりも優先され、ポストノートが常に丸括弧で囲まれるようになります。

\documentclass{article}
\usepackage[
    style=authoryear-comp,
    backend=biber,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@mvcollection{CAO,
  editor     = {Friedrich Wilhelm and Richard Newald and Helmut de Boor and Diether Haacke and Bettina Kirschstein},
  gender     = {pp},
  title      = {Corpus der altdeutschen Originalurkunden bis zum Jahr 1300},
  shorthand  = {CAO},
  sortkey    = {CAO0},
  volumes    = {5},
  publisher  = {Moritz Schauenburg and Erich Schmidt},
  location   = {Lahr and Berlin},
  date       = {1932/2004},
  pagination = {number},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\makeatletter
\newtoggle{cbx:postparens}
\renewbibmacro*{textcite}{%
  \iffieldundef{shorthand}
    {\iffieldequals{namehash}{\cbx@lasthash}
       {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                    \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
          {\setunit{\addcomma}%
           \usebibmacro{cite:extradate}}
          {\setunit{\compcitedelim}%
           \usebibmacro{cite:labeldate+extradate}%
           \savefield{labelyear}{\cbx@lastyear}}}
       {\ifnameundef{labelname}
         {\usebibmacro{cite:label}%
          \setunit{%
            \global\booltrue{cbx:parens}%
            \printdelim{nonameyeardelim}\bibopenparen}%
          \ifnumequal{\value{citecount}}{1}
            {\usebibmacro{prenote}}
            {}%
          \usebibmacro{cite:labeldate+extradate}}
         {\printnames{labelname}%
          \setunit{%
            \global\booltrue{cbx:parens}%
            \printdelim{nameyeardelim}\bibopenparen}%
          \ifnumequal{\value{citecount}}{1}
            {\usebibmacro{prenote}}
            {}%
          \iffieldundef{labelyear}
            {\usebibmacro{cite:label}}
            {\usebibmacro{cite:labeldate+extradate}}%
          \savefield{labelyear}{\cbx@lastyear}}}%
     \stepcounter{textcitecount}%
     \savefield{namehash}{\cbx@lasthash}%
     \togglefalse{cbx:postparens}}%
    {\usebibmacro{cite:shorthand}%
     \toggletrue{cbx:postparens}%
     \global\undef\cbx@lasthash
     \global\undef\cbx@lastyear}%
  \setunit{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}%
    \textcitedelim}}

\renewbibmacro*{textcite:postnote}{%
  \ifboolexpr{togl {cbx:postparens} and not test {\iffieldundef{postnote}}}
    {\togglefalse{cbx:postparens}%
     \printunit{\extpostnotedelim\bibopenparen\global\booltrue{cbx:parens}}}
    {}%
  \usebibmacro{postnote}%
  \ifthenelse{\value{multicitecount}=\value{multicitetotal}}
    {\setunit{}%
     \printtext{%
       \ifbool{cbx:parens}
         {\bibcloseparen\global\boolfalse{cbx:parens}}
         {}}}
    {\setunit{%
       \ifbool{cbx:parens}
         {\bibcloseparen\global\boolfalse{cbx:parens}}
         {}%
       \textcitedelim}}}

\DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite]
  {\gdef\cbx@savedkeys{}%
   \citetrackerfalse%
   \pagetrackerfalse%
   \DeferNextCitekeyHook%
   \usebibmacro{cite:init}}
  {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
     {\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
      \global\clearfield{multipostnote}}
     {}%
   \xappto\cbx@savedkeys{\thefield{entrykey},}%
   \iffieldequals{namehash}{\cbx@lasthash}
     {\iffieldundef{shorthand}
        {}
        {\stepcounter{textcitetotal}%
         \global\undef\cbx@lasthash}}
     {\stepcounter{textcitetotal}%
      \savefield{namehash}{\cbx@lasthash}}}
  {}
  {\protected@xappto\cbx@savedcites{%
     [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}}
\makeatother

\begin{document}
\textcite[1234]{CAO}
\end{document}

ここに画像の説明を入力してください

答え2

この場合、参照に関連付けられた\textciteがあるかどうかを確認し、空の場合は を使用します。この特定のエントリでは、 が として使用されています。このような役割で を使用したくない場合は、とともに、エントリごとに設定可能なオプション を使用できます。これにより、エントリが参考文献でフォーマットされる方法が変わることに注意してください。これは、引用形式を考えると、実際には理にかなっています。意味的にはこれがあなたが探していたものだと思いますが、結果はあなたが期待したものと同一ではありません(プレーンな のように見えます)。しかし、も「すぐに使用できる」オプションになる可能性があります(もちろん、テキストの流れによって異なります)。labelnameeditorlabelnameuseeditor=falseoptions = {useeditor=false},\cite\parencite

ここに画像の説明を入力してください

完全な MWE:

\documentclass{article}

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

\begin{filecontents*}{\jobname.bib}
@mvcollection{CAO,
    editor = {Friedrich Wilhelm and Richard Newald and Helmut {de Boor} and Diether Haacke and Bettina Kirschstein},
    gender = {pp},
    title = {{Corpus der altdeutschen Originalurkunden bis zum Jahr 1300}},
    shorthand = {CAO},
    sortkey = {CAO0},
    volumes = {5},
    publisher = {Moritz Schauenburg and Erich Schmidt},
    location = {Lahr and Berlin},
    year = {1932--2004},
    pagination = {number},
    options = {useeditor=false},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\textcite[1234]{CAO}

\parencite[1234]{CAO}

\printbibliography
\end{document}

関連情報