From 275a02abde664ff395868e975c7c06d89276ac0b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Jul 2013 23:36:27 +0000 Subject: biblatex (10jul13) git-svn-id: svn://tug.org/texlive/trunk@31176 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/biblatex/biblatex2.sty | 235 +++++++++++++++------ 1 file changed, 168 insertions(+), 67 deletions(-) (limited to 'Master/texmf-dist/tex/latex/biblatex/biblatex2.sty') diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty index 1a9542da6c6..fd4576f2653 100644 --- a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty +++ b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty @@ -65,7 +65,11 @@ amsrefs,apacite,babelbib,backref,bibtopic,bibunits,chapterbib, cite,citeref,drftcite,footbib,inlinebib,jurabib,mcite,mciteplus, mlbib,multibbl,multibib,natbib,opcit,overcite,splitbib,ucs}% - \@ifpackageloaded{babel} + \ifboolexpr{ + test {\@ifpackageloaded{babel}} + and + not test {\@ifpackageloaded{polyglossia}} + } {\iftoggle{blx@autolang} {\blx@mkbabel} {\blx@mknobabel}} @@ -368,8 +372,6 @@ \newcount\blx@parenlevel@foot \expandafter\newcount\csname blx@sectionciteorder@0\endcsname - - \def\blx@uniquename{0} \def\blx@uniquelist{0} \def\blx@maxbibnames{0} @@ -2155,6 +2157,19 @@ \expandafter\@secondoftwo \fi}}} +% {}{} + +\def\blx@imc@iffirstcitekey{% + \ifboolexpr{ ( test {\ifnumequal\c@multicitetotal\z@} + and test {\ifnumequal\c@citecount\@ne} ) + or ( test {\ifnumgreater\c@multicitetotal\z@} + and test {\ifnumequal\c@multicitecount\@ne} + and test {\ifnumequal\c@citecount\@ne} ) }} + +\def\blx@imc@iflastcitekey{% + \ifboolexpr{ test {\ifnumequal\c@citecount\c@citetotal} + and test {\ifnumequal\c@multicitecount\c@multicitetotal} }} + % {}{}{} \protected\def\blx@imc@ifcategory{% @@ -2203,6 +2218,12 @@ \expandafter{\abx@field@entrykey}} {\@secondoftwo}} +\protected\def\blx@ifciteseen@context{% + \ifdef\abx@field@entrykey + {\expandafter\blx@ifseen@context + \expandafter{\abx@field@entrykey}} + {\@secondoftwo}} + % {}{}{} \protected\def\blx@ifentryseen@global{% @@ -2817,7 +2838,8 @@ \else \numdef\blx@tempc\blx@tempd \fi - \edef\blx@tempb{\blx@range@out@value{\blx@tempb\noexpand\bibrangedash\blx@tempc}}% + \edef\blx@tempb{% + \blx@range@out@value{\blx@tempb\noexpand\bibrangedash\blx@tempc}}% \blx@tempb} \def\blx@comprange@comp@div{% @@ -3046,11 +3068,12 @@ \ifdriver \thefield \strfield \csfield \usefield \thelist \thename \clearfield \clearlist \clearname \restorefield \restorelist \restorename \ifcategory \ifentrycategory \ifkeyword \ifentrykeyword - \ifciteseen \ifentryseen \ifciteibid \ifciteidem \ifopcit \ifloccit + \ifciteseen \ifentryseen \ifentryinbib \ifciteibid \ifciteidem \ifopcit \ifloccit \ifcurrentfield \ifcurrentlist \ifcurrentname \ifentrytype \iffieldequalcs \iffieldequals \iffieldequalstr \iffieldsequal \ifbibmacroundef \iffieldundef \iffieldxref \iflistequalcs \iflistequals - \iflistsequal \iflistundef \iflistxref \ifmorenames \ifmoreitems + \iflistsequal \iflistundef \iflistxref + \ifmorenames \ifmoreitems \iffirstcitekey \iflastcitekey \ifnameequalcs \ifnameequals \ifnamesequal \ifnameundef \ifnamexref \iffirstonpage \ifsamepage \savefield \savefieldcs \savelist \savelistcs \savename \savenamecs \usedriver @@ -4310,6 +4333,7 @@ \do{langitalian}% \do{langlatin}% \do{langnorwegian}% + \do{langpolish}% \do{langportuguese}% \do{langrussian}% \do{langspanish}% @@ -4329,6 +4353,7 @@ \do{fromitalian}% \do{fromlatin}% \do{fromnorwegian}% + \do{frompolish}% \do{fromportuguese}% \do{fromrussian}% \do{fromspanish}% @@ -4685,6 +4710,7 @@ \newrobustcmd*{\bibrangessep}{,\space} \newrobustcmd*{\bibdatedash}{\bibrangedash} \newrobustcmd*{\finalandcomma}{} +\newrobustcmd*{\finalandsemicolon}{} \newrobustcmd*{\mkbibordinal}[1]{#1} \newrobustcmd*{\mkbibmascord}{\mkbibordinal} \newrobustcmd*{\mkbibfemord}{\mkbibordinal} @@ -5109,7 +5135,7 @@ % {}{} -\protected\long\def\blx@bbl@countdef#1#2{% +\protected\long\def\blx@bbl@cntdef#1#2{% \csxappto\blx@bbl@data{% \csname c@#1\endcsname#2\relax}} @@ -5262,6 +5288,7 @@ \def\blx@ifdata#1{% \ifcsdef{blx@data@\the\c@refsection @#1}} +\let\blx@imc@ifentryinbib\blx@ifdata \def\blx@getdata#1{% \csuse{blx@data@\the\c@refsection @#1}% @@ -5564,7 +5591,7 @@ \let\list\blx@bbl@listdef \let\field\blx@bbl@fielddef \let\strng\blx@bbl@stringdef - \let\count\blx@bbl@countdef + \let\cnt\blx@bbl@cntdef \let\true\blx@bbl@booltrue \let\false\blx@bbl@boolfalse \let\verb\blx@bbl@verbdef @@ -5637,19 +5664,19 @@ {} {\blx@logreq@active{}}} {}% - % Test to see if we removed any mention of a sorting scheme since last run. + % Test if we removed any mention of a sorting scheme since last run. % If we did, we need to re-run biber \def\do#1{\ifinlist{#1}{\blx@sortschemes}{}{\blx@logreq@active{}}\relax}% \dolistloop\blx@lastsortschemes - % Test to see if we added any mention of a sorting scheme since last run + % Test if we added any mention of a sorting scheme since last run % If we did, we need to re-run biber \def\do#1{\ifinlist{#1}{\blx@lastsortschemes}{}{\blx@logreq@active{}}\relax}% \dolistloop\blx@sortschemes - % Test to see if we removed any mention of a shorthand sorting scheme since last run. + % Test if we removed any mention of a shorthand sorting scheme since last run. % If we did, we need to re-run biber \def\do#1{\ifinlist{#1}{\blx@sortschemeslos}{}{\blx@logreq@active{}}\relax}% \dolistloop\blx@lastsortschemeslos - % Test to see if we added any mention of a shorthand sorting scheme since last run + % Test to see if we added any mention of a shorthand sorting scheme since last run. % If we did, we need to re-run biber \def\do#1{\ifinlist{#1}{\blx@lastsortschemeslos}{}{\blx@logreq@active{}}\relax}% \dolistloop\blx@sortschemeslos @@ -5679,17 +5706,28 @@ {\let\abx@field@localnumber\@empty} {\csnumgdef{blx@labelnumber@\the\c@refsection}{% \csuse{blx@labelnumber@\the\c@refsection}+1}% - \edef\abx@field@localnumber{\csuse{blx@labelnumber@\the\c@refsection}}% + \edef\abx@field@localnumber{% + \csuse{blx@labelnumber@\the\c@refsection}}% \blx@bbl@addentryfield{\abx@field@entrykey}{\the\c@refsection}% {localnumber}{\abx@field@localnumber}}% - \listxadd\blx@localnumaux{\string\abx@aux@number{\the\c@instcount}{\abx@field@entrykey}{\the\c@refsection}{\abx@field@localnumber}}} + \listxadd\blx@localnumaux{% + \string\abx@aux@number + {\the\c@instcount} + {\abx@field@entrykey} + {\the\c@refsection} + {\abx@field@localnumber}}} % If localnumbers were already in the .aux, add them % again from the .aux. This prevents some cycling % problems where pagebreaks change after localnumber % settles down and then we need another run which then % regenerates localnumber requiring another run but then % the pagebreaks change back again ... etc. - {\listxadd\blx@localnumaux{\string\abx@aux@number{\the\c@instcount}{\abx@field@entrykey}{\the\c@refsection}{\abx@field@localnumber}}}} + {\listxadd\blx@localnumaux{% + \string\abx@aux@number + {\the\c@instcount} + {\abx@field@entrykey} + {\the\c@refsection} + {\abx@field@localnumber}}}} {}}% {}} {}% @@ -6284,7 +6322,8 @@ \togglefalse{blx@omitnumbers}% \setkeys{blx@bib2}{#1}% ... now we have correct \blx@tempa, set rest of options \blx@rest@actives - \csxappto{blx@xml@slistsbib}{\blx@xml@slist{entry}{\blx@tempe}{\blx@tempc}{\blx@tempd}}% + \csxappto{blx@xml@slistsbib}{% + \blx@xml@slist{entry}{\blx@tempe}{\blx@tempc}{\blx@tempd}}% \ifdefvoid\blx@tempa {\blx@warn@bibempty\endgroup} {\blx@bibliography\blx@tempa}} @@ -6536,6 +6575,10 @@ \@onlypreamble\AtBeginBibliography \@onlypreamble\AtEveryBibitem +\def\blx@imc@UseBibitemHook{\csuse{blx@hook@bibitem}} + +\blx@regimcs{\UseBibitemHook} + \newrobustcmd*{\AtNextBibliography}{% \ifundef\blx@hook@bibinit@next {\gdef\blx@hook@bibinit@next{\global\undef\blx@hook@bibinit@next}} @@ -6637,7 +6680,8 @@ \blx@safe@actives \setkeys{blx@los2}{#1}% ... now we have correct \blx@tempa, set rest of options \blx@rest@actives - \csxappto{blx@xml@slistsbib}{\blx@xml@slistlos{shorthand}{\blx@tempe}{\blx@tempc}{\blx@tempd}}% + \csxappto{blx@xml@slistsbib}{% + \blx@xml@slistlos{shorthand}{\blx@tempe}{\blx@tempc}{\blx@tempd}}% \ifdefvoid\blx@tempa {\blx@warn@losempty\endgroup} {\blx@shorthands\blx@tempa}} @@ -6756,8 +6800,9 @@ \ifblank{#1} {} {\let\blx@bibfiles\@empty - \blx@xsanitizeafter{\forcsvlist\blx@refsection@addfile}{#1}% + % globals should be first as it might contain macros needed for others \forlistloop{\listadd\blx@bibfiles}\blx@bibfiles@global}% + \blx@xsanitizeafter{\forcsvlist\blx@refsection@addfile}{#1}% \blx@refsection@biber \fi \blx@info{Setting label 'refsection:\the\c@refsection'}% @@ -7057,8 +7102,14 @@ \newrobustcmd*{\AtEveryCite}{\gappto\blx@hook@cite} \newrobustcmd*{\AtEveryCitekey}{\gappto\blx@hook@citekey} +\newrobustcmd*{\AtEveryMultiCite}{\gappto\blx@hook@mcite} \@onlypreamble\AtEveryCite \@onlypreamble\AtEveryCitekey +\@onlypreamble\AtEveryMultiCite + +\def\blx@imc@UseEveryCiteHook{\csuse{blx@hook@cite}} +\def\blx@imc@UseEveryCitekeyHook{\csuse{blx@hook@citekey}} +\def\blx@imc@UseEveryMultiCiteHook{\csuse{blx@hook@mcite}} \newrobustcmd*{\AtNextCite}{% \ifundef\blx@hook@cite@next @@ -7072,7 +7123,24 @@ {}% \gappto\blx@hook@citekey@next} -% {