diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx | 73 |
1 files changed, 49 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx b/Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx index 11b3729dd0b..03f185df895 100644 --- a/Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx +++ b/Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx @@ -1,7 +1,7 @@ -% $Id: numeric-comp.cbx,v 0.9a 2010/03/19 19:52:15 lehman beta $ +% $Id: numeric-comp.cbx,v 0.9d 2010/09/03 20:11:58 lehman beta $ \ProvidesFile{numeric-comp.cbx} -[\abx@cbxid $Id: numeric-comp.cbx,v 0.9a 2010/03/19 19:52:15 lehman beta $] +[\abx@cbxid $Id: numeric-comp.cbx,v 0.9d 2010/09/03 20:11:58 lehman beta $] \ExecuteBibliographyOptions{labelnumber,sortcites,autocite=inline} \renewcommand*{\multicitedelim}{\addcomma\space} @@ -12,13 +12,15 @@ \DeclareFieldFormat{entrysetcount}{\mknumalph{#1}} \newbibmacro*{cite:init}{% - \let\cbx@tempa=\empty - \undef\cbx@lasthash - \defcounter{cbx@tempcnta}{0}% - \defcounter{cbx@tempcntb}{-2}} + \global\let\cbx@tempa=\empty + \global\undef\cbx@lasthash + \global\undef\cbx@lastnumber + \global\undef\cbx@lastprefix + \setcounter{cbx@tempcnta}{0}% + \setcounter{cbx@tempcntb}{-2}} \newbibmacro*{cite:comp}{% - \global\defcounter{cbx@tempcntb}{\value{cbx@tempcntb}+1}% + \addtocounter{cbx@tempcntb}{1}% \iffieldundef{shorthand} {\ifbool{bbx:subentry} {\iffieldundef{entrysetcount} @@ -28,18 +30,36 @@ {\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}}} + \ifboolexpr{ + ( test {\iffieldundef{prefixnumber}} and test {\ifundef\cbx@lastprefix} ) + or + test {\iffieldequals{prefixnumber}{\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{prefixnumber}% + \printfield{labelnumber}}}}} + {\usebibmacro{cite:comp:end}}% + \setcounter{cbx@tempcntb}{\thefield{labelnumber}}% + \savefield{prefixnumber}{\cbx@lastprefix}} + +\newbibmacro*{cite:comp:end}{% + \usebibmacro{cite:dump}% + \ifnumgreater{\value{cbx@tempcntb}}{-1} + {\multicitedelim} + {}% + \printtext[bibhyperref]{% + \printfield{prefixnumber}% + \printfield{labelnumber}}} \newbibmacro*{cite:comp:inset}{% \usebibmacro{cite:dump}% @@ -47,9 +67,10 @@ {\multicitedelim} {}% \printtext[bibhyperref]{% + \printfield{prefixnumber}% \printfield{labelnumber}% \printfield{entrysetcount}}% - \global\defcounter{cbx@tempcntb}{-1}} + \setcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:comp:shand}{% \usebibmacro{cite:dump}% @@ -57,7 +78,7 @@ {\multicitedelim} {}% \printtext[bibhyperref]{\printfield{shorthand}}% - \global\defcounter{cbx@tempcntb}{-1}} + \setcounter{cbx@tempcntb}{-1}} \newbibmacro*{cite:dump}{% \ifnumgreater{\value{cbx@tempcnta}}{0} @@ -65,9 +86,13 @@ {\bibrangedash} {\multicitedelim}% \bibhyperref[\cbx@lastkey]{% - \printtext[labelnumber]{\cbx@lastnumber}}% - \global\defcounter{cbx@tempcnta}{0}} - {}} + \ifdef\cbx@lastprefix + {\printtext[prefixnumber]{\cbx@lastprefix}} + {}% + \printtext[labelnumber]{\cbx@lastnumber}}} + {}% + \setcounter{cbx@tempcnta}{0}% + \global\undef\cbx@lastprefix} \newbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} |