summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/biblatex2.sty')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/biblatex2.sty910
1 files changed, 432 insertions, 478 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
index e9b49c817f2..41d9068dfb5 100644
--- a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
+++ b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
@@ -65,6 +65,13 @@
amsrefs,apacite,babelbib,backref,bibtopic,bibunits,chapterbib,
cite,citeref,drftcite,footbib,inlinebib,jurabib,mcite,mciteplus,
mlbib,multibbl,multibib,natbib,opcit,overcite,splitbib,ucs}%
+ \def\blx@langstrings{}%
+ % Set up sortlocale defaults
+ \ifdefstring\blx@sortlocale{auto}
+ {\ifdef\bbl@main@language% babel or polyglossia is loaded
+ {\edef\blx@sortlocale{\bbl@main@language}}
+ {\def\blx@sortlocale{english}}}
+ {}%
\@ifpackageloaded{polyglossia}
{\ifboolexpr{
not test {\iftoggle{blx@autolangbib}}
@@ -211,7 +218,7 @@
{\blx@err@patch{floats}}%
\ifdef\TX@endtabularx % tabularx/memoir
{\pretocmd\TX@endtabularx
- {\addtocounter{tabx@nest}{1}}% track nestes tabularx environments
+ {\addtocounter{tabx@nest}{1}}% track nested tabularx environments
{}
{\blx@err@patch{'tabularx'}}%
% no need to conditionalise on top-level tabx as the search/replace
@@ -219,14 +226,14 @@
\patchcmd\TX@endtabularx
{\edef\TX@ckpt{\cl@@ckpt}}
{\edef\TX@ckpt{\cl@@ckpt\abx@resttrackers}%
- \abx@savetrackers}
+ \abx@savetrackers}
{}
{\blx@err@patch{'tabularx'}}%
\apptocmd\TX@endtabularx
{\ifnum\value{tabx@nest}=1% only clear trackers for top-level tabularx
- \abx@cleartrackers
- \fi
- \addtocounter{tabx@nest}{-1}}
+ \abx@cleartrackers
+ \fi
+ \addtocounter{tabx@nest}{-1}}
{}
{\blx@err@patch{'tabularx'}}}
{}%
@@ -410,7 +417,6 @@
\newlength{\labelnumberwidth}
\newlength{\labelalphawidth}
-\newlength{\shorthandwidth}
\newlength{\biblabelsep}
\ifdef\bibitemsep % memoir
{}
@@ -466,7 +472,7 @@
\newtoggle{blx@setonly}
\newtoggle{blx@dataonly}
\newtoggle{blx@skipbib}
-\newtoggle{blx@skiplos}
+\newtoggle{blx@skipbiblist}
\newtoggle{blx@skiplab}
\newtoggle{blx@citation}
\newtoggle{blx@bibliography}
@@ -480,8 +486,8 @@
\global\let\blx@cites\@empty
\global\let\blx@sortschemes\@empty
\global\let\blx@lastsortschemes\@empty
-\global\let\blx@sortschemeslos\@empty
-\global\let\blx@lastsortschemeslos\@empty
+\global\let\blx@biblists\@empty
+\global\let\blx@lastbiblists\@empty
\global\let\blx@lastcites\@empty
\global\let\blx@localnumaux\@empty
@@ -516,6 +522,9 @@
\blx@idemreset@force
\blx@opcitreset@force
\blx@loccitreset@force
+ % List to track all aliases in a section. We need to output all aliases
+ % to the .bcf every time so that they are visible to biber
+ \global\cslet{blx@keyaliases@\the\c@refsection}\@empty
\ifcsundef{blx@segm@\the\c@refsection @\the\c@refsegment}
{\global\cslet{blx@segm@\the\c@refsection @\the\c@refsegment}\@empty}
{}}
@@ -542,7 +551,6 @@
\fi}
% {<field>} => \do{<item1>}\do{<item2>}...
-
\def\blx@imc@docsvfield#1{%
\blx@imc@iffieldundef{#1}
{}
@@ -551,7 +559,6 @@
\csname abx@field@#1\endcsname}}}
% {<handler>}{<field>} => <handler>{<item1>}<handler>{<item2>}...
-
\def\blx@imc@forcsvfield#1#2{%
\blx@imc@iffieldundef{#2}
{}
@@ -564,7 +571,6 @@
\blx@regimcs{\docsvfield \forcsvfield}
% {<list>|<listmacro>}
-
\protected\long\def\blx@listloop#1{%
\expandafter\blx@listloop@i#1|&}
\long\def\blx@listloop@i#1|{%
@@ -578,7 +584,6 @@
\undef\blx@done}
% {<listmacro>}{<listcsname>} => matches in <listmacro>
-
\protected\def\blx@filter#1#2{%
\def\do##1{%
\ifinlistcs{##1}{#2}
@@ -594,7 +599,6 @@
% of filtering for cite sorting has the side-effect of stripping
% duplicates like \cite{foo,foo} but we need then to keep citetotal
% in sync.
-
\protected\def\blx@filtercitesort#1#2{%
\blx@tempcnta\z@
\def\do##1{%
@@ -605,7 +609,6 @@
\blx@runfilter#1}
% {<listmacro>}{<listcsname>} => neg. matches in <listmacro>
-
\protected\def\blx@notfilter#1#2{%
\def\do##1{%
\ifinlistcs{##1}{#2}
@@ -619,7 +622,6 @@
#1\let\do\noexpand}
% {<code>}{<string>} => <code>{<string>}
-
\protected\def\blx@xsanitizeafter#1#2{%
\begingroup
\abx@hook@xsanitize
@@ -633,7 +635,6 @@
\let\protect\string}
% {<code>}{<string>} => <code>{<string>}
-
\begingroup
\catcode`\<=\active
\catcode`\>=\active
@@ -665,7 +666,6 @@
\endgroup
% {<file>}{<message>}{<preload>}{<postload>}{<success>}{<failure>}
-
\protected\long\def\blx@inputonce#1#2#3#4#5#6{%
\ifcsundef{blx@file@#1}
{\blx@info@noline{Trying to load #2..}%
@@ -679,7 +679,6 @@
{#5}}
% {<write>}{<precode>}{<string>}
-
\protected\def\blx@auxwrite#1#2#3{%
\if@filesw
\begingroup
@@ -691,7 +690,6 @@
\fi}
% {<file>}{<signature>}{<true>}{<false>}
-
\def\blx@ifsigned#1#2{%
\begingroup
\let\blx@tempa\@firstoftwo
@@ -736,7 +734,6 @@
\detokenize{" xmlns:bcf="https://sourceforge.net/projects/biblatex">}}
% {<true>}{<false>}
-
\newrobustcmd*{\lbx@ifutfinput}{\ifboolexpr{%
test {\ifdefstring\inputencodingname{utf8}}
or
@@ -937,8 +934,8 @@
\def\blx@warn@bibempty{%
\@latex@warning{Empty bibliography}}
-\def\blx@warn@losempty{%
- \@latex@warning{Empty list of shorthands}}
+\def\blx@warn@biblistempty#1{%
+ \@latex@warning{Empty biblist '#1'}}
\def\blx@inf@refsec{%
\blx@info{Reference section=\the\c@refsection}}%
@@ -1626,7 +1623,6 @@
%% Style definition
% {<bibstyle>}
-
\newrobustcmd*{\RequireBibliographyStyle}[1]{%
\blx@inputonce{#1.bbx}{bibliography style '#1'}{}{}{}
{\blx@error
@@ -1635,18 +1631,15 @@
\@onlypreamble\RequireBibliographyStyle
% {<code>}
-
\newrobustcmd*{\InitializeBibliographyStyle}{\appto\blx@hook@bbxinit}
\@onlypreamble\InitializeBibliographyStyle
% {<entry type>}{<driverdef>}
-
\newrobustcmd*{\DeclareBibliographyDriver}[1]{%
\long\csdef{blx@bbx@#1}}
\@onlypreamble\DeclareBibliographyDriver
% {<entry type>}
-
\def\blx@driver#1{%
\ifcsdef{blx@bbx@#1}
{\csuse{blx@bbx@#1}}
@@ -1662,18 +1655,15 @@
and there is no fallback driver either}}}}
% {<type>}{<true>}{<false>}
-
\def\blx@imc@ifdriver#1{\ifcsdef{blx@bbx@#1}}
% {<alias>}{<type>}
-
\newrobustcmd*{\DeclareBibliographyAlias}[2]{%
\csedef{blx@bbx@#1}{%
\expandafter\noexpand\csname blx@bbx@#2\endcsname}}
\@onlypreamble\DeclareBibliographyAlias
% {<key>}[<value>]{<code>}
-
\newrobustcmd*{\DeclareBibliographyOption}[1]{%
\@ifnextchar[%]
{\blx@defbibopt{#1}}
@@ -1689,7 +1679,6 @@
{\blx@err@optdef{#1}}}
% {<key>}[<value>]{<code>}
-
\newrobustcmd*{\DeclareTypeOption}[1]{%
\@ifnextchar[%]
{\blx@deftypeopt{#1}}
@@ -1703,7 +1692,6 @@
{\blx@err@optdef{#1}}}
% {<key>}[<value>]{<code>}
-
\newrobustcmd*{\DeclareEntryOption}[1]{%
\@ifnextchar[%]
{\blx@defentryopt{#1}}
@@ -1717,7 +1705,6 @@
{\blx@err@optdef{#1}}}
%% Auxiliary commands
-
\newrobustcmd*{\citereset}{%
\csuse{blx@hook@cbxinit}%
\@ifstar
@@ -1756,7 +1743,6 @@
{}}
% {<name>}
-
\newrobustcmd*{\savebibmacro}[1]{%
\blx@save{abx@macro@\detokenize{#1}}}
@@ -1764,7 +1750,6 @@
\blx@restore{abx@macro@\detokenize{#1}}}
% {<name>}[<args>][<optarg>]{<definition>}
-
\newrobustcmd*{\newbibmacro}{%
\@star@or@long\blx@newbibmacro}
@@ -1794,7 +1779,6 @@
\expandafter#1\csname abx@macro@\detokenize{#2}\endcsname}
% {<name>}
-
\newrobustcmd*{\usebibmacro}{%
\@ifstar
{\blx@usebibmacro@i}
@@ -1811,12 +1795,10 @@
{\csuse{abx@macro@#1}}}
% {<name>}{<true>}{<false>}
-
\def\blx@imc@ifbibmacroundef#1{%
\ifcsundef{abx@macro@#1}}
% {<field>}
-
\def\blx@imc@thefield#1{\csuse{abx@field@#1}}
\def\blx@imc@strfield#1{%
@@ -1828,26 +1810,21 @@
\def\blx@imc@csfield#1{\usefield{\unexpanded}{#1}}
% {<command>}{<field>}
-
\def\blx@imc@usefield#1#2{%
\expandafter\expandafter\expandafter#1%
\expandafter\expandafter\expandafter{\csname abx@field@#2\endcsname}}
% {<plainlist>}
-
\def\blx@imc@thelist#1{\csuse{abx@list@#1}}
% {<namelist>}
-
\def\blx@imc@thename#1{\csuse{abx@name@#1}}
% {<field>}
-
\protected\def\blx@imc@clearfield#1{%
\csundef{abx@field@#1}}
% {<plainlist>}
-
\protected\def\blx@imc@clearlist#1{%
\ifcsundef{abx@list@#1}
{}
@@ -1856,7 +1833,6 @@
\csname c@#1\endcsname\z@}}
% {<namelist>}
-
\protected\def\blx@imc@clearname#1{%
\ifcsundef{abx@name@#1}
{}
@@ -1865,76 +1841,61 @@
\csname c@#1\endcsname\z@}}
% {<field>}{<macro>}
-
\protected\def\blx@imc@restorefield#1{\cslet{abx@field@#1}}
% {<plainlist>}{<macro>}
-
\protected\def\blx@imc@restorelist#1{\cslet{abx@list@#1}}
% {<namelist>}{<macro>}
-
\protected\def\blx@imc@restorename#1{\cslet{abx@name@#1}}
% {<field>}{<macro>}
-
\protected\def\blx@imc@savefield{%
\@ifstar{\blx@savedata{field}}{\global\blx@savedata{field}}}
\def\blx@savedata#1#2#3{\letcs#3{abx@#1@#2}}
% {<plainlist>}{<macro>}
-
\protected\def\blx@imc@savelist{%
\@ifstar{\blx@savedata{list}}{\global\blx@savedata{list}}}
% {<namelist>}{<macro>}
-
\protected\def\blx@imc@savename{%
\@ifstar{\blx@savedata{name}}{\global\blx@savedata{name}}}
% {<field>}{<csname>}
-
\protected\def\blx@imc@savefieldcs{%
\@ifstar{\blx@savedatacs{field}}{\global\blx@savedatacs{field}}}
\def\blx@savedatacs#1#2#3{\csletcs{#3}{abx@#1@#2}}
% {<plainlist>}{<csname>}
-
\protected\def\blx@imc@savelistcs{%
\@ifstar{\blx@savedatacs{list}}{\global\blx@savedatacs{list}}}
% {<namelist>}{<csname>}
-
\protected\def\blx@imc@savenamecs{%
\@ifstar{\blx@savedatacs{name}}{\global\blx@savedatacs{name}}}
% {<field>}{<true>}{<false>}
-
\def\blx@imc@iffieldundef#1{%
\ifcsundef{abx@field@#1}}
% {<plainlist>}{<true>}{<false>}
-
\def\blx@imc@iflistundef#1{%
\ifcsundef{abx@list@#1}}
% {<namelist>}{<true>}{<false>}
-
\def\blx@imc@ifnameundef#1{%
\ifcsundef{abx@name@#1}}
% {<field1>}{<field2>}{<true>}{<false>}
-
\def\blx@imc@iffieldsequal#1#2{%
\ifcsequal{abx@field@#1}{abx@field@#2}}
% {<plainlist1>}{<plainlist2>}{<true>}{<false>}
-
\def\blx@imc@iflistsequal#1#2{%
\ifcsequal{abx@list@#1}{abx@list@#2}}
% {<namelist1>}{<namelist2>}{<true>}{<false>}
-
\def\blx@imc@ifnamesequal#1#2{%
\ifcsundef{abx@name@#1}
{\@secondoftwo}
@@ -1974,7 +1935,6 @@
{\appto\blx@tempa{{{#2}{#4}{#6}{#8}}}}}
% {<field>}{<macro>}{<true>}{<false>}
-
\def\blx@imc@iffieldequals#1#2{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -1987,7 +1947,6 @@
\fi}}}
% {<plainlist>}{<macro>}{<true>}{<false>}
-
\def\blx@imc@iflistequals#1#2{%
\blx@imc@iflistundef{#1}
{\@secondoftwo}
@@ -2000,7 +1959,6 @@
\fi}}}
% {<namelist>}{<macro>}{<true>}{<false>}
-
\def\blx@imc@ifnameequals#1#2{% FIXME
\blx@imc@ifnameundef{#1}
{\@secondoftwo}
@@ -2013,22 +1971,18 @@
\fi}}}
% {<field>}{<csname>}{<true>}{<false>}
-
\def\blx@imc@iffieldequalcs#1{%
\ifcsequal{abx@field@#1}}
% {<plainlist>}{<csname>}{<true>}{<false>}
-
\def\blx@imc@iflistequalcs#1{%
\ifcsequal{abx@list@#1}}
% {<namelist>}{<csname>}{<true>}{<false>}
-
\def\blx@imc@ifnameequalcs#1{% FIXME
\ifcsequal{abx@name@#1}}
% {<field>}{<string>}{<true>}{<false>}
-
\protected\long\def\blx@imc@iffieldequalstr#1#2{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -2037,7 +1991,6 @@
\csname abx@field@#1\endcsname}{#2}}}
% {<field>}{<true>}{<false>}
-
\protected\def\blx@imc@iffieldxref#1{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -2064,7 +2017,6 @@
{#1{crossref}}}
% {<plainlist>}{<true>}{<false>}
-
\protected\def\blx@imc@iflistxref#1{%
\blx@imc@iflistundef{#1}
{\@secondoftwo}
@@ -2084,7 +2036,6 @@
\endgroup}
% {<namelist>}{<true>}{<false>}
-
\protected\def\blx@imc@ifnamexref#1{%
\blx@imc@ifnameundef{#1}
{\@secondoftwo}
@@ -2104,7 +2055,6 @@
\endgroup}
% {<string>}{<true>}{<false>}
-
\protected\def\blx@imc@ifcurrentfield#1{%
\begingroup
\def\blx@tempa{#1}%
@@ -2116,7 +2066,6 @@
\endgroup}
% {<string>}{<true>}{<false>}
-
\protected\def\blx@imc@ifcurrentlist#1{%
\begingroup
\def\blx@tempa{#1}%
@@ -2128,7 +2077,6 @@
\endgroup}
% {<string>}{<true>}{<false>}
-
\protected\def\blx@imc@ifcurrentname#1{%
\begingroup
\def\blx@tempa{#1}%
@@ -2140,7 +2088,6 @@
\endgroup}
% {<string>}{<true>}{<false>}
-
\protected\def\blx@imc@ifentrytype#1{%
\begingroup
\def\blx@tempa{#1}%
@@ -2152,7 +2099,6 @@
\endgroup}
% {<true>}{<false>}
-
\def\blx@imc@ifmorenames{%
\ifundef\currentname
{\@secondoftwo}
@@ -2165,7 +2111,6 @@
\fi}}}
% {<true>}{<false>}
-
\def\blx@imc@ifmoreitems{%
\ifundef\currentlist
{\@secondoftwo}
@@ -2178,7 +2123,6 @@
\fi}}}
% {<true>}{<false>}
-
\def\blx@imc@iffirstcitekey{%
\ifboolexpr{ ( test {\ifnumequal\c@multicitetotal\z@}
and test {\ifnumequal\c@citecount\@ne} )
@@ -2191,14 +2135,12 @@
and test {\ifnumequal\c@multicitecount\c@multicitetotal} }}
% {<category>}{<true>}{<false>}
-
\protected\def\blx@imc@ifcategory{%
\ifdef\abx@field@entrykey
{\blx@imc@ifentrycategory\abx@field@entrykey}
{\expandafter\@secondoftwo\@gobble}}
% {<entrykey>}{<category>}{<true>}{<false>}
-
\protected\def\blx@imc@ifentrycategory{%
\blx@xsanitizeafter\blx@imc@ifentrycategory@i}
@@ -2208,14 +2150,12 @@
{\@secondoftwo}}
% {<keyword>}{<true>}{<false>}
-
\protected\def\blx@imc@ifkeyword{%
\ifdef\abx@field@entrykey
{\blx@imc@ifentrykeyword\abx@field@entrykey}
{\expandafter\@secondoftwo\@gobble}}
% {<entrykey>}{<keyword>}{<true>}{<false>}
-
\protected\def\blx@imc@ifentrykeyword{%
\blx@xsanitizeafter\blx@imc@ifentrykeyword@i}
@@ -2225,7 +2165,6 @@
{\@secondoftwo}}
% {<true>}{<false>}
-
\protected\def\blx@ifciteseen@global{%
\ifbool{citetracker}
{\ifdef\abx@field@entrykey
@@ -2251,7 +2190,6 @@
{\@secondoftwo}}
% {<entrykey>}{<true>}{<false>}
-
\protected\def\blx@ifentryseen@global{%
\blx@xsanitizeafter\blx@ifseen@global}
@@ -2271,7 +2209,6 @@
{\@secondoftwo}}
% {<true>}{<false>}
-
\def\blx@ifciteibid@global{%
\ifbool{citetracker}
{\blx@imc@iffieldequals{entrykey}\blx@lastkey@text}
@@ -2303,7 +2240,6 @@
{\@secondoftwo}}
% {<true>}{<false>}
-
\def\blx@ifciteidem@global{%
\ifbool{citetracker}
{\blx@imc@iffieldequals{fullhash}\blx@lasthash@text}
@@ -2328,7 +2264,6 @@
{\@secondoftwo}}
% {<true>}{<false>}
-
\def\blx@ifopcit@global{%
\ifbool{citetracker}
{\blx@imc@iffieldundef{namehash}
@@ -2366,7 +2301,6 @@
{\@secondoftwo}}
% {<true>}{<false>}
-
\def\blx@ifloccit@global{%
\ifbool{citetracker}
{\blx@loccit@check{text}}
@@ -2411,7 +2345,6 @@
{\@secondoftwo}}}
% {<true>}{<false>}
-
\def\blx@ifmpfncheck{%
\ifnum\numexpr\value\@mpfn-\blx@lastmpfn<\tw@
\expandafter\@firstoftwo
@@ -2428,7 +2361,6 @@
\blx@mpfnreset
% {<true>}{<false>}
-
\def\blx@imc@iffirstonpage{%
\ifbool{pagetracker}
{\iftoggle{blx@footnote}
@@ -2460,7 +2392,6 @@
\fi}}
% {<count1>}{<count2>}{<true>}{<false>}
-
\def\blx@imc@ifsamepage#1#2{%
\ifbool{pagetracker}
{\ifcsundef{blx@page@\number\numexpr#1}
@@ -2486,7 +2417,6 @@
\fi}
% {<string>}{<true>}{<false>}
-
\protected\long\def\blx@imc@ifinteger#1{%
\begingroup
\def\do##1{\uccode`##1=`\%}%
@@ -2503,7 +2433,6 @@
\endgroup}
% {<field>}{<true>}{<false>}
-
\protected\def\blx@imc@iffieldint#1{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -2513,7 +2442,6 @@
\expandafter{\csname abx@field@#1\endcsname}}}
% {<string>}{<true>}{<false>}
-
\protected\def\blx@imc@ifnumeral{%
\blx@ifnum\blx@hook@ifnum}
@@ -2566,7 +2494,6 @@
\blx@dopagecmds}
% {<field>}{<true>}{<false>}
-
\protected\def\blx@imc@iffieldnum#1{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -2592,7 +2519,6 @@
\expandafter{\csname abx@field@#1\endcsname}}}
% {<chars>}
-
\newrobustcmd*{\DeclareNumChars}{%
\@ifstar
{\blx@defnumchars}
@@ -2607,7 +2533,6 @@
\detokenize{#1}\relax}}
% {<chars>}
-
\newrobustcmd*{\DeclareRangeChars}{%
\@ifstar
{\blx@defrangechars}
@@ -2632,7 +2557,6 @@
\fi}
% {<cstokens>}
-
\newrobustcmd*{\DeclareRangeCommands}{%
\@ifstar
{\blx@defrangecmds}
@@ -2652,7 +2576,6 @@
\fi}
% {<cstokens>}
-
\newrobustcmd*{\DeclarePageCommands}{%
\@ifstar
{\blx@defpagecmds}
@@ -2682,12 +2605,10 @@
\DeclarePageCommands{\pno\ppno}
% *{<code>}
-
\newrobustcmd*{\NumCheckSetup}{\appto\blx@hook@ifnum}
\newcommand*{\NumcheckSetup}{\NumCheckSetup}
% [<pagination>][<postpro>]{<string>}
-
\newrobustcmd*{\blx@imc@mkpageprefix}[1][pagination]{%
\begingroup
\def\blx@tempa{\blx@mkpageprefix{page}}%
@@ -2715,7 +2636,6 @@
\long\def\blx@mkpageprefix@i[#1]#2{#1{#2}\endgroup}
% [<pagination>][<postpro>]{<string>}
-
\newrobustcmd*{\blx@imc@mkpagetotal}[1][bookpagination]{%
\begingroup
\def\blx@tempa{\blx@mkpagetotal{page}}%
@@ -2928,7 +2848,25 @@
\fi}
\def\blx@range@chunk#1{%
- \blx@range@chunk@sep#1\bibrangessep&}
+ \blx@range@chunk@semcol#1;&}
+
+\def\blx@range@chunk@semcol#1;#2&{%
+ \notblank{#1}
+ {\blx@range@chunk@comma#1,&}
+ {}%
+ \notblank{#2}
+ {\notblank{#1}{\blx@range@out@delim{\bibrangessep}}{}%
+ \blx@range@chunk@semcol#2&}
+ {}}
+
+\def\blx@range@chunk@comma#1,#2&{%
+ \notblank{#1}
+ {\blx@range@chunk@sep#1\bibrangessep&}
+ {}%
+ \notblank{#2}
+ {\notblank{#1}{\blx@range@out@delim{\bibrangessep}}{}%
+ \blx@range@chunk@comma#2&}
+ {}}
\def\blx@range@chunk@sep#1\bibrangessep#2&{%
\notblank{#1}
@@ -2941,7 +2879,6 @@
{}}
% <*>[<postpro>]{<string>}
-
\newrobustcmd*{\mkfirstpage}{%
\begingroup
\@ifstar
@@ -3186,7 +3123,6 @@
% capitalization
% {<text>}
-
\newrobustcmd{\MakeCapital}[1]{%
\begingroup
\blx@mkcp@init
@@ -3262,7 +3198,6 @@
\do\t}
% {<text>}
-
\newrobustcmd*{\MakeSentenceCase}{%
\@ifstar\blx@mksc@i\blx@mksc@ii}
@@ -3414,7 +3349,6 @@
\let\blx@mksc@endhead\relax}
% {<language,language,...>}
-
\newrobustcmd*{\DeclareCaseLangs}{%
\@ifstar
{\blx@defcaselangs}
@@ -3434,7 +3368,6 @@
%% Main formatting commands
% [<entrytype>]{<name>}{<definiton>}
-
\newrobustcmd*{\DeclareNameFormat}{%
\@ifstar
{\blx@defformat\blx@defnameformat{nfd}*}
@@ -3463,14 +3396,12 @@
{\blx@defformat\blx@defplainformat{fid}{}}}
% {<macro>}{<class>}{<*>}
-
\def\blx@defformat#1#2#3{%
\@ifnextchar[%]
{\blx@defformat@i{#1}{#2}{#3}}
{\blx@defformat@i{#1}{#2}{#3}[*]}}
% {<macro>}{<class>}{<*>}[<entrytype>]{<name>}
-
\def\blx@defformat@i#1#2#3[#4]#5{%
\notblank{#3}
{\blx@resetformat{#2}{#5}}
@@ -3509,14 +3440,12 @@
{}}
% {<name>}{<name>}
-
\def\blx@letformat#1#2{%
\blx@safe@actives
\afterassignment\blx@rest@actives
\csletcs{#1}{#2}}
% [aliastype]{aliasname}[formattype]{formatname}
-
\def\blx@defalias#1{%
\@ifnextchar[%]
{\blx@defalias@i{#1}}
@@ -3532,7 +3461,6 @@
\expandonce{\csname abx@#1@#4@#5\endcsname}}}
% {<macro>}{<id>}{<name>}{<field>}
-
\def\blx@getformat#1#2#3#4{%
\blx@safe@actives
\afterassignment\blx@rest@actives
@@ -3547,7 +3475,6 @@
{\letcs#1{abx@#2@\blx@imc@thefield{entrytype}@#3}}}
% [<entrytype>]{<name>}
-
\newrobustcmd*{\savefieldformat}[2][*]{\blx@save{abx@ffd@#1@#2}}
\newrobustcmd*{\savelistformat}[2][*]{\blx@save{abx@lfd@#1@#2}}
\newrobustcmd*{\savenameformat}[2][*]{\blx@save{abx@nfd@#1@#2}}
@@ -3557,13 +3484,11 @@
\newrobustcmd*{\restorenameformat}[2][*]{\blx@restore{abx@nfd@#1@#2}}
% [<entrytype>]{<name>}{<true>}{<false>}
-
\newrobustcmd*{\iffieldformatundef}[2][*]{\ifcsundef{abx@ffd@#1@#2}}
\newrobustcmd*{\iflistformatundef}[2][*]{\ifcsundef{abx@lfd@#1@#2}}
\newrobustcmd*{\ifnameformatundef}[2][*]{\ifcsundef{abx@nfd@#1@#2}}
% [<entrytype>]{<alias>}[<entrytype>]{<name>}
-
\newrobustcmd*{\DeclareNameAlias}{\blx@defalias{nfd}}
\newrobustcmd*{\DeclareIndexNameAlias}{\blx@defalias{nid}}
@@ -3574,7 +3499,6 @@
\newrobustcmd*{\DeclareIndexFieldAlias}{\blx@defalias{fid}}
% [<format>]{<text>}
-
\newrobustcmd{\blx@imc@printtext}[2][]{%
\ifblank{#2}
{\blx@nounit}
@@ -3588,7 +3512,6 @@
\blx@endunit}}}
% [<format>]{<field>}
-
\newrobustcmd*{\blx@imc@printfield}[2][]{%
\blx@imc@iffieldundef{#2}
{\blx@nounit}
@@ -3604,7 +3527,6 @@
\blx@endunit}}}
% [<format>]{<field>}
-
\newcommand*{\blx@imc@indexfield}[2][]{%
\blx@imc@iffieldundef{#2}
{}
@@ -3618,7 +3540,6 @@
\endgroup}}}
% [<format>]{<file>}
-
\newrobustcmd*{\blx@imc@printfile}[2][]{%
\iftoggle{blx@loadfiles}
{\IfFileExists{#2}
@@ -3629,7 +3550,6 @@
% {<macro>}[<format>][<start>-<stop>]
% => <macro>{<format>}{<start>}{<stop>}
-
\def\blx@listargs#1{%
\@ifnextchar[%]
{\blx@listargs@i{#1}}
@@ -3647,12 +3567,10 @@
#1{#2}{#3}{#4}}
% [<format>][<start>-<stop>]{<namelist>}
-
\protected\def\blx@imc@printnames{%
\blx@listargs\blx@printnames}
% {<format>}{<start>}{<stop>}{<namelist>}
-
\def\blx@printnames#1#2#3#4{%
\blx@imc@ifnameundef{#4}
{\blx@nounit}
@@ -3720,12 +3638,10 @@
\newrobustcmd*{\bibnamedelimi}{\addnbspace}
% [<format>][<start>-<stop>]{<namelist>}
-
\protected\def\blx@imc@indexnames{%
\blx@listargs\blx@indexnames}
% {<format>}{<start>}{<stop>}{<namelist>}
-
\def\blx@indexnames#1#2#3#4{%
\blx@imc@ifnameundef{#4}
{}
@@ -3749,7 +3665,6 @@
\let\bibnamedelimi\bibindexnamedelimi}
% {<name1>}{<name2>}{...}
-
\long\def\blx@nameparser#1{%
\ifblank{#1}
{\blx@namebreak}
@@ -3772,12 +3687,10 @@
\long\def\blx@namebreak#1&{}
% [<format>][<start>-<stop>]{<plainlist>}
-
\protected\def\blx@imc@printlist{%
\blx@listargs\blx@printlist}
% {<format>}{<start>}{<stop>}{<plainlist>}
-
\def\blx@printlist#1#2#3#4{%
\blx@imc@iflistundef{#4}
{\blx@nounit}
@@ -3817,12 +3730,10 @@
\fi}}
% [<format>][<start>-<stop>]{<plainlist>}
-
\protected\def\blx@imc@indexlist{%
\blx@listargs\blx@indexlist}
% {<format>}{<start>}{<stop>}{<plainlist>}
-
\def\blx@indexlist#1#2#3#4{%
\blx@imc@iflistundef{#4}
{}
@@ -3835,7 +3746,6 @@
\endgroup}}}
% {<item1>}{<item2>}{...}
-
\long\def\blx@listparser#1{%
\ifblank{#1}
{\blx@listbreak}
@@ -3852,7 +3762,6 @@
\long\def\blx@listbreak#1&{}
% <*>{<key>}{<code>}
-
\protected\def\blx@imc@entrydata{%
\@ifstar
{\blx@xsanitizeafter{\blx@imc@entrydata@i\blx@saveentry}}
@@ -3925,7 +3834,6 @@
%% Localization
% [<wrapper>]{<string>}
-
\newrobustcmd*{\blx@imc@bibstring}[2][\@firstofone]{%
\blx@bibstring{#1}{\abx@str}{#2}}
@@ -3951,7 +3859,6 @@
\blx@endunit}}
% [<wrapper>]{<string>}
-
\newrobustcmd*{\blx@imc@bibcpstring}[2][\@firstofone]{%
\blx@bibcpstring{#1}{\abx@str}{#2}}
@@ -3975,7 +3882,6 @@
\blx@endunit}}
% [<wrapper>]{<string>}
-
\newrobustcmd*{\blx@imc@biblcstring}[2][\@firstofone]{%
\blx@biblcstring{#1}{\abx@str}{#2}}
@@ -3999,7 +3905,6 @@
\blx@endunit}}
% [<wrapper>]{<string>}
-
\newrobustcmd*{\blx@imc@bibucstring}[2][\@firstofone]{%
\blx@bibucstring{#1}{\abx@str}{#2}}
@@ -4023,7 +3928,6 @@
\blx@endunit}}
% {<string>}
-
\def\blx@imc@bibxstring#1{%
\blx@bibxstring{\abx@str}{#1}}
@@ -4039,7 +3943,6 @@
{\csuse{#1@#2}}}
% {<string>}{<true>}{<false>}
-
\def\blx@imc@ifbibstring#1{%
\ifcsundef{\abx@str @\detokenize{#1}}
{\@secondoftwo}
@@ -4051,7 +3954,6 @@
{\@firstoftwo}}
% {<field>}{<true>}{<false>}
-
\def\blx@imc@iffieldbibstring#1{%
\blx@imc@iffieldundef{#1}
{\@secondoftwo}
@@ -4400,6 +4302,7 @@
\do{langpolish}%
\do{langportuguese}%
\do{langrussian}%
+ \do{langslovene}%
\do{langspanish}%
\do{langswedish}%
\do{fromamerican}%
@@ -4420,6 +4323,7 @@
\do{frompolish}%
\do{fromportuguese}%
\do{fromrussian}%
+ \do{fromslovene}%
\do{fromspanish}%
\do{fromswedish}%
\do{countryde}%
@@ -4453,13 +4357,11 @@
% in *.cbx/bbx/tex: <key> = {<string>},
% in *.lbx: <key> = {{<longstring>}{<abbrevstring>}},
-
\def\do#1{\define@key{blx@lbx}{#1}{\blx@defstring{#1}{##1}}}
\abx@dostrings
% in *.cbx/bbx/tex: (implicit)
% in *.lbx: inherit = {<language>},
-
\define@key{blx@lbx}{inherit}{%
\blx@lbxinput{#1}{}{\blx@err@nolang{#1}}%
\csuse{abx@strings@#1}}
@@ -4475,7 +4377,6 @@
\csdef{abx@sstr@#1}{#3}}
% {<language>}
-
\def\blx@lbxcheck#1{%
\ifcsdef{blx@lng@#1}
{\expandafter\expandafter\expandafter\IfFileExists
@@ -4488,7 +4389,6 @@
{\blx@err@nolang{#1}}}}
% {<language>}{<definitions>}
-
\newrobustcmd*{\DefineBibliographyExtras}[2]{%
\blx@lbxcheck{#1}%
\csgappto{blx@hook@extras@#1}{%
@@ -4505,14 +4405,12 @@
\def\blx@undefbibextras#1{\csgappto{abx@noextras@#1}}
% {<language>}{<language>}
-
\def\blx@letbibextras#1#2{%
\blx@lbxinput{#2}{}{\blx@err@nolang{#2}}%
\global\csletcs{abx@extras@#1}{abx@extras@#2}
\global\csletcs{abx@noextras@#1}{abx@noextras@#2}}%
% {<language>}{<strings>}
-
\newrobustcmd*{\DefineBibliographyStrings}[2]{%
\blx@lbxcheck{#1}%
\csgappto{blx@hook@strings@#1}{%
@@ -4537,8 +4435,8 @@
{\letcs\refname{\abx@str @references}}
{\let\refname\@empty}%
\ifcsdef{\abx@str @shorthands}
- {\letcs\losname{\abx@str @shorthands}}
- {\let\losname\@empty}}}
+ {\letcs\biblistname{\abx@str @shorthands}}
+ {\let\biblistname\@empty}}}
\def\blx@defbibstrings@i#1{%
\ifcsdef{abx@lstr@#1}
@@ -4551,13 +4449,11 @@
{\undef\expandafter\noexpand\csname abx@sstr@#1\endcsname}}
% {<language>}{<language>}
-
\def\blx@letbibstrings#1#2{%
\blx@lbxinput{#2}{}{\blx@err@nolang{#2}}%
\global\csletcs{abx@strings@#1}{abx@strings@#2}}%
% {<language>}{<exceptions>}
-
\newrobustcmd*{\DefineHyphenationExceptions}[2]{%
\ifcsundef{l@#1}
{\blx@warn@nohyph{#1}}
@@ -4574,13 +4470,11 @@
\endgroup}}
% {<language>}{<mapping>}
-
\newrobustcmd*{\DeclareLanguageMapping}[2]{%
\csgdef{blx@lng@#1}{#2}}
\@onlypreamble\DeclareLanguageMapping
% {<language>}{<success>}{<failure>}
-
\def\blx@lbxinput#1{%
\ifcsdef{blx@lng@#1}
{\expandafter\expandafter\expandafter\blx@lbxinput@i
@@ -4589,7 +4483,6 @@
{\blx@lbxinput@ii{#1}{#1}{language '#1'}}}
% {<mapping>}{<language>}
-
\def\blx@lbxinput@i#1#2{%
\global\csundef{blx@lng@#2}%
\IfFileExists{#1.lbx}
@@ -4600,7 +4493,6 @@
\blx@lbxinput{#2}}}
% {<language>}{<lbxfile>}{<message>}
-
\def\blx@lbxinput@ii#1#2#3{%
\begingroup
\setbox\@tempboxa=\hbox\bgroup
@@ -4638,7 +4530,6 @@
\egroup}
% {<language>}
-
\def\blx@langsetup#1{%
\blx@lbxinput{#1}
{\edef\blx@languagename{#1}}
@@ -4848,7 +4739,6 @@
\printurldate \printeventdate \printorigdate \stripzeros \mkdatezeros}
% {<language>}{<strings>}
-
\def\blx@maplang#1#2{%
\csxappto{extras#1}{%
\noexpand\blx@resetpunct
@@ -4906,6 +4796,7 @@
\expandafter{\abx@field@langid}}}
{}}}
{}%
+ \def\blx@langstrings{}%
\def\blx@imc@mainlang{\select@language{\bbl@main@language}}%
\blx@langsetup\bbl@main@language}
{\blx@err@patch{'babel' package}%
@@ -4946,6 +4837,11 @@
\csuse{abx@strings@\abx@field@langid}}}
{}}}
{}%
+ % polyglossia needs this - it doesn't get the
+ % strings by automatically set for some reason
+ \def\blx@langstrings{%
+ \csuse{abx@extras@\languagename}%
+ \csuse{abx@strings@\languagename}}
\def\blx@imc@mainlang{%
\select@language{\bbl@main@language}%
% These lines are equal to \blx@maplang
@@ -4955,7 +4851,7 @@
\blx@langsetup\bbl@main@language}
{\blx@err@patch{'polyglossia' package}%
\blx@mknoautolang}%
- \catcode`\_=8}
+ \catcode`\_=8}
\endgroup
\def\blx@mknoautolang{%
@@ -5003,6 +4899,10 @@
\def\abx@dotypes{\dolistcsloop{blx@biber@datamodel@entrytypes}}
+% fields which can be used as labels - we auto-create some macros for these
+\def\abx@dolabelfields{%
+ \dolistcsloop{blx@biber@datamodel@labelfields}}
+
\def\abx@donames{%
\dolistcsloop{blx@biber@datamodel@names}%
\do{labelname}%
@@ -5090,7 +4990,8 @@
\do{localnumber}%
\do{namehash}%
\do{prefixnumber}%
- \do{sortinit}}
+ \do{sortinit}%
+ \do{sortinithash}}
\def\abx@dobooleans{%
\do{singletitle}}
@@ -5098,23 +4999,25 @@
\def\do#1{%
\newcounter{#1}%
\newcounter{saved#1}%
- \csedef{the#1}{\noexpand\the\expandonce{\csname c@#1\endcsname}}%
- \csedef{thesaved#1}{\noexpand\the\expandonce{\csname c@saved#1\endcsname}}%
\appto\abx@dobooleans{\do{more#1}}}
-\dolistcsloop{blx@biber@datamodel@names}\do{labelname}%
-\dolistcsloop{blx@biber@datamodel@lists}\do{pageref}%
+
+\abx@donames
+\abx@dolists
\def\do#1{\newtoggle{abx@bool@#1}}
\abx@dobooleans
+\def\do#1{\expandafter\newlength\expandafter{\csname #1width\endcsname}}
+\abx@dolabelfields
+
\protected\def\blx@resetdata{%
\let\blx@saved@do\do
\let\do\blx@imc@clearname
- \dolistcsloop{blx@biber@datamodel@names}\do{labelname}%
+ \abx@donames
\let\do\blx@imc@clearlist
- \dolistcsloop{blx@biber@datamodel@lists}\do{pageref}%
+ \abx@dolists
\let\do\blx@imc@clearfield
- \dolistcsloop{blx@biber@datamodel@fields}\do{options}%
- \do{labeltitle}\do{labelyear}\do{labelmonth}\do{labelday}\do{datelabelsource}%
+ \abx@dofields
+ \do{options}\do{labeltitle}\do{labelyear}\do{labelmonth}\do{labelday}\do{datelabelsource}%
\abx@dointernalfields
\def\do##1{\togglefalse{abx@bool@##1}}%
\abx@dobooleans
@@ -5131,12 +5034,12 @@
\protected\def\blx@saveentry{%
\let\blx@saved@do\do
\let\do\blx@savename
- \dolistcsloop{blx@biber@datamodel@names}\do{labelname}%
+ \abx@donames
\let\do\blx@savelist
- \dolistcsloop{blx@biber@datamodel@lists}\do{pageref}%
+ \abx@dolists
\let\do\blx@savefield
- \dolistcsloop{blx@biber@datamodel@fields}\do{options}%
- \do{labeltitle}\do{labelyear}\do{labelmonth}\do{labelday}\do{datelabelsource}%
+ \abx@dofields
+ \do{options}\do{labeltitle}\do{labelyear}\do{labelmonth}\do{labelday}\do{datelabelsource}%
\abx@dointernalfields
\let\do\blx@savebool
\abx@dobooleans
@@ -5160,12 +5063,10 @@
\csletcs{abx@bool@saved#1}{abx@bool@#1}}
% {<code>}
-
\protected\long\def\blx@bbl@preamble#1{%
\gappto\abx@preamble{#1}}
% {<message>}
-
\protected\def\blx@bbl@warn#1{%
\begingroup
\def\item{\MessageBreak-\space}%
@@ -5180,7 +5081,6 @@
\endgroup}
% {<field>}{<code>}
-
\newrobustcmd{\DeclareFieldInputHandler}[2]{%
\ifblank{#2}
{\csundef{blx@fih@#1}}
@@ -5188,7 +5088,6 @@
\@onlypreamble\DeclareFieldInputHandler
% {<list>}{<code>}
-
\newrobustcmd*{\DeclareListInputHandler}[2]{%
\ifblank{#2}
{\csundef{blx@lih@#1}}
@@ -5196,7 +5095,6 @@
\@onlypreamble\DeclareListInputHandler
% {<name>}{<code>}
-
\newrobustcmd*{\DeclareNameInputHandler}[2]{%
\ifblank{#2}
{\csundef{blx@nih@#1}}
@@ -5204,13 +5102,11 @@
\@onlypreamble\DeclareNameInputHandler
% {<entrykey>}{<refsection>}{<field>}{<value>}
-
\long\def\blx@bbl@addentryfield#1#2#3#4{%
\csxappto{blx@data@#2@#1}{%
\def\expandafter\noexpand\csname abx@field@#3\endcsname{#4}}}
% {<field>}{<value>}
-
\long\def\blx@bbl@addfield#1#2{%
\csxappto\blx@bbl@data{%
\def\expandafter\noexpand\csname abx@field@#1\endcsname{#2}}}
@@ -5240,8 +5136,29 @@
\blx@bbl@fielddef{#1}{\detokenize{#2}}}%
\blx@tempa}
-% {<field>}
+% Verbatim lists
+% {<list>}{<listcount>}
+\protected\def\blx@bbl@verbldef#1#2{%
+ \begingroup
+ \let\lverb\blx@bbl@verbladd
+ \def\blx@tempa{#1}%
+ \def\blx@tempb{#2}%
+ \let\blx@tempc\@empty
+ \let\NewValue\@empty}
+
+\protected\def\blx@bbl@verblend{%
+ \expandafter\blx@bbl@listdef\expandafter{\expandafter\blx@tempa\expandafter}\expandafter{\expandafter\blx@tempb\expandafter}\expandafter{\blx@tempc}%
+ \endgroup}
+\protected\def\blx@bbl@verbladd{%
+ \begingroup
+ \let\do\@makeother
+ \dospecials
+ \catcode\endlinechar=12\relax
+ \blx@bbl@verbladd@i}
+
+% Verbatim fields
+% {<field>}
\protected\def\blx@bbl@verbdef#1{%
\begingroup
\let\verb\blx@bbl@verbadd
@@ -5273,16 +5190,17 @@
\uppercase{\gdef\blx@bbl@verbadd@i<#1>}{%
\endgroup
\edef\NewValue{\NewValue\detokenize{#1}}}
+\uppercase{\gdef\blx@bbl@verbladd@i<#1>}{%
+ \endgroup
+ \eappto\blx@tempc{{\detokenize{#1}}}}%
\endgroup
% {<counter>}{<value>}
-
\protected\long\def\blx@bbl@cntdef#1#2{%
\csxappto\blx@bbl@data{%
\csname c@#1\endcsname#2\relax}}
% {<boolean>}
-
\protected\def\blx@bbl@booltrue#1{%
\csgappto\blx@bbl@data{%
\toggletrue{abx@bool@#1}}}
@@ -5291,8 +5209,7 @@
\csgappto\blx@bbl@data{%
\togglefalse{abx@bool@#1}}}
-% {<list}{<itemcount>}{<value>}
-
+% {<list>}{<itemcount>}{<value>}
\protected\def\blx@bbl@listdef#1#2#3{%
\def\NewCount{#2}%
\def\NewValue{#3}%
@@ -5306,9 +5223,7 @@
\def\expandafter\noexpand\csname abx@list@#1\endcsname
{\expandonce\NewValue}}}}
-
% {<name>}{<itemcount>}{<nameoptions>}{<value>}
-
\protected\def\blx@bbl@namedef#1#2#3#4{%
\def\NewCount{#2}%
\def\NewOption{#3}%
@@ -5324,7 +5239,6 @@
{{\expandonce\NewOption}{\expandonce\NewValue}}}}}
% {<entrykey>,...}
-
\protected\def\blx@bbl@set#1{%
\blx@bbl@fieldedef{entryset}{\detokenize{#1}}%
\csxdef{blx@setp@\the\c@refsection @\abx@field@entrykey}{\detokenize{#1}}%
@@ -5340,14 +5254,12 @@
\csxdef{blx@seti@\the\c@refsection @#1}{\the\blx@tempcnta}}
% {<entrykey>}
-
\protected\def\blx@bbl@inset#1{%
\toggletrue{blx@setonly}%
\blx@bbl@fieldedef{entryset}{\detokenize{#1}}%
\csxdef{blx@setc@\the\c@refsection @\abx@field@entrykey}{\detokenize{#1}}}
% {<keyword>,...}
-
\protected\def\blx@bbl@keyw#1{%
\iftoggle{blx@skipbib}
{}
@@ -5358,7 +5270,6 @@
\listcsxadd{blx@keyw@\the\c@refsection @\detokenize{#2}}{#1}}
% {<options>}
-
\protected\long\def\blx@bbl@options#1{%
\begingroup
\let\blx@tempa\@empty
@@ -5382,52 +5293,6 @@
\ifx\blx@tempa\@empty\else,\fi
\unexpanded{#1}\ifblank{#2}{}{=\unexpanded{#2}}}}}
-% \blx@data@<section>@<entrykey> data hook
-% key -> data
-% \blx@miss@<section> missing entries (blacklist)
-% section -> keys [internal list]
-% \blx@sort@<section> all entries, sorted
-% section -> keys [internal list]
-% \blx@sbib@<section> all entries in bibliography, sorted
-% section -> keys [internal list]
-% \blx@bsee@<section> seen citations, document body
-% section -> keys [internal list]
-% \blx@fsee@<section> seen citations, footnotes
-% section -> keys [internal list]
-% \blx@type@<section>@<entrytype> type hash
-% type -> keys [internal list]
-% \blx@subt@<section>@<entrytype> subtype hash
-% subtype -> keys [internal list]
-% \blx@segm@<section>@<segment> segment hash
-% segment -> keys [internal list]
-% \blx@keyw@<section>@<keyword> keyword hash
-% keyword -> keys [internal list]
-% \blx@losh@<section> shorthand hash
-% section -> keys [internal list]
-% \blx@slistsbib@<section>@<sectiontype>@<sectionname> all entries in
-% bibliography of a type sorted
-% in a particular way
-% section -> keys [internal list]
-% sectiontype -> "shorthand" or "entry"
-% sectionname -> sort scheme name
-% \blx@slists@<section>@<sectiontype>@<sectionname> all entries of a type sorted
-% in a particular way
-% section -> keys [internal list]
-% sectiontype -> "shorthand" or "entry"
-% sectionname -> sort scheme name
-% \blx@catg@<category> category hash, global
-% category -> keys [internal list]
-% \blx@set@<section>@<entrykey> parent -> child mapping (dynamic entry sets)
-% key -> key,key,... [csv list]
-% \blx@setp@<section>@<entrykey> parent -> child mapping (entry sets)
-% key -> key,key,... [csv list]
-% \blx@setc@<section>@<entrykey> child -> parent mapping (entry sets)
-% key -> key
-% \blx@seti@<section>@<entrykey> child -> index mapping (entry sets)
-% key -> index
-% \blx@pref@<section>@<entrykey> pageref hook, temporary
-% key -> pages [internal list]
-
\def\blx@ifdata#1{%
\ifcsdef{blx@data@\the\c@refsection @#1}}
\let\blx@imc@ifentryinbib\blx@ifdata
@@ -5487,7 +5352,6 @@
{}}
% {<section>}
-
\def\blx@bbl@refsection#1{%
\begingroup
\c@refsection#1\relax}
@@ -5502,7 +5366,6 @@
\iftoggle{blx@reencode}{\blx@reencode}{}}
% {<entrykey>}
-
\protected\def\blx@bbl@missing#1{%
\listcsxadd{blx@miss@\the\c@refsection}{\detokenize{#1}}%
\blx@warning@noline{%
@@ -5515,11 +5378,15 @@
Please verify the spelling and rerun\MessageBreak
LaTeX afterwards}}
+% We create an alias resolving macro and also a list of aliases
+% which we need to add to the .bcf. We need to resolve the aliases
+% for internal use but we always want the aliases themselves in the .bcf
+% so that biber can correctly use and resolve them too.
\protected\def\blx@bbl@keyalias#1#2{%
- \csgdef{blx@keyalias@\the\c@refsection @#1}{\detokenize{#2}}}
+ \csgdef{blx@keyalias@\the\c@refsection @#1}{\detokenize{#2}}%
+ \listcsgadd{blx@keyaliases@\the\c@refsection}{#1}}
% {<entrykey>}{<entrytype>}{<options>}
-
\protected\def\blx@bbl@entry#1#2#3{%
\begingroup
\edef\abx@field@entrykey{\detokenize{#1}}%
@@ -5540,20 +5407,20 @@
{}
{\blx@addpageref{\abx@field@entrykey}}%
\nottoggle{blx@setonly}
- {\listcsxadd{blx@slists@\the\c@refsection @entry@\blx@slist@name}{\abx@field@entrykey}}
+ {\listcsxadd{blx@slists@\the\c@refsection @entry@\blx@slist@scheme}{\abx@field@entrykey}}
{\global\toggletrue{blx@addset}%
\toggletrue{blx@skipbib}%
- \toggletrue{blx@skiplos}%
+ \toggletrue{blx@skipbiblist}%
\toggletrue{blx@skiplab}}%
\nottoggle{blx@skipbib}
- {\listcsxadd{blx@slistsbib@\the\c@refsection @entry@\blx@slist@name}{\abx@field@entrykey}%
+ {\listcsxadd{blx@slistsbib@\the\c@refsection @entry@\blx@slist@scheme}{\abx@field@entrykey}%
\listcsxadd{blx@type@\the\c@refsection @\abx@field@entrytype}{\abx@field@entrykey}%
\ifdef\abx@field@entrysubtype
{\listcsxadd{blx@subt@\the\c@refsection @\abx@field@entrysubtype}{\abx@field@entrykey}}
{}}
{}%
- \nottoggle{blx@skiplos}
- {\blx@bbl@shorthand}
+ \nottoggle{blx@skipbiblist}
+ {\blx@bbl@labelfields}
{}%
\nottoggle{blx@skiplab}
{\iftoggle{blx@labelnumber}
@@ -5601,40 +5468,41 @@
\def\blx@addset@ii#1{%
\listcsgadd{blx@slists@\the\c@refsection @entry@\blx@sorting}{#1}}
-\def\blx@bbl@shorthand{%
- \ifundef\abx@field@shorthand
- {}
- {\blx@setlabwidth{\shorthandwidth}{%
- \csuse{abx@ffd@*@shorthandwidth}{\abx@field@shorthand}}}}
+\def\blx@bbl@labelfields{%
+ \def\do##1{%
+ \ifcsundef{abx@field@##1}
+ {}
+ {\blx@setlabwidth{\csname ##1width\endcsname}{%
+ \csuse{abx@ffd@*@##1width}{\csname abx@field@##1\endcsname}}}}%
+ \abx@dolabelfields}
\def\blx@bbl@labelnumber{%
% Used at endentry, when reading .bbl
% only do this for the global sorting list otherwise we increment
% the labelnumbers for each sortlist
- \ifdefstrequal{\blx@slist@name}{\blx@sorting}
+ \ifdefstrequal{\blx@slist@scheme}{\blx@sorting}
{\ifdefempty\abx@field@localnumber
{}% only if omitnumbers=true
{\ifundef\abx@field@shorthand
- {\ifdef\abx@field@localnumber
+ {\ifdef\abx@field@localnumber
{}% only if defernumbers=true
{\csnumgdef{blx@labelnumber@\the\c@refsection}{%
\csuse{blx@labelnumber@\the\c@refsection}+1}%
- \edef\abx@field@localnumber{%
- \csuse{blx@labelnumber@\the\c@refsection}}}%
- \blx@bbl@fieldedef{labelnumber}{\abx@field@localnumber}%
- \iftoggle{blx@skipbib}
- {}
- {\blx@setlabwidth{\labelnumberwidth}{%
+ \edef\abx@field@localnumber{%
+ \csuse{blx@labelnumber@\the\c@refsection}}%
+ \blx@bbl@fieldedef{labelnumber}{\abx@field@localnumber}}%
+ \iftoggle{blx@skipbib}
+ {}
+ {\blx@setlabwidth{\labelnumberwidth}{%
\csuse{abx@ffd@*@labelnumberwidth}{%
\ifdef\abx@field@prefixnumber
- {\csuse{abx@ffd@*@prefixnumber}{\abx@field@prefixnumber}}
- {}%
+ {\csuse{abx@ffd@*@prefixnumber}{\abx@field@prefixnumber}}
+ {}%
\abx@field@localnumber}}}}
- {\csgappto\blx@bbl@data{%
- \let\abx@field@labelnumber\abx@field@shorthand}%
- \iftoggle{blx@skipbib}
- {}
- {\blx@setlabwidth{\labelnumberwidth}{%
+ {\csgappto\blx@bbl@data{\let\abx@field@labelnumber\abx@field@shorthand}%
+ \iftoggle{blx@skipbib}
+ {}
+ {\blx@setlabwidth{\labelnumberwidth}{%
\csuse{abx@ffd@*@labelnumberwidth}{\abx@field@shorthand}}}}}}
{}}
@@ -5737,7 +5605,9 @@
\let\true\blx@bbl@booltrue
\let\false\blx@bbl@boolfalse
\let\verb\blx@bbl@verbdef
- \let\endverb\blx@bbl@verbend}
+ \let\endverb\blx@bbl@verbend
+ \let\lverb\blx@bbl@verbldef
+ \let\endlverb\blx@bbl@verblend}
\def\blx@bblend{%
}
@@ -5754,16 +5624,8 @@
% {<sortschemename>}
% Get the saved information on which shorthand sorting schemes were mentioned last run
-\protected\def\abx@aux@sortschemelos#1{%
- \listgadd{\blx@lastsortschemeslos}{#1}}
-
-% {<instcount>}{<entrykey>}{<refsection>}{<labelnumber>}
-\protected\def\blx@aux@number#1#2#3#4{%
- \blx@bbl@addentryfield{\detokenize{#2}}{#3}{localnumber}{#4}%
- \global\toggletrue{blx@localnumber}%
- \ifblank{#4}
- {}
- {\csgdef{blx@labelnumber@#3}{#4}}}
+\protected\def\abx@aux@biblist#1{%
+ \listgadd{\blx@lastbiblists}{#1}}
% Here we mustn't change the checksum if we used localnumbers from the
% .aux file as this means that deferred numbering is
@@ -5798,8 +5660,8 @@
% already tested for more or less cites between runs by now, we are
% testing here for exactly the same cites by treating the cite and
% lastcite lists as strings and comparing them. This doesn't apply
- % to shorthand sortschemes as nobody wants to sort shorthands with
- % "none" anyway, it makes no sense
+ % to biblist sortschemes as nobody wants to sort biblists with
+ % "none", since it makes no sense
\ifinlist{none}{\blx@sortschemes}
{\ifdefstrequal{\blx@cites}{\blx@lastcites}
{}
@@ -5813,14 +5675,14 @@
% If we did, we need to re-run biber
\def\do#1{\ifinlist{#1}{\blx@lastsortschemes}{}{\blx@logreq@active{}}\relax}%
\dolistloop\blx@sortschemes
- % Test if we removed any mention of a shorthand sorting scheme since last run.
+ % Test if we removed any mention of a biblist 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.
+ \def\do#1{\ifinlist{#1}{\blx@biblists}{}{\blx@logreq@active{}}\relax}%
+ \dolistloop\blx@lastbiblists
+ % Test to see if we added any mention of a biblist 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
+ \def\do#1{\ifinlist{#1}{\blx@lastbiblists}{}{\blx@logreq@active{}}\relax}%
+ \dolistloop\blx@biblists
% If we have to run biber or latex again and we are using defernumbers,
% don't write the localnumber information to the .aux file yet as we will
% potentially have to regenerate sorting order first in biber
@@ -5832,6 +5694,15 @@
{}%
\endgroup}
+% {<instcount>}{<entrykey>}{<refsection>}{<labelnumber>}
+\protected\def\blx@aux@number#1#2#3#4{%
+ \blx@bbl@addentryfield{\detokenize{#2}}{#3}{localnumber}{#4}%
+ \blx@bbl@addentryfield{\detokenize{#2}}{#3}{labelnumber}{#4}%
+ \global\toggletrue{blx@localnumber}%
+ \ifblank{#4}
+ {}
+ {\csgdef{blx@labelnumber@#3}{#4}}}
+
% Called as part of bib output for an entry
% Only used when defernumbers=true
\def\blx@addlabelnumber{%
@@ -5842,34 +5713,39 @@
% Need to know if we set any localnumber from .aux file, not
% just current item. Otherwise, we may just write new
% localnumbers but not existing ones
- {\nottoggle{blx@localnumber}
- {\iftoggle{blx@omitnumbers}
- {\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}}%
- \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}}}
- % 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}}}}
- {}}%
+ % Also, don't want to regenerate localnumber for any key in a
+ % refsection which we've already seen because this has the nasty
+ % side-effect of incrementing the localnum counter
+ {\ifboolexpr { not togl {blx@localnumber}
+ and
+ test {\ifcsundef{blx@defer@\the\c@refsection @\abx@field@entrykey}} }
+ {\iftoggle{blx@omitnumbers}
+ {\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}}%
+ \blx@bbl@addentryfield{\abx@field@entrykey}{\the\c@refsection}%
+ {localnumber}{\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.
+ \ifcsundef{blx@defer@\the\c@refsection @\abx@field@entrykey}
+ {\listxadd\blx@localnumaux{%
+ \string\abx@aux@number%
+ {\the\c@instcount}%
+ {\abx@field@entrykey}%
+ {\the\c@refsection}%
+ {\abx@field@localnumber}}%
+ % record that we have already generated and output localnum
+ % for this key in this refsection
+ \csgdef{blx@defer@\the\c@refsection @\abx@field@entrykey}{}}
+ {}}
+ {}}%
{}}
{}%
\endgroup}
@@ -5891,15 +5767,15 @@
{}}
% {<entrykey>}{<refsection>}{<numberprefix>}
-
\protected\def\blx@aux@numprefix#1#2#3{%
\blx@bbl@addentryfield{\detokenize{#1}}{#2}{prefixnumber}{#3}}
+% {<sortlistname>}{<sortlistsortscheme>}
\def\blx@bbl@slist#1#2{%
\begingroup
- \def\blx@slist@name{#2}%
- % This macro (\key) will only be called in shorthand lists
- \def\key##1{\listcsxadd{blx@slistsbib@\the\c@refsection @shorthand@#2}{\detokenize{##1}}}}
+ \def\blx@slist@scheme{#2}%
+ % This macro (\key) will only be called in sortlists of type "list"
+ \def\key##1{\listcsxadd{blx@slistsbib@\the\c@refsection @#1@#2}{\detokenize{##1}}}}
\let\blx@bbl@endslist\endgroup
\def\blx@addpageref#1{%
@@ -5954,11 +5830,12 @@
\abx@hook@reencode
\let\protect\@unexpandable@protect
\def\do##1{\cslet{abx@name@##1}\relax}%
- \dolistcsloop{blx@biber@datamodel@names}\do{labelname}%
+ \abx@donames
\def\do##1{\cslet{abx@list@##1}\relax}%
- \dolistcsloop{blx@biber@datamodel@lists}\do{pageref}%
+ \abx@dolists
\def\do##1{\cslet{abx@field@##1}\relax}%
- \dolistcsloop{blx@biber@datamodel@fields}\do{options}%
+ \abx@dofields
+ \do{options}%
\abx@dointernalfields
\long\def\abx@field@execute##1{%
\unexpanded{\abx@field@execute{##1}}}%
@@ -5978,7 +5855,6 @@
%% Bibliography
% {<name>}{<start code>}[<end code>]{<item code>}
-
\newrobustcmd*{\defbibenvironment}[4]{%
\long\csdef{blx@env@#1}{#2}%
\long\csdef{blx@endenv@#1}{#3}%
@@ -5993,20 +5869,21 @@
{\endlist}
{\item}
-\defbibenvironment{shorthands}
- {\list{\thefield{shorthand}}{%
- \labelwidth\shorthandwidth
- \labelsep\biblabelsep
- \leftmargin\labelwidth
- \advance\leftmargin\labelsep
- \itemsep\bibitemsep
- \parsep\bibparsep
- \def\makelabel##1{##1\hss}}}
- {\endlist}
- {\item}
+\def\do#1{%
+ \defbibenvironment{#1}
+ {\list{\thefield{#1}}{%
+ \labelwidth\csname #1width\endcsname
+ \labelsep\biblabelsep
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \itemsep\bibitemsep
+ \parsep\bibparsep
+ \def\makelabel####1{####1\hss}}}
+ {\endlist}
+ {\item}}
+\abx@dolabelfields
% {<name>}[<default>]{<code>}
-
\newrobustcmd*{\defbibheading}[1]{%
\@ifnextchar[%]
{\blx@defbibheading{blx@head@#1}}
@@ -6017,12 +5894,10 @@
\expandafter\newcommand\csname#1\endcsname[1][#2]}
% {<name>}{<text>}
-
\newrobustcmd*{\defbibnote}[1]{%
\long\csdef{blx@note@#1}}
% {<name>}{<code>}
-
\newrobustcmd*{\defbibfilter}[2]{%
\begingroup
\def\blx@flt@error{\csname blx@flt@errortrue\endcsname}%
@@ -6080,7 +5955,6 @@
test {\xifinlistcs\blx@flt@item{blx@catg@#1}}}
% {<name>}{<code>}
-
\newrobustcmd*{\defbibcheck}[2]{%
\csdef{blx@bibcheck@#1}{%
\togglefalse{blx@skipentry}%
@@ -6089,9 +5963,8 @@
% options
% We need a 2-pass structure for options in \printbibliography and
-% \printshorthands because section and/or sorting have to be set before any
+% \printbiblist because section and/or sorting have to be set before any
% other options and these also determine which list to use for later filtering
-
\define@key{blx@bib1}{segment}{}
\define@key{blx@bib1}{type}{}
\define@key{blx@bib1}{nottype}{}
@@ -6115,25 +5988,25 @@
\define@key{blx@bib2}{section}{}
\define@key{blx@bib2}{sorting}{}
-\define@key{blx@los1}{segment}{}
-\define@key{blx@los1}{type}{}
-\define@key{blx@los1}{nottype}{}
-\define@key{blx@los1}{subtype}{}
-\define@key{blx@los1}{notsubtype}{}
-\define@key{blx@los1}{keyword}{}
-\define@key{blx@los1}{notkeyword}{}
-\define@key{blx@los1}{category}{}
-\define@key{blx@los1}{notcategory}{}
-\define@key{blx@los1}{filter}{}
-\define@key{blx@los1}{check}{}
-\define@key{blx@los1}{heading}{}
-\define@key{blx@los1}{env}{}
-\define@key{blx@los1}{title}{}
-\define@key{blx@los1}{prenote}{}
-\define@key{blx@los1}{postnote}{}
-
-\define@key{blx@los2}{section}{}
-\define@key{blx@los2}{sorting}{}
+\define@key{blx@biblist1}{segment}{}
+\define@key{blx@biblist1}{type}{}
+\define@key{blx@biblist1}{nottype}{}
+\define@key{blx@biblist1}{subtype}{}
+\define@key{blx@biblist1}{notsubtype}{}
+\define@key{blx@biblist1}{keyword}{}
+\define@key{blx@biblist1}{notkeyword}{}
+\define@key{blx@biblist1}{category}{}
+\define@key{blx@biblist1}{notcategory}{}
+\define@key{blx@biblist1}{filter}{}
+\define@key{blx@biblist1}{check}{}
+\define@key{blx@biblist1}{heading}{}
+\define@key{blx@biblist1}{env}{}
+\define@key{blx@biblist1}{title}{}
+\define@key{blx@biblist1}{prenote}{}
+\define@key{blx@biblist1}{postnote}{}
+
+\define@key{blx@biblist2}{section}{}
+\define@key{blx@biblist2}{sorting}{}
\define@key{blx@bib1}{sorting}{%
\ifcsundef{blx@biber@sorting@#1}
@@ -6148,21 +6021,27 @@
\blx@auxwrite\@mainaux{}{\string\abx@aux@sortscheme{#1}}}%
\edef\blx@tempd{%
\blx@xml@sorting{%
+ \ifcsdef{blx@sortdef@locale@#1}
+ { locale="\csuse{blx@sortdef@locale@#1}"}
+ {}}{%
\csuse{blx@biber@sorting@#1}}}}}
-\define@key{blx@los1}{sorting}{%
+\define@key{blx@biblist1}{sorting}{%
\ifcsundef{blx@biber@sorting@#1}
{\blx@err@invopt{sorting=#1}{}}%
{\blx@printbibchecks
\def\blx@tempc{#1}%
- % Add the sortscheme to the list of shorthand sortschemes
+ % Add the sortscheme to the list of sortschemes for this biblist
% so we can compare on next run
- \ifinlist{#1}{\blx@sortschemeslos}
+ \ifinlist{#1}{\blx@biblists}
{}
- {\listgadd\blx@sortschemeslos{#1}%
- \blx@auxwrite\@mainaux{}{\string\abx@aux@sortschemelos{#1}}}%
+ {\listgadd\blx@biblists{#1}%
+ \blx@auxwrite\@mainaux{}{\string\abx@aux@biblist{#1}}}%
\edef\blx@tempd{%
\blx@xml@sorting{%
+ \ifcsdef{blx@sortdef@locale@#1}
+ { locale="\csuse{blx@sortdef@locale@#1}"}
+ {}}{%
\csuse{blx@biber@sorting@#1}}}}}
\define@key{blx@bib1}{section}{%
@@ -6171,7 +6050,7 @@
{\c@refsection#1\relax
\def\blx@tempe{#1}}}
-\define@key{blx@los1}{section}{%
+\define@key{blx@biblist1}{section}{%
\ifcsundef{blx@sections@#1}
{\blx@err@nosec{#1}}
{\c@refsection#1\relax
@@ -6188,7 +6067,7 @@
{\c@refsection#1\relax}}
\define@key{blx@bib2}{segment}{\blx@key@segment{#1}}
-\define@key{blx@los2}{segment}{\blx@key@segment{#1}}
+\define@key{blx@biblist2}{segment}{\blx@key@segment{#1}}
\def\blx@key@segment#1{%
\ifcsundef{blx@segm@\the\c@refsection @#1}
@@ -6200,7 +6079,7 @@
\blx@filter\blx@tempa{blx@segm@\the\c@refsection @#1}}}
\define@key{blx@bib2}{type}{\blx@key@type{#1}}
-\define@key{blx@los2}{type}{\blx@key@type{#1}}
+\define@key{blx@biblist2}{type}{\blx@key@type{#1}}
\def\blx@key@type#1{%
\ifcsundef{blx@type@\the\c@refsection @#1}
@@ -6219,7 +6098,7 @@
Use 'filter' and '\string\defbibfilter' with OR conjunctions}}}}
\define@key{blx@bib2}{nottype}{\blx@key@nottype{#1}}
-\define@key{blx@los2}{nottype}{\blx@key@nottype{#1}}
+\define@key{blx@biblist2}{nottype}{\blx@key@nottype{#1}}
\def\blx@key@nottype#1{%
\ifcsundef{blx@type@\the\c@refsection @#1}
@@ -6228,7 +6107,7 @@
\blx@notfilter\blx@tempa{blx@type@\the\c@refsection @#1}}}
\define@key{blx@bib2}{subtype}{\blx@key@subtype{#1}}
-\define@key{blx@los2}{subtype}{\blx@key@subtype{#1}}
+\define@key{blx@biblist2}{subtype}{\blx@key@subtype{#1}}
\def\blx@key@subtype#1{%
\ifcsundef{blx@subt@\the\c@refsection @#1}
@@ -6247,7 +6126,7 @@
Use 'filter' and '\string\defbibfilter' with OR conjunctions}}}}
\define@key{blx@bib2}{notsubtype}{\blx@key@notsubtype{#1}}
-\define@key{blx@los2}{notsubtype}{\blx@key@notsubtype{#1}}
+\define@key{blx@biblist2}{notsubtype}{\blx@key@notsubtype{#1}}
\def\blx@key@notsubtype#1{%
\ifcsundef{blx@subt@\the\c@refsection @#1}
@@ -6256,7 +6135,7 @@
\blx@notfilter\blx@tempa{blx@subt@\the\c@refsection @#1}}}
\define@key{blx@bib2}{keyword}{\blx@key@keyword{#1}}
-\define@key{blx@los2}{keyword}{\blx@key@keyword{#1}}
+\define@key{blx@biblist2}{keyword}{\blx@key@keyword{#1}}
\def\blx@key@keyword#1{%
\ifcsundef{blx@keyw@\the\c@refsection @\detokenize{#1}}
@@ -6266,7 +6145,7 @@
\blx@filter\blx@tempa{blx@keyw@\the\c@refsection @\detokenize{#1}}}}
\define@key{blx@bib2}{notkeyword}{\blx@key@notkeyword{#1}}
-\define@key{blx@los2}{notkeyword}{\blx@key@notkeyword{#1}}
+\define@key{blx@biblist2}{notkeyword}{\blx@key@notkeyword{#1}}
\def\blx@key@notkeyword#1{%
\ifcsundef{blx@keyw@\the\c@refsection @\detokenize{#1}}
@@ -6275,7 +6154,7 @@
\blx@notfilter\blx@tempa{blx@keyw@\the\c@refsection @\detokenize{#1}}}}
\define@key{blx@bib2}{category}{\blx@key@category{#1}}
-\define@key{blx@los2}{category}{\blx@key@category{#1}}
+\define@key{blx@biblist2}{category}{\blx@key@category{#1}}
\def\blx@key@category#1{%
\ifcsundef{blx@catg@\detokenize{#1}}
@@ -6285,7 +6164,7 @@
\blx@filter\blx@tempa{blx@catg@\detokenize{#1}}}}
\define@key{blx@bib2}{notcategory}{\blx@key@notcategory{#1}}
-\define@key{blx@los2}{notcategory}{\blx@key@notcategory{#1}}
+\define@key{blx@biblist2}{notcategory}{\blx@key@notcategory{#1}}
\def\blx@key@notcategory#1{%
\ifcsundef{blx@catg@#1}
@@ -6294,7 +6173,7 @@
\blx@notfilter\blx@tempa{blx@catg@#1}}}
\define@key{blx@bib2}{filter}{\blx@key@filter{#1}}
-\define@key{blx@los2}{filter}{\blx@key@filter{#1}}
+\define@key{blx@biblist2}{filter}{\blx@key@filter{#1}}
\def\blx@key@filter#1{%
\ifcsdef{blx@filter@#1}
@@ -6307,7 +6186,7 @@
Use \string\defbibfilter\space to define it}}}
\define@key{blx@bib2}{check}{\blx@key@bibcheck{#1}}
-\define@key{blx@los2}{check}{\blx@key@bibcheck{#1}}
+\define@key{blx@biblist2}{check}{\blx@key@bibcheck{#1}}
\def\blx@key@bibcheck#1{%
\ifcsdef{blx@bibcheck@#1}
@@ -6320,7 +6199,7 @@
\define@key{blx@bhd}{heading}{\blx@key@heading{#1}}
\define@key{blx@bib2}{heading}{\blx@key@heading{#1}}
-\define@key{blx@los2}{heading}{\blx@key@heading{#1}}
+\define@key{blx@biblist2}{heading}{\blx@key@heading{#1}}
\define@key{blx@bbs}{heading}{\blx@key@heading{#1}}
\define@key{blx@bbg}{heading}{\blx@key@heading{#1}}
@@ -6333,7 +6212,7 @@
{\def\blx@theheading{#1}}}
\define@key{blx@bib2}{env}{\blx@key@env{#1}}
-\define@key{blx@los2}{env}{\blx@key@env{#1}}
+\define@key{blx@biblist2}{env}{\blx@key@env{#1}}
\define@key{blx@bbs}{env}{\blx@key@env{#1}}
\define@key{blx@bbg}{env}{\blx@key@env{#1}}
\define@key{blx@bbc}{env}{\blx@key@env{#1}}
@@ -6348,10 +6227,10 @@
\define@key{blx@bhd}{title}{\def\blx@thetitle{#1}}
\define@key{blx@bib2}{title}{\def\blx@thetitle{#1}}
-\define@key{blx@los2}{title}{\def\blx@thetitle{#1}}
+\define@key{blx@biblist2}{title}{\def\blx@thetitle{#1}}
\define@key{blx@bib2}{prenote}{\blx@key@prenote{#1}}
-\define@key{blx@los2}{prenote}{\blx@key@prenote{#1}}
+\define@key{blx@biblist2}{prenote}{\blx@key@prenote{#1}}
\define@key{blx@bbs}{prenote}{\blx@key@prenote{#1}}
\define@key{blx@bbg}{prenote}{\blx@key@prenote{#1}}
\define@key{blx@bbc}{prenote}{\blx@key@prenote{#1}}
@@ -6364,7 +6243,7 @@
{\def\blx@theprenote{#1}}}
\define@key{blx@bib2}{postnote}{\blx@key@postnote{#1}}
-\define@key{blx@los2}{postnote}{\blx@key@postnote{#1}}
+\define@key{blx@biblist2}{postnote}{\blx@key@postnote{#1}}
\define@key{blx@bbs}{postnote}{\blx@key@postnote{#1}}
\define@key{blx@bbg}{postnote}{\blx@key@postnote{#1}}
\define@key{blx@bbc}{postnote}{\blx@key@postnote{#1}}
@@ -6378,13 +6257,15 @@
{\def\blx@thepostnote{#1}}}
\define@key{blx@bib2}{resetnumbers}[true]{%
- \ifstrequal{#1}{true}
- {\iftoggle{blx@defernumbers}
+ \iftoggle{blx@defernumbers}
+ {\ifstrequal{#1}{true}
{\csnumdef{blx@labelnumber@\the\c@refsection}{0}}
- {\blx@warning{%
- Option 'resetnumbers' requires 'defernumbers=true'.\MessageBreak
- Ignoring 'resetnumbers=true'}}}
- {}}
+ {\ifstrequal{#1}{false}
+ {}
+ {\csnumdef{blx@labelnumber@\the\c@refsection}{#1-1}}}}
+ {\blx@warning{%
+ Option 'resetnumbers' requires 'defernumbers=true'.\MessageBreak
+ Ignoring 'resetnumbers=true'}}}
\define@key{blx@bib2}{omitnumbers}[true]{%
\ifstrequal{#1}{true}
@@ -6406,7 +6287,6 @@
{}}}
% [<options>]
-
\newrobustcmd*{\printbibheading}{%
\begingroup
\edef\on@line{\on@line}%
@@ -6420,11 +6300,11 @@
\blx@safe@actives
\setkeys{blx@bhd}{#1}%
\blx@rest@actives
+ \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\endgroup}
% [<options>]
-
\newrobustcmd*{\printbibliography}{%
\begingroup
\edef\on@line{\on@line}%
@@ -6445,7 +6325,10 @@
\let\blx@tempc\blx@sorting% sorting scheme name from "sorting" option
\edef\blx@tempd{%
\blx@xml@sorting{%
- \csuse{blx@biber@sorting@\blx@sorting}}}% sorting scheme from "sorting" option
+ \ifcsdef{blx@sortdef@locale@\blx@sorting}
+ { locale="\csuse{blx@sortdef@locale@\blx@sorting}"}
+ {}}{%
+ \csuse{blx@biber@sorting@\blx@sorting}}}% default to global
\edef\blx@tempe{\the\c@refsection}% default refsection is current
\blx@safe@actives
\setkeys{blx@bib1}{#1}% Set sorting and section only, if present ...
@@ -6464,13 +6347,12 @@
\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}}%
+ \blx@xml@slist{\blx@tempc}{entry}{\blx@tempe}{\blx@tempc}{\blx@tempd}{}}%
\ifdefvoid\blx@tempa
{\blx@warn@bibempty\endgroup}
{\blx@bibliography\blx@tempa}}
% [<options>]
-
\newrobustcmd*{\bibbysection}{%
\begingroup
\ifnum\blx@maxsection=\z@
@@ -6509,7 +6391,6 @@
\fi}
% [<options>]
-
\newrobustcmd*{\bibbysegment}{%
\begingroup
\edef\on@line{\on@line}%
@@ -6553,7 +6434,6 @@
\fi}
% [<options>]
-
\newrobustcmd*{\bibbycategory}{%
\begingroup
\edef\on@line{\on@line}%
@@ -6596,8 +6476,8 @@
\endgroup}
% {<entrykey>,...}
-
\def\blx@bibliography{%
+ \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
@@ -6694,14 +6574,14 @@
\let\blx@bibcheck\relax
\def\blx@initsep{%
- \blx@imc@iffieldundef{sortinit}
+ \blx@imc@iffieldundef{bibinitsephash}
{}
{\ifnum\c@instcount>\@ne
- \blx@imc@iffieldequals{sortinit}\blx@previnit
+ \blx@imc@iffieldequals{sortinithash}\blx@previnithash
{}
{\addvspace{\bibinitsep}}%
\fi
- \global\let\blx@previnit\abx@field@sortinit}}
+ \global\let\blx@previnithash\abx@field@sortinithash}}
\def\blx@namesep{%
\ifnum\c@instcount>\@ne
@@ -6727,7 +6607,6 @@
\gappto\blx@hook@bibinit@next}
% page tracker
-
\def\blx@pagetracker@context{%
\blx@leavevmode
\ifbool{@filesw}
@@ -6741,7 +6620,6 @@
{}}
% {<instcount>}{<page>}
-
\protected\def\blx@aux@page#1#2{%
\csgdef{blx@page@#1}{#2}%
\blx@addpagesum{#1}{#2}}
@@ -6769,7 +6647,6 @@
\def\abx@aux@fnpage#1#2{\blx@addpagesum{#1}{#2}}}
% hyperref interface
-
\appto\blx@mkhyperref{%
\let\blx@anchors\@empty
\ifundef\hyper@natanchorstart
@@ -6787,45 +6664,59 @@
\appto\blx@mknohyperref{\let\blx@anchor\relax}
-% List of shorthands
-
-\newrobustcmd*{\printshorthands}{%
- \begingroup
- \edef\on@line{\on@line}%
+% Legacy alias for \printshorthands
+\def\printshorthands{%
\@ifnextchar[%]
{\blx@printshorthands}
{\blx@printshorthands[]}}
-\def\blx@printshorthands[#1]{%
+\def\blx@printshorthands[#1]{\printbiblist[#1]{shorthand}}
+
+% Custom bibliography list
+% [<otions>]{biblistname}
+\newrobustcmd*{\printbiblist}[2][]{%
+ \begingroup
+ \edef\on@line{\on@line}%
\toggletrue{blx@tempa}%
\toggletrue{blx@tempb}%
- \def\blx@theheading{shorthands}%
- \def\blx@theenv{shorthands}%
+ \def\blx@theheading{biblist}% default to biblist heading
+ \def\blx@theenv{#2}% default to list name
+ \def\blx@thebiblist{#2}%
\let\blx@theprenote\@empty
\let\blx@thepostnote\@empty
\let\blx@thetitle\@empty
% defaults
\let\blx@tempa\@empty% before there is a .bbl, this must not be undef
- \def\blx@tempc{shorthand}% default sorting scheme for shorthands
+ % default sorting scheme and scheme name for list is same name as list
+ % name, then global if not found
+ \edef\blx@tempc{%
+ \ifcsdef{blx@biber@sorting@#2}
+ {#2}
+ {\blx@sorting}}%
\edef\blx@tempd{%
- \blx@xml@sorting{%
- \csuse{blx@biber@sorting@shorthand}}}% default sorting scheme for shorthands
+ \blx@xml@sorting
+ {\ifcsdef{blx@sortdef@locale@#2}
+ { locale="\csuse{blx@sortdef@locale@#2}"}
+ {}}
+ {\ifcsdef{blx@biber@sorting@#2}
+ {\csuse{blx@biber@sorting@#2}}
+ {\csuse{blx@biber@sorting@\blx@sorting}}}}%
\let\blx@printbibchecks\relax
\edef\blx@tempe{\the\c@refsection}% default refsection is current
\blx@safe@actives
- \setkeys{blx@los1}{#1}% Set sorting and section only, if present ...
+ \setkeys{blx@biblist1}{#1}% Set sorting and section only, if present ...
\blx@rest@actives
- \ifcsvoid{blx@slistsbib@\blx@tempe @shorthand@\blx@tempc}
+ \ifcsvoid{blx@slistsbib@\blx@tempe @#2@\blx@tempc}
{}
- {\letcs\blx@tempa{blx@slistsbib@\blx@tempe @shorthand@\blx@tempc}}%
+ {\letcs\blx@tempa{blx@slistsbib@\blx@tempe @#2@\blx@tempc}}%
\blx@safe@actives
- \setkeys{blx@los2}{#1}% ... now we have correct \blx@tempa, set rest of options
+ \setkeys{blx@biblist2}{#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}}%
+ \blx@xml@slist{#2}{list}{\blx@tempe}{\blx@tempc}{\blx@tempd}{\csuse{blx@biber@biblistfilters@#2}}}%
\ifdefvoid\blx@tempa
- {\blx@warn@losempty\endgroup}
- {\blx@shorthands\blx@tempa}}
+ {\blx@warn@biblistempty{#2}\endgroup}
+ {\blx@biblist\blx@tempa}}
\def\blx@printbibchecks{%
\togglefalse{blx@tempa}%
@@ -6836,26 +6727,26 @@
{\global\let\blx@printbibchecks\relax}}}
% {<entrykey>,...}
-
-\def\blx@shorthands{%
+\def\blx@biblist{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
+ \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
\blx@bibinit
\let\@noitemerr\@empty
- \let\blx@noitem\blx@warn@losempty
+ \def\blx@noitem{\blx@warn@biblistempty{\blx@thebiblist}}%
\csuse{blx@env@\blx@theenv}%
- \csuse{blx@hook@losinit}%
- \let\blx@do\blx@lositem
- \let\blx@done\blx@endshorthands
+ \csuse{blx@hook@biblistinit@\blx@thebiblist}%
+ \let\blx@do\blx@biblistitem
+ \let\blx@done\blx@endbiblist
\blx@listloop}
-\def\blx@endshorthands{%
+\def\blx@endbiblist{%
\csuse{blx@endenv@\blx@theenv}%
\blx@noitem
\endgroup
@@ -6863,14 +6754,20 @@
\endgroup
\if@restonecol\twocolumn\fi}
-\newrobustcmd*{\AtBeginShorthands}{\gappto\blx@hook@losinit}
-\newrobustcmd*{\AtEveryLositem}{\gappto\blx@hook@lositem}
+% Legacy aliases
+\def\AtBeginShorthands{\AtBeginBiblist{shorthand}}
+\def\AtEveryLositem{\AtEveryBiblistitem{shorthand}}
\@onlypreamble\AtBeginShorthands
\@onlypreamble\AtEveryLositem
-% {<entrykey>}
+% {<biblistname>}
+\newrobustcmd*{\AtBeginBiblist}[1]{\csgappto{blx@hook@biblistinit@#1}}
+\newrobustcmd*{\AtEveryBiblistitem}[1]{\csgappto{blx@hook@biblistitem@#1}}
+\@onlypreamble\AtBeginBiblist
+\@onlypreamble\AtEveryBiblistitem
-\def\blx@lositem#1{%
+% {<entrykey>}
+\def\blx@biblistitem#1{%
\blx@ifdata{#1}
{\begingroup
\blx@getdata{#1}%
@@ -6881,19 +6778,21 @@
\blx@setoptions@entry
\addtocounter{instcount}\@ne
\csuse{blx@item@\blx@theenv}\relax
- \csuse{blx@hook@lositem}%
+ \csuse{blx@hook@biblistitem@\blx@thebiblist}%
\blx@execute
\blx@initunit
\blx@beglangbib
\bibsentence
\blx@pagetracker
- \blx@driver{shorthands}%
+ \blx@driver{\blx@thebiblist}%
\blx@postpunct
\blx@endlangbib}%
\endgroup}
{}}
-\DeclareBibliographyDriver{shorthands}{%
+% Just a default in case .bbx doesn't define it. standard.bbx defines
+% it to print a complete entry, like the bibliography.
+\DeclareBibliographyDriver{shorthand}{%
\iffieldundef{shorttitle}
{\printfield{title}}
{\printfield{shorttitle}}}
@@ -6983,6 +6882,20 @@
\global\c@refsection\z@}
\def\blx@endrefsection@biber{%
+ % make sure we always output aliases to the .bcf otherwise after their
+ % first resolution by biber, they will be invisible to subsequent biber
+ % runs since biblatex will resolve the \keyalias{} macro to the main
+ % entry key, biber won't put \keyalias{}in the .bbl on subsequent runs
+ % and biblatex will report a missing citekey
+ \def\do##1{%
+ % Make sure this counter exists. Sometimes it might not when using, e.g:
+ % refsection=chapter and \includeonly to put in the chapters.
+ \ifcsname blx@sectionciteorder@\the\c@refsection\endcsname\else
+ \expandafter\newcount\csname blx@sectionciteorder@\the\c@refsection\endcsname
+ \fi
+ \global\advance\csname blx@sectionciteorder@\the\c@refsection\endcsname\@ne
+ \blx@auxwrite\blx@bcfout{}{\blx@xml@citekey{##1}{\expandafter\the\csname blx@sectionciteorder@\the\c@refsection\endcsname}}}%
+ \dolistcsloop{blx@keyaliases@\the\c@refsection}%
\ifnum\c@refsection>\z@
\blx@auxwrite\blx@bcfout{}{%
\blx@xml@endsection\blx@nl
@@ -7412,7 +7325,6 @@
\endgroup}
% {<entrykey>,...}
-
\protected\def\blx@citeloop#1{%
\begingroup
\global\advance\csname blx@sectionciteorder@\the\c@refsection\endcsname\@ne
@@ -7930,7 +7842,6 @@
\csname blx@#1@\the\c@refsection @#2\endcsname}}
% {<instcount>}{<entrykey>}{<refsection>}{<page>}{<page int>}
-
\protected\def\blx@aux@backref#1#2#3#4#5{%
\ifcsundef{blx@pref@#3@\detokenize{#2}}
{\global\cslet{blx@pref@#3@\detokenize{#2}}\@empty
@@ -7945,7 +7856,6 @@
\def\abx@aux@backref#1#2#3#4#5{\blx@addpagesum{#1}{#5}}}
% {<true>}{<false>}
-
\def\blx@ifcitesingle{%
\ifnum\c@citetotal=\@ne
\expandafter\@firstoftwo
@@ -8005,7 +7915,6 @@
\bibhyperref \bibhyperlink \bibhypertarget \ifhyperref}
% {<entrykey>,...}
-
\protected\def\nocite#{\blx@nocite}
\def\blx@nocite#1{%
@@ -8024,7 +7933,6 @@
% {<macro>}[<arg1>][<arg2>]{<arg3>}
% => <macro>{<arg1>}{<arg2>}{<arg3>}
-
\protected\def\blx@citeargs#1{%
\@ifnextchar[%]
{\blx@citeargs@i{#1}}
@@ -8040,7 +7948,6 @@
% {<macro>}(<arg1>)(<arg2>)
% => <macro>{<arg1>}{<arg2>}
-
\protected\def\blx@multiargs#1{%
\@ifnextchar(%)
{\blx@multiargs@i{#1}}
@@ -8053,7 +7960,6 @@
% {<macro>}[<arg1>][<arg2>]{<arg3>}<punct>
% => <macro>{<arg1>}{<arg2>}{<arg3>}{<punctcmd>}
-
\protected\def\blx@citepunct#1{%
\blx@citeargs{\blx@citepunct@i{#1}}}
\long\def\blx@citepunct@i#1#2#3#4{%
@@ -8061,7 +7967,6 @@
% {<csname>}[<arg1>][<arg2>]{arg3}[arg4]{arg5}<punct>
% => <macro>{<arg1>}{<arg2>}{<arg3>}{<arg4>}{arg5}{<punctcmd>}
-
\protected\def\blx@citexpunct#1{%
\blx@citeargs{\blx@citexpunct@i{#1}}}
\long\def\blx@citexpunct@i#1#2#3#4{%
@@ -8072,7 +7977,6 @@
\blx@thecheckpunct{\blxcitecmd{#1}#2{#3}{#4}}}
% {<code>}<punct> => <code>{<punctcmd>}
-
\long\def\blx@checkpunct#1{%
\begingroup
\def\blx@tempa{\endgroup#1}%
@@ -8123,7 +8027,6 @@
{\blx@initunit}}
% *{<command>}[<wrapper>]{<precode>}{<loopcode>}{<delimcode>}{<postcode>}
-
\newrobustcmd*{\DeclareCiteCommand}{%
\@ifstar{\blx@defcitecmd*}{\blx@defcitecmd{}}}
@@ -8173,7 +8076,6 @@
\endgroup}}
% {<type>}{<name>}{*}
-
\def\blx@checkcitecmd#1#2{%
\ifblank{#2}
{\ifcsdef{blx@cite@#1}
@@ -8193,7 +8095,6 @@
\csdef{blx@citei@#1}{\blx@err@citecmd{#1}}}}}
% {<name>}{prenote}{postnote}{citekey}{punct}
-
\newrobustcmd*{\blxcitecmd}[1]{%
\ifcsundef{blx@cite@#1}
{\blx@err@citecmd{#1}}
@@ -8207,13 +8108,11 @@
{\csuse{blx@citei@#1}}}
% {<multicitecount>}{<name>}{prenote}{postnote}{citekey}{punct}
-
\protected\def\blxmciteicmd#1{%
\c@multicitecount#1\relax
\blxciteicmd}
% {<multicitetotal>}{<multiprenote>}{<multipostnote>}
-
\protected\def\blxmcites#1#2#3{%
\begingroup
\blx@citeinit
@@ -8237,7 +8136,6 @@
\endgroup}
% {<command>}[<wrapper>]{<cite>}{<delimiter>}
-
\newrobustcmd{\DeclareMultiCiteCommand}[1]{%
\ifundef#1%
{}
@@ -8274,7 +8172,6 @@
% {<command>}{<wrapper>}{<citecmd>}{<delimiter>} =>
% <init><command>{<wrapper>}{<cites>}{<punct>}
-
\def\blx@multicite#1#2#3#4{%
\begingroup
\csuse{blx@hook@mcite@before}%
@@ -8348,7 +8245,6 @@
\csdef{blx@multiparse@iii} {\toggletrue{blx@tempa}\blx@multiparse}
% {<name>}[l|i|r]{<cite>}{<multicite>}
-
\newrobustcmd*{\DeclareAutoCiteCommand}[1]{%
\ifcsundef{blx@acite@#1}
{}
@@ -8402,7 +8298,6 @@
\endgroup}}
% {<characters>}
-
\newrobustcmd*{\DeclareAutoPunctuation}[1]{%
\ifblank{#1}
{\let\blx@thecheckpunct\blx@nocheckpunct}
@@ -8420,7 +8315,6 @@
\endgroup}
% [<prenote>][<postnote>]{<entrykey>,...}[<format>]{<namelist>}<punct>
-
\newrobustcmd*{\citename}{\blx@citexpunct{citename}}
\long\csdef{blx@cite@citename}#1#2#3#4#5#6{%
\begingroup
@@ -8448,7 +8342,6 @@
\endgroup}
% [<prenote>][<postnote>]{<entrykey>,...}[<format>]{<list>}<punct>
-
\newrobustcmd*{\citelist}{\blx@citexpunct{citelist}}
\long\csdef{blx@cite@citelist}#1#2#3#4#5#6{%
\begingroup
@@ -8682,7 +8575,11 @@
\protected\long\def\blx@imc@mkbibbold#1{%
\textbf{#1}\blx@imc@setpunctfont\textbf}
-\blx@regimcs{\mkbibquote \mkbibemph \mkbibbold}
+\newrobustcmd*{\mkbibitalic}{\textit}
+\protected\long\def\blx@imc@mkbibitalic#1{%
+ \textit{#1}\blx@imc@setpunctfont\textit}
+
+\blx@regimcs{\mkbibquote \mkbibemph \mkbibbold \mkbibitalic}
\newcommand*{\bibleftparen}{\blx@postpunct(}
\newcommand*{\bibrightparen}{\blx@postpunct)\midsentence}
@@ -9021,9 +8918,9 @@
\xdef\blx@xml@noinit#1{%
~~~~<bcf:noinit value="#1"/>\blx@nl}
-\xdef\blx@xml@sorting#1{%
- ~~<bcf:sorting>\blx@nl
- #1%
+\xdef\blx@xml@sorting#1#2{%
+ ~~<bcf:sorting#1>\blx@nl%
+ #2%
~~</bcf:sorting>\blx@nl}
\xdef\blx@xml@presort#1#2{%
~~~~<bcf:presort\noexpand\ifblank{#1}{}{ type="#1"}>%
@@ -9046,15 +8943,17 @@
\xdef\blx@xml@endsection{%
~~</bcf:section>}
-\xdef\blx@xml@slist#1#2#3#4{%
- ~~<bcf:sortlist section="#2" type="#1" label="#3">\blx@nl
- #4%
- ~~</bcf:sortlist>\blx@nl}
-\xdef\blx@xml@slistlos#1#2#3#4{%
- ~~<bcf:sortlist section="#2" type="#1" label="#3">\blx@nl
- ~~~~<bcf:filter type="field">shorthand</bcf:filter>\blx@nl
- #4%
+\xdef\blx@xml@slist#1#2#3#4#5#6{%
+ ~~<bcf:sortlist section="#3" name="#1" type="#2" sortscheme="#4">\blx@nl
+ #6%
+ #5%
~~</bcf:sortlist>\blx@nl}
+\xdef\blx@xml@slistfilterorbegin{%
+ ~~~~<bcf:filteror>\blx@nl}
+\xdef\blx@xml@slistfilterorend{%
+ ~~~~</bcf:filteror>\blx@nl}
+\xdef\blx@xml@slistfilter#1#2{%
+ ~~~~<bcf:filter type="#1">#2</bcf:filter>\blx@nl}
\xdef\blx@xml@bibdata#1#2{%
~~<bcf:bibdata section="#1">\blx@nl
@@ -9099,6 +8998,7 @@
\blx@xml@svalue{minitems}{\blx@minitems}%
\blx@xml@toggle{singletitle}%
\blx@xml@svalue{sortalphaothers}{\sortalphaothers}%
+ \blx@xml@svalue{sortlocale}{\blx@sortlocale}%
\blx@xml@svalue{sortscheme}{\blx@sorting}%
\blx@xml@svalue{uniquelist}{\blx@uniquelist}%
\blx@xml@svalue{uniquename}{\blx@uniquename}%
@@ -9139,7 +9039,7 @@
\blx@xml@toggle{singletitle}%
\blx@xml@toggle{skipbib}%
\blx@xml@toggle{skiplab}%
- \blx@xml@toggle{skiplos}%
+ \blx@xml@toggle{skipbiblist}%
\blx@xml@svalue{uniquelist}{\blx@uniquelist}%
\blx@xml@svalue{uniquename}{\blx@uniquename}%
\blx@xml@toggle{useauthor}%
@@ -9168,9 +9068,6 @@
\blx@xml@svalue{mincrossrefs}{\blx@mincrossrefs}%
\blx@xml@toggle{sortcase}%
\blx@xml@toggle{sortfirstinits}%
- \ifdef\blx@sortlocale
- {\blx@xml@svalue{sortlocale}{\blx@sortlocale}}
- {}%
\blx@xml@toggle{sortupper}%
}%
\blx@xml@comment{BIBLATEX OPTIONS}%
@@ -9258,7 +9155,7 @@
\dolistcsloop{blx@biber@datamodel@entrytypes}%
\eappto\blx@tempa{%
\blx@xml@comment{SORTING}%
- \blx@xml@sorting{%
+ \blx@xml@sorting{}{%
\blx@bcf@presort
\blx@bcf@exclude
\csuse{blx@biber@sorting@\blx@sorting}%
@@ -9669,8 +9566,43 @@
\@onlypreamble\ResetDataInheritance
% {<name>}{<spec>}
+\newrobustcmd*{\DeclareBiblistFilter}[2]{%
+ \begingroup
+ \let\filteror\blx@biblistfilteror
+ \let\filter\blx@biblistfilter
+ \let\blx@tempa\@empty
+ #2%
+ \global\cslet{blx@biber@biblistfilters@#1}\blx@tempa
+ \endgroup}
+\@onlypreamble\DeclareBiblistFilter
+
+\newcommand*{\blx@biblistfilteror}[1]{%
+ \eappto\blx@tempa{\blx@xml@slistfilterorbegin}%
+ #1%
+ \eappto\blx@tempa{\blx@xml@slistfilterorend}}
+
+\newcommand*{\blx@biblistfilter}[1][2]{%
+ \let\blx@tempc\@empty
+ \let\blx@tempd\@empty
+ \setkeys{blx@biblistfilter@filter}{#1}%
+ \eappto\blx@tempa{%
+ \blx@xml@slistfilter{\blx@tempc}{\blx@tempd}}}
+
+\define@key{blx@biblistfilter@filter}{type}{%
+ \def\blx@tempc{#1}}
+\define@key{blx@biblistfilter@filter}{filter}{%
+ \def\blx@tempd{#1}}
+
+% Predefine filters for label fields
+\def\do#1{\DeclareBiblistFilter{#1}{\filter[type=field,filter=#1]}}
+\abx@dolabelfields
-\newrobustcmd*{\DeclareSortingScheme}[2]{%
+% {<name>}{<spec>}
+\newrobustcmd*{\DeclareSortingScheme}[3][]{%
+ \ifblank{#1}
+ {}
+ {\setkeys{blx@sortdef@sorting}{#1}%
+ \csxdef{blx@sortdef@locale@#2}{\blx@templ}}%
\begingroup
\let\sort\blx@sortdef@sort
\let\name\blx@sortdef@field% legacy pre-biblatex 2.0 compat
@@ -9680,11 +9612,14 @@
\def\citeorder{\blx@sortdef@field{citeorder}}%
\blx@tempcnta\z@
\let\blx@tempa\@empty
- #2%
- \global\cslet{blx@biber@sorting@#1}\blx@tempa
+ #3%
+ \global\cslet{blx@biber@sorting@#2}\blx@tempa
\endgroup}
\@onlypreamble\DeclareSortingScheme
+\define@key{blx@sortdef@sorting}{locale}{% locale name
+ \def\blx@templ{#1}}
+
\newcommand*{\blx@sortdef@sort}[2][]{%
\advance\blx@tempcnta\@ne
\blx@tempcntb\z@
@@ -9698,6 +9633,8 @@
\eappto\blx@tempa{%
\blx@xml@sort{\blx@tempc}{\blx@tempb}}}
+\define@key{blx@sortdef@sort}{locale}{% locale name
+ \eappto\blx@tempc{ locale="#1"}}
\define@key{blx@sortdef@sort}{direction}{% ascending|descending
\ifstrequal{#1}{ascending}
{\eappto\blx@tempc{ sort\string_direction="ascending"}}
@@ -9988,14 +9925,9 @@
\DeclareBibliographyOption{sortupper}[true]{%
\settoggle{blx@sortupper}{#1}}
-\DeclareBibliographyOption{sortlocale}{%
- \ifblank{#1}
- {\undef\blx@sortlocale}
- {\edef\blx@sortlocale{\detokenize{#1}}}}
-
\DeclareBibliographyOption{sortlos}{%
\blx@warning@noline{%
- sortlos option is deprecated, use 'sorting' option to \string\printshorthands}}
+ sortlos option is deprecated, use 'sorting' option to \string\printbiblist}}
\DeclareBibliographyOption{maxnames}{%
\numdef\blx@maxcitenames{#1}%
@@ -10162,6 +10094,9 @@
{\let\abx@bibmonth\blx@imc@bibsstring}
{\let\abx@bibmonth\blx@imc@biblstring}}
+\DeclareBibliographyOption{sortlocale}{%
+ \edef\blx@sortlocale{\detokenize{#1}}}
+
\DeclareBibliographyOption{language}{%
\togglefalse{blx@autolangbib}%
\togglefalse{blx@autolangcite}%
@@ -10810,10 +10745,19 @@
\DeclareEntryOption{skipbib}[true]{%
\settoggle{blx@skipbib}{#1}}
-\DeclareTypeOption{skiplos}[true]{%
- \settoggle{blx@skiplos}{#1}}
-\DeclareEntryOption{skiplos}[true]{%
- \settoggle{blx@skiplos}{#1}}
+\DeclareTypeOption{skiplos}{%
+ \blx@warning@noline{%
+ skiplos option is deprecated, use 'skipbiblist' instead}%
+ \settoggle{blx@skipbiblist}{#1}}
+\DeclareEntryOption{skiplos}{%
+ \blx@warning@noline{%
+ skiplos option is deprecated, use 'skipbiblist' instead}%
+ \settoggle{blx@skipbiblist}{#1}}
+
+\DeclareTypeOption{skipbiblist}[true]{%
+ \settoggle{blx@skipbiblist}{#1}}
+\DeclareEntryOption{skipbiblist}[true]{%
+ \settoggle{blx@skipbiblist}{#1}}
\DeclareTypeOption{skiplab}[true]{%
\settoggle{blx@skiplab}{#1}}
@@ -10822,11 +10766,11 @@
\DeclareTypeOption{dataonly}[true]{%
\settoggle{blx@skipbib}{#1}%
- \settoggle{blx@skiplos}{#1}%
+ \settoggle{blx@skipbiblist}{#1}%
\settoggle{blx@skiplab}{#1}}
\DeclareEntryOption{dataonly}[true]{%
\settoggle{blx@skipbib}{#1}%
- \settoggle{blx@skiplos}{#1}%
+ \settoggle{blx@skipbiblist}{#1}%
\settoggle{blx@skiplab}{#1}}
% Option processor/scheduler
@@ -10857,7 +10801,7 @@
\setkeys{blx@opt@ldt}{style=numeric}
\setkeys{blx@opt@pre}{%
- sorting=nty,sortcase,sortupper,sortcites=false,
+ sorting=nty,sortlocale=auto,sortcase,sortupper,sortcites=false,
maxnames=3,minnames=1,maxalphanames=3,minalphanames=1,
maxitems=3,minitems=1,mincrossrefs=2,useauthor=true,useeditor=true,
usetranslator=false,indexing=false,abbreviate=true,dateabbrev=true,
@@ -11017,6 +10961,16 @@
\blx@inf@refseg}
\AtEndOfPackage{%
+ % Data model macros are forbidden after package load is finished
+ \def\blx@warn@dm#1{\blx@warning@noline{Data model macro '#1' cannot be used in preamble}}
+ \def\ResetDatamodelEntrytypes{\blx@warn@dm{ResetDatamodelEntrytypes}}
+ \def\ResetDatamodelFields{\blx@warn@dm{ResetDatamodelFields}}
+ \def\ResetDatamodelEntryfields{\blx@warn@dm{ResetDatamodelEntryfields}}
+ \def\ResetDatamodelConstraints{\blx@warn@dm{ResetDatamodelConstraints}}
+ \renewcommand*{\DeclareDatamodelEntrytypes}[2][]{\blx@warn@dm{DeclareDatamodelEntrytypes}}
+ \renewcommand*{\DeclareDatamodelFields}[2][]{\blx@warn@dm{DeclareDatamodelFields}}
+ \renewcommand*{\DeclareDatamodelEntryfields}[2][]{\blx@warn@dm{DeclareDatamodelEntryfields}}
+ \renewcommand*{\DeclareDatamodelConstraints}[2][]{\blx@warn@dm{DeclareDatamodelConstraints}}
\AtBeginDocument{%
\let\do\undef
\blx@dopreamblecmds