% $Id: authoryear.bbx,v 1.1 2011/01/05 21:45:11 lehman stable $ \ProvidesFile{authoryear.bbx} [\abx@bbxid $Id: authoryear.bbx,v 1.1 2011/01/05 21:45:11 lehman stable $] \RequireBibliographyStyle{standard} \DeclareBibliographyOption{dashed}[true]{% \ifstrequal{#1}{true} {\ExecuteBibliographyOptions{pagetracker}% \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}} {\ExecuteBibliographyOptions{pagetracker=false}% \renewbibmacro*{bbx:savehash}{}}} \DeclareBibliographyOption{mergedate}[true]{% \setbool{bbx:mergedate}{#1}} \newbool{bbx:mergedate} \ExecuteBibliographyOptions{labelyear,sorting=nyt,pagetracker,mergedate} \DeclareFieldFormat{shorthandwidth}{#1} \setlength{\bibitemsep}{0pt} \DeclareNameAlias{author}{sortname} \DeclareNameAlias{editor}{sortname} \DeclareNameAlias{translator}{sortname} \defbibenvironment{bibliography} {\list {} {\setlength{\leftmargin}{\bibhang}% \setlength{\itemindent}{-\leftmargin}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}} {\endlist} {\item} \defbibenvironment{shorthands} {\list {\printfield[shorthandwidth]{shorthand}} {\setlength{\labelwidth}{\shorthandwidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}% \renewcommand*{\makelabel}[1]{##1\hss}}} {\endlist} {\item} \InitializeBibliographyStyle{% \global\undef\bbx@lasthash} \newbibmacro*{bbx:savehash}{% \savefield{fullhash}{\bbx@lasthash}} \newbool{bbx@inset} \DeclareBibliographyDriver{set}{% \booltrue{bbx@inset}% \entryset{}{}% \newunit\newblock \usebibmacro{setpageref}% \finentry} \renewbibmacro*{author}{% \ifboolexpr{ test \ifuseauthor and not test {\ifnameundef{author}} } {\usebibmacro{bbx:dashcheck} {\bibnamedash} {\usebibmacro{bbx:savehash}% \printnames{author}% \iffieldundef{authortype} {\setunit{\addspace}} {\setunit{\addcomma\space}}}% \iffieldundef{authortype} {} {\usebibmacro{authorstrg}% \setunit{\addspace}}}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% \usebibmacro{date+extrayear}} \renewbibmacro*{editor}{% \usebibmacro{bbx:editor}{editorstrg}} \renewbibmacro*{editor+others}{% \usebibmacro{bbx:editor}{editor+othersstrg}} \newbibmacro*{bbx:editor}[1]{% \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} } {\usebibmacro{bbx:dashcheck} {\bibnamedash} {\printnames{editor}% \setunit{\addcomma\space}% \usebibmacro{bbx:savehash}}% \usebibmacro{#1}% \clearname{editor}% \setunit{\addspace}}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% \usebibmacro{date+extrayear}} \renewbibmacro*{translator}{% \usebibmacro{bbx:translator}{translatorstrg}} \renewbibmacro*{translator+others}{% \usebibmacro{bbx:translator}{translator+othersstrg}} \newbibmacro*{bbx:translator}[1]{% \ifboolexpr{ test \ifusetranslator and not test {\ifnameundef{translator}} } {\usebibmacro{bbx:dashcheck} {\bibnamedash} {\printnames{translator}% \setunit{\addcomma\space}% \usebibmacro{bbx:savehash}}% \usebibmacro{translator+othersstrg}% \clearname{translator}% \setunit{\addspace}}% {\global\undef\bbx@lasthash \usebibmacro{labeltitle}% \setunit*{\addspace}}% \usebibmacro{date+extrayear}} \newbibmacro*{bbx:dashcheck}[2]{% \ifboolexpr{ test {\iffieldequals{fullhash}{\bbx@lasthash}} and not test \iffirstonpage and ( not bool {bbx@inset} or test {\iffieldequalstr{entrysetcount}{1}} ) } {#1} {#2}} \newbibmacro*{date+extrayear}{% \iffieldundef{year} {} {\printtext[parens]{% \ifbool{bbx:mergedate} {\printdateextra} {\printfield{labelyear}% \printfield{extrayear}}}}} \newbibmacro*{labeltitle}{% \iffieldundef{label} {\iffieldundef{shorttitle} {\printfield{title}% \clearfield{title}} {\printfield[title]{shorttitle}}} {\printfield{label}}} \renewbibmacro*{issue+date}{% \ifbool{bbx:mergedate} {\iffieldundef{issue} {} {\printtext[parens]{\printfield{issue}}}} {\printtext[parens]{% \iffieldundef{issue} {\usebibmacro{date}} {\printfield{issue}% \setunit*{\addspace}% \usebibmacro{date}}}} \newunit} \renewbibmacro*{date}{% \ifboolexpr{ bool {bbx:mergedate} or test {\iffieldundef{month}} } {} {\printdate}} \endinput