Seite 1 von 1

Änderungen in biblatex-apa: Literaturliste anpassen

Verfasst: Di 28. Aug 2018, 11:57
von AlWeis
Hallo!

Ich habe einige Vorgaben für das Literaturverzeichnis bekommen, um meine Diss zu veröffentlichen. Nun hatte ich vorher alles im APA-Stil und habe daran Änderungen durchgeführt. Bisher war das auch erfolgreich, aber es fehlen mir nun doch drei kleine Aspekte im Literaturverzeichnis, die ich nicht hinbekomme. Ich hoffe, ihr könnt mir helfen!

1. Nach dem (letzten) ausgeschriebenen Vornamen sollte kein Punkt erscheinen.

2. Bei Sammelbänden erscheint zwischen Herausgeberkürzel und Jahr ein Punkt, es sollte aber nur ein Leerzeichen sein.

3. Wenn ein Artikel in einem Sammelband erschienen ist, soll das Jahr auch nach dem Herausgeberkürzel stehen, nicht nur nach den Autoren.

Also, bisher sieht es so aus:

Someone, John M. & Otherone, Sally. (2004), Introduction. In: Someone, John M. & Otherone, Sally (Eds.), The XXX (pp. ix-xiv). New York: Psychology Press.

Someone, John M. & Otherone, Sally (Eds.). (2004), The XXX. New York: Psychology Press.


Es sollte aber so aussehen:

Someone, John M. & Otherone, Sally (2004), Introduction. In: Someone, John M. & Otherone, Sally (Eds.) (2004), The XXX (pp. ix-xiv). New York: Psychology Press.

Someone, John M. & Otherone, Sally (Eds.) (2004), The XXX. New York: Psychology Press.


Ich habe ein Minimalbeispiel erstell, dass aber nicht ganz funktioniert und statt des Jahres "labelyearlabelmonthlabelday" ausspuckt. Aber sonst stimmt alles:
\documentclass
[paper=a4,
 pagesize, % passt die Seitengröße für PDFs korrekt an
 fontsize=11pt,
 parskip=half,
 twoside]
{scrreprt}

% Biblatex für die Literaturverwaltung, nach ZFF angepasst
\usepackage[backend=biber,style=apa, doi=false]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}

%In Literaturliste: Komma nach Jahr
\renewcommand*{\labelnamepunct}{\addcomma\space} 

%kein Zeichen zwischen Name und Jahr bei Zitaten
\renewcommand{\nameyeardelim}{\space}

%Semikolon zwischen mehreren Namen
\renewcommand{\multinamedelim}{\addsemicolon\space}

%Vornamen ausschreiben statt Initialen bei Autoren
\renewbibmacro*{name:apa:family-given}[5]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#4#1}%
     \usebibmacro{name:hook}{#4#1}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4\isdot}%
       \ifpunctmark{'}{}{\addhighpenspace}}%
     \mkbibnamefamily{#1\isdot}%
     \ifdefvoid{#2}{}{\addcomma\addlowpenspace\mkbibnamegiven{#2}\isdot%
                    \ifthenelse{\value{uniquename}>1}
                      {\addspace\mkbibbrackets{#2}}
                      {}}%
     \ifdefvoid{#5}{}{\addcomma\addlowpenspace\mkbibnamesuffix{#5}\isdot}}
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamefamily{#1}\isdot
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       {\addcomma}%
     \ifdefvoid{#2}{}{\addlowpenspace\mkbibnamegiven{#2}%
                    \ifthenelse{\value{uniquename}>1}
                      {\addspace\mkbibbrackets{#2}}
                      {}}%
     \ifdefvoid{#4}{}{%
       \addhighpenspace\mkbibnameprefix{#4}%
       \ifpunctmark{'}{}{\addhighpenspace}}%
     \ifdefvoid{#5}{}{\addcomma\addlowpenspace\mkbibnamesuffix{#5}}}}

%auch für Herausgeber
\renewbibmacro*{name:apa:given-family}[5]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#2}%
     \usebibmacro{name:hook}{#2}%
     \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot%
                    \ifthenelse{\value{uniquename}>1}
                      {\addspace\mkbibbrackets{#2}}
                      {}\addspace}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4\isdot}%
       \ifpunctmark{'}{}{\addhighpenspace}}%
     \mkbibnamefamily{#1\isdot}%
     \ifdefvoid{#5}{}{\addlowpenspace\mkbibnamesuffix{#5}\isdot}}
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot%
                    \ifthenelse{\value{uniquename}>1}
                      {\addspace\mkbibbrackets{#2}}
                      {}\addspace}%
     \mkbibnamefamily{#1}\isdot
     \ifdefvoid{#5}{}{\addcomma\addlowpenspace\mkbibnamesuffix{#5}\isdot}}}
    
%Doppelpunkt nach "In" 
\renewcommand{\intitlepunct}{\addcolon\space} 

%auch bei Herausgeber Nachname, Vorname
\DeclareNameFormat{apanames}{% 
  \ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}} 
    {\addcomma\addspace\ldots} 
    {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}} 
      {} 
      {\usebibmacro{name:apa:family-given}% 
        {\namepartfamily}% 
        {\namepartgiven}% 
        {\namepartgiveni}% 
        {\namepartprefix}% 
        {\namepartsuffix}}}% 
    \ifthenelse{\value{listcount}=\value{listtotal}}% 
      {\ifmorenames{\printdelim{andothersdelim}\bibstring{andothers}}{}}{}} 

\renewbibmacro*{in}{% 
  \ifbool{bbx:in}% 
    {}% 
    {\global\booltrue{bbx:in}% 
     \bibcpstring{in}\setunit{\intitlepunct}}} 

\usepackage{filecontents}

\begin{filecontents}{literatur.bib}

@book{Someone.2004,
 year = {2004},
 title = {{The XXX}},
 address = {New York},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally}
}


@incollection{Someone.2004b,
 author = {Someone, John M. and Otherone, Sally},
 title = {{Introduction}},
 pages = {ix--xiv},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally},
 booktitle = {{The XXX}},
 year = {2004},
 address = {New York}
}

\end{filecontents}

\addbibresource{literatur.bib}
     
\begin{document}

Erster  Quellenverweis \parencite{Someone.2004}

Zweiter Quellenverweis \parencite{Someone.2004b}

\printbibliography

\end{document}

Verfasst: Di 28. Aug 2018, 12:47
von Gast
Ach je, warum möchten eigentlich alle möglichen Leute immer ihre subtil anderen eigenen Stile für irgendetwas durchsetzen? Ich hatte Dich ja gewarnt, dass es hässlich werden kann, biblatex-apa zu modifizieren. Das ginge mit den Standardstilen zumindest an einigen Ecken wesentlich leichter.

Der folgende Code funktioniert mit biblatex 3.11 und biblatex-apa 7.7.
\documentclass{article}
\usepackage[ngerman]{babel}
% Biblatex für die Literaturverwaltung, nach ZFF angepasst
\usepackage[backend=biber,style=apa, doi=false]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}

%In Literaturliste: Komma nach Jahr
\renewcommand*{\labelnamepunct}{\addcomma\space}

%kein Zeichen zwischen Name und Jahr bei Zitaten
\DeclareDelimFormat{nameyeardelim}{\space}

%Semikolon zwischen mehreren Namen
\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}

%Vornamen ausschreiben statt Initialen bei Autoren
\renewbibmacro*{name:apa:family-given}[5]{%
  \ifuseprefix
    {\usebibmacro{name:delim:apa:family-given}{#4#1}%
     \usebibmacro{name:hook}{#4#1}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4}\isdot%
       \ifprefchar{}{\bibnamedelimc}}%
     \mkbibnamefamily{#1}\isdot%
     \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
     \ifdefvoid{#5}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}
    {\usebibmacro{name:delim:apa:family-given}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamefamily{#1}\isdot
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       {\revsdnamepunct}%
     \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#3}}%
     \ifdefvoid{#4}{}{%
       \bibnamedelimc\mkbibnameprefix{#4}%
       \ifprefchar{}{\bibnamedelimc}}%
     \ifdefvoid{#5}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}}

%auch für Herausgeber
\renewbibmacro*{name:apa:given-family}[5]{%
  \usebibmacro{name:delim}{#2#4#1#5}%
  \usebibmacro{name:hook}{#2#4#1#5}%
  \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot
                   \bibnamedelimd}%
  \ifdefvoid{#4}{}{%
    \mkbibnameprefix{#4}\isdot
    \ifprefchar{}{\bibnamedelimc}}%
  \mkbibnamefamily{#1}\isdot%
  \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}
   
   
\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+extradate}}

\renewbibmacro*{editorinauthpos}{%
    \global\booltrue{bbx:editorinauthpos}%
    \printnames[apaauthor][-\value{listtotal}]{editor}%
    \setunit{\addspace}%
    \ifnameundef{editor}
      {}
      {\printtext[parens]{\usebibmacro{apaeditorstrg}{editor}}%
       % need to clear editor so we don't get an "In" clause later
       % But we also need to set a flag to say we did this so we
       % don't lose sight of the fact we once had an editor for
       % various year placement tests
       \clearname{editor}%
       \setunit{\addspace}\newblock%
       \usebibmacro{labelyear+extradate}%
       \setunit{\adddot\addspace}}}

%Doppelpunkt nach "In"
\renewcommand{\intitlepunct}{\addcolon\space}

\renewbibmacro*{in}{%
  \ifbool{bbx:in}%
    {}%
    {\global\booltrue{bbx:in}%
     \bibcpstring{in}\setunit{\intitlepunct}}}

%auch bei Herausgeber Nachname, Vorname
\DeclareNameFormat{apanames}{%
  \ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
    {\addcomma\addspace\ldots}
    {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
      {}
      {\usebibmacro{name:apa:family-given}%
        {\namepartfamily}%
        {\namepartgiven}%
        {\namepartgiveni}%
        {\namepartprefix}%
        {\namepartsuffix}}}%
    \ifthenelse{\value{listcount}=\value{listtotal}}%
      {\ifmorenames{\printdelim{andothersdelim}\bibstring{andothers}}{}}{}}

\newbibmacro*{labelyearonly}{%
  \iffieldundef{labelyear}
    {\iffieldundef{origyear}
      {}
      {\printtext[apadate]{\printorigdate}}}%
    {\printtext[apadate]{\printlabeldate}}}

\renewbibmacro*{editor+trans}{%
  \ifthenelse{\ifnameundef{editor}\AND%
              \ifnameundef{editora}\AND%
              \ifnameundef{editorb}\AND%
              \ifnameundef{editorc}\AND%
              \ifnameundef{translator}}%
    {\setunit{\adddot\addspace}}%
    {\ifnamesequal{editor}{translator}%
      {\usebibmacro{in}%
       \printnames[apanames][-\value{listtotal}]{editor}%
       \setunit{\addspace\bibopenparen\global\booltrue{bbx:parens}}%
       \usebibmacro{apaeditorstrg}{editor}%
       \setunit*{\addspace\&\space}%
       \printtext{\bibcpstring{translator}}%
       \ifbool{bbx:parens}{\printtext{\bibcloseparen}\global\boolfalse{bbx:parens}}{}}
      {\ifnameundef{translator}%
        {}%
        {\setunit{\addspace}%
         \printtext[parens]{\printnames[apanames][-\value{listtotal}]{translator}%
         \setunit{\addcomma\addspace}%
         \printtext{\bibcpstring{translator}}}%
         \clearname{translator}%
         \setunit{\adddot\addspace}}%
       \usebibmacro{in}%
       \usebibmacro{editorx}}%
     \setunit{\addspace}%
     \usebibmacro{labelyearonly}%
     \setunit{\addcomma\space}\newblock}}

\usepackage{filecontents}

\begin{filecontents}{literatur.bib}

@book{Someone.2004,
 year = {2004},
 title = {{The XXX}},
 address = {New York},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally}
}


@incollection{Someone.2004b,
 author = {Someone, John M. and Otherone, Sally},
 title = {{Introduction}},
 pages = {ix--xiv},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally},
 booktitle = {{The XXX}},
 year = {2004},
 address = {New York}
}

\end{filecontents}

\addbibresource{literatur.bib}
     
\begin{document}

Erster  Quellenverweis \parencite{Someone.2004}

Zweiter Quellenverweis \parencite{Someone.2004b}

\printbibliography

\end{document}

Nachfrage

Verfasst: Di 28. Aug 2018, 15:13
von AlWeis
Hallo!

Vielen Dank! Du hast mir sehr geholfen. Und ja, du hast Recht: Mich nervt es natürlich auch, dass ich jetzt alles anpassen muss.
APA als Grundlage schien mir sinnvoller, weil ich bei anderen Vorlagen wieder Fehler in den Referenzen drin hatte, die ich schon lange beseitigt hatte.

Nun zu meiner Nachfrage: Ich habe versucht, deinen Code nachzuvollziehen und an meine biblatex-apa-Version anzupassen. Dadurch konnte ich die Probleme 2 und 3 lösen. Jedoch kann ich nicht nachvollziehen, welcher Codeteil dafür verantwortlich ist, dass nach dem Vornamen kein Punkt mehr steht. Könntest du mir das im Skript kurz kommentieren?

Danke und viele Grüße!

Verfasst: Di 28. Aug 2018, 15:38
von Gast
Hab die entsprechenden Stellen markiert und auch andere Änderungen kurz erläutert. Dazu habe ich zu besseren Sichtbarkeit Deine Kommentare entfernt.
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=apa, doi=false]{biblatex}
% mit neuen Versionen braucht man \DeclareLanguageMapping nicht mehr

\renewcommand*{\labelnamepunct}{\addcomma\space}

% \DeclareDelimFormat statt \renewcommand für context-sensitive Zeichensetzung
\DeclareDelimFormat{nameyeardelim}{\space}

% ditto
\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}

% Vereinfachung des Codes (damit einhergehend Beseitigung eines Bugs,
% der dazu führen könnte, dass bei zwei Autoren mit gleichen Nachnamen
% und Initialen der Vorname zusätzlich auch noch in Klammern ausgegeben wird)
\renewbibmacro*{name:apa:family-given}[5]{%
  \ifuseprefix
    {\usebibmacro{name:delim:apa:family-given}{#4#1}%
     \usebibmacro{name:hook}{#4#1}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4}\isdot%
       \ifprefchar{}{\bibnamedelimc}}%
     \mkbibnamefamily{#1}\isdot%
     \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
     \ifdefvoid{#5}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}
    {\usebibmacro{name:delim:apa:family-given}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamefamily{#1}\isdot
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#4}}}
       {}
       {\revsdnamepunct}%
     \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#3}}%
     \ifdefvoid{#4}{}{%
       \bibnamedelimc\mkbibnameprefix{#4}%
       \ifprefchar{}{\bibnamedelimc}}%
     \ifdefvoid{#5}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}}

% ditto, geht hier sogar noch einfacher, da der Code in älteren Versionen
% redundant war
\renewbibmacro*{name:apa:given-family}[5]{%
  \usebibmacro{name:delim}{#2#4#1#5}%
  \usebibmacro{name:hook}{#2#4#1#5}%
  \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot
                   \bibnamedelimd}%
  \ifdefvoid{#4}{}{%
    \mkbibnameprefix{#4}\isdot
    \ifprefchar{}{\bibnamedelimc}}%
  \mkbibnamefamily{#1}\isdot%
  \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}}

% Punkt nach Autor weg
\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% <- hier stand mal \newunit, was für den Punkt sorgte
  \usebibmacro{labelyear+extradate}}

% Punkt nach Herausgeber (in Autor-Position) weg
\renewbibmacro*{editorinauthpos}{%
    \global\booltrue{bbx:editorinauthpos}%
    \printnames[apaauthor][-\value{listtotal}]{editor}%
    \setunit{\addspace}%
    \ifnameundef{editor}
      {}
      {\printtext[parens]{\usebibmacro{apaeditorstrg}{editor}}%
       \clearname{editor}%
       \setunit{\addspace}\newblock%<- \adddot (warum nicht \addperiod?) weg
       \usebibmacro{labelyear+extradate}%
       \setunit{\adddot\addspace}}}

\renewcommand{\intitlepunct}{\addcolon\space}

\renewbibmacro*{in}{%
  \ifbool{bbx:in}%
    {}%
    {\global\booltrue{bbx:in}%
     \bibcpstring{in}\setunit{\intitlepunct}}}


\DeclareNameFormat{apanames}{%
  \ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
    {\addcomma\addspace\ldots}
    {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
      {}
      {\usebibmacro{name:apa:family-given}%
        {\namepartfamily}%
        {\namepartgiven}%
        {\namepartgiveni}%
        {\namepartprefix}%
        {\namepartsuffix}}}%
    \ifthenelse{\value{listcount}=\value{listtotal}}%
      {\ifmorenames{\printdelim{andothersdelim}\bibstring{andothers}}{}}{}}

% eigentlich würde ich gerne labelyear+extradate nutzen, aber dann würde
% man im Beispiel (2004a) statt (2004) bekommen.
\newbibmacro*{labelyearonly}{%
  \iffieldundef{labelyear}
    {\iffieldundef{origyear}
      {}
      {\printtext[apadate]{\printorigdate}}}%
    {\printtext[apadate]{\printlabeldate}}}

% Punkt nach Herausgeber für @in...-Typen weg und Jahr dazu
\renewbibmacro*{editor+trans}{%
  \ifthenelse{\ifnameundef{editor}\AND%
              \ifnameundef{editora}\AND%
              \ifnameundef{editorb}\AND%
              \ifnameundef{editorc}\AND%
              \ifnameundef{translator}}%
    {\setunit{\adddot\addspace}}%
    {\ifnamesequal{editor}{translator}%
      {\usebibmacro{in}%
       \printnames[apanames][-\value{listtotal}]{editor}%
       \setunit{\addspace\bibopenparen\global\booltrue{bbx:parens}}%
       \usebibmacro{apaeditorstrg}{editor}%
       \setunit*{\addspace\&\space}%
       \printtext{\bibcpstring{translator}}%
       \ifbool{bbx:parens}{\printtext{\bibcloseparen}\global\boolfalse{bbx:parens}}{}}
      {\ifnameundef{translator}%
        {}%
        {\setunit{\addspace}%
         \printtext[parens]{\printnames[apanames][-\value{listtotal}]{translator}%
         \setunit{\addcomma\addspace}%
         \printtext{\bibcpstring{translator}}}%
         \clearname{translator}%
         \setunit{\adddot\addspace}}%
       \usebibmacro{in}%
       \usebibmacro{editorx}}%
     \setunit{\addspace}%<- für Leerzeichen vor dem Jahr
     \usebibmacro{labelyearonly}%<- Jahr hinzugefügt
     \setunit{\addcomma\space}\newblock}}

\usepackage{filecontents}

\begin{filecontents}{literatur.bib}
@book{Someone.2004,
  year      = {2004},
  title     = {{The XXX}},
  address   = {New York},
  publisher = {{Psychology Press}},
  editor    = {Someone, John M. and Otherone, Sally}
}

@suppcollection{Someone.2004b,
  author    = {Someone, John M. and Otherone, Sally},
  title     = {{Introduction}},
  pages     = {ix--xiv},
  publisher = {{Psychology Press}},
  editor    = {Someone, John M. and Otherone, Sally},
  booktitle = {{The XXX}},
  year      = {2004},
  address   = {New York}
}
\end{filecontents}

\addbibresource{literatur.bib}

\begin{document}
Erster  Quellenverweis \parencite{Someone.2004}

Zweiter Quellenverweis \parencite{Someone.2004b}

\printbibliography
\end{document}
Die Originaldefinition der meisten Makros findest Du in apa.bbx, falls Du eine exakte Analyse der Änderungen brauchst.

Verfasst: Mi 29. Aug 2018, 12:42
von AlWeis
Vielen Dank nochmal!

Ja, die bbx-Datei habe ich immer herangezogen, um Änderungen so zu machen, dass sie meiner Version entsprechen. Jetzt sehen die Referenzen in der Literaturliste genau so aus, wie gefordert.

Nur ist jetzt ein anderes Problem aufgetaucht: Die Sammelbände, aus denen ich Artikel zitiert habe, erscheinen nicht mehr eigenständig in der Literaturliste. Woran könnte das denn liegen?

(btw. DeclareDelimFormat funktioniert bei mir nicht, also hab ich es beim alten gelassen. Und auch DeclareLanguageMapping brauche ich.)

Hier mein aktueller Code als Minimalbeispiel - komischerweise tritt das Poblem mit den Sammelbänden hier nicht auf...
\documentclass
[paper=a4,
 pagesize, % passt die Seitengröße für PDFs korrekt an
 fontsize=11pt,
 parskip=half,
 twoside]
{scrreprt}

% Biblatex für die Literaturverwaltung, nach ZFF
\usepackage[backend=biber,style=apa, doi=false]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}

%In Literaturliste: Komma nach Jahr
\renewcommand*{\labelnamepunct}{\addcomma\space} 

%kein Zeichen zwischen Name und Jahr bei Zitaten
\renewcommand{\nameyeardelim}{\space}

%Semikolon zwischen mehreren Namen
\renewcommand{\multinamedelim}{\addsemicolon\space}

%Doppelpunkt zwischen Vol. und Number bei Zeitschriften
\DeclareFieldFormat[article]{volume}{{\apanum{#1}}}
\DeclareFieldFormat[article]{number}{\addcolon{\apanum{#1}}}

%Vornamen ausschreiben statt Initialen bei Autoren
\renewbibmacro*{name:apa:family-given}[5]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#4#1}%
     \usebibmacro{name:hook}{#4#1}%
     \ifdefvoid{#4}{}{%
       \mkbibnameprefix{#4\isdot}%
       \ifpunctmark{'}{}{\bibnamedelimc}}%
     \mkbibnamefamily{#1\isdot}%
     \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}%
     \ifdefvoid{#5}{}{\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}{}{\bibnamedelimd\mkbibnamegiven{#2}}%
     \ifdefvoid{#4}{}{%
       \bibnamedelimd\mkbibnameprefix{#4}%
       \ifprefchar{'}{}{\bibnamedelimc}}%
     \ifdefvoid{#5}{}{\addcomma\bibnamedelimd\mkbibnamesuffix{#5}\idot}}}

%Punkt nach Autor weg 
\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% <- hier stand mal \newunit, was für den Punkt sorgte 
  \usebibmacro{labelyear+extrayear}} 

%auch für Herausgeber
\renewbibmacro*{name:apa:given-family}[5]{% 
  \usebibmacro{name:delim}{#2#4#1#5}% 
  \usebibmacro{name:hook}{#2#4#1#5}% 
  \ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot 
                   \bibnamedelimd}% 
  \ifdefvoid{#4}{}{% 
    \mkbibnameprefix{#4}\isdot 
    \ifprefchar{}{\bibnamedelimc}}% 
  \mkbibnamefamily{#1}\isdot% 
  \ifdefvoid{#5}{}{\bibnamedelimd\mkbibnamesuffix{#5}\isdot}} 
    
%auch bei Herausgeber Nachname, Vorname
\DeclareNameFormat{apanames}{% 
  \ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}} 
    {\addcomma\addspace\ldots} 
    {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}} 
      {} 
      {\usebibmacro{name:apa:family-given}% 
        {\namepartfamily}% 
        {\namepartgiven}% 
        {\namepartgiveni}% 
        {\namepartprefix}% 
        {\namepartsuffix}}}% 
    \ifthenelse{\value{listcount}=\value{listtotal}}% 
      {\ifmorenames{\printdelim{andothersdelim}\bibstring{andothers}}{}}{}} 

%Wenn Artikel in Sammelband, dann Jahr nach Herausgeber
\newbibmacro*{labelyearonly}{% 
  \iffieldundef{labelyear} 
    {\iffieldundef{origyear} 
      {} 
      {\printtext[apadate]{\printorigdate}}}% 
    {\printtext[apadate]{\printlabeldate}}} 

\renewbibmacro*{editor+trans}{% 
  \ifthenelse{\ifnameundef{editor}\AND% 
              \ifnameundef{editora}\AND% 
              \ifnameundef{editorb}\AND% 
              \ifnameundef{editorc}\AND% 
              \ifnameundef{translator}}% 
    {\setunit{\adddot\addspace}}% 
    {\ifnamesequal{editor}{translator}% 
      {\usebibmacro{in}% 
       \printnames[apanames][-\value{listtotal}]{editor}% 
       \setunit{\addspace\bibopenparen\global\booltrue{bbx:parens}}% 
       \usebibmacro{apaeditorstrg}{editor}% 
       \setunit*{\addspace\&\space}% 
       \printtext{\bibcpstring{translator}}% 
       \ifbool{bbx:parens}{\printtext{\bibcloseparen}\global\boolfalse{bbx:parens}}{}} 
      {\ifnameundef{translator}% 
        {}% 
        {\setunit{\addspace}% 
         \printtext[parens]{\printnames[apanames][-\value{listtotal}]{translator}%
         \setunit{\addcomma\addspace}% 
         \printtext{\bibcpstring{translator}}}% 
         \clearname{translator}% 
         \setunit{\adddot\addspace}}% 
       \usebibmacro{in}% 
       \usebibmacro{editorx}}% 
     \setunit{\addspace}% 
     \usebibmacro{labelyearonly}% 
     \setunit{\addcomma\addspace}}} 

%kein Punkt zwischen (Hrsg.) und Jahr
\renewbibmacro*{editorinauthpos}{%
    \global\booltrue{bbx:editorinauthpos}%
    \printnames[apaauthor][-\value{listtotal}]{editor}%
    \setunit{\addspace}%
    \ifnameundef{editor}
      {}
      {\printtext[parens]{\usebibmacro{apaeditorstrg}{editor}}%
       % need to clear editor so we don't get an "In" clause later
       % But we also need to set a flag to say we did this so we
       % don't lose sight of the fact we once had an editor for
       % various year placement tests
       \clearname{editor}%
       \setunit{\addspace}%
       \usebibmacro{labelyear+extrayear}%
       \setunit{\adddot\addspace}}}

%Doppelpunkt nach "In" 
\renewcommand{\intitlepunct}{\addcolon\space} 

\renewbibmacro*{in}{% 
  \ifbool{bbx:in}% 
    {}% 
    {\global\booltrue{bbx:in}% 
     \bibcpstring{in}\setunit{\intitlepunct}}} 


\usepackage{filecontents}

\begin{filecontents}{literatur.bib}

@book{Someone.2004,
 year = {2004},
 title = {{The XXX}},
 address = {New York},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally}
}


@incollection{Someone.2004b,
 author = {Someone, John M. and Otherone, Sally},
 title = {{Introduction}},
 pages = {ix--xiv},
 publisher = {{Psychology Press}},
 editor = {Someone, John M. and Otherone, Sally},
 booktitle = {{The XXX}},
 year = {2004},
 address = {New York}
}

\end{filecontents}

\addbibresource{literatur.bib}
     
\begin{document}

%Erster  Quellenverweis \parencite{Someone.2004}

Zweiter Quellenverweis \parencite{Someone.2004b}

\printbibliography

\end{document}

Verfasst: Mi 29. Aug 2018, 13:31
von Gast
Ich bin mir nicht ganz sicher, ob ich Dein Problem verstehe. Prinzipiell tauchen im Literaturverzeichnis nur explizit zitierte oder mit \nocite nicht-zitierte Werke auf.

Wenn Du also den Sammelband zu einem bestimmten Artikel nicht extra zitierst, wird er im Literaturverzeichnis nicht auftauchen. Natürlich wird im Eintrag des Artikels der Sammelband genannt, aber der Sammelband bekommt keinen eigenen Verzeichniseintrag. Insbesondere gibt es in der gezeigten Form keine Möglichkeit für biblatex, den Eintrag automatisch hinzuzufügen, da keinerlei Verbindung zwischen den Beiden Einträgen Someone.2004 und Someone.2004b angezeigt wurde.

Wenn man mit crossrefs Arbeitet, dann wäre so etwas aber möglich. Zum Beispiel (vereinfacht aus biblatex-examples.bib)
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@collection{westfahl:frontier,
  editor       = {Westfahl, Gary},
  title        = {Space and Beyond},
  date         = 2000,
  subtitle     = {The Frontier Theme in Science Fiction},
  publisher    = {Greenwood},
  location     = {Westport, Conn. and London},
}

@incollection{westfahl:space,
  author       = {Westfahl, Gary},
  title        = {The True Frontier},
  subtitle     = {Confronting and Avoiding the Realities of Space in {American}
                  Science Fiction Films},
  pages        = {55-65},
  crossref     = {westfahl:frontier},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{westfahl:space}
\printbibliography
\end{document}
Der erste Vorteil von crossref ist, dass man viele Sachen nicht doppelt angeben muss, sie werden automatisch in die richtigen Felder vererbt (siehe kein booktitle oder editor in westfahl:space, aber sie erscheinen trotzdem in der Ausgabe). Ferner kann man mit mincrossrefs dafür sorgen, dass der Sammelband trotz fehlender expliziter Erwähnung dennoch im Literaturverzeichnis auftaucht: Füge in dem Beispiel mal die Option mincrossrefs=1 hinzu (der Standardwert ist 2). Einen ähnlichen Effekt ohne Vererbung von Feldern bietet xref.

PS: Sollte Someone.2004 nicht eine @collection sein, wenn Someone.2004b eine @incollection ist?

PPS: Minimalbeispiele sind natürlich nur wirklich sinnvoll, wenn sie das Problem reproduzieren.

PPPS: Minimalbeispiele sollten idealerweise auch minimal sein. Versuch also bitte ruhig Dein Problem auch ohne Deine vielen Modifikationen zu reproduzieren. Wenn wir die im Minimalbeispiel nämlich weglassen können, machen sie die Sache viel übersichtlicher.

PPPPS (ich hör gleich auf, versprochen): Wenn es sich hier um ein neues Problem handelt, ist es auch kein Problem, ein neues Thema aufzumachen, auch das hält die Sache hier übersichtlich.

Großen Dank!

Verfasst: Mi 29. Aug 2018, 13:55
von AlWeis
So, jetzt habe ich wirklich alles so, wie es sein soll!

Vielen, vielen Dank!

P.s. Ich werde mich das nächste Mal an die Regeln halten! :-P