summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-09-06 22:29:57 +0000
committerKarl Berry <karl@freefriends.org>2010-09-06 22:29:57 +0000
commit240dbb5ee820f2e77e4106bf872f363540c413e2 (patch)
tree3921b3f18013915f30f418d31199a3770604a0db /Master/texmf-dist/tex/latex/biblatex/cbx/numeric-comp.cbx
parent6892558c73756d9f24023e6269e025fa6f3cf15d (diff)
biblatex 0.9d (4sep10)
git-svn-id: svn://tug.org/texlive/trunk@19592 c570f23f-e606-0410-a88d-b1316a301751
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.cbx73
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}