% $Id: numeric-comp.cbx,v 0.9a 2010/03/19 19:52:15 lehman beta $ \ProvidesFile{numeric-comp.cbx} [\abx@cbxid $Id: numeric-comp.cbx,v 0.9a 2010/03/19 19:52:15 lehman beta $] \ExecuteBibliographyOptions{labelnumber,sortcites,autocite=inline} \renewcommand*{\multicitedelim}{\addcomma\space} \providebool{bbx:subentry} \newcounter{cbx@tempcnta} \newcounter{cbx@tempcntb} \DeclareFieldFormat{entrysetcount}{\mknumalph{#1}} \newbibmacro*{cite:init}{% \let\cbx@tempa=\empty \undef\cbx@lasthash \defcounter{cbx@tempcnta}{0}% \defcounter{cbx@tempcntb}{-2}} \newbibmacro*{cite:comp}{% \global\defcounter{cbx@tempcntb}{\value{cbx@tempcntb}+1}% \iffieldundef{shorthand} {\ifbool{bbx:subentry} {\iffieldundef{entrysetcount} {\usebibmacro{cite:comp:comp}} {\usebibmacro{cite:comp:inset}}} {\usebibmacro{cite:comp:comp}}} {\usebibmacro{cite:comp:shand}}} \newbibmacro*{cite:comp:comp}{% \ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} {\savefield{entrykey}{\cbx@lastkey}% \savefield{labelnumber}{\cbx@lastnumber}% \global\defcounter{cbx@tempcnta}{\value{cbx@tempcnta}+1}} {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}-1} {} {\usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{\printfield{labelnumber}}}}% \global\defcounter{cbx@tempcntb}{\thefield{labelnumber}}} \newbibmacro*{cite:comp:inset}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{% \printfield{labelnumber}% \printfield{entrysetcount}}% \global\defcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:comp:shand}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{\printfield{shorthand}}% \global\defcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:dump}{% \ifnumgreater{\value{cbx@tempcnta}}{0} {\ifnumgreater{\value{cbx@tempcnta}}{1} {\bibrangedash} {\multicitedelim}% \bibhyperref[\cbx@lastkey]{% \printtext[labelnumber]{\cbx@lastnumber}}% \global\defcounter{cbx@tempcnta}{0}} {}} \newbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\usebibmacro{cite:comp}} {\usebibmacro{cite:dump}\cbx@tempa \usebibmacro{cite:init}% \ifnameundef{labelname} {\printfield[citetitle]{labeltitle}} {\printnames{labelname}}% \addspace\bibopenbracket \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:comp}}% \savefield{namehash}{\cbx@lasthash}% \gdef\cbx@tempa{\bibclosebracket\multicitedelim}} \DeclareCiteCommand{\cite}[\mkbibbrackets] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} \DeclareCiteCommand{\parencite}[\mkbibbrackets] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} \DeclareCiteCommand{\footcite}[\mkbibfootnote] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} \DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} \DeclareCiteCommand{\textcite} {\usebibmacro{cite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {} {\usebibmacro{postnote}% \bibclosebracket} \DeclareCiteCommand{\supercite}[\mkbibsuperscript] {\usebibmacro{cite:init}% \let\multicitedelim=\supercitedelim \iffieldundef{prenote} {} {\BibliographyWarning{Ignoring prenote argument}}% \iffieldundef{postnote} {} {\BibliographyWarning{Ignoring postnote argument}}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}} \DeclareMultiCiteCommand{\cites}[\mkbibbrackets]{\cite}{\multicitedelim} \DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}{\multicitedelim} \endinput