\ProvidesFile{numeric-comp.cbx} [\abx@cbxid] \ExecuteBibliographyOptions{labelnumber,sortcites,autocite=inline} \renewcommand*{\multicitedelim}{\addcomma\space} \renewcommand*{\iffinalcitedelim}{% \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}} \providebool{bbx:subentry} \newbool{cbx:parens} \newcounter{cbx@tempcnta} \newcounter{cbx@tempcntb} \DeclareFieldFormat{entrysetcount}{\mknumalph{#1}} \newbibmacro*{cite:init}{% \global\boolfalse{cbx:parens}% \global\undef\cbx@lasthash \global\undef\cbx@lastnumber \global\undef\cbx@lastprefix \setcounter{cbx@tempcnta}{0}% \setcounter{cbx@tempcntb}{-2}} \newbibmacro*{cite:comp}{% \addtocounter{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}{% \ifboolexpr{ ( test {\iffieldundef{labelprefix}} and test {\ifundef\cbx@lastprefix} ) or test {\iffieldequals{labelprefix}{\cbx@lastprefix}} } {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} {\savefield{entrykey}{\cbx@lastkey}% \savefield{labelnumber}{\cbx@lastnumber}% \addtocounter{cbx@tempcnta}{1}} {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}-1} {} {\usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{% \printfield{labelprefix}% \printfield{labelnumber}}}}} {\usebibmacro{cite:comp:end}}% \setcounter{cbx@tempcntb}{\thefield{labelnumber}}% \savefield{labelprefix}{\cbx@lastprefix}} \newbibmacro*{cite:comp:end}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{% \printfield{labelprefix}% \printfield{labelnumber}}} \newbibmacro*{cite:comp:inset}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{% \printfield{labelprefix}% \printfield{labelnumber}% \printfield{entrysetcount}}% \setcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:comp:shand}{% \usebibmacro{cite:dump}% \ifnumgreater{\value{cbx@tempcntb}}{-1} {\multicitedelim} {}% \printtext[bibhyperref]{\printfield{shorthand}}% \setcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:dump}{% \ifnumgreater{\value{cbx@tempcnta}}{0} {\ifnumgreater{\value{cbx@tempcnta}}{1} {\bibrangedash} {\multicitedelim}% \bibhyperref[\cbx@lastkey]{% \ifdef\cbx@lastprefix {\printtext[labelprefix]{\cbx@lastprefix}} {}% \printtext[labelnumber]{\cbx@lastnumber}}} {}% \setcounter{cbx@tempcnta}{0}% \global\undef\cbx@lastprefix} \newbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\usebibmacro{cite:comp}} {\usebibmacro{cite:dump}% \ifbool{cbx:parens} {\bibclosebracket\global\boolfalse{cbx:parens}} {}% \iffirstcitekey {} {\textcitedelim}% \usebibmacro{cite:init}% \ifnameundef{labelname} {\printfield[citetitle]{labeltitle}} {\printnames{labelname}}% \global\booltrue{cbx:parens}% \printdelim{namelabeldelim}\bibopenbracket% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:comp}% \stepcounter{textcitecount}% \savefield{namehash}{\cbx@lasthash}}} \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{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote] {\usebibmacro{cite:init}% \usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}} \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}} \DeclareCiteCommand{\cbx@textcite} {\usebibmacro{cite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {} {\usebibmacro{cite:dump}% \usebibmacro{postnote}% \ifbool{cbx:parens} {\bibclosebracket\global\boolfalse{cbx:parens}} {}} \DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite] {\gdef\cbx@savedkeys{}% \citetrackerfalse% \pagetrackerfalse% \DeferNextCitekeyHook% \usebibmacro{cite:init}} {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0} {\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}% \global\clearfield{multipostnote}} {}% \xappto\cbx@savedkeys{\thefield{entrykey},}% \iffieldequals{namehash}{\cbx@lasthash} {} {\stepcounter{textcitetotal}% \savefield{namehash}{\cbx@lasthash}}} {} {\protected@xappto\cbx@savedcites{% [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}} % textcite has nested \DeclareCiteCommand definitions for textcite and we want to use % the normal textcite context \DeclareDelimcontextAlias{cbx@textcite}{textcite} \newrobustcmd{\cbx@textcite@init}[2]{% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} \DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{} \DeclareMultiCiteCommand{\textcites}[\cbx@textcites@init\cbx@textcites]{\textcite}{} \let\cbx@textcites@init\cbx@textcite@init \pretocmd{\cbx@textcites@init}{\UseNextMultiCiteHook}{}{} \DeclareMultiCiteCommand{\cites}[\mkbibbrackets]{\cite}{\multicitedelim} \DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}{\multicitedelim} \DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbrackets\mkbibfootnote] {\smartcite}{\multicitedelim} \endinput