Pergunta de acompanhamento para modificação do estilo biblatex APA

Pergunta de acompanhamento para modificação do estilo biblatex APA

Para minha tese final preciso usar uma versão ligeiramente modificada do estilo APA. Antes de entrar em mais detalhes, gostaria de mostrar um 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}

O que preciso mudar é:

  1. Deverá haver uma vírgula antes de "&" no caso de 2 E mais de 2 autores/editores na posição inicial da entrada bibliográfica.
  2. Caso os editores apareçam posteriormente como nas entradas nº 3 e 4 do MWE deverá haver apenas uma vírgula antes de "&" caso haja mais de 2 editores. Sem vírgula para apenas 2 editores aqui. Não me pergunte por que, eu só tenho que fazer assim!
  3. A APA normalmente imprime um ponto final entre os autores/editores/instituição e o ano (entre parênteses). Não tenho permissão para inserir um ponto final lá. Como posso removê-lo? No exemplo, o período na entrada nº 2 após "(Hrsg.)" não seria permitido.

Inseri uma imagem da saída. Usei vermelho para indicar o que está errado e verde para mostrar o que está correto.

Bibliografia

Veja tambémModificação do estilo biblatex APA.

Responder1

Acho que este código deve satisfazer seus requisitos:

\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} 

insira a descrição da imagem aqui

informação relacionada