summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/biblatex.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/biblatex.sty')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/biblatex.sty290
1 files changed, 168 insertions, 122 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex.sty
index 60f1674d7fa..775d3ecfb3e 100644
--- a/Master/texmf-dist/tex/latex/biblatex/biblatex.sty
+++ b/Master/texmf-dist/tex/latex/biblatex/biblatex.sty
@@ -12,8 +12,8 @@
% particular purpose.
% Set up the version strings here
-\def\abx@date{2019/08/31}
-\def\abx@version{3.13a}
+\def\abx@date{2019/12/01}
+\def\abx@version{3.14}
\def\abx@bbxid{\abx@date\space v\abx@version\space biblatex bibliography style (PK/MW)}
\def\abx@cbxid{\abx@date\space v\abx@version\space biblatex citation style (PK/MW)}
\def\abx@lbxid{\abx@date\space v\abx@version\space biblatex localization (PK/MW)}
@@ -22,7 +22,7 @@
% This is not updated by build script as the control file version
% does not necessarily change with the package version.
% This is used when writing the .bcf
-\def\blx@bcfversion{3.6}
+\def\blx@bcfversion{3.7}
% This is not updated by build script as the bbl version
% does not necessarily change with the package version.
@@ -52,21 +52,6 @@
This is a fatal error. I'm aborting now}%
\endinput}
-% polyglossia pretends to be babel, so we need to make sure
-% we are definitely talking to babel here.
-\AtEndPreamble{%
- \@ifpackageloaded{polyglossia}
- {}
- {\@ifpackageloaded{babel}
- {\@ifpackagelater{babel}{2016/04/23}
- {}
- {\PackageError{biblatex}
- {Outdated 'babel' package}
- {Upgrade to babel 3.9r (2016/04/23) or later.\MessageBreak
- I found: '\csuse{ver@babel.sty}'.\MessageBreak
- This is a fatal error. I'm aborting now}%
- \endinput}}
- {}}}
%% Category codes
@@ -117,6 +102,9 @@
\endgroup}}
%% Compatibility
+% this hook is executed once at the beginning of loading the package
+% just a few lines down
+% and again later in an \AtEndPreamble hook
\def\blx@packageincompatibility{%
\def\do##1{%
\@ifpackageloaded{##1}
@@ -166,8 +154,15 @@
% still gives a weird error.
\blx@packageincompatibility
-% people should not be abusing noerroretextools, so warn if it is not needed
+% this part is only executed now
+\@ifpackageloaded{polyglossia}
+ {\global\cslet{blx@pkgloaded@polyglossia}\@empty}
+ {}
+
+% this part is deferred to \AtEndPreamble
\def\blx@packageincompatibility@endpreambleonly{%
+ % people should not be abusing noerroretextools,
+ % so warn if it is not needed
\ifcsdef{blx@noerroretextools}
{\@ifpackageloaded{etextools}
{}
@@ -176,7 +171,34 @@
but 'etextools' is not loaded.\MessageBreak
Please do not define '\string\blx@noerroretextools'\MessageBreak
unless you really need it}}}
- {}}
+ {}%
+ % polyglossia pretends to be babel, so the nested structure helps
+ % to make sure that babel really is babel
+ \@ifpackageloaded{polyglossia}
+ {\ifcsundef{blx@pkgloaded@polyglossia}
+ {\blx@error
+ {'polyglossia' loaded after biblatex}
+ {'polyglossia' must be loaded before biblatex}}
+ {}%
+ \@ifpackagelater{polyglossia}{2019/10/27}
+ {}
+ {\blx@warning@noline
+ {biblatex works best with 'polyglossia' 1.45\MessageBreak
+ or above.\MessageBreak
+ Please update 'polyglossia' to v1.45 (2019/10/27)\MessageBreak
+ or later.\MessageBreak
+ Variant detection will not work properly with\MessageBreak
+ older versions}}}
+ {\@ifpackageloaded{babel}
+ {\@ifpackagelater{babel}{2016/04/23}
+ {}
+ {\blx@error
+ {Outdated 'babel' package}
+ {Upgrade to babel 3.9r (2016/04/23) or later.\MessageBreak
+ I found: '\csuse{ver@babel.sty}'.\MessageBreak
+ This is a fatal error. I'm aborting now}%
+ \endinput}}
+ {}}}
\begingroup
\catcode`\#=12
@@ -201,69 +223,6 @@
\AtEndPreamble{%
\blx@packageincompatibility
\blx@packageincompatibility@endpreambleonly
- \def\blx@langstrings{}%
- % Set up sortlocale defaults and default language if babel/polyglossia is not loaded
- \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}
- {% polyglossia support is not great when it comes to language variants,
- % so we better warn about it.
- \ifundef\blx@nowarnpolyglossia
- {\blx@warning@noline{%
- Package 'polyglossia' detected.\MessageBreak
- Please note that biblatex's polyglossia\MessageBreak
- interface has some rough edges.\MessageBreak
- Language variants are not picked up correctly.\MessageBreak
- You can disable this warning by defining the macro\MessageBreak
- '\string\blx@nowarnpolyglossia' in the preamble}}
- {}%
- % This is required for languages which are never explicitly selected
- % This check because \xpg@loaded is not defined in polyglossia <= v1.42.0
- \ifundef\xpg@loaded
- {\let\xpg@loaded\@empty
- \let\xpg@vloaded\@empty
- \blx@warning@noline{Upgrade package 'polyglossia' to > v1.42.0 recommended}}
- {}%
- \def\do#1{\blx@langsetup{#1}}%
- \expandafter\docsvlist\expandafter{\xpg@loaded}%
- \expandafter\docsvlist\expandafter{\xpg@vloaded}%
- \ifboolexpr{
- not togl {blx@autolangbib}
- and
- not togl {blx@autolangcite}}
- {\blx@mknoautolang}
- {\blx@mkautolangpoly}}
- {\@ifpackageloaded{babel}
- {% This is required for languages which are never explicitly selected
- \def\do#1{\blx@langsetup{#1}}%
- \expandafter\docsvlist\expandafter{\bbl@loaded}%
- \ifboolexpr{
- not togl {blx@autolangbib}
- and
- not togl {blx@autolangcite}}
- {\blx@mknoautolang}
- {\blx@mkautolangbabel}}
- {\blx@mknoautolang}}%
- % These already have defaults set to basically do nothing
- % so if the toggles are true, we need to define again since
- % mkautolang* redefines \blx@beglang
- % In turn, \blx@beglang defines \blx@endlang and so \blx@beglangcite and
- % \blx@endlangcite need redefining inside \blx@beglang after \blx@endlang
- % has been defined.
- \iftoggle{blx@autolangbib}
- {\let\blx@beglangbib\blx@beglang}
- {}%
- \iftoggle{blx@autolangcite}
- {\let\blx@beglangcite\blx@beglang}
- {}%
- \csuse{abx@extras@\blx@languagename}%
- \csuse{abx@strings@\blx@languagename}%
- \undef\blx@mkautolangbabel
- \undef\blx@mkautolangpoly
- \undef\blx@mknoautolang
\ifnum\blx@hyperref=\thr@@
\else
\ifnum\blx@hyperref=\z@
@@ -488,6 +447,75 @@
\sfcode`\'=\z@}}%
\let\do\noexpand}
+% no longer needed, keep for backwards compatibility
+\let\blx@langstrings\relax
+
+\def\blx@ifhyphenationundef#1{\ifcsundef{l@#1}}
+
+% polyglossia makes heavy use of \AtBeginDocument, so we need to use
+% it too to get in later than polyglossia's setup.
+% This means that load-order is relevant, boo ...
+\AtBeginDocument{%
+ \@ifpackageloaded{polyglossia}
+ {\ifundef\xpg@ifdefined
+ {}
+ {\def\blx@ifhyphenationundef#1#2#3{\xpg@ifdefined{#1}{#3}{#2}}}%
+ % This is required for languages which are never explicitly selected
+ % \xpg@bloaded is not defined in polyglossia < v1.45
+ \ifundef\xpg@bloaded
+ {\ifundef\xpg@loaded
+ {\let\xpg@bloaded\@empty}
+ {\let\xpg@bloaded\xpg@loaded}}
+ {}%
+ \global\let\blx@maplang\blx@maplang@polyglossia
+ \def\do#1{\blx@langsetup{#1}}%
+ \expandafter\docsvlist\expandafter{\xpg@bloaded}%
+ \ifboolexpr{
+ not togl {blx@autolangbib}
+ and
+ not togl {blx@autolangcite}}
+ {\blx@mknoautolang}
+ {\blx@mkautolangpoly}%
+ }
+ {\global\let\blx@maplang\blx@maplang@babel
+ \@ifpackageloaded{babel}
+ {% This is required for languages which are never explicitly selected
+ \def\do#1{\blx@langsetup{#1}}%
+ \expandafter\docsvlist\expandafter{\bbl@loaded}%
+ \ifboolexpr{
+ not togl {blx@autolangbib}
+ and
+ not togl {blx@autolangcite}}
+ {\blx@mknoautolang}
+ {\blx@mkautolangbabel}}
+ {\blx@mknoautolang}}%
+ % These already have defaults set to basically do nothing
+ % so if the toggles are true, we need to define again since
+ % mkautolang* redefines \blx@beglang
+ % In turn, \blx@beglang defines \blx@endlang and so \blx@beglangcite and
+ % \blx@endlangcite need redefining inside \blx@beglang after \blx@endlang
+ % has been defined.
+ \iftoggle{blx@autolangbib}
+ {\let\blx@beglangbib\blx@beglang}
+ {}%
+ \iftoggle{blx@autolangcite}
+ {\let\blx@beglangcite\blx@beglang}
+ {}%
+ \csuse{abx@extras@\blx@languagename}%
+ \csuse{abx@strings@\blx@languagename}%
+ \undef\blx@mkautolangbabel
+ \undef\blx@mkautolangpoly
+ \undef\blx@mknoautolang
+ % pick up the main document language as sortlocale if
+ % auto-detection is desired
+ \ifdefstring\blx@sortlocale{auto}
+ {\ifdef\blx@main@language% babel or polyglossia is loaded
+ {\edef\blx@sortlocale{\blx@main@language}}
+ {\def\blx@sortlocale{english}}}
+ {}%
+}
+
+
\begingroup
\@makeother\#
% \relax: gobble newline -> titletoc.sty
@@ -3994,8 +4022,8 @@
{\xifinlist\abx@field@langid\blx@cmksc@lang
{\blx@mksc@ii}
{\@firstofone}}
- {\ifdef\bbl@main@language
- {\xifinlist\bbl@main@language\blx@cmksc@lang
+ {\ifdef\blx@main@language
+ {\xifinlist\blx@main@language\blx@cmksc@lang
{\blx@mksc@ii}
{\@firstofone}}
{\xifinlist\blx@languagename\blx@cmksc@lang
@@ -5446,14 +5474,14 @@
% {<language>}{<exceptions>}
\newrobustcmd*{\DefineHyphenationExceptions}[2]{%
- \ifcsundef{l@#1}
+ \blx@ifhyphenationundef{#1}
{\blx@warn@nohyph{#1}}
{}%
\csgappto{blx@hook@hyph@#1}{\blx@hyphexcept{#1}{#2}}}
\@onlypreamble\DefineHyphenationExceptions
\def\blx@hyphexcept#1#2{%
- \ifcsundef{l@#1}
+ \blx@ifhyphenationundef{#1}
{\blx@warn@nohyph{#1}}
{\begingroup
\language\csname l@#1\endcsname\relax
@@ -6326,7 +6354,7 @@
\def\currentlang{\blx@languagename}
% {<language>}{<strings>}
-\def\blx@maplang#1#2{%
+\def\blx@maplang@babel#1#2{%
\csgappto{extras#1}{%
\blx@resetpunct
\csuse{abx@extras@#2}%
@@ -6335,6 +6363,19 @@
\blx@resetpunct
\csuse{abx@noextras@#2}}}
+\def\blx@maplang@polyglossia#1#2{%
+ \csgappto{blockextras@bbl@#1}{%
+ \blx@resetpunct
+ \csuse{abx@extras@#2}%
+ \csuse{abx@strings@#2}}%
+ \csgappto{inlinextras@bbl@#1}{%
+ \blx@resetpunct
+ \csuse{abx@extras@#2}%
+ \csuse{abx@strings@#2}}%
+ \csgappto{noextras@bbl@#1}{%
+ \blx@resetpunct
+ \csuse{abx@noextras@#2}}}
+
%% babel/polyglossia interface
\def\blx@beglang{\blx@clearlang\begingroup}
\def\blx@endlang{\endgroup}
@@ -6346,7 +6387,7 @@
\let\blx@hook@initlang\@empty
\let\blx@imc@mainlang\@empty
\def\blx@hyphenreset{%
- \ifcsundef{l@\blx@languagename}
+ \blx@ifhyphenationundef{\blx@languagename}
{}
{\language\csname l@\blx@languagename\endcsname\relax}%
\ifcsundef{\blx@languagename hyphenmins}
@@ -6364,7 +6405,7 @@
{\blx@error
{No default 'babel' language defined}
{You must define a default language for 'babel'}}
- {}%
+ {\let\blx@main@language\bbl@main@language}%
\pretocmd\select@language{\blx@langsetup{#1}}
{\ifdef\blx@thelangenv
{\def\blx@beglang{%
@@ -6381,7 +6422,7 @@
{\let\abx@field@langid\blx@forcelanguagename}
{}%
\let\blx@languagename\abx@field@langid% track global language
- \ifcsundef{l@\abx@field@langid}
+ \blx@ifhyphenationundef{\abx@field@langid}
{\blx@warn@nohyph{\abx@field@langid}}
{\blx@hook@initlang
\def\blx@endlang{%
@@ -6398,37 +6439,38 @@
\expandafter{\abx@field@langid}}}
{}}}
{}%
- \def\blx@langstrings{}%
- \def\blx@imc@mainlang{\select@language{\bbl@main@language}}%
- \blx@langsetup\bbl@main@language}
+ \def\blx@imc@mainlang{\select@language{\blx@main@language}}%
+ \blx@langsetup\blx@main@language}
{\blx@err@patch{'babel' package}%
\blx@mknoautolang}}
\gdef\blx@mkautolangpoly{%
- \ifundef\bbl@main@language
- {\blx@error
- {No default 'polyglossia' language defined}
- {You must define a default language for 'polyglossia'}}
- {}%
+ \ifundef\mainbabelname
+ {\ifundef\bbl@main@language
+ {\blx@error
+ {No default 'polyglossia' language defined}
+ {You must define a default language for 'polyglossia'}}
+ {\let\blx@main@language\bbl@main@language}}
+ {\let\blx@main@language\mainbabelname}%
\edef\blx@saved@underscore@catcode{\the\catcode`\_}%
\catcode`\_=11% polyglossia uses "_" as a letter
- \pretocmd\select@language{\blx@langsetup{#1}}
+ \pretocmd\select@language{\blx@langsetup{\babelname}}
{\ifdef\blx@thelangenv
{\def\blx@beglang{%
\blx@clearlang
\begingroup
- % Need to override all entries, regardless of if there is a langid
- % if language=<language> option is given
- \ifboolexpr { test {\ifdef\abx@field@langid }
- or
- test {\ifdef\blx@forcelanguagename} }
+ % Need to override all entries, regardless of if there is a
+ % langid if language=<language> option is given
+ \ifboolexpr { test {\ifdef\abx@field@langid }
+ or
+ test {\ifdef\blx@forcelanguagename} }
% override local langid if we forced it with
% language=<language> option
{\ifdef\blx@forcelanguagename
{\let\abx@field@langid\blx@forcelanguagename}
{}%
\let\blx@languagename\abx@field@langid% track global language
- \ifcsundef{l@\abx@field@langid}
+ \blx@ifhyphenationundef{\abx@field@langid}
{\blx@warn@nohyph{\abx@field@langid}}
{\blx@hook@initlang
\def\blx@endlang{%
@@ -6457,18 +6499,8 @@
\csuse{abx@strings@\abx@field@langid}}}}
{}}}
{}%
- % polyglossia needs this - it doesn't get the
- % strings 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
- \blx@resetpunct
- \csuse{abx@extras@\bbl@main@language}%
- \csuse{abx@strings@\bbl@main@language}}%
- \blx@langsetup\bbl@main@language}
+ \def\blx@imc@mainlang{\select@language{\blx@main@language}}%
+ \blx@langsetup\blx@main@language}
{\blx@err@patch{'polyglossia' package}%
\blx@mknoautolang}%
\catcode`\_=\blx@saved@underscore@catcode\relax}
@@ -9126,7 +9158,6 @@
\blx@safe@actives
\setkeys{blx@bhd}{#1}%
\blx@rest@actives
- \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\endgroup}
@@ -9316,7 +9347,6 @@
% {<entrykey>,...}
\def\blx@bibliography#1{%
- \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
@@ -9666,7 +9696,6 @@
\else
\@restonecolfalse
\fi
- \blx@langstrings
\blx@bibheading\blx@theheading\blx@thetitle
\blx@bibnote\blx@theprenote
\begingroup
@@ -11407,7 +11436,6 @@
{}
{\toggletrue{blx@citation}}%
\blx@blxinit
- \blx@langstrings
\citesetup
\blx@setsfcodes
\blx@postpunct@agroup
@@ -12888,6 +12916,7 @@
\blx@bcf@datamodel@fields
}%
\blx@bcf@datamodel@entryfields
+ \blx@bcf@datamodel@multiscript@entryfields
\blx@bcf@datamodel@constraints
}%
}%
@@ -13153,6 +13182,22 @@
\ifstrequal{#1}{true}
{\appto\blx@tempf{ map\string_final="1"}}
{}}
+\define@key{blx@sourcemap@step}{cited}[true]{% true|false
+ \ifstrequal{#1}{true}
+ {\appto\blx@tempf{ map\string_entrykey\string_cited="1"}}
+ {}}
+\define@key{blx@sourcemap@step}{nocited}[true]{% true|false
+ \ifstrequal{#1}{true}
+ {\appto\blx@tempf{ map\string_entrykey\string_nocited="1"}}
+ {}}
+\define@key{blx@sourcemap@step}{citedornocited}[true]{% true|false
+ \ifstrequal{#1}{true}
+ {\appto\blx@tempf{ map\string_entrykey\string_citedornocited="1"}}
+ {}}
+\define@key{blx@sourcemap@step}{allnocited}[true]{% true|false
+ \ifstrequal{#1}{true}
+ {\appto\blx@tempf{ map\string_entrykey\string_allnocited="1"}}
+ {}}
\define@key{blx@sourcemap@step}{fieldsource}{% characters
\eappto\blx@tempf{ map\string_field\string_source="#1"}}
\define@key{blx@sourcemap@step}{notfield}{% characters
@@ -15264,6 +15309,7 @@
\def\ResetDatamodelFields{\blx@warn@dm{ResetDatamodelFields}}
\def\ResetDatamodelEntryfields{\blx@warn@dm{ResetDatamodelEntryfields}}
\def\ResetDatamodelConstraints{\blx@warn@dm{ResetDatamodelConstraints}}
+ \renewcommand*{\DeclareDatamodelMultiscriptEntryfields}[1]{\blx@warn@dm{DeclareDatamodelMultiscriptEntryfields}}
\renewcommand*{\DeclareDatamodelEntrytypes}[2][]{\blx@warn@dm{DeclareDatamodelEntrytypes}}
\renewcommand*{\DeclareDatamodelFields}[2][]{\blx@warn@dm{DeclareDatamodelFields}}
\renewcommand*{\DeclareDatamodelEntryfields}[2][]{\blx@warn@dm{DeclareDatamodelEntryfields}}