Biblatex APA スタイルの修正に関するフォローアップの質問

Biblatex APA スタイルの修正に関するフォローアップの質問

私の最終論文では、APA スタイルを少し変更したバージョンを使用する必要があります。詳細に入る前に、MWE を紹介したいと思います。

\documentclass[12pt]{scrreprt} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel}
\usepackage{csquotes} 
\usepackage[%
backend=biber,
style=authoryear-comp,
bibstyle=apa]{biblatex}   
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}

\usepackage{filecontents} 
\begin{filecontents}{literatur.bib} 
@book{XYZ2010, 
 author = {Andrew Alphason and Bertram Betason and Christian Gammason}, 
 year = {2010}, 
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart}
}
@book{XYZ2011,
 editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
 year = {2011},
 title = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
@incollection{XYZ2012,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason},
 editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
 year = {2012},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart}, 
}
@incollection{XYZ2013,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason},
 editor = {Andrew Alphason and Bertram Betason},
 year = {2013},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart}, 
}
@book{XYZ2014a, 
 author = {Phil Phison and Bertram Betason}, 
 year = {2014}, 
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart},
} 
@book{XYZ2014b, 
 author = {{Fictional Institution}}, 
 year = {2014}, 
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart},
}
@incollection{XYZ2014c,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason and Ezra Epsilonson},
 editor = {Andrew Alphason and Bertram Betason},
 year = {2014},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
\end{filecontents} 
\bibliography{literatur} 

\begin{document} 
\parencite{XYZ2010,XYZ2011,XYZ2012,XYZ2013,XYZ2014a,XYZ2014b,XYZ2014c}
\printbibliography 
\end{document}

変更する必要があるのは次の点です。

  1. 参考文献エントリの最初の位置に 2 人の AND の著者/編集者がいる場合は、「&」の前にカンマが必要です。
  2. MWE のエントリ 3 と 4 のように編集者が後から登場する場合、編集者が 2 人以上いる場合は、「&」の前にコンマのみが必要です。ここでは編集者が 2 人だけなのでコンマはありません。なぜかは聞かないでください。そのようにする必要があるだけです。
  3. APA では通常、著者/編集者/機関と年 (括弧内) の間にピリオドが印刷されます。そこにピリオドを挿入することはできません。削除するにはどうすればよいでしょうか? この例では、エントリ番号 2 の「(Hrsg.)」の後のピリオドは許可されません。

出力の画像を挿入しました。間違っている部分を赤で示し、正しい部分を緑で示しています。

文献

参照biblatex APA スタイルの修正

答え1

このコードはあなたの要件を満たすはずです:

\documentclass[12pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
style=authoryear-comp,
bibstyle=apa]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}

\usepackage{filecontents}
\begin{filecontents}{literatur.bib}
@book{XYZ2010,
 author = {Andrew Alphason and Bertram Betason and Christian Gammason},
 year = {2010},
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart}
}
@book{XYZ2011,
 editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
 year = {2011},
 title = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
@incollection{XYZ2012,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason},
 editor = {Andrew Alphason and Bertram Betason and Christian Gammason},
 year = {2012},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
@incollection{XYZ2013,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason},
 editor = {Andrew Alphason and Bertram Betason},
 year = {2013},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
@book{XYZ2014a,
 author = {Phil Phison and Bertram Betason},
 year = {2014},
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart},
}
@book{XYZ2014b,
 author = {{Fictional Institution}},
 year = {2014},
 title = {{Ein Testbuch}},
 publisher = {Springer},
 address = {Stuttgart},
}
@incollection{XYZ2014c,
 title = {{Meine kleine Testdatei}},
 author = {Dirk Deltason and Ezra Epsilonson},
 editor = {Andrew Alphason and Bertram Betason},
 year = {2014},
 booktitle = {{Ein Sammelwerk}},
 publisher = {Springer},
 address = {Stuttgart},
}
\end{filecontents}
\bibliography{literatur}

    \usepackage{xpatch}

     \DefineBibliographyExtras{ngerman}{\def\finalandcomma{\addcomma}}

    \xpatchbibmacro{editorinauthpos}{%
           \clearname{editor}%
           \setunit{\adddot\addspace}%
    }{%
           \clearname{editor}%
           \setunit{\addspace}%
    }{}{}
\AtBeginBibliography{\renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\finalandcomma\addspace\&\space}
         }}

\renewbibmacro*{author}{%
  \ifnameundef{author}
    {\usebibmacro{labeltitle}}
    {\printnames[apaauthor][-\value{listtotal}]{author}%
     \setunit*{\addspace}%
     \printfield{nameaddon}%
     \ifnameundef{with}
       {}
       {\setunit{}\addspace\mkbibparens{\printtext{\bibstring{with}\addspace}%
        \printnames[apaauthor][-\value{listtotal}]{with}}
        \setunit*{\addspace}}}%
  \setunit{\addspace}\newblock%
  \usebibmacro{labelyear+extrayear}}

\xpretobibmacro{editor+trans}{\renewcommand*{\finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\&\space}}


\begin{document}
\parencite{XYZ2010,XYZ2011,XYZ2012,XYZ2013,XYZ2014a,XYZ2014b,XYZ2014c}
\printbibliography
\end{document} 

ここに画像の説明を入力してください

関連情報