% archaeologie --% % biblatex for archaeologists, % historians and philologists % Copyright (c) 2017 Lukas C. Bossert | Johannes Friedl % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. \ProvidesFile{archaeologie.cbx}% [\arch@cbxid] %----------------------- \newbool{cbx:yearinparens} \newbool{cbx:seenote} \newbool{cbx:uniqueme} %----------------------- %\renewcommand*{\multicitedelim}{\addsemicolon\addspace} \newcommand*{\labelyeardelim}{\addspace} %\renewcommand{\textcitedelim}{\addcomma\space} \renewcommand{\postnotedelim}{% \ifboolexpr{% bool {cbx:ancient}% or bool {cbx:frgancient}% or bool {cbx:corpus}% }% {\addspace}% {\newunitpunct}} \newcommand*{\cbx@fseen@names}{} \newcommand*{\cbx@tseen@names}{} \newrobustcmd*{\cbx@nameseen}[1]{% \iftoggle{blx@footnote} {\listcsxadd{cbx@fseen@names}{#1}} {\listcsxadd{cbx@tseen@names}{#1}}} \newrobustcmd*{\cbx@ifnameseen}[1]{% \iftoggle{blx@footnote}% {\xifinlistcs{#1}{cbx@fseen@names}}% {\xifinlistcs{#1}{cbx@tseen@names}}} %----------------------- \DeclareBibliographyOption{yearinparens}[true]{% \ifstrequal{#1}{true}% {\DeclareFieldFormat{citeyear}{\mkbibparens{##1}}% \csuse{bool#1}{cbx:yearinparens}}% {\DeclareFieldFormat{citeyear}{##1}}}% \DeclareBibliographyOption{seenote}[true]{% \csuse{bool#1}{cbx:seenote}% \ExecuteBibliographyOptions{maxnames=999}% }% \DeclareBibliographyOption[string]{citeauthorformat}{% \ifcsdef{cbx@arch@citeauthorformat@#1}% {\csuse{cbx@arch@citeauthorformat@#1}}% {\PackageError{biblatex-archaeologie}% {Option 'citeauthorformat=#1' invalid.\MessageBreak Use one of the values 'initials', 'full', 'family' or 'firstfull'.}{}}% \def\citeauthorformatVALUE{#1}% } \DeclareEntryOption{uniqueme}[true]{\csuse{bool#1}{cbx:uniqueme}} %----------------------- \DeclareFieldFormat{citeyear}{#1} \DeclareFieldFormat{prenote}{#1\isdot} \DeclareFieldFormat{postnote}{#1} \DeclareFieldFormat{shorttitle}{#1} \DeclareFieldFormat{pages}{#1} \DeclareNameFormat{labelname}{% \ifcase\value{uniquename}% \usebibmacro{name:family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \or \ifuseprefix {\usebibmacro{name:family-given} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffixi}} {\usebibmacro{name:family-given} {\namepartfamily} {\namepartgiveni} {\namepartprefixi} {\namepartsuffixi}}% \or \usebibmacro{name:family-given} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \fi \usebibmacro{name:andothers}} \DeclareNameFormat{name:family}{% \ifcase\value{uniquename}% \usebibmacro{name:family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \or \ifuseprefix {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffixi}} {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefixi} {\namepartsuffixi}}% \or \usebibmacro{name:given-family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \fi \usebibmacro{name:andothers}} \DeclareNameFormat{name:initials}{% \ifnum\value{uniquename}=2% \usebibmacro{name:given-family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \else \ifuseprefix {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffixi}} {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefixi} {\namepartsuffixi}}% \fi \usebibmacro{name:andothers}} \def\cbx@arch@citeauthorformat@family{% \DeclareNameAlias{citeauthor}{name:family}} \def\cbx@arch@citeauthorformat@full{% \DeclareNameAlias{citeauthor}{given-family}} \def\cbx@arch@citeauthorformat@initials{% \DeclareNameAlias{citeauthor}{name:initials}} \DeclareNameFormat{citeauthor:fancy}{% \cbx@ifnameseen{\thefield{hash}} {\ifnum\value{uniquename}=2 \usebibmacro{name:given-family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \else \ifuseprefix {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffixi}} {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefixi} {\namepartsuffixi}}% \fi} {\usebibmacro{name:given-family} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}% \cbx@nameseen{\thefield{hash}}}% \usebibmacro{name:andothers}} \def\cbx@arch@citeauthorformat@firstfull{% \DeclareNameAlias{citeauthor}{citeauthor:fancy}} %----------------------- \ExecuteBibliographyOptions{% citetracker=true,% idemtracker=true,% ibidtracker=true,% opcittracker=true,% loccittracker=true,% alldates=comp,% dateuncertain=true, datecirca=true, citeauthorformat=initials,% uniquename=minfull,% autocite=footnote, } %----------------------- \newbibmacro*{uniqueshorthand}{% \printtext[brackets]{% \ifnameundef{translator} {\ifnameundef{intranslator}% {\iffieldundef{series}% {\printnames[name:family]{editor}}% {\usebibmacro{series}}% }% {\printnames[name:family]{intranslator}}}% {\printnames[name:family]{translator}}}} %----------------------- \renewbibmacro*{citeindex}{% \ifciteindex% {\ifboolexpr{% bool {cbx:ancient}% or bool {cbx:frgancient}}% {}% {\indexnames{labelname}}}% {}% } %----------------------- \renewbibmacro*{postnote}{% \ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {} {\iffieldundef{postnote}% {}% {\setunit{\postnotedelim}% \printfield{postnote}% \ifbool{cbx:frgancient}% {\setunit{\addspace}% \usebibmacro{cite:frgname}}% {}}}} %----------------------- \newbibmacro*{cite:frgname}{% \ifnameundef{shorteditor}% {\printnames[name:family]{editor}}% {\printnames{shorteditor}}% } %----------------------- \newbibmacro*{seenote}{% \ifnameundef{labelname}% {\usebibmacro{cite:label}}% {\printnames{labelname}}% \setunit{\labelyeardelim}% \bibstring{loccit}% \setunit{\addspace}% \printtext[parens]{\bibstring{seenote}% \addspace% \ref{footref:\thefield{entrykey}}}% \renewcommand{\postnotedelim}{\addspace}% }% %----------------------- \newbibmacro*{cite:title}{\printfield{labeltitle}}% %----------------------- \newbibmacro*{cite:year}{% \iffieldundef{labelyear}% {}% {\printtext[citeyear]{\usebibmacro{cite:labelyear+extrayear}}}% } %----------------------- \newbibmacro*{cite:lexikon}{% \printfield{booktitle}% \setunit{\addspace}% \printfield{volume}% \setunit{\addspace}% \printfield[parens]{year}% \setunit{\addspace}% \iffieldundef{postnote}% {\printfield{pages}}% {\printfield{postnote}}% \usebibmacro{inreference:title+author}% } %----------------------- \newbibmacro{cite:seenote}{% \ifboolexpr{bool{cbx:ancient}% or bool{cbx:frgancient}% or bool{cbx:corpus}}% {\usebibmacro{cite:shorthand}}% {\ifciteseen% {\usebibmacro{seenote}}% {\bibhypertarget{ref:\thefield{entrykey}}% {\usedriver% {\DeclareNameAlias{sortname}{default}}% {\thefield{entrytype}}% \iffootnote{\label{footref:\thefield{entrykey}}}}% }}} %----------------------- \newbibmacro{cite}{% \ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {\usebibmacro{cite:lexikon}}% {\ifbool{cbx:seenote}% {\usebibmacro{cite:seenote}}% {\printtext[bibhyperref]{% \iffieldundef{shorthand}% {\ifnameundef{labelname}% {\usebibmacro{cite:label}% \setunit{\labelyeardelim}}% {\printnames{labelname}% \setunit{\nameyeardelim}}% \usebibmacro{cite:year}}% {\usebibmacro{cite:shorthand}}% }}}} %----------------------- \newbibmacro*{citeyear}{% \iffieldundef{shorthand}% {\iffieldundef{labelyear}% {\usebibmacro{cite:label}}% {\usebibmacro{cite:labelyear+extrayear}}}% {\usebibmacro{cite}}} %----------------------- \newbibmacro*{textcite}{% \ifnameundef{labelname}% {\iffieldundef{shorthand}% {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:yearinparens}% \nonameyeardelim\bibopenparen}% \ifnumequal{\value{citecount}}{1}% {\usebibmacro{prenote}}% {}% \usebibmacro{cite:labelyear+extrayear}}% {\usebibmacro{cite}}}% {\printnames{labelname}% \setunit{% \global\booltrue{cbx:yearinparens}% \nameyeardelim\bibopenparen}% \usebibmacro{citeyear}}} %----------------------- \newbibmacro*{cite:shorthand}{% \ifbool{cbx:seenote}% {\printtext{\printfield{shorthand}}}% {\printtext[bibhyperref]{\printfield{shorthand}% \ifbool{cbx:uniqueme} {\setunit*{\addspace}% \usebibmacro*{uniqueshorthand}}% {}% }}} %----------------------- \newbibmacro*{cite:label}{% \iffieldundef{label}% {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}% {\printtext[bibhyperref]{\printfield{label}}}} %----------------------- \newbibmacro*{cite:labelyear+extrayear}{% \iffieldundef{labelyear} {} {\printtext[bibhyperref]{% \ifdefstring\blx@dateformat@labeldate{edtf} {} {\datecircaprint}% \dateeraprintpre{labelyear}% \iffieldnums{labelyear}% {\mkyearzeros{\thefield{labelyear}}}% {\printfield{labelyear}}% \printfield{extrayear}% \iffieldsequal{labeldateera}{labelenddateera}{}% {\dateeraprint{labelyear}}% \dateuncertainprint% \ifdefstring\blx@dateformat@labeldate{edtf}% {\datecircaprintedtf}% {}% \iffieldundef{labelendyear}% {} {\iffieldsequal{labelyear}{labelendyear}{}% {\ifdefstring\blx@dateformat@labeldate{edtf}% {\slash}% strict EDTF {\bibdaterangesep% \enddatecircaprint}% \dateeraprintpre{labelendyear}% \mkyearzeros{\thefield{labelendyear}}% \enddateuncertainprint% \ifdefstring\blx@dateformat@labeldate{edtf}% {\enddatecircaprintedtf}% {}% \dateeraprint{labelendyear}}}}}} %----------------------- \newbibmacro*{textcite:postnote}{% \iffieldundef{postnote}% {\ifbool{cbx:yearinparens}% {\bibcloseparen}% {}}% {\ifbool{cbx:yearinparens}% {\setunit{\postnotedelim}}% {\setunit{\extpostnotedelim\bibopenparen}}% \printfield{postnote}% \ifbool{cbx:frgancient}% {\setunit{\addthinspace}% \usebibmacro{cite:frgname}% \bibcloseparen}% \bibcloseparen}} %----------------------- \DeclareCiteCommand{\cite}% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\footcite}[\mkbibfootnote] {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\textcite}% {\boolfalse{cbx:yearinparens}% \renewcommand*{\multinamedelim}{\addcomma\space}% \renewcommand*{\finalnamedelim}{% \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space}% \usebibmacro{prenote}% }% {\usebibmacro{citeindex}% \iffirstcitekey% {\setcounter{textcitetotal}{1}}% {\stepcounter{textcitetotal}% \textcitedelim}% \ifbool{cbx:seenote}{\usebibmacro{cite:seenote}}% {\usebibmacro{textcite}}}% {\ifbool{cbx:parens}% {\bibcloseparen\global\boolfalse{cbx:yearinparens}}% {}}% {\ifbool{cbx:seenote}{\usebibmacro{postnote}}% {\usebibmacro{textcite:postnote}}} %----------------------- \DeclareCiteCommand{\parencite}[\mkbibparens]% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\smartcite}[\iffootnote\textnormal\mkbibfootnote] {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {\multicitedelim} {\ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {} {\usebibmacro{postnote}}}% %----------------------- \DeclareCiteCommand{\fullcite} {\usebibmacro{prenote}} {\usedriver {\DeclareNameAlias{sortname}{default}} {\thefield{entrytype}}} {\multicitedelim} {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\footfullcite}[\mkbibfootnote] {\usebibmacro{prenote}} {\usedriver {\DeclareNameAlias{sortname}{default}} {\thefield{entrytype}}} {\multicitedelim} {\usebibmacro{postnote}} %----------------------- \DeclareMultiCiteCommand{\cites}% {\cite}{\multicitedelim}% \DeclareMultiCiteCommand{\parencites}[\mkbibparens]% {\parencite}{\multicitedelim}% \DeclareMultiCiteCommand{\textcites}% {\textcite}{\textcitedelim} \DeclareMultiCiteCommand{\smartcites} [\iffootnote\textnormal\mkbibfootnote]{\smartcite}{\multicitedelim} %----------------------- \DeclareCiteCommand{\citeauthor} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \renewcommand*{\multinamedelim}{\addcomma\space}% \renewcommand*{\finalnamedelim}{% \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space}% \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {\printtext}% {\printtext[bibhyperref]}% {\printnames[citeauthor]{labelname}}}% {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\citetranslator} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \renewcommand*{\multinamedelim}{\addcomma\space}% \renewcommand*{\finalnamedelim}{% \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space}% \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \ifboolexpr{% test {\ifentrytype{incollection}} or test {\ifentrytype{inbook}} }% {\ifnameundef{intranslator}% {\bibstring{owntranslation}}% {\printtext[bibhyperref]{\printnames[citeauthor]{intranslator}}}}% {\ifnameundef{translator}% {\bibstring{owntranslation}}% {\ifboolexpr{ bool {bbx:inreferences} and test {\ifentrytype{inreference}} }% {\printnames[citeauthor]{translator}} {\printtext[bibhyperref]{\printnames[citeauthor]{translator}}}}}} {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand*{\citetranslator} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \DeclareNameAlias{bytranslator}{citeauthor}% \renewcommand*{\multinamedelim}{\addcomma\space}% \renewcommand*{\finalnamedelim}{% \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space}% \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {\printtext}% {\printtext[bibhyperref]}% {\ifthenelse{% \ifentrytype{incollection}% \OR% \ifentrytype{inbook}% }% {\ifnameundef{intranslator}% {\bibstring{owntranslation}}% {\usebibmacro{byintranslator+others}}}% {\ifnameundef{translator}% {\bibstring{owntranslation}}% {\usebibmacro{bytranslator+others}}}}}% {\multicitedelim}% {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand*{\citeauthor} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \printnames[][1-1]{labelname}} {\multicitedelim} {\usebibmacro{postnote}} %----------------------- \DeclareCiteCommand{\citetitle} % {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}}% {\ifboolexpr{ bool{bbx:inreferences} and test{\ifentrytype{inreference}}} {\printtext}% {\printtext[bibhyperref]}{% \ifbool{cbx:ancient}{\printtext[emph]{\usebibmacro{cite:title}}}% {\printtext[emph]{\usebibmacro{cite:title}}% \iffieldundef{year} {} {\setunit{\addspace}% \printtext[parens]{% \printfield{year}% \iffieldundef{origyear} {}% {\addspace\printfield[parens]{origyear}}}% }}}}% {\multicitedelim}% {\usebibmacro{postnote}}% \endinput %% End of file `archaeologie.cbx'.