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.sty103
1 files changed, 89 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
index 19f1cf302e6..75d6b1a3372 100644
--- a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
+++ b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
@@ -73,14 +73,27 @@
{\def\blx@sortlocale{english}}}
{}%
\@ifpackageloaded{polyglossia}
- {\ifboolexpr{
+ {% 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
+ \PackageWarningNoLine{biblatex}{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 test {\iftoggle{blx@autolangbib}}
and
not test {\iftoggle{blx@autolangcite}}}
{\blx@mknoautolang}
{\blx@mkautolangpoly}}
{\@ifpackageloaded{babel}
- {\ifboolexpr{
+ {% This is required for languages which are never explicitly selected
+ \def\do#1{\blx@langsetup{#1}}%
+ \expandafter\docsvlist\expandafter{\bbl@loaded}%
+ \ifboolexpr{
not test {\iftoggle{blx@autolangbib}}
and
not test {\iftoggle{blx@autolangcite}}}
@@ -1142,7 +1155,7 @@
%% Punctuation and capitalization
-% 1001 apostrophe (\printnames only)
+% 1001 prefix sep for names (e.g. d'Argent ... \printnames only)
% 1002 abbreviation period (dot)
% 1003/1250 comma
% 1004/1500 semicolon
@@ -1153,7 +1166,7 @@
% 1009 suppress punctuation
% 1010 new paragaph
-\mathchardef\blx@sf@apo=1001
+\mathchardef\blx@sf@prefixchar=1001% e.g. apostrophe or equivalent for prefix handling
\mathchardef\blx@sf@dot=1002
\mathchardef\blx@sf@comma=1003
\mathchardef\blx@sf@semicolon=1004
@@ -1219,12 +1232,52 @@
\sfcode`\?=3002
}
+% Defining characters that count as prefices in names like d'Argent
+% Code from moewe
+\let\blx@prefchars\@empty
+
+\def\blx@defprefchars@loop#1{%
+ \ifx#1\relax
+ \else
+ \listadd{\blx@prefchars}{#1}%
+ \expandafter\blx@defprefchars@loop
+ \fi}
+
+\def\blx@defprefchars#1{%
+ \expandafter\blx@defprefchars@loop\detokenize{#1}\relax}
+
+\newrobustcmd*{\DeclarePrefChars}{%
+ \@ifstar
+ {\blx@defprefchars}
+ {\let\blx@prefchars\@empty
+ \blx@defprefchars}}
+\DeclarePrefChars{'}
+
+\protected\def\blx@imc@ifprefchar{%
+ \ifhmode
+ \begingroup
+ \ifnum\spacefactor=\blx@sf@prefixchar
+ \endgroup
+ \expandafter\expandafter
+ \expandafter\@firstoftwo
+ \else
+ \endgroup
+ \expandafter\expandafter
+ \expandafter\@secondoftwo
+ \fi
+ \else
+ \expandafter\@secondoftwo
+ \fi}
+
+\blx@regimcs{\ifprefchar}
+
\def\blx@namecodes{%
\ifnum\sfcode`\A=\@m
\else
\blx@setazcodes
\fi
- \sfcode`\'=\blx@sf@apo
+ \def\do##1{\sfcode`##1=\blx@sf@prefixchar}%
+ \dolistloop\blx@prefchars
}
\begingroup
@@ -1367,7 +1420,7 @@
\newrobustcmd*{\DeclarePunctuationPairs}[2]{%
\ifcsdef{blx@sf@\detokenize{#1}}
- {\ifnum\csname blx@sf@\detokenize{#1}\endcsname>\blx@sf@apo
+ {\ifnum\csname blx@sf@\detokenize{#1}\endcsname>\blx@sf@prefixchar
\ifnum\csname blx@sf@\detokenize{#1}\endcsname<\blx@sf@nopunct
\expandafter\blx@defpunctpairs
\expandafter{\the\csname blx@sf@\detokenize{#1}\endcsname}{#2}%
@@ -1400,7 +1453,7 @@
\def\blx@defpair#1{%
\ifx&#1%
\else
- \ifnum\the\sfcode`#1>\blx@sf@apo
+ \ifnum\the\sfcode`#1>\blx@sf@prefixchar
\ifnum\the\sfcode`#1<\blx@sf@nopunct
\eappto\blx@tempb{%
\cslet{blx@pp@\blx@tempa @\the\sfcode`#1}\noexpand\@empty}%
@@ -4338,6 +4391,7 @@
\do{langgerman}%
\do{langgreek}%
\do{langitalian}%
+ \do{langjapanese}%
\do{langlatin}%
\do{langnorwegian}%
\do{langpolish}%
@@ -4359,6 +4413,7 @@
\do{fromgerman}%
\do{fromgreek}%
\do{fromitalian}%
+ \do{fromjapanese}%
\do{fromlatin}%
\do{fromnorwegian}%
\do{frompolish}%
@@ -4889,10 +4944,10 @@
{}}}
{}%
% polyglossia needs this - it doesn't get the
- % strings by automatically set for some reason
+ % strings automatically set for some reason
\def\blx@langstrings{%
\csuse{abx@extras@\languagename}%
- \csuse{abx@strings@\languagename}}
+ \csuse{abx@strings@\languagename}}%
\def\blx@imc@mainlang{%
\select@language{\bbl@main@language}%
% These lines are equal to \blx@maplang
@@ -7008,7 +7063,8 @@
% 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.
+ % refsection=chapter and \includeonly to put in the chapters or when
+ % inserting citations into table of contents
\ifcsname blx@sectionciteorder@\the\c@refsection\endcsname\else
\expandafter\newcount\csname blx@sectionciteorder@\the\c@refsection\endcsname
\fi
@@ -7284,6 +7340,9 @@
\@onlypreamble\AtEveryCitekey
\@onlypreamble\AtEveryMultiCite
+\newrobustcmd*{\AtEachCitekey}{%
+ \iftoggle{blx@citation}{\appto\blx@hook@citekey}{\@gobble}}
+
\def\blx@imc@UseEveryCiteHook{\csuse{blx@hook@cite}}
\def\blx@imc@UseEveryCitekeyHook{\csuse{blx@hook@citekey}}
\def\blx@imc@UseEveryMultiCiteHook{\csuse{blx@hook@mcite}}
@@ -7450,6 +7509,12 @@
% {<entrykey>,...}
\protected\def\blx@citeloop#1{%
\begingroup
+ % Make sure this counter exists. Sometimes it might not when using, e.g:
+ % refsection=chapter and \includeonly to put in the chapters or when
+ % inserting citations into table of contents
+ \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@tempcnta\z@
\blx@tempcntb\z@
@@ -8049,6 +8114,12 @@
\@esphack}
\def\blx@nocite@do#1{%
+ % Make sure this counter exists. Sometimes it might not when using, e.g:
+ % refsection=chapter and \includeonly to put in the chapters or when
+ % inserting citations into table of contents
+ \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@citation{#1}\blx@msg@cundef}
@@ -8132,6 +8203,7 @@
{}
{\toggletrue{blx@citation}}%
\blx@blxinit
+ \blx@langstrings
\citesetup
\blx@setsfcodes
\blx@postpunct@agroup
@@ -9648,9 +9720,6 @@
\eappto\blx@tempb{%
\blx@xml@labelalpha@part{\blx@tempc}{#2}}}
-% script form - original | translated | romanised | uniform
-\define@key{blx@latem@field}{form}{%
- \appto\blx@tempc{ form="#1"}}
\define@key{blx@latem@field}{lang}{%
\appto\blx@tempc{ lang="#1"}}
\define@key{blx@latem@field}{uppercase}[true]{% true|false
@@ -9667,6 +9736,8 @@
{}}
\define@key{blx@latem@field}{strwidth}{% integer
\eappto\blx@tempc{ substring\string_width="#1"}}
+\define@key{blx@latem@field}{pstrwidth}{% integer
+ \eappto\blx@tempc{ substring\string_pwidth="#1"}}
\define@key{blx@latem@field}{varwidth}[true]{% "v"
\ifstrequal{#1}{true}
{\appto\blx@tempc{ substring\string_width="v"}}
@@ -9687,10 +9758,14 @@
\ifstrequal{#1}{right}
{\eappto\blx@tempc{ substring\string_side="right"}}
{\eappto\blx@tempc{ substring\string_side="left"}}}
-\define@key{blx@latem@field}{compound}[false]{% true|false
+\define@key{blx@latem@field}{compound}[true]{% true|false
\ifstrequal{#1}{true}
{\appto\blx@tempc{ substring\string_compound="1"}}
{}}
+\define@key{blx@latem@field}{pcompound}[true]{% true|false
+ \ifstrequal{#1}{true}
+ {\appto\blx@tempc{ substring\string_pcompound="1"}}
+ {}}
\define@key{blx@latem@field}{ifnames}{%
\eappto\blx@tempc{ ifnamecount="#1"}}
\define@key{blx@latem@field}{names}{%