summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/babel.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel.def250
1 files changed, 156 insertions, 94 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def
index be6f32123e6..a58501aec4a 100644
--- a/Master/texmf-dist/tex/generic/babel/babel.def
+++ b/Master/texmf-dist/tex/generic/babel/babel.def
@@ -38,7 +38,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%% File 'babel.dtx'
-%%\ProvidesFile{babel.dtx}[2013/05/16 v3.9f The Babel package]
+%%\ProvidesFile{babel.dtx}[2013/10/10 v3.9g The Babel package]
%% Babel package for LaTeX2e.
%% Copyright (C) 1989 -- 2008 by Johannes Braams,
%% TeXniek
@@ -54,16 +54,13 @@
\ifx\ProvidesFile\@undefined
\def\ProvidesFile#1[#2 #3 #4]{%
\wlog{File: #1 #4 #3 <#2>}%
- \let\ProvidesFile\@undefined
- }
+ \let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{babel.def}
- [2013/05/16 v3.9f %
- Babel common definitions]
+\ProvidesFile{babel.def}[2013/10/10 3.9g Babel common definitions]
\ifx\AtBeginDocument\@undefined
\input plain.def\relax
\fi
-\def\bbl@tempa{3.9f}
+\def\bbl@tempa{3.9g}%
\ifx\bbl@version\bbl@tempa\else
\input switch.def\relax
\fi
@@ -84,6 +81,16 @@
\ifx\bbl@afterlang\@undefined\let\bbl@afterlang\relax\fi
\providecommand\AfterBabelLanguage[2]{}
\def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}%
+\chardef\bbl@engine=%
+ \ifx\directlua\@undefined
+ \ifx\XeTeXinputencoding\@undefined
+ \z@
+ \else
+ \tw@
+ \fi
+ \else
+ \@ne
+ \fi
\long\def\bbl@afterelse#1\else#2\fi{\fi#1}
\long\def\bbl@afterfi#1\fi{\fi#1}
\def\bbl@withactive#1#2{%
@@ -145,6 +152,9 @@
\fi
\fi
\let\bbl@screset\@empty
+ \let\BabelStrings\bbl@opt@strings
+ \let\BabelOptions\@empty
+ \let\BabelLanguages\relax
\ifx\originalTeX\@undefined
\let\originalTeX\@empty
\else
@@ -434,9 +444,9 @@
\fi}
\def\babelshorthand{\active@prefix\babelshorthand\bbl@putsh}
\def\bbl@putsh#1{%
- \@ifundefined{bbl@active@\string#1}%
- {\bbl@putsh@i#1\@empty\@nnil}%
- {\csname bbl@active@\string#1\endcsname}}
+ \@ifundefined{bbl@active@\string#1}%
+ {\bbl@putsh@i#1\@empty\@nnil}%
+ {\csname bbl@active@\string#1\endcsname}}
\def\bbl@putsh@i#1#2\@nnil{%
\csname\languagename @sh@\string#1@%
\ifx\@empty#2\else\string#2@\fi\endcsname}
@@ -831,6 +841,21 @@
\DeclareTextCompositeCommand{\"}{OT1}{O}{\bbl@umlauta{O}}%
\DeclareTextCompositeCommand{\"}{OT1}{U}{\bbl@umlauta{U}}%
}
+\def\bbl@patchuclc{%
+ \let\bbl@patchuclc\relax
+ \@ifundefined{bbl@tolower}{%
+ \g@addto@macro\@uclclist{%
+ \reserved@b{\reserved@b\@gobble}% stops processing the list
+ \@ifundefined{\languagename @bbl@uclc}% and resumes it
+ {\reserved@a}%
+ {\csname\languagename @bbl@uclc\endcsname}%
+ {\bbl@tolower\@empty}{\bbl@toupper\@empty}}%
+ \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}%
+ \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}{}}%
+\def\bbl@aftercmds#1{%
+ \toks@\expandafter{\bbl@scafter#1}%
+ \xdef\bbl@scafter{\the\toks@}}
+\def\bbl@toglobal#1{\global\let#1#1}
\def\bbl@recatcode#1{%
\@tempcnta="7F
\def\bbl@tempa{%
@@ -844,118 +869,128 @@
\def\StartBabelCommands{%
\begingroup
\bbl@recatcode{11}%
- \def\bbl@scuse{%
- \ifx\bbl@opt@strings\@nnil\def\bbl@opt@strings{generic}\fi}%
- \def\UseStrings{\bbl@scuse\aftergroup\bbl@scuse}%
\def\SetStringLoop{\afterassignment\bbl@sclp\def\bbl@templ####1}%
\def\bbl@sclp##1{%
- \count@\z@ % dangerous if a hook is used
+ \def\bbl@tempk{\@ne}%
\@for\bbl@tempm:=##1\do{%
- \advance\count@\@ne
+ \count@\bbl@tempk\relax % Because of stringprocess event
\toks@\expandafter{\bbl@tempm}%
\edef\bbl@tempn{%
\expandafter\noexpand
- \csname\bbl@templ{\romannumeral\count@}\endcsname%
- {\the\toks@}}%
+ \csname\bbl@templ{\romannumeral\count@}\endcsname{\the\toks@}}%
+ \advance\count@\@ne
+ \edef\bbl@tempk{\the\count@}%
\expandafter\SetString\bbl@tempn}}%
- \def\SetCase{%
- \@ifundefined{bbl@tolower}{%
- \g@addto@macro\@uclclist{%
- \reserved@b{\reserved@b\@gobble}% stops processing the list
- \@ifundefined{\languagename @bbl@uclc}% and resumes it
- {\reserved@a}%
- {\csname\languagename @bbl@uclc\endcsname}%
- {\bbl@tolower\@empty}{\bbl@toupper\@empty}}%
- \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}%
- \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}{}%
- \let\SetCase\bbl@setcase
- \SetCase}%
- \def\bbl@provstring##1{%
- \@ifundefined{\expandafter\@gobble\string##1}{\gdef##1}\@gobble}%
- \def\bbl@dftstring##1##2{%
- \@dec@text@cmd\gdef##1?{##2}%
- \global\let##1##1}%
- \def\bbl@encstring##1##2{%
- \bbl@for\bbl@tempc\bbl@sc@fontenc{%
- \@ifundefined{T@\bbl@tempc}%
- \@empty
- {\@dec@text@cmd\gdef##1\bbl@tempc{##2}%
- \global\let##1##1}}}%
+ \newcommand\SetCase[3][]{%
+ \bbl@patchuclc
+ \bbl@forlang\bbl@tempa{%
+ \expandafter\bbl@stringdef
+ \csname\bbl@tempa @bbl@uclc\endcsname{\reserved@a##1}%
+ \expandafter\bbl@stringdef
+ \csname\bbl@tempa @bbl@uc\endcsname{##2}%
+ \expandafter\bbl@stringdef
+ \csname\bbl@tempa @bbl@lc\endcsname{##3}}}%
+ \def\bbl@provstring##1##2{%
+ \providecommand##1{##2}%
+ \bbl@toglobal##1}%
+ \global\let\bbl@scafter\@empty
\let\StartBabelCommands\bbl@startcmds
+ \ifx\BabelLanguages\relax
+ \let\BabelLanguages\CurrentOption
+ \fi
\begingroup
\let\bbl@screset\@nnil % local flag - disable 1st stopcommands
\StartBabelCommands}
-\def\bbl@startcmds#1#2{%
+\def\bbl@startcmds{%
\ifx\bbl@screset\@nnil\else
\bbl@usehooks{stopcommands}{}%
\fi
\endgroup
\begingroup
+ \@ifstar
+ {\ifx\bbl@opt@strings\@nnil
+ \let\bbl@opt@strings\BabelStringsDefault
+ \fi
+ \bbl@startcmds@i}%
+ \bbl@startcmds@i}
+\def\bbl@startcmds@i#1#2{%
\edef\bbl@L{\zap@space#1 \@empty}%
\edef\bbl@G{\zap@space#2 \@empty}%
- \let\bbl@sc@charset\space
- \let\bbl@sc@fontenc\space
+ \bbl@startcmds@ii}
+\newcommand\bbl@startcmds@ii[1][\@empty]{%
\let\SetString\@gobbletwo
\let\bbl@stringdef\@gobbletwo
- \bbl@startcmds@i}
-\newcommand\bbl@startcmds@i[1][\@empty]{%
+ \let\AfterBabelCommands\@gobble
\ifx\@empty#1%
\def\bbl@sc@label{generic}%
- \bbl@scswitch{%
- \ifx\bbl@opt@strings\@nnil
- \let\bbl@stringdef\bbl@dftstring
- \else\ifx\bbl@opt@strings\relax
- \let\SetString\bbl@setstring
- \let\bbl@stringdef\bbl@dftstring
- \else
- \let\SetString\bbl@setstring
- \let\bbl@stringdef\bbl@provstring
- \fi\fi}%
- \@expandtwoargs
- \bbl@usehooks{defaultcommands}{}%
+ \def\bbl@encstring##1##2{%
+ \ProvideTextCommandDefault##1{##2}%
+ \bbl@toglobal##1%
+ \expandafter\bbl@toglobal\csname\string?\string##1\endcsname}%
+ \let\bbl@sctest\in@true
\else
+ \let\bbl@sc@charset\space % <- zapped below
+ \let\bbl@sc@fontenc\space % <- " "
\def\bbl@tempa##1=##2\@nil{%
\bbl@csarg\edef{sc@\zap@space##1 \@empty}{##2 }}%
\bbl@for\bbl@tempb{label=#1}{\expandafter\bbl@tempa\bbl@tempb\@nil}%
- \def\bbl@tempa##1 ##2{%
+ \def\bbl@tempa##1 ##2{% space -> comma
##1%
\ifx\@empty##2\else\ifx,##1,\else,\fi\bbl@afterfi\bbl@tempa##2\fi}%
\edef\bbl@sc@fontenc{\expandafter\bbl@tempa\bbl@sc@fontenc\@empty}%
\edef\bbl@sc@label{\expandafter\zap@space\bbl@sc@label\@empty}%
\edef\bbl@sc@charset{\expandafter\zap@space\bbl@sc@charset\@empty}%
- \bbl@scswitch{%
- \ifx\bbl@opt@strings\@nnil
- \let\bbl@stringdef\bbl@encstring
- \else\ifx\bbl@opt@strings\relax
- \let\SetString\bbl@setstring
- \let\bbl@stringdef\bbl@encstring
- \else
+ \def\bbl@encstring##1##2{%
+ \bbl@for\bbl@tempc\bbl@sc@fontenc{%
+ \@ifundefined{T@\bbl@tempc}%
+ {}%
+ {\ProvideTextCommand##1\bbl@tempc{##2}%
+ \bbl@toglobal##1%
+ \expandafter
+ \bbl@toglobal\csname\bbl@tempc\string##1\endcsname}}}%
+ \def\bbl@sctest{%
\@expandtwoargs
- \in@{,\bbl@opt@strings,}{,\bbl@sc@label,\bbl@sc@fontenc,}%
- \ifin@
- \let\SetString\bbl@setstring
- \let\bbl@stringdef\bbl@provstring
- \fi\fi\fi}%
+ \in@{,\bbl@opt@strings,}{,\bbl@sc@label,\bbl@sc@fontenc,}}%
+ \fi
+ \bbl@scswitch{%
+ \ifx\bbl@opt@strings\@nnil % ie, no strings
+ \let\bbl@stringdef\bbl@encstring % for \SetCase
+ \else\ifx\bbl@opt@strings\relax % ie, strings with no value
+ \let\AfterBabelCommands\bbl@aftercmds
+ \let\SetString\bbl@setstring
+ \let\bbl@stringdef\bbl@encstring
+ \else % ie, strings=value
+ \bbl@sctest
+ \ifin@
+ \let\AfterBabelCommands\bbl@aftercmds
+ \let\SetString\bbl@setstring
+ \let\bbl@stringdef\bbl@provstring
+ \fi\fi\fi}%
+ \ifx\@empty#1%
+ \@expandtwoargs
+ \bbl@usehooks{defaultcommands}{}%
+ \else
\@expandtwoargs
\bbl@usehooks{encodedcommands}{{\bbl@sc@charset}{\bbl@sc@fontenc}}%
\fi}
+\def\bbl@forlang#1#2{%
+ \bbl@for#1\bbl@L{%
+ \@expandtwoargs\in@{,#1,}{,\BabelLanguages,}%
+ \ifin@#2\fi}}
\def\bbl@scswitch#1{%
- \@expandtwoargs\in@{,\CurrentOption,}{,\bbl@L,}%
- \ifin@
- \let\bbl@L\CurrentOption
- #1\relax
- \bbl@scswitch@i
+ #1\relax
+ \bbl@scswitch@i
+ \bbl@forlang\bbl@tempa{%
\ifx\bbl@G\@empty\else
\ifx\SetString\@gobbletwo\else
- \edef\bbl@GL{\bbl@G\bbl@L}%
+ \edef\bbl@GL{\bbl@G\bbl@tempa}%
\@expandtwoargs\in@{,\bbl@GL,}{,\bbl@screset,}%
\ifin@\else
\global\expandafter\let\csname\bbl@GL\endcsname\@undefined
\xdef\bbl@screset{\bbl@screset,\bbl@GL}%
\fi
\fi
- \fi
- \fi}
+ \fi}}
\def\bbl@scswitch@i{%
\ifx\bbl@G\@empty
\def\SetString##1##2{%
@@ -963,15 +998,18 @@
{You must assign strings to some category, typically\\%
captions or extras, but you set none}}%
\fi}
-\AtEndOfPackage{\def\bbl@scswitch#1{#1\relax\bbl@scswitch@i}}
+\AtEndOfPackage{%
+ \def\bbl@scswitch#1{#1\relax\bbl@scswitch@i}%
+ \def\bbl@forlang#1#2{\bbl@for#1\bbl@L{\@ifundefined{date#1}{}{#2}}}}
\@onlypreamble\EndBabelCommands
\def\EndBabelCommands{%
\bbl@usehooks{stopcommands}{}%
\endgroup
- \endgroup}
+ \endgroup
+ \bbl@scafter}
\def\bbl@scset#1#2{\def#1{#2}}
\def\bbl@setstring#1#2{%
- \bbl@for\bbl@tempa\bbl@L{%
+ \bbl@forlang\bbl@tempa{%
\edef\bbl@LC{\bbl@tempa\expandafter\@gobble\string#1}%
\@ifundefined{\bbl@LC}% eg, \germanchaptername
{\global\expandafter
@@ -982,14 +1020,40 @@
\bbl@usehooks{stringprocess}{}%
\expandafter\bbl@stringdef
\csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}}
-\newcommand\bbl@setcase[3][]{%
- \bbl@for\bbl@tempa\bbl@L{%
+\def\SetHyphenMap#1{%
+ \bbl@forlang\bbl@tempa{%
\expandafter\bbl@stringdef
- \csname\bbl@tempa @bbl@uclc\endcsname{\reserved@a#1}%
- \expandafter\bbl@stringdef
- \csname\bbl@tempa @bbl@uc\endcsname{#2}%
- \expandafter\bbl@stringdef
- \csname\bbl@tempa @bbl@lc\endcsname{#3}}}
+ \csname\bbl@tempa @bbl@hyphenmap\endcsname{#1}}}
+\AtEndOfPackage{%
+ \ifx\bbl@hymapopt\@undefined
+ \@expandtwoargs\in@{,}{\bbl@language@opts}%
+ \chardef\bbl@hymapopt\ifin@4\else\@ne\fi
+ \fi}
+\newcommand\BabelLower[2]{% one to one.
+ \ifnum\lccode#1=#2\else
+ \babel@savevariable{\lccode#1}%
+ \lccode#1=#2\relax
+ \fi}
+\newcommand\BabelLowerMM[4]{% many-to-many
+ \@tempcnta=#1\relax
+ \@tempcntb=#4\relax
+ \def\bbl@tempa{%
+ \ifnum\@tempcnta>#2\else
+ \@expandtwoargs\BabelLower{\the\@tempcnta}{\the\@tempcntb}%
+ \advance\@tempcnta#3\relax
+ \advance\@tempcntb#3\relax
+ \expandafter\bbl@tempa
+ \fi}%
+ \bbl@tempa}
+\newcommand\BabelLowerMO[4]{% many-to-one
+ \@tempcnta=#1\relax
+ \def\bbl@tempa{%
+ \ifnum\@tempcnta>#2\else
+ \@expandtwoargs\BabelLower{\the\@tempcnta}{#4}%
+ \advance\@tempcnta#3
+ \expandafter\bbl@tempa
+ \fi}%
+ \bbl@tempa}
\def\AddBabelHook#1#2{%
\@ifundefined{bbl@hk@#1}{\EnableBabelHook{#1}}{}%
\def\bbl@tempa##1,#2=##2,##3\@empty{\def\bbl@tempb{##2}}%
@@ -1010,12 +1074,10 @@
adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
hyphenation=2}
-\ifx\directlua\@undefined
- \ifx\XeTeXinputencoding\@undefined\else
- \input xebabel.def
- \fi
-\else
+\ifcase\bbl@engine\or
\input luababel.def
+\or
+ \input xebabel.def
\fi
{\def\format{lplain}
\ifx\fmtname\format
@@ -1084,7 +1146,7 @@
}{}}
\bbl@redefine\nocite#1{%
\@safe@activestrue\org@nocite{#1}\@safe@activesfalse}
- \bbl@redefine\bibcite{%
+ \bbl@redefine\bibcite{%
\bbl@cite@choice
\bibcite}
\def\bbl@bibcite#1#2{%