% $Id: numeric.bbx,v 0.8e 2009/07/04 15:02:31 lehman beta $

\ProvidesFile{numeric.bbx}
[\abx@bbxid $Id: numeric.bbx,v 0.8e 2009/07/04 15:02:31 lehman beta $]

\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelnumber}

\providebool{bbx:subentry}

\DeclareBibliographyOption{subentry}[true]{%
  \setbool{bbx:subentry}{#1}}

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

\DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}
\renewcommand*{\thebibitem}{\item}
\renewcommand*{\thelositem}{\item}

\renewenvironment*{thebibliography}
  {\list
     {\printfield[labelnumberwidth]{labelnumber}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}

\renewenvironment*{theshorthands}
  {\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]{\hss##1}}}
  {\endlist}


\DeclareBibliographyDriver{set}{%
  \ifbool{bbx:subentry}
    {\entryset{%
       \printfield[bibentrysetcount]{entrysetcount}%
       \setunit*{\addnbspace}}{}}
    {\entryset{}{}}
  \finentry}

\endinput
