使用“et al.”作为 3 位作者的 apa 和 biblatex

使用“et al.”作为 3 位作者的 apa 和 biblatex

社区,

我在使用带有“apa”样式的“biblatex”包时,遇到了 LaTeX 文档中“mincitenames”和“maxcitenames”选项的问题。根据文档,这些选项应该控制文内引文中显示的作者数量,但它们似乎没有按预期生效。

\usepackage[backend=biber, style=apa, pagetracker, ibidtracker=constrict, apamaxprtauth=20, mincitenames=2, maxcitenames=2 ]{biblatex}

以下是我的 github repo 链接,包括我的学术作品模板。即使是第一次引用,文内引用也只能使用 2 位作者。其他所有作者都应显示“Et al.”

对于第二个引用,应该使用 (ebd)。但这已经实现并且有效。只有“et al.”不起作用,因为 mincitenames 和 maxcitenames 选项被忽略了。

这是MWE:

   \documentclass{article}[11pt, a4paper, oneside, ngerman]
\usepackage[ngerman]{babel} % neue deutsche Trennungsregeln, etc
\usepackage[utf8]{inputenc} % korrekte Darstellung von Umlauten


\usepackage[autostyle]{csquotes}
\usepackage[backend=biber, style=apa, pagetracker, apamaxprtauth=20, ibidtracker=constrict]{biblatex}

% Remove Comma after second to last author and ampersand
% https://tex.stackexchange.com/questions/670888/biblatex-apa-7-modification
\makeatletter
\renewcommand*{\apablx@ifrevnameappcomma}{\@secondoftwo}
\makeatother

\DefineBibliographyExtras{ngerman}{%
  \renewcommand*{\finalandcomma}{}%
}

%% Verwendung von "ebenda (ebd.)", wenn eine Quelle hintereinander zitiert wird. 
%% Dies ist nicht im Standard von APA definiert und muss somit explizit aktiviert werden.
%% https://tex.stackexchange.com/questions/449249/getting-ibid-for-apa-style-citations-from-biblatex

\makeatletter
\providecommand*{\mkibid}[1]{#1}

\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}

\renewbibmacro*{cite}{%
  \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
    {\usebibmacro{cite:ibid}}
    {\iffieldequals{fullhash}{\cbx@lasthash}
     % Multiple cites in one command
      {\setunit{\compcitedelim}%
       \usebibmacro{cite:plabelyear+extradate}}%
     % Single cite
      {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
     % No author/editor
         {\usebibmacro{cite:noname}%
          \setunit{\printdelim{nameyeardelim}}%
          \usebibmacro{cite:plabelyear+extradate}%
          \savefield{fullhash}{\cbx@lasthash}}
     % Normal cite
        {\ifnameundef{shortauthor}
           {\printnames[labelname][-\value{listtotal}]{labelname}}%
           {\cbx@apa@ifnamesaved
             {\printnames{shortauthor}}
             {\printnames[labelname][-\value{listtotal}]{author}%
              \addspace\printnames[sabrackets]{shortauthor}}}%
         \setunit{\printdelim{nameyeardelim}}%
         \usebibmacro{cite:plabelyear+extradate}%
         \savefield{fullhash}{\cbx@lasthash}}}}%
   \setunit{\multicitedelim}}

\renewbibmacro*{textcite}{%
  \iffieldequals{fullhash}{\cbx@lasthash}
   % Compact cite - more than one thing for same author
    {\setunit{\compcitedelim}%
     \usebibmacro{cite:plabelyear+extradate}}
   % New cite
    {%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}%
      \setunit{\compcitedelim}%
      \ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
    % No author/editor or patent
       {\iffieldundef{shorthand}%
    % Cite using title
         {\usebibmacro{cite:noname}%
          \setunit{\ifbool{cbx:np}%
                   {\printdelim{nameyeardelim}}%
                   {\global\booltrue{cbx:parens}\addspace\bibopenparen}}%
          \usebibmacro{cite:plabelyear+extradate}}
    % Cite using shorthand
         {\usebibmacro{cite:shorthand}}}
    % Normal cite with author/editor
    % Normal full cite
       {\ifnameundef{shortauthor}%
    % Normal full cite
         {\printnames[labelname][-\value{listtotal}]{labelname}}
    % Cite using short author
         {\cbx@apa@ifnamesaved
           {\printnames{shortauthor}}
           {\printnames[labelname][-\value{listtotal}]{author}}}%
    % Year
        \setunit{\ifbool{cbx:np}
                  {\printdelim{nameyeardelim}}
                  {\global\booltrue{cbx:parens}\addspace\bibopenparen}}%
    % Put the shortauthor inside the year brackets if necessary
        \ifnameundef{shortauthor}
         {}
         {\cbx@apa@ifnamesaved
           {}
           {\printnames{shortauthor}\setunit{\printdelim{nameyeardelim}}}}%
    % Actual year printing
        \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
          {\usebibmacro{cite:ibid}}
          {\usebibmacro{cite:plabelyear+extradate}}%
    % Save name hash for checks later
        \savefield{fullhash}{\cbx@lasthash}}}}
\makeatother

%% Bibliographie einbinden
\addbibresource{biblatex-examples.bib}
%% ++++++++++++++++++++++++++++++++++++++++++
%% Dokument
%% ++++++++++++++++++++++++++++++++++++++++++
\begin{document}

here we have 5 authors, but only 2 should be displayed \parencite{herrmann}.'et al.' is missing here.

First citation should be normal \parencite[11]{sigfridsson}, second time with ibidem
\parencite[95]{sigfridsson}, but after a second citation \parencite[282]{geer} it should appear as usual \parencite[2]{sigfridsson}.

\end{document}

答案1

cite修改和的代码textcite基于旧版本biblatex-apa(如果我没记错的话,它基于biblatex-apa实现第 6 版 APA 样式的版本)。在当前版本中,biblatex-apa这些宏看起来略有不同。如果我们将它们调整为当前版本,则宏将响应mincitenames/ maxcitenames。(您确定需要作者加上“et al.”?这很不寻常。通常你会看到一位作者加上“et al.”——这也是正常的 APA 样式所要求的。)

\documentclass[11pt, a4paper, oneside, ngerman]{article}
\usepackage[ngerman]{babel} % neue deutsche Trennungsregeln, etc
\usepackage[utf8]{inputenc} % korrekte Darstellung von Umlauten

\usepackage[autostyle]{csquotes}
\usepackage[
  backend=biber,
  style=apa,
  maxcitenames=2,
  mincitenames=2,
  apamaxprtauth=20,
  pagetracker,
  ibidtracker=constrict,
]{biblatex}

% Remove Comma after second to last author and ampersand
% https://tex.stackexchange.com/questions/670888/biblatex-apa-7-modification
\makeatletter
\renewcommand*{\apablx@ifrevnameappcomma}{\@secondoftwo}
\makeatother

\DefineBibliographyExtras{ngerman}{%
  \renewcommand*{\finalandcomma}{}%
}

%% Verwendung von "ebenda (ebd.)", wenn eine Quelle hintereinander zitiert wird. 
%% Dies ist nicht im Standard von APA definiert und muss somit explizit aktiviert werden.
%% https://tex.stackexchange.com/questions/449249/getting-ibid-for-apa-style-citations-from-biblatex

\makeatletter
\providecommand*{\mkibid}[1]{#1}

\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}

\renewbibmacro*{cite}{%
  \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
    {\usebibmacro{cite:ibid}}
    {\iffieldequals{namehash}{\cbx@lasthash}
   % Multiple cites in one command
      {\setunit{\compcitedelim}%
       \usebibmacro{cite:plabelyear+extradate}}%
   % Single cite
      {\ifnameundef{labelname}
   % No author/editor
        {\usebibmacro{cite:noname}%
          \setunit{\printdelim{nameyeardelim}}%
          \usebibmacro{cite:plabelyear+extradate}%
          \savefield{namehash}{\cbx@lasthash}}
   % Normal cite
        {\ifnameundef{shortauthor}
          {\printnames{labelname}}%
          {\cbx@apa@ifnamesaved
            {\printnames{shortauthor}}
            {\printnames[labelname]{author}%
             \addspace\printnames[sabrackets]{shortauthor}}}%
          \setunit{\printdelim{nameyeardelim}}%
         \usebibmacro{cite:plabelyear+extradate}%
         \savefield{namehash}{\cbx@lasthash}}}}%
   \setunit{\multicitedelim}}

\renewbibmacro*{textcite}{%
  \iffieldequals{namehash}{\cbx@lasthash}
% Compact cite - more than one thing for same author
    {\setunit{\compcitedelim}%
     \usebibmacro{cite:plabelyear+extradate}}
% New cite
    {\ifbool{cbx:parens}
       {\bibcloseparen\global\boolfalse{cbx:parens}}
       {}%
     \setunit{\textcitedelim}%
     \ifnameundef{labelname}
     % No author/editor
       {\iffieldundef{shorthand}%
    % Cite using title
         {\usebibmacro{cite:noname}%
          \setunit{\global\booltrue{cbx:parens}%
                   \printdelim{nonameyeardelim}%
                   \bibopenparen}%
          \usebibmacro{cite:plabelyear+extradate}}
    % Cite using shorthand
         {\usebibmacro{cite:shorthand}}}
  % Normal cite with author/editor
  % Normal full cite
       {\ifnameundef{shortauthor}%
    % Normal full cite
         {\printnames{labelname}}
    % Cite using short author
         {\cbx@apa@ifnamesaved
           {\printnames{shortauthor}}
           {\printnames[labelname]{author}}}%
  % Year
        \setunit{\global\booltrue{cbx:parens}%
                 \printdelim{nameyeardelim}%
                 \bibopenparen}%
  % Put the shortauthor inside the year brackets if necessary
        \ifnameundef{shortauthor}
         {}
         {\cbx@apa@ifnamesaved
           {}
           {\printnames{shortauthor}%
            \setunit{\printdelim{innernameyeardelim}}}}%
  % Print prenote (belongs to first cite)
        \ifnumequal{\value{citecount}}{1}
           {\usebibmacro{prenote}}
           {}%
  % Actual year printing
        \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
          {\usebibmacro{cite:ibid}}
          {\usebibmacro{cite:plabelyear+extradate}}%
  % Save name hash for checks later
        \savefield{namehash}{\cbx@lasthash}}%
    \stepcounter{textcitecount}}}
\makeatother

%% Bibliographie einbinden
\addbibresource{biblatex-examples.bib}
%% ++++++++++++++++++++++++++++++++++++++++++
%% Dokument
%% ++++++++++++++++++++++++++++++++++++++++++
\begin{document}

here we have 5 authors, but only 2 should be displayed \parencite{herrmann}.'et al.' is missing here.

First citation should be normal \parencite[11]{sigfridsson}, second time with ibidem
\parencite[95]{sigfridsson}, but after a second citation \parencite[282]{geer} it should appear as usual \parencite[2]{sigfridsson}.

\end{document}

这里有 5 位作者,但只应显示 2 位(Herrmann、Öfele 等,2006 年)。此处缺少“et al.” 。第一次引用应正常(Sigfridsson & Ryde,1998 年,S. 11),第二次引用应同上(ebd.,S. 95),但第二次引用后(Geer,1985 年,S. 282)应照常显示(Sigfridsson & Ryde,1998 年,S. 2)。

相关内容