\ProvidesFile{alphabetic.bbx}
[\abx@bbxid]

\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelalpha,sorting=anyt}

\providebool{bbx:subentry}

\DeclareBiblatexOption{global,type,entry}[boolean]{subentry}[true]{%
  \setbool{bbx:subentry}{#1}}

\DeclareNameAlias{author}{default}
\DeclareNameAlias{editor}{default}
\DeclareNameAlias{translator}{default}

\DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}}
\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelalphawidth]{%
        \printfield{labelprefix}%
        \printfield{labelalpha}%
        \printfield{extraalpha}}}
     {\setlength{\labelwidth}{\labelalphawidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{##1\hss}}
  {\endlist}
  {\item}

\defbibenvironment{shorthand}
  {\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}

\DeclareBibliographyDriver{set}{%
  \entryset
    {\ifbool{bbx:subentry}
       {\printfield[bibentrysetcount]{entrysetcount}%
        \printunit*{\addnbspace}}
       {}}
    {}%
  \newunit\newblock
  \usebibmacro{setpageref}%
  \finentry}

\endinput
