authoryear-comp 中多卷合集的简写

authoryear-comp 中多卷合集的简写

我正在尝试使用shorthand样式,@mvcollectionauthoryear-comp这正是我使用命令时所期望的\textcite

CAO(编号 1234)

然而,生成的内容如下:

Wilhelm 等人(CAO,编号 1234)

\cite另一方面,普通命令会按预期生成引用:

首席行政官,没有。 1234

在这种情况下@mvcollection, 是按编号排序的 5 卷版中世纪德国宪章和契约;我再次将每卷单独存档。但是,我在这里试图引用整个集合中的条目,因为单个记录的枚举不会从每卷开始。我不明白为什么在使用 时用代替 而不是和一起year替换。shorthandeditoryear\textcite


梅威瑟:

\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检查是否有labelname与参考文献相关的,如果为空,则使用简写。对于这个特定的条目,editor被用作labelname。如果您不想让它以这样的角色使用,您可以使用选项useeditor=false,该选项也可以在每个条目的基础上设置,options = {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}

相关内容