为 biblatex-apa 设置 maxcitenames

为 biblatex-apa 设置 maxcitenames

我想使用 biblatex 编写符合 APA 格式的文档。我想知道,在作者列表被“et al.”替换之前,我如何才能更改文档中第一次使用的文本中引用中显示的最大作者数量?


这是一个最小的工作示例来解释我的意思:

\documentclass[12pt,a4paper]{scrartcl}

% Bibliography entries:
\begin{filecontents}{literatur.bib}
@booklet{one,
    author = {Author One and Author Three and Author Four and Author Five 
and Author Six and Author Seven and Author Eight and Author Nine},
title = {Testtitle 1.},
date = {2018},
}
@booklet{two,
author = {Author Two},
shortauthor = {AOne},
title = {Testtitle 2.},
date = {2018},

} 
\end{filecontents}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} 
\usepackage{lmodern}
\usepackage[ngerman]{babel}   
\usepackage[backend=biber,style=apa,sortlocale=de_DE, natbib = true, 
pagetracker, ibidtracker=constrict]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\addbibresource{literatur.bib}

\begin{document}

\noindent Here, I cite the publication a first time: \citep{one}.\\
Now, I will cite it a second time: \citep{one}. 
\printbibliography
\end{document}

输出结果如下:

MWE 的结果


根据biblatex-APA文档,显示的最大作者数量实际参考书目可以通过选项进行更改apamaxprtauth我没有找到任何与第一次引用的最大作者数量等效的选项不过。在上面的 MWE 中,期望的结果是,我可以将显示的作者数量设置为我想要的任意高(例如 10),以便对于第一次引用,整个列表都会出现。

从第二次引用开始,无论如何,作者都应该被“et al.”取代。我只想在第一次出现时更改它。

感谢您的任何建议。:)

答案1

biblatex-apa不遵守,maxcitenames因为实现 APA more-names-on-first-citations-one-et-al-on-subsequent-citations 规则的代码有点复杂。

五位作者的最大数量是硬编码的,无法通过选项进行定制。

可以进行自定义。所需的代码不是特别短,但它是对 中原始定义的直接修改apa.cbx。在下面的代码中,您只需重新定义apamaxcitenames

\documentclass[12pt,a4paper]{scrartcl}

\begin{filecontents}{\jobname.bib}
@booklet{one,
  author = {Author One and Author Three and Author Four and Author Five 
            and Author Six and Author Seven and Author Eight and Author Nine},
  title  = {Testtitle 1.},
  date   = {2018},
}
\end{filecontents}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} 
\usepackage{lmodern}
\usepackage[ngerman]{babel}   
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{\jobname.bib}

\makeatletter
\newcommand{\apamaxcitenames}{8}

\DeclareNameFormat{labelname}{%
  % First set the truncation point
  \ifthenelse{\value{uniquelist}>1}
    {\numdef\cbx@min{\value{uniquelist}}}
    {\numdef\cbx@min{\value{minnames}}}%
  % Always print the first name and the second if there are only two since
  % "et al" must always be plural
  \ifboolexpr{test {\ifnumcomp{\value{listcount}}{=}{1}}
              or test {\ifnumcomp{\value{listtotal}}{=}{2}}}
    {\usebibmacro{labelname:doname}%
      {\namepartfamily}%
      {\namepartfamilyi}%
      {\namepartgiven}%
      {\namepartgiveni}%
      {\namepartprefix}%
      {\namepartprefixi}%
      {\namepartsuffix}%
      {\namepartsuffixi}}
    % We are looking at name >=3
    % If the list is 6 or more names or we have seen citation before, potential truncation
    {\ifboolexpr{test {\ifnumcomp{\value{listtotal}}{>}{\apamaxcitenames}}
                 or test {\ifciteseen}}
     % Less than the truncation point, print normally
     {\ifnumcomp{\value{listcount}}{<}{\cbx@min + 1}
       {\usebibmacro{labelname:doname}%
         {\namepartfamily}%
         {\namepartfamilyi}%
         {\namepartgiven}%
         {\namepartgiveni}%
         {\namepartprefix}%
         {\namepartprefixi}%
         {\namepartsuffix}%
         {\namepartsuffixi}}
       {}%
      % At potential truncation point ...
      \ifnumcomp{\value{listcount}}{=}{\cbx@min + 1}
        % but enforce plurality of et al - only truncate here if there is at
        % least one more element after the current potential truncation point
        % so that "et al" covers at least two elements.
        {\ifnumcomp{\value{listcount}}{<}{\value{listtotal}}
          {\printdelim{andothersdelim}\bibstring{andothers}}
          {\usebibmacro{labelname:doname}%
            {\namepartfamily}%
            {\namepartfamilyi}%
            {\namepartgiven}%
            {\namepartgiveni}%
            {\namepartprefix}%
            {\namepartprefixi}%
            {\namepartsuffix}%
            {\namepartsuffixi}}}
        {}%
      % After truncation point, do not print name
      \ifnumcomp{\value{listcount}}{>}{\cbx@min + 1}
       {\relax}%
       {}}%
     % We are looking at name >=3
     % Name list is < 6 names or we haven't seen this citation before, print normally
     {\usebibmacro{labelname:doname}%
       {\namepartfamily}%
       {\namepartfamilyi}%
       {\namepartgiven}%
       {\namepartgiveni}%
       {\namepartprefix}%
       {\namepartprefixi}%
       {\namepartsuffix}%
       {\namepartsuffixi}}}}
\makeatother

\begin{document}
Here, I cite the publication a first time: \parencite{one}.

Now, I will cite it a second time: \parencite{one}. 
\printbibliography
\end{document}

在这里,我第一次引用该出版物:(One, Three, Four, Five, Six, Seven, Eight & Nine, 2018)。//现在,我将第二次引用它:(One et al., 2018)。

如果你认为这可能是一个有用的功能,你可能想游说作者将其包括在内https://github.com/plk/biblatex-apa/issues。这并不完全符合 APA 标准,但考虑到所需的修改不是太大,而且已经有了修改apamaxprtauth,他可能不会立即放弃这个想法。

相关内容