summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-24 22:40:15 +0000
committerKarl Berry <karl@freefriends.org>2013-11-24 22:40:15 +0000
commit2f4083de8cf96ea8d55425d1e0074d43b2216d93 (patch)
treeb4f499b2fd0cb8bbb5d84cff3d81e22f1158ee27 /Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
parent7d8d8f2338990bb460545d4ca8b2738b0d3bb25e (diff)
biblatex (24nov13)
git-svn-id: svn://tug.org/texlive/trunk@32231 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/biblatex2.sty')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/biblatex2.sty114
1 files changed, 84 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
index 9a7bef604b1..e9b49c817f2 100644
--- a/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
+++ b/Master/texmf-dist/tex/latex/biblatex/biblatex2.sty
@@ -66,14 +66,32 @@
cite,citeref,drftcite,footbib,inlinebib,jurabib,mcite,mciteplus,
mlbib,multibbl,multibib,natbib,opcit,overcite,splitbib,ucs}%
\@ifpackageloaded{polyglossia}
- {\iftoggle{blx@autolang}
- {\blx@mkautolangpoly}
- {\blx@mknoautolang}}
+ {\ifboolexpr{
+ not test {\iftoggle{blx@autolangbib}}
+ and
+ not test {\iftoggle{blx@autolangcite}}}
+ {\blx@mknoautolang}
+ {\blx@mkautolangpoly}}
{\@ifpackageloaded{babel}
- {\iftoggle{blx@autolang}
- {\blx@mkautolangbabel}
- {\blx@mknoautolang}}
+ {\ifboolexpr{
+ not test {\iftoggle{blx@autolangbib}}
+ and
+ not test {\iftoggle{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
@@ -422,7 +440,8 @@
\newtoggle{blx@debug}
\newtoggle{blx@sortcase}
\newtoggle{blx@sortupper}
-\newtoggle{blx@autolang}
+\newtoggle{blx@autolangbib}
+\newtoggle{blx@autolangcite}
\newtoggle{blx@clearlang}
\newtoggle{blx@defernumbers}
\newtoggle{blx@omitnumbers}
@@ -3002,9 +3021,9 @@
\let\abx@macro@bibindex\@empty
\let\abx@macro@pageref\@empty
\csuse{blx@hook@bbxinit}#1%
- \blx@beglang
+ \blx@beglangbib
\blx@driver{#2}%
- \blx@endlang
+ \blx@endlangbib
\endgroup}
% Punctuation
@@ -3850,7 +3869,7 @@
\blx@setoptions@entry
\addtocounter{instcount}\@ne
\blx@execute
- \blx@beglang#3\blx@endlang
+ \blx@beglangbib#3\blx@endlangbib
\endgroup}
{}}
@@ -3889,13 +3908,13 @@
\blx@setoptions@entry
\addtocounter{instcount}\@ne
\blx@execute
- \blx@beglang
+ \blx@beglangbib
\blx@begunit
\blx@entryset@precode
\blx@driver{\blx@imc@thefield{entrytype}}
\blx@entryset@postcode
\blx@endunit
- \blx@endlang
+ \blx@endlangbib
\endgroup}
{\blx@nounit}}
@@ -4842,6 +4861,10 @@
%% babel/polyglossia interface
\def\blx@beglang{\blx@clearlang\begingroup}
\def\blx@endlang{\endgroup}
+\let\blx@beglangbib\blx@beglang
+\let\blx@endlangbib\blx@endlang
+\let\blx@beglangcite\blx@beglang
+\let\blx@endlangcite\blx@endlang
\let\blx@hook@endlang\@empty
\let\blx@hook@initlang\@empty
\let\blx@imc@mainlang\@empty
@@ -4873,6 +4896,12 @@
\blx@hook@endlang
\csname end\blx@thelangenv\endcsname
\endgroup}%
+ \iftoggle{blx@autolangbib}
+ {\let\blx@endlangbib\blx@endlang}
+ {}%
+ \iftoggle{blx@autolangcite}
+ {\let\blx@endlangcite\blx@endlang}
+ {}%
\csname\blx@thelangenv\expandafter\endcsname
\expandafter{\abx@field@langid}}}
{}}}
@@ -4896,16 +4925,21 @@
\def\blx@endlang{%
\blx@hook@endlang
% Polyglossia language envs are \<lang>[]
- \expandafter\ifstrequal\expandafter{\blx@thelangenv}{langname}
+ \ifcsstring{blx@thelangenv}{langname}
{\csname end\abx@field@langid\endcsname}
{\csname end\blx@thelangenv\endcsname}%
\endgroup}%
- \expandafter\ifstrequal\expandafter{\blx@thelangenv}{langname}
+ \iftoggle{blx@autolangbib}
+ {\let\blx@endlangbib\blx@endlang}
+ {}%
+ \iftoggle{blx@autolangcite}
+ {\let\blx@endlangcite\blx@endlang}
+ {}%
+ \ifcsstring{blx@thelangenv}{langname}
{\ifdef\abx@field@langidopts
{\csname\abx@field@langid\expandafter\endcsname\expandafter[\abx@field@langidopts]}
{\csname\abx@field@langid\endcsname}}
- {\csname\blx@thelangenv\expandafter\endcsname
- \expandafter{\abx@field@langid}}%
+ {\csname\blx@thelangenv\expandafter\endcsname\expandafter{\abx@field@langid}}%
% These lines are equal to \blx@maplang
\blx@resetpunct
\csuse{abx@extras@\abx@field@langid}%
@@ -6648,12 +6682,12 @@
\blx@execute
\blx@initunit
\blx@anchor
- \blx@beglang
+ \blx@beglangbib
\bibsentence
\blx@pagetracker
\blx@driver\abx@field@entrytype
\blx@postpunct
- \blx@endlang}%
+ \blx@endlangbib}%
\endgroup}
{}}
@@ -6850,12 +6884,12 @@
\csuse{blx@hook@lositem}%
\blx@execute
\blx@initunit
- \blx@beglang
+ \blx@beglangbib
\bibsentence
\blx@pagetracker
\blx@driver{shorthands}%
\blx@postpunct
- \blx@endlang}%
+ \blx@endlangbib}%
\endgroup}
{}}
@@ -7456,6 +7490,7 @@
\blx@pagetracker
\csuse{blx@hook@citekey}%
\csuse{blx@hook@citekey@next}%
+ \blx@beglangcite
\blx@execute
\blx@loopcode
\blx@citecounter
@@ -7468,6 +7503,7 @@
\def\blx@thecheckpunct{\blx@err@nestcite\@gobble}%
\blx@postcode
\fi
+ \blx@endlangcite
\endgroup}
% cite counter
@@ -10127,15 +10163,33 @@
{\let\abx@bibmonth\blx@imc@biblstring}}
\DeclareBibliographyOption{language}{%
- \ifstrequal{#1}{auto}
- {\toggletrue{blx@autolang}%
- \def\blx@languagename{english}}
- {\IfFileExists{#1.lbx}
- {\togglefalse{blx@autolang}%
- \edef\blx@languagename{#1}}
- {\blx@error
- {Language '#1' not supported}
- {Failed to find a matching '#1.lbx' file}}}}
+ \togglefalse{blx@autolangbib}%
+ \togglefalse{blx@autolangcite}%
+ \ifboolexpr{
+ test {\ifstrequal{#1}{auto}}
+ or
+ test {\ifstrequal{#1}{autobib}}
+ or
+ test {\ifstrequal{#1}{autocite}}
+ }
+ {\def\blx@languagename{english}%
+ \ifstrequal{#1}{auto}
+ {\toggletrue{blx@autolangbib}%
+ \toggletrue{blx@autolangcite}}
+ {}%
+ \ifstrequal{#1}{autobib}
+ {\toggletrue{blx@autolangbib}}
+ {}%
+ \ifstrequal{#1}{autocite}
+ {\toggletrue{blx@autolangcite}}
+ {}}
+ {\IfFileExists{#1.lbx}
+ {\togglefalse{blx@autolangbib}%
+ \togglefalse{blx@autolangcite}%
+ \edef\blx@languagename{#1}}
+ {\blx@error
+ {Language '#1' not supported}
+ {Failed to find a matching '#1.lbx' file}}}}
\DeclareBibliographyOption{clearlang}[true]{%
\settoggle{blx@clearlang}{#1}}
@@ -10809,7 +10863,7 @@
usetranslator=false,indexing=false,abbreviate=true,dateabbrev=true,
backref=false,backrefsetstyle=setonly,pagetracker=false,ibidtracker=false,
idemtracker=false,opcittracker=false,loccittracker=false,citetracker=false,
- citecounter=false,block=none,language=auto,clearlang=true,autolang=none,
+ citecounter=false,block=none,language=autobib,clearlang=true,autolang=none,
date=comp,datelabel=year,origdate=comp,eventdate=comp,urldate=short,
autopunct=true,punctfont=false,defernumbers=false,
refsection=none,refsegment=none,citereset=none,hyperref=auto,