biblatex-apa:在文本中始终使用 shortauthor

biblatex-apa:在文本中始终使用 shortauthor

我正在biblatex-apa与 koma-script 书类一起使用scrbook。参考问题biblatex-apa:用于引用同一作者但不同出版物的文本:每次在 [ ] 中使用 shortauthor,我试图实现在文中每次引用该组织时都打印简短的作者。

假设以下最小示例

\documentclass[10pt,ngerman]{scrbook}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @book{OECD2009,
        title = {P{ISA} {D}ata {A}nalysis {M}anual: {SPSS}, {S}econd {E}dition},
        publisher = {OECD Publishing},
        year = {2009},
        author = {{Organisation for Economic Co-operation and Development}},
        address = {Paris},
        shortauthor = {{OECD}}}
\end{filecontents}

\usepackage[ngerman]{babel}
\usepackage[backend=biber, style=apa, natbib=true, refsegment=chapter, defernumbers=true]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}

\addbibresource{\jobname.bib}
\defcitealias{OECD2009}{OECD}

\begin{document}        
    first \cite{OECD2009} -- subsequent \cite{OECD2009}     
    \printbibliography
\end{document}

因此,当我第一次引用\cite{OECD2009}以及随后的每次引用时,我希望看到

经合组织(2009)

\parencite同样)。但是参考文献部分应该包括使用完整作者的条目

经济合作与发展组织。(2009 年)。PISA 数据分析手册:SPSS,第二版。巴黎:OECD 出版社。

我该如何实现呢?正如您所看到的,我已经尝试过了,\defcitealias但我对此不太满意,因为我必须在每个实例中使用\citetalias和。\citepalias

任何提示都将受到热烈欢迎

答案1

您可以使用一小段代码

\makeatletter
\AtEveryCitekey{\ifnameundef{shortauthor}{}{\def\cbx@apa@ifnamesaved{\@firstoftwo}}}
\makeatother

如果存在a,它会重置测试以检查该名称是否之前出现过,如果是,则为真。因此,您甚至可以在第一次引用时shortauthor看到。shortauthor

平均能量损失

\documentclass[ngerman]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{OECD2009,
  title       = {P{ISA} {D}ata {A}nalysis {M}anual: {SPSS}, {S}econd {E}dition},
  publisher   = {OECD Publishing},
  year        = {2009},
  author      = {{Organisation for Economic Co-operation and Development}},
  address     = {Paris},
  shortauthor = {{OECD}},
}
@ARTICLE{7.01:7,
  AUTHOR         = {J. Chamberlin and A. Novotney and E. Packard and M. Price},
  TITLE          = {Enhancing Worker Well-being},
  SUBTITLE       = {Occupational Health Psychologists Convene to Share Their Research on Work, Stress, and Health},
  JOURNALTITLE   = {Monitor on Psychology},
  VOLUME         = {39},
  NUMBER         = {5},
  PAGES          = {26-29},
  DATE           = {2008-05}
}
\end{filecontents}
\usepackage[ngerman]{babel}
\usepackage[backend=biber, style=apa, natbib=true, defernumbers=true]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}

\addbibresource{\jobname.bib}

\makeatletter
\AtEveryCitekey{\ifnameundef{shortauthor}{}{\def\cbx@apa@ifnamesaved{\@firstoftwo}}}
\makeatother

\begin{document}        
  \cite{OECD2009}

  \cite{OECD2009}   

  \cite{7.01:7}

  \cite{7.01:7}
  
  \printbibliography
\end{document}

给出

经合组织,2009 年

经合组织,2009 年

Chamberlin、Novotney、Packard 和 Price,2008 年

Chamberlin ua,2008

相关内容