biblatex-apa7 参考书目中的完整名字

biblatex-apa7 参考书目中的完整名字

通常,biblatex-apa在参考书目中给出作者姓名

姓氏,F.(2000)。书名. 出版商.

不幸的是,我的教授明确希望它写成:

姓氏,名字 I.(2000)。书名. 出版商.

我的代码看起来有点像这样:

\documentclass[
    paper=A4,
    pagesize=auto
    12pt,
    ngerman,
    usegeometry,
    oneside,
    headinclude=false,
    footinclude=true,
    BCOR=0mm,
    DIV=calc,
    parskip=onehalf,
    bibliography=totocnumbered,
]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,style=apa]{biblatex} %This should render as APA7, the current version of the APA guidline
\usepackage{filecontents}

\begin{filecontents*}{Test.bib}
@book{Lastname2000,
  author = {given={Firstname Initial}}, family=Lastname},
  publisher = {Publisher},
  title = {Booktitle},
  year = {2000},
}
\end{filecontents*}

\addbibresource{Test.bib}
\usepackage[ngerman]{babel}

\begin{document}
Lorem ipsum dolor sit amet \parencite[S.~222]{Lastname2000}. Quod equitur...
\printbibliography
\end{document}

我已经阅读了以下答案biblatex-apa:参考书目中的完整名字,但这不适用于当前版本biblatex-apa(我假设?),至少我从这个解决方案中得到的只是错误。

答案1

您必须弄乱名称格式宏的内部实现。以下定义基于(并已使用)biblatex-apav9.16(2022/06/22)进行测试。

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[backend=biber,style=apa]{biblatex}

\makeatletter
\renewbibmacro*{name:apa:family-given}[5]{%
  \togglefalse{apablx@wantcomma}%
  \ifuseprefix
    {\usebibmacro{name:delim}{#4#1}%
     \usebibmacro{name:hook}{#4#1}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4}\isdot%
       \ifprefchar{}{\bibnamedelimc}}%
     \mkbibnamefamily{#1}\isdot%
     \ifdefvoid{#2}{}{\toggletrue{apablx@wantcomma}%
                      \revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}}%
     \ifdefvoid{#5}{}{\toggletrue{apablx@wantcomma}%
                      \addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamefamily{#1}\isdot
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       {\revsdnamepunct}%
     \ifdefvoid{#2}{}{\toggletrue{apablx@wantcomma}%
                      \bibnamedelimd\mkbibnamegiven{#2}}%
     \ifdefvoid{#4}{}{%
       \toggletrue{apablx@wantcomma}%
       \bibnamedelimc\mkbibnameprefix{#4}%
       \ifprefchar{}{\bibnamedelimc}}%
     \ifdefvoid{#5}{}{\toggletrue{apablx@wantcomma}%
                      \addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}%
  \let\bibstring\bibcplstring
  \usebibmacro{role}{\addspace}{\mkbibparens}%
  \hasitemannotation[\currentname][username]
    {\addspace\mkbibbrackets{\getitemannotation[\currentname][username]}}
    {}%
  \apablx@ifrevnameappcomma
    {\addcomma}
    {}}

\renewbibmacro*{name:apa:given-family}[5]{%
  \usebibmacro{name:delim}{#2#4#1#5}%
  \usebibmacro{name:hook}{#2#4#1#5}%
  \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\bibnamedelimd}%
  \ifdefvoid{#4}{}{%
    \mkbibnameprefix{#4}\isdot
    \ifprefchar{}{\bibnamedelimc}}%
  \mkbibnamefamily{#1}\isdot%
  \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}%
  \let\bibstring\bibcpsstring
  \usebibmacro{role}{\addcomma\space}{\@firstofone}}
\makeatother

\begin{filecontents*}{\jobname.bib}
@book{Lastname2000,
  author    = {Firstname Initial Lastname},
  publisher = {Publisher},
  title     = {Booktitle},
  year      = {2000},
}
\end{filecontents*}
\addbibresource{\jobname.bib}


\begin{document}
Lorem ipsum dolor sit amet \parencite[222]{Lastname2000}. Quod equitur...
\printbibliography
\end{document}

姓氏,名字首字母。(2000 年)。书名。出版商。

您不需要为此使用扩展名称格式。(并且示例条目有括号错误,因此我恢复了通常的名称输入格式。)

相关内容