%%
%% This is file `dguf-apa.bbx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% biblatex-archaeology.dtx  (with options: `dgufapaBBX,noarticlesubtitlepunct')
%% 

\ProvidesFile{dguf-apa.bbx}
[2019/12/30 v2.2 biblatex-archaeology bibliography style (IB)]
\RequireBibliographyStyle{authoryear-archaeology}
\def\archaeobibstyletitle{\blxarch@style@dgufapa}
\DeclareLanguageMappingSuffix{-dguf-apa}
\DeclareStyleSourcemap{
    \maps[datatype=bibtex]{
        \map[overwrite=true]{
            \step[fieldsource=language,notmatch=\regexp{german|austrian},final]
            \step[fieldset=langid,fieldvalue=english]
            %\step[fieldset=langidopts,fieldvalue={variant=british}]
        }
        \map[overwrite=true]{
            \pertype{review}
            \step[fieldsource=language,notmatch=\regexp{german|austrian},final]
            \step[fieldset=langid,fieldvalue={}]
        }
    }
}
\ExecuteBibliographyOptions{
    autolang=other,
    dashed=false,
    doi=true,
    giveninits=true,
    ibidtracker=false,
    idemtracker=false,
    loccittracker=false,
    maxbibnames=7,
    maxcitenames=2,
    maxitems=2,
    mergedate=true,
    minbibnames=7,
    mincitenames=1,
    minitems=1,
    notetype=foot+end,
    sorting=nyc,
    editionsuperscript=posttitle,
    giveninitligatures={},
    idemincitation=false,
    injournal=false,
    journallocation=false,
    maxbooknames=7,
    minbooknames=7,
    minrealdatediff=\blxarch@maxnumber,
    nothesistitlepunct=false,
    notitlepunct=false,
    origfields=false,
    pagesfirst=true,
    positionlabeldate=label,
    preservelastauthor=true,
    repeatlabel=false,
    reviewedauthoraftertitle=true,
    shortform=false,
    shortjournal=false,
    shortseries=false,
    subseries=false,
    summarytitle=false,
    tabbedlabeldate=false,
    titlebrackets=true,
    titlenote=true,
    useeventdate=false,
    useeventnumber=true,
    usefestschriftaddon=false,
    useinstitution=pluslocation,
    uselocation=true,
    usemultivenue=false,
    usepublisher=true,
    usesourceeditor=false,
    useunpublishedthesis=true,
    volumeafterseries=false,
}
\setlength{\bibhang}{0em}
\setlength{\bibitemsep}{\baselineskip}
\renewcommand*{\multicitedelim}{\addsemicolon\space}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\renewcommand*{\multinamedelim}{\addcomma\space}
\renewcommand*{\finalnamedelim}{\addspace\&\space}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{bookauthor}{given-family}
\renewcommand*{\labelnamepunct}{\addperiod\space}
\renewcommand*{\booklabelnamepunct}{\addcomma\space}
\renewcommand*{\intitlepunct}{\printunit{\addspace}}
\DeclareNameAlias{reviewname}{given-family}
\DeclareDelimFormat{reviewnametitledelim}{\addcomma\space\biblstring{by}\addspace}
\renewcommand*{\reviewofnamedelim}{\addspace}
\renewcommand*{\finentrypunct}{%
    \iffieldundef{doi}
        {\ifboolexpr{
            not test {\iffieldundef{eprint}}
            and
            test {\iffieldundef{eprintclass}}
         }
            {}
            {\ifboolexpr{
                not test {\iffieldundef{url}}
                and
                test {\iffieldundef{urlyear}}
             }
                {}
                {\addperiod}}%
        }
        {}%
}
\DeclareFieldFormat*{title}{\mkbibitalic{#1}}
\DeclareFieldFormat
[article,bookinbook,inbook,incollection,inproceedings,inreference,review,suppperiodical]
{title}{#1}
\DeclareFieldFormat*{booktitle}{\mkbibitalic{#1}}
\DeclareFieldFormat*{maintitle}{\mkbibitalic{#1}}
\DeclareFieldFormat*{reviewedtitle}{\mkbibitalic{#1}}
\renewbibmacro*{maintitle+title}{%
    \iffieldsequal{maintitle}{title}
        {\clearfield{maintitle}%
         \clearfield{mainsubtitle}%
         \clearfield{maintitleaddon}}
        {}%
    \iffieldundef{maintitle}
        {\iffieldundef{subseries}
            {}
            {\savefield*{subseries}{\blxarch@field@subseries}%
             \restorefield{subtitle}{\blxarch@field@subseries}%
             \clearfield{volume}%
             \savefield*{subnumber}{\blxarch@field@subnumber}%
             \restorefield{volume}{\blxarch@field@subnumber}}}
        {\savefield*{maintitle}{\blxarch@field@maintitle}%
         \restorefield{subtitle}{\blxarch@field@maintitle}}%
    \usebibmacro{title}%
    \newunit}
\renewbibmacro*{maintitle+booktitle}{%
    \iffieldsequal{maintitle}{booktitle}
        {\clearfield{maintitle}%
         \clearfield{mainsubtitle}%
         \clearfield{maintitleaddon}}
        {}%
    \iffieldundef{maintitle}
        {\iffieldundef{subseries}
            {}
            {\savefield*{subseries}{\blxarch@field@subseries}%
             \restorefield{booksubtitle}{\blxarch@field@subseries}%
             \clearfield{volume}%
             \savefield*{subnumber}{\blxarch@field@subnumber}%
             \restorefield{volume}{\blxarch@field@subnumber}}}
        {\savefield*{maintitle}{\blxarch@field@maintitle}%
         \restorefield{booksubtitle}{\blxarch@field@maintitle}}%
    \usebibmacro{booktitle}%
    \newunit}
\renewcommand*{\subtitlepunct}{\addcolon\space}
\renewcommand*{\titleseriesdelim}{\addspace}
\DeclareFieldFormat*{titlebrackets}{\textup{\mkbibparens{#1}}}
\DeclareFieldFormat*{usere}{%
    \addspace%
    \bibopenparen%
    \ifinteger{#1}
        {\mkbibordinal{#1}\addspace\bibstring{edition}}
        {#1}%
    \bibcloseparen%
}
\DeclareFieldFormat*{locationdateparens}{\addperiod\space#1}
\DeclareFieldFormat[article,review,suppperiodical]{number}{\mkbibparens{#1}}
\renewcommand*{\volumenumberdelim}{}
\renewcommand*{\journalvolumedelim}{\addcomma\space}
\DeclareFieldFormat*{journalvolumeblock}{\mkbibitalic{#1}}
\DeclareFieldFormat*{journaldateparens}{#1}
\DeclareFieldFormat*{volume}{%
    \addspace%
    \bibopenparen%
    \ifinteger{#1}
        {\mkbibordinal{#1}\space\biblstring{volume}}
        {\biblstring{volume}\addspace#1}%
    \bibcloseparen%
}
\DeclareFieldFormat[article,review,suppperiodical]{volume}{\addspace#1}
\DeclareFieldFormat*{seriesparens}{\mkbibparens{#1}}
\DeclareFieldFormat*{pages}{%
    \mkbibparens{\mkpageprefix[bookpagination]{#1}}}
\DeclareFieldFormat[article,review,suppperiodical]{pages}{#1}
\renewcommand*{\bibpagespunct}{%
    \iffieldundef{journaltitle}
        {\addspace}
        {\addcomma\space}}
\DeclareFieldFormat*{urldate}{\mkbibbrackets{#1\unspace}}
\DeclareFieldFormat*{url}{\url{#1}}
\DeclareFieldFormat{doi}{%
  \ifhyperref
    {\href{http://dx.doi.org/#1}{\nolinkurl{doi:#1}}}
    {\nolinkurl{doi:#1}}}
\renewcommand*{\typeinstitutiondelim}{\addcomma\space}
\xpatchbibmacro{thesistype}{bibstring}{biblstring}
  {}{Patching driver 'thesistype' failed (2)}
\renewcommand*{\articlesubtitlepunct}{\subtitlepunct}
\endinput
%%
%% End of file `dguf-apa.bbx'.
