pferdefreund
31-12-2013, 12:15
Hallo!
Ich habe nach den strengen Vorgaben meiner Uni versucht einen eigenen Stil zu erstellen. Leider komme ich momentan nicht mehr weiter.
Problem 1: Warum erscheint im Literaturverzeichnis vor dem Textzitat (z.B. (1)) ein Punkt ab dem zweiten Eintrag?
Problem 2: Umlaute im Literaturverzeichnis werden nicht korrekt angezeigt. {"u} hilft auch nicht weiter.
Vielen Dank im Voraus!
%LaTeX Dokument
\documentclass[parskip=full]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{acronym}
\usepackage[backend=biber, style=meinstil]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\addbibresource{literatur.bib}
\defbibheading{lit}{\chapter{Literaturverzeichnis} }
\begin{document}
\chapter{Einleitung}
Hier steht ein Text \cite{Muller2005} \\
bla bla \cite{Moller2005}
und noch mehr Text \cite{Müller2000} \\
\printbibliography[heading=lit]
\end{document}
% Literatur
@article{Bassi2005,
author = {C Müller and F Meyer and H Schmitt and T Moll and E Wing and O Troll and P Myer},
title = {Hier steht der Titel.},
journal = {Journal},
volume = {138},
year = {2005},
pages = {8-13},
}
@article{Müller2000,
author = {MW Müller},
title = {Titel des Dokumentes.},
journal = {Journal},
volume = {87},
year = {2000},
pages = {883–889},
}
% meinstil.bbx
\ProvidesFile{meinstil.bbx}[2013/10/30\space v6.4\space APA biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\newcommand{\maxprtauth}{20}
\DeclareBibliographyOption{apamaxprtauth}{%
\ifstrempty{#1}
{}
{\renewcommand{\maxprtauth}{#1}}}
\ExecuteBibliographyOptions{labelnumber}
\DeclareNameAlias{author}{default}
\DeclareNameAlias{editor}{default}
\DeclareNameAlias{translator}{default}
\DeclareFieldFormat{bibentrysetcount}{{\mknumalph{ #1}}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbracke ts{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext({%
\printfield{prefixnumber}%
\printfield{labelnumber})}} %
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
}
{\endlist}
{\item}
\newcommand{\apanum}[1]{\ifrmnum{#1}{\rmntonum{#1}}{#1}}
\newcommand*{\mkbibrangeapalong}[1]{%
\ifthenelse{\equal{#1}{url}}
{\printtext{%
\mkbibdateapalongmdy{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalongmdy{}{}{#1endday}}}%
{\mkbibdateapalongmdy{}{#1endmonth}{#1endday}}}%
{\mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1end day}}}}}}
{\printtext{%
\mkbibdateapalong{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalong{}{}{#1endday}}}%
{\mkbibdateapalong{}{#1endmonth}{#1endday}}}%
{\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday }}}}}}}
% Only for DATE as only \printdateextra is used
\newcommand*{\mkbibrangeapalongextra}[1]{%
\printtext{%
\mkbibdateapalongextra{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalongextra{}{}{#1endday}}}
{\mkbibdateapalongextra{}{#1endmonth}{#1endday}}}
{\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1e ndday}}}}}}
\DeclareSortingScheme{apa}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{writer}
\field{director}
\field{producer}
\field{execproducer}
\field{origauthor}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
\field{pubstate}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}
}
}
\DeclareLabeldate{%
\field{pubstate}
\field{date}
\literal{nodate}
}
\ExecuteBibliographyOptions{labeldate=true,%
sorting=apa,%
autocite=inline,%
backref=true,%
pagetracker=true,%
useprefix=true,%
usetranslator=true,%
uniquelist=minyear,%
uniquename=full,%
citetracker=true,%
maxcitenames=2,%
mincitenames=1,%
maxbibnames=7,%
minbibnames=6,%
abbreviate=true,%
mincrossrefs=999,%
date=apalong,%
datelabel=apalong,%
origdate=apalong,%
urldate=apalong,%
eventdate=comp}
\newbool{apa:backref}
\DeclareBibliographyOption{apabackref}{%
\ifstrequal{#1}{true}
{\global\booltrue{apa:backref}}
{\global\boolfalse{apa:backref}}}
\DeclareNameAlias{default}{apaauthor}
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\valu e{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\iffieldequalstr{doubtfulauthor}{true}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}%
{\ifmorenames{\andothersdelim\bibstring{andothers} }{}}{}}
\renewbibmacro*{author}{%
\ifnameundef{author}
{\usebibmacro{labeltitle}}
{\printnames[apaauthor][-\value{listtotal}]{author}%
\setunit*{\addspace}%
\printfield{nameaddon}%
\ifnameundef{with}
{}
{\setunit{}\addspace\mkbibparens{\printtext{\bibst ring{with}\addspace}%
\printnames[apaauthor][-\value{listtotal}]{with}}
\setunit*{\addspace}}}%
\newunit\newblock%
\usebibmacro{labelyear+extrayear}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%
% (APA 6.27) References section delimiters are ampersands, not " and "
% Needs to be in this hook otherwise it sets this for all
% citations too.
% (APA 6.27) Use blank for long lists
% (APA 4.03) Serial comma for lists of three or more
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{~,\space}%
\renewcommand*{\finalnamedelim}{~,\space}%
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.28) Use "nodate" bibstring for references with no year
% Months and days go into parenthesis with year, if set
% (APA 6.29) Issue goes where month normally goes if it
% is set.
% Make sure endmonth gets an expansion too
\DeclareFieldFormat{endmonth}{\mkbibmonth{#1}}
\newbibmacro*{monthorissue}{%
\iffieldundef{issue}
{\iffieldundef{month}
{}
{\addcomma\space\printfield{month}%
\iffieldundef{endmonth}{}{/\printfield{endmonth}}}}
{\addcomma\space\printfield{issue}}}
\newbibmacro*{labelyear+extrayear}{%
\iffieldundef{labelyear}
{\iffieldundef{origyear}
{}
{\printtext[yearorunkyear]{\printfield[noformat]{origyear}}}}%
{\printtext[yearorunkyear]{\printdateextralabel}}}
\DeclareFieldFormat{yearorunkyear}{%
\ifthenelse{\iffieldequalstr{doubtfuldate}{true}}
{\mkbibbrackets{ca\adddot\addspace#1}}
{\mkbibparens{#1}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
% (APA 6.29) General format of titles.
% Ugly Chicago-style lowercasing of English titles
\DeclareFieldFormat{apacase}{\MakeSentenceCase*{#1 }}
\DeclareFieldFormat{issuetitle}{#1\isdot}
\DeclareFieldFormat{title}{#1\isdot}
\DeclareFieldFormat{origtitle}{\MakeSentenceCase*{ #1}\isdot}
\DeclareFieldFormat[article]{title}{#1\isdot}
\DeclareFieldFormat[article]{origtitle}{\MakeSentenceCase*{#1}\isdot}
\DeclareFieldFormat{journaltitle}{#1\isdot}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%
% (APA 7.01 Example 10) Newspapers have prefix for pages.
\DeclareFieldFormat[newsarticle]{pages}{%
\DeclareNumChars{.abcdefghijklmnopqrstuvwxyzABCDEF GHIJKLMNOPQRSTUVWXYZ}%
\mkpageprefix{#1}%
\DeclareNumChars{.}}
\DeclareFieldFormat[newsarticle]{newspaper}{#1}
\DeclareFieldFormat[newsarticle]{entrysubtype}{\mkbibbrackets{#1}}
\DeclareFieldFormat[newsarticle]{title}{#1}
\DeclareFieldFormat[article]{pages}{#1}
\newbibmacro*{newspaper}{%
\printfield{newspaper}
\setunit{\addcomma\space}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%
% (APA 6.30) Commas between title and volume for articles
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\printfield{number}%
\setunit{\addspace}\newblock
\usebibmacro{issuename}%
\newunit}
\newbibmacro*{issuename}{%
\iffieldundef{issuetitle}
{}
{\printtext[issuetitle]{%
\printfield[noformat]{issuetitle}%
\setunit{\subtitlepunct}%
\printfield[noformat]{issuesubtitle}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%
% (APA 6.27) Name format. Don't capitalise prefixes
% (APA 6.27) Full name disambiguation using brackets
% #1 = last name
% #2 = first name
% #3 = first name (initials)
% #4 = name prefix, a.k.a. 'von part'
% #5 = name affix, a.k.a. 'junior part'
\makeatletter
\def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@ i#1..\@nil}
\def\mkbibnamefirst@i#1.#2.#3\@nil{#1}
\newbibmacro*{name:apa:last-first}[5]{%
\ifuseprefix
{\usebibmacro{name:delim}{#2#1}%
\usebibmacro{name:hook}{#2#1}%
\ifblank{#3}{}{%
\mkbibnameprefix{#4}%
\ifpunctmark{'}{}{\addhighpenspace}}%
\mkbibnamelast{#1\isdot}%
\ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#3}\ isdot%
\ifthenelse{\value{uniquename}>1}
{\addspace\mkbibbrackets{#2}}
{}}%
\ifblank{#5}{}{\addcomma\addlowpenspace\mkbibnamea ffix{#5}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
\ifblank{#2#4}{}{\addcomma}%
\ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#3}%
\ifthenelse{\value{uniquename}>1}
{\addspace\mkbibbrackets{#2}}
{}}%
\ifblank{#4}{}{%
\addhighpenspace\mkbibnameprefix{#4}%
\ifpunctmark{'}{}{\addhighpenspace}}%
\ifblank{#5}{}{\addcomma\addlowpenspace\mkbibnamea ffix{#5}\isdot}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.29) Special journal issues
\DeclareFieldFormat[periodical]{title}{#1\isdot}
\DeclareFieldFormat[periodical]{issuetitle}{\mkbibemph{#1}\isdot}
\renewbibmacro*{periodical}{%
\iffieldundef{title}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}}}
\renewbibmacro*{title+issuetitle}{%
\usebibmacro{periodical}%
\newunit
\usebibmacro{issue}%
\setunit*{\addcomma\addspace}%
\setunit{\addcomma\space}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
% Hacky bits to suppress final period in some cases.
% * If there is an ORIGYEAR field (APA 7.02:21)
% * Unless there is a RELATED and ADDENDUM
\newbibmacro*{apa:finpunct}{%
\iffieldundef{origyear}
{\ifboolexpr{
test {\iffieldundef{addendum}}
and
test {\iffieldundef{related}}}
{}
{\renewcommand*{\finentrypunct}{\relax}}}
{\renewcommand*{\finentrypunct}{\relax}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 7.x) General type layouts
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor}%
\setunit{\addspace}\newblock
\usebibmacro{title}%
\newunit\newblock{\newline}
\usebibmacro{journal+issuetitle}%
\setunit{\addspace}%
\printfield{volume}%
\setunit{\addcolon\addspace}%
\printfield{pages}%
\newunit\newblock{\newline}
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Wrapper for backrefs
\newbibmacro{apa:pageref}{%
\ifbool{apa:backref}{\usebibmacro{pageref}}{}}
\endinput
Ich habe nach den strengen Vorgaben meiner Uni versucht einen eigenen Stil zu erstellen. Leider komme ich momentan nicht mehr weiter.
Problem 1: Warum erscheint im Literaturverzeichnis vor dem Textzitat (z.B. (1)) ein Punkt ab dem zweiten Eintrag?
Problem 2: Umlaute im Literaturverzeichnis werden nicht korrekt angezeigt. {"u} hilft auch nicht weiter.
Vielen Dank im Voraus!
%LaTeX Dokument
\documentclass[parskip=full]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[babel, german=quotes]{csquotes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{acronym}
\usepackage[backend=biber, style=meinstil]{biblatex}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\addbibresource{literatur.bib}
\defbibheading{lit}{\chapter{Literaturverzeichnis} }
\begin{document}
\chapter{Einleitung}
Hier steht ein Text \cite{Muller2005} \\
bla bla \cite{Moller2005}
und noch mehr Text \cite{Müller2000} \\
\printbibliography[heading=lit]
\end{document}
% Literatur
@article{Bassi2005,
author = {C Müller and F Meyer and H Schmitt and T Moll and E Wing and O Troll and P Myer},
title = {Hier steht der Titel.},
journal = {Journal},
volume = {138},
year = {2005},
pages = {8-13},
}
@article{Müller2000,
author = {MW Müller},
title = {Titel des Dokumentes.},
journal = {Journal},
volume = {87},
year = {2000},
pages = {883–889},
}
% meinstil.bbx
\ProvidesFile{meinstil.bbx}[2013/10/30\space v6.4\space APA biblatex references style]
\RequireBiber[3]
\RequireBibliographyStyle{standard}
\newcommand{\maxprtauth}{20}
\DeclareBibliographyOption{apamaxprtauth}{%
\ifstrempty{#1}
{}
{\renewcommand{\maxprtauth}{#1}}}
\ExecuteBibliographyOptions{labelnumber}
\DeclareNameAlias{author}{default}
\DeclareNameAlias{editor}{default}
\DeclareNameAlias{translator}{default}
\DeclareFieldFormat{bibentrysetcount}{{\mknumalph{ #1}}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbracke ts{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext({%
\printfield{prefixnumber}%
\printfield{labelnumber})}} %
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
}
{\endlist}
{\item}
\newcommand{\apanum}[1]{\ifrmnum{#1}{\rmntonum{#1}}{#1}}
\newcommand*{\mkbibrangeapalong}[1]{%
\ifthenelse{\equal{#1}{url}}
{\printtext{%
\mkbibdateapalongmdy{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalongmdy{}{}{#1endday}}}%
{\mkbibdateapalongmdy{}{#1endmonth}{#1endday}}}%
{\mkbibdateapalongmdy{#1endyear}{#1endmonth}{#1end day}}}}}}
{\printtext{%
\mkbibdateapalong{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalong{}{}{#1endday}}}%
{\mkbibdateapalong{}{#1endmonth}{#1endday}}}%
{\mkbibdateapalong{#1endyear}{#1endmonth}{#1endday }}}}}}}
% Only for DATE as only \printdateextra is used
\newcommand*{\mkbibrangeapalongextra}[1]{%
\printtext{%
\mkbibdateapalongextra{#1year}{#1month}{#1day}%
\iffieldundef{#1endyear}%
{}%
{\iffieldequalstr{#1endyear}{}% open-ended range?
{\mbox{\bibdatedash}}
{\bibdatedash%
\iffieldsequal{#1year}{#1endyear}%
{\iffieldsequal{#1month}{#1endmonth}%
{\iffieldsequal{#1day}{#1endday}%
{}%
{\mkbibdateapalongextra{}{}{#1endday}}}
{\mkbibdateapalongextra{}{#1endmonth}{#1endday}}}
{\mkbibdateapalongextra{#1endyear}{#1endmonth}{#1e ndday}}}}}}
\DeclareSortingScheme{apa}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{writer}
\field{director}
\field{producer}
\field{execproducer}
\field{origauthor}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{year}
\field{pubstate}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field[padside=left,padwidth=4,padchar=0]{volume}
\literal{0000}
}
}
\DeclareLabeldate{%
\field{pubstate}
\field{date}
\literal{nodate}
}
\ExecuteBibliographyOptions{labeldate=true,%
sorting=apa,%
autocite=inline,%
backref=true,%
pagetracker=true,%
useprefix=true,%
usetranslator=true,%
uniquelist=minyear,%
uniquename=full,%
citetracker=true,%
maxcitenames=2,%
mincitenames=1,%
maxbibnames=7,%
minbibnames=6,%
abbreviate=true,%
mincrossrefs=999,%
date=apalong,%
datelabel=apalong,%
origdate=apalong,%
urldate=apalong,%
eventdate=comp}
\newbool{apa:backref}
\DeclareBibliographyOption{apabackref}{%
\ifstrequal{#1}{true}
{\global\booltrue{apa:backref}}
{\global\boolfalse{apa:backref}}}
\DeclareNameAlias{default}{apaauthor}
\DeclareNameFormat{apaauthor}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\valu e{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots\addspace}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\iffieldequalstr{doubtfulauthor}{true}
{\mkbibbrackets{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}?}}
{\usebibmacro{name:apa:last-first}{#1}{#3}{#4}{#5}{#7}}}}%
\ifthenelse{\value{listcount}=\value{listtotal}}%
{\ifmorenames{\andothersdelim\bibstring{andothers} }{}}{}}
\renewbibmacro*{author}{%
\ifnameundef{author}
{\usebibmacro{labeltitle}}
{\printnames[apaauthor][-\value{listtotal}]{author}%
\setunit*{\addspace}%
\printfield{nameaddon}%
\ifnameundef{with}
{}
{\setunit{}\addspace\mkbibparens{\printtext{\bibst ring{with}\addspace}%
\printnames[apaauthor][-\value{listtotal}]{with}}
\setunit*{\addspace}}}%
\newunit\newblock%
\usebibmacro{labelyear+extrayear}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%
% (APA 6.27) References section delimiters are ampersands, not " and "
% Needs to be in this hook otherwise it sets this for all
% citations too.
% (APA 6.27) Use blank for long lists
% (APA 4.03) Serial comma for lists of three or more
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{~,\space}%
\renewcommand*{\finalnamedelim}{~,\space}%
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.28) Use "nodate" bibstring for references with no year
% Months and days go into parenthesis with year, if set
% (APA 6.29) Issue goes where month normally goes if it
% is set.
% Make sure endmonth gets an expansion too
\DeclareFieldFormat{endmonth}{\mkbibmonth{#1}}
\newbibmacro*{monthorissue}{%
\iffieldundef{issue}
{\iffieldundef{month}
{}
{\addcomma\space\printfield{month}%
\iffieldundef{endmonth}{}{/\printfield{endmonth}}}}
{\addcomma\space\printfield{issue}}}
\newbibmacro*{labelyear+extrayear}{%
\iffieldundef{labelyear}
{\iffieldundef{origyear}
{}
{\printtext[yearorunkyear]{\printfield[noformat]{origyear}}}}%
{\printtext[yearorunkyear]{\printdateextralabel}}}
\DeclareFieldFormat{yearorunkyear}{%
\ifthenelse{\iffieldequalstr{doubtfuldate}{true}}
{\mkbibbrackets{ca\adddot\addspace#1}}
{\mkbibparens{#1}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
% (APA 6.29) General format of titles.
% Ugly Chicago-style lowercasing of English titles
\DeclareFieldFormat{apacase}{\MakeSentenceCase*{#1 }}
\DeclareFieldFormat{issuetitle}{#1\isdot}
\DeclareFieldFormat{title}{#1\isdot}
\DeclareFieldFormat{origtitle}{\MakeSentenceCase*{ #1}\isdot}
\DeclareFieldFormat[article]{title}{#1\isdot}
\DeclareFieldFormat[article]{origtitle}{\MakeSentenceCase*{#1}\isdot}
\DeclareFieldFormat{journaltitle}{#1\isdot}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%
% (APA 7.01 Example 10) Newspapers have prefix for pages.
\DeclareFieldFormat[newsarticle]{pages}{%
\DeclareNumChars{.abcdefghijklmnopqrstuvwxyzABCDEF GHIJKLMNOPQRSTUVWXYZ}%
\mkpageprefix{#1}%
\DeclareNumChars{.}}
\DeclareFieldFormat[newsarticle]{newspaper}{#1}
\DeclareFieldFormat[newsarticle]{entrysubtype}{\mkbibbrackets{#1}}
\DeclareFieldFormat[newsarticle]{title}{#1}
\DeclareFieldFormat[article]{pages}{#1}
\newbibmacro*{newspaper}{%
\printfield{newspaper}
\setunit{\addcomma\space}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%
% (APA 6.30) Commas between title and volume for articles
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\printfield{number}%
\setunit{\addspace}\newblock
\usebibmacro{issuename}%
\newunit}
\newbibmacro*{issuename}{%
\iffieldundef{issuetitle}
{}
{\printtext[issuetitle]{%
\printfield[noformat]{issuetitle}%
\setunit{\subtitlepunct}%
\printfield[noformat]{issuesubtitle}}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%
% (APA 6.27) Name format. Don't capitalise prefixes
% (APA 6.27) Full name disambiguation using brackets
% #1 = last name
% #2 = first name
% #3 = first name (initials)
% #4 = name prefix, a.k.a. 'von part'
% #5 = name affix, a.k.a. 'junior part'
\makeatletter
\def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@ i#1..\@nil}
\def\mkbibnamefirst@i#1.#2.#3\@nil{#1}
\newbibmacro*{name:apa:last-first}[5]{%
\ifuseprefix
{\usebibmacro{name:delim}{#2#1}%
\usebibmacro{name:hook}{#2#1}%
\ifblank{#3}{}{%
\mkbibnameprefix{#4}%
\ifpunctmark{'}{}{\addhighpenspace}}%
\mkbibnamelast{#1\isdot}%
\ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#3}\ isdot%
\ifthenelse{\value{uniquename}>1}
{\addspace\mkbibbrackets{#2}}
{}}%
\ifblank{#5}{}{\addcomma\addlowpenspace\mkbibnamea ffix{#5}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamelast{#1}\isdot
\ifblank{#2#4}{}{\addcomma}%
\ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#3}%
\ifthenelse{\value{uniquename}>1}
{\addspace\mkbibbrackets{#2}}
{}}%
\ifblank{#4}{}{%
\addhighpenspace\mkbibnameprefix{#4}%
\ifpunctmark{'}{}{\addhighpenspace}}%
\ifblank{#5}{}{\addcomma\addlowpenspace\mkbibnamea ffix{#5}\isdot}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 6.29) Special journal issues
\DeclareFieldFormat[periodical]{title}{#1\isdot}
\DeclareFieldFormat[periodical]{issuetitle}{\mkbibemph{#1}\isdot}
\renewbibmacro*{periodical}{%
\iffieldundef{title}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}}}
\renewbibmacro*{title+issuetitle}{%
\usebibmacro{periodical}%
\newunit
\usebibmacro{issue}%
\setunit*{\addcomma\addspace}%
\setunit{\addcomma\space}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
% Hacky bits to suppress final period in some cases.
% * If there is an ORIGYEAR field (APA 7.02:21)
% * Unless there is a RELATED and ADDENDUM
\newbibmacro*{apa:finpunct}{%
\iffieldundef{origyear}
{\ifboolexpr{
test {\iffieldundef{addendum}}
and
test {\iffieldundef{related}}}
{}
{\renewcommand*{\finentrypunct}{\relax}}}
{\renewcommand*{\finentrypunct}{\relax}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% (APA 7.x) General type layouts
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor}%
\setunit{\addspace}\newblock
\usebibmacro{title}%
\newunit\newblock{\newline}
\usebibmacro{journal+issuetitle}%
\setunit{\addspace}%
\printfield{volume}%
\setunit{\addcolon\addspace}%
\printfield{pages}%
\newunit\newblock{\newline}
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Wrapper for backrefs
\newbibmacro{apa:pageref}{%
\ifbool{apa:backref}{\usebibmacro{pageref}}{}}
\endinput