Para mi tesis final necesito utilizar una versión ligeramente modificada del estilo APA. Antes de entrar en más detalles, me gustaría mostrarles un 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}
Lo que necesito cambiar es:
- Debe haber una coma antes de "&" en caso de 2 Y más de 2 autores/editores en la posición inicial de la entrada de bibliografía.
- En caso de que los editores aparezcan después, como en las entradas 3 y 4 del MWE, solo debe haber una coma antes de "&" en caso de que haya más de 2 editores. Aquí no hay coma para solo 2 editores. ¡No me preguntes por qué, solo tengo que hacerlo así!
- La APA normalmente imprime un período entre los autores/editores/institución y el año (entre paréntesis). No se me permite insertar un punto allí. ¿Como puedo quitarlo? En el ejemplo, no se permitiría el punto en la entrada número 2 después de "(Hrsg.)".
He insertado una imagen de la salida. Utilicé el rojo para indicar lo que estaba mal y el verde para mostrar lo que estaba bien.
Ver tambiénModificación del estilo APA de biblatex..
Respuesta1
Creo que este código debería satisfacer sus 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}