diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 204 |
1 files changed, 173 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 23c13db2653..d21eae211a7 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -38,12 +38,12 @@ %% 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/12/03 v3.9h The Babel package] +%%\ProvidesFile{babel.dtx}[2014/03/15 v3.9i The Babel package] %% Babel package for LaTeX2e. -%% Copyright (C) 1989 -- 2008 by Johannes Braams, +%% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek %% all rights reserved. -%% Copyright (C) 2013 by Johannes Braams +%% Copyright (C) 2013-2014 by Johannes Braams %% TeXniek %% by Javier Bezos %% all rights reserved. @@ -56,15 +56,31 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2013/12/03 3.9h Babel common definitions] +\ProvidesFile{babel.def}[2014/03/15 3.9i Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi -\def\bbl@tempa{3.9h}% +\def\bbl@tempa{3.9i}% \ifx\bbl@version\bbl@tempa\else \input switch.def\relax \fi -\def\bbl@for#1#2#3{\@for#1:=#2\do{\ifx#1\@empty\else#3\fi}} +\ifx\bbl@languages\@undefined + \openin1 = language.def + \ifeof1 + \closein1 + \message{I couldn't find the file language.def} + \else + \closein1 + \def\addlanguage#1#2#3#4#5{% + \expandafter\ifx\csname lang@#1\endcsname\relax\else + \global\expandafter\let\csname l@#1\expandafter\endcsname + \csname lang@#1\endcsname + \fi}% + \input language.def + \fi + \chardef\l@english\lang@USenglish +\fi +\def\bbl@for#1#2#3{\bbl@loopx#1{#2}{\ifx#1\@empty\else#3\fi}} \def\bbl@add#1#2{% \@ifundefined{\expandafter\@gobble\string#1}% {\def#1{#2}}% @@ -72,6 +88,12 @@ \def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% \long\def\bbl@afterelse#1\else#2\fi{\fi#1} \long\def\bbl@afterfi#1\fi{\fi#1} +\def\bbl@loop#1#2#3{\bbl@@loop#1{#3}#2,\@nnil,} +\def\bbl@loopx#1#2{\expandafter\bbl@loop\expandafter#1\expandafter{#2}} +\def\bbl@@loop#1#2#3,{% + \ifx\@nnil#3\relax\else + \def#1{#3}#2\bbl@afterfi\bbl@@loop#1{#2}% + \fi} \ifx\bbl@opt@strings\@undefined \def\bbl@opt@safe{BR} \let\bbl@opt@strings\@nnil @@ -79,6 +101,7 @@ \fi \ifx\BabelModifiers\@undefined\let\BabelModifiers\relax\fi \ifx\bbl@afterlang\@undefined\let\bbl@afterlang\relax\fi +\ifx\bbl@language@opts\@undefined\let\bbl@language@opts\@empty\fi \providecommand\AfterBabelLanguage[2]{} \def\bbl@csarg#1#2{\expandafter#1\csname bbl@#2\endcsname}% \chardef\bbl@engine=% @@ -119,6 +142,41 @@ \fi \expandafter\def\csname\bbl@tempa\space\endcsname} \@onlypreamble\bbl@redefinerobust +\newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,} +\let\org@TeX\TeX +\let\org@LaTeX\LaTeX +\let\ensureascii\@firstofone +\AtBeginDocument{% + \in@false + \bbl@loopx\bbl@tempa\BabelNonASCII{% is there a non-ascii enc? + \ifin@\else + \edef\bbl@tempb{{,\bbl@tempa enc.def,}{,\@filelist,}}% + \lowercase\expandafter{\expandafter\in@\bbl@tempb}% + \fi} + \ifin@ % if a non-ascii has been loaded + \def\ensureascii#1{{\fontencoding{OT1}\selectfont#1}}% + \DeclareTextCommandDefault{\TeX}{\org@TeX}% + \DeclareTextCommandDefault{\LaTeX}{\org@LaTeX}% + \def\bbl@tempb#1\@@{\uppercase{\bbl@tempc#1}ENC.DEF\@empty\@@}% + \def\bbl@tempc#1ENC.DEF#2\@@{% + \ifx\@empty#2\else + \@ifundefined{T@#1}% + {}% + {\@expandtwoargs\in@{,#1,}{,\BabelNonASCII,}% + \ifin@ + \DeclareTextCommand{\TeX}{#1}{\ensureascii{\org@TeX}}% + \DeclareTextCommand{\LaTeX}{#1}{\ensureascii{\org@LaTeX}}% + \else + \def\ensureascii##1{{\fontencoding{#1}\selectfont##1}}% + \fi}% + \fi}% + \bbl@loopx\bbl@tempa\@filelist{\expandafter\bbl@tempb\bbl@tempa\@@}% + \@expandtwoargs\in@{,\cf@encoding,}{,\BabelNonASCII,}% + \ifin@\else + \edef\ensureascii#1{{% + \noexpand\fontencoding{\cf@encoding}\noexpand\selectfont#1}}% + \fi + \fi} \AtEndOfPackage{\edef\latinencoding{\cf@encoding}} \AtBeginDocument{% \gdef\latinencoding{OT1}% @@ -136,6 +194,60 @@ \else \DeclareTextFontCommand{\textlatin}{\latintext} \fi +\newcommand\babelensure[2][]{% + \AddBabelHook{babel-ensure}{afterextras}{% + \ifcase\bbl@select@type + \@nameuse{bbl@e@\languagename}% + \fi} + \begingroup + \let\bbl@ens@include\@empty + \let\bbl@ens@exclude\@empty + \def\bbl@ens@fontenc{\relax}% + \def\bbl@tempb##1{% + \ifx\@empty##1\else\noexpand##1\expandafter\bbl@tempb\fi}% + \edef\bbl@tempa{\bbl@tempb#1\@empty}% + \def\bbl@tempb##1=##2\@@{\@namedef{bbl@ens@##1}{##2}}% + \bbl@for\bbl@tempa\bbl@tempa{\expandafter\bbl@tempb\bbl@tempa\@@}% + \def\bbl@tempc{\bbl@ensure} + \expandafter\bbl@add\expandafter\bbl@tempc\expandafter{% + \expandafter{\bbl@ens@include}}% + \expandafter\bbl@add\expandafter\bbl@tempc\expandafter{% + \expandafter{\bbl@ens@exclude}}% + \toks@\expandafter{\bbl@tempc}% + \edef\x{% + \endgroup + \noexpand\@namedef{bbl@e@#2}{\the\toks@{\bbl@ens@fontenc}}} + \x} +\def\bbl@ensure#1#2#3{% + \def\bbl@tempb##1{% + \ifx##1\@empty\else + \in@{##1}{#2}% + \ifin@\else + \toks@\expandafter{##1}% + \edef##1{% + \noexpand\foreignlanguage{\languagename}% + {\ifx\relax#3\else + \noexpand\fontencoding{#3}\noexpand\selectfont + \fi + \the\toks@}}% + \fi + \expandafter\bbl@tempb + \fi}% + \expandafter\bbl@tempb\bbl@ensured\@empty + \def\bbl@tempa##1{% + \ifx##1\@empty\else + \expandafter\in@\expandafter\foreignlanguage\expandafter{##1}% + \ifin@\else + \bbl@tempb##1\@empty + \fi + \expandafter\bbl@tempa + \fi}% + \bbl@tempa#1\@empty} +\def\bbl@ensured{% + \prefacename\refname\abstractname\bibname\chaptername\appendixname + \contentsname\listfigurename\listtablename\indexname\figurename + \tablename\partname\enclname\ccname\headtoname\pagename\seename + \alsoname\proofname\glossaryname\today} \def\LdfInit#1#2{% \chardef\atcatcode=\catcode`\@ \catcode`\@=11\relax @@ -269,9 +381,11 @@ \expandafter\noexpand\csname normal@char#2\endcsname \noexpand\else \noexpand\expandafter - \expandafter\noexpand\csname user@active#2\endcsname + \expandafter\noexpand\csname bbl@doactive#2\endcsname \noexpand\fi}% {\expandafter\noexpand\csname normal@char#2\endcsname}}% + \bbl@csarg\edef{doactive#2}{% + \expandafter\noexpand\csname user@active#2\endcsname}% \bbl@csarg\edef{active@#2}{% \noexpand\active@prefix\noexpand#1% \expandafter\noexpand\csname active@char#2\endcsname}% @@ -289,7 +403,8 @@ \if\string'#2% \let\prim@s\bbl@prim@s \let\active@math@prime#1% - \fi} + \fi + \bbl@usehooks{initiateactive}{{#1}{#2}{#3}}} \@ifpackagewith{babel}{KeepShorthandsActive}% {\let\bbl@restoreactive\@gobble}% {\def\bbl@restoreactive#1{% @@ -487,9 +602,6 @@ \pr@@@s {\bbl@if@primes*^\pr@@@t\egroup}}} \endgroup -\initiate@active@char{~} -\declare@shorthand{system}{~}{\leavevmode\nobreak\ } -\bbl@activate{~} \expandafter\def\csname OT1dqpos\endcsname{127} \expandafter\def\csname T1dqpos\endcsname{4} \ifx\f@encoding\@undefined @@ -499,7 +611,7 @@ \def\bbl@tempc{#1}% \bbl@fixname\bbl@tempc \bbl@iflanguage\bbl@tempc{% - \@for\bbl@attr:=#2\do{% + \bbl@loopx\bbl@attr{#2}{% \ifx\bbl@known@attribs\@undefined \in@false \else @@ -556,7 +668,7 @@ } \def\bbl@ifknown@ttrib#1#2{% \let\bbl@tempa\@secondoftwo - \@for\bbl@tempb:=#2\do{% + \bbl@loopx\bbl@tempb{#2}{% \expandafter\in@\expandafter{\expandafter,\bbl@tempb,}{,#1,}% \ifin@ \let\bbl@tempa\@firstoftwo @@ -566,7 +678,7 @@ } \def\bbl@clear@ttribs{% \ifx\bbl@attributes\@undefined\else - \@for\bbl@tempa:=\bbl@attributes\do{% + \bbl@loopx\bbl@tempa{\bbl@attributes}{% \expandafter\bbl@clear@ttrib\bbl@tempa. }% \let\bbl@attributes\@undefined @@ -611,6 +723,20 @@ \xdef#1{\the\toks@}}% \fi \fi} +\def\babeltags#1{% + \edef\bbl@tempa{\zap@space#1 \@empty}% + \def\bbl@tempb##1=##2\@@{% + \edef\bbl@tempc{% + \noexpand\newcommand + \expandafter\noexpand\csname ##1\endcsname{% + \noexpand\protect + \expandafter\noexpand\csname otherlanguage*\endcsname{##2}} + \noexpand\newcommand + \expandafter\noexpand\csname text##1\endcsname{% + \noexpand\foreignlanguage{##2}}} + \bbl@tempc}% + \bbl@for\bbl@tempa\bbl@tempa{% + \expandafter\bbl@tempb\bbl@tempa\@@}} \@onlypreamble\babelhyphenation \AtEndOfPackage{% \newcommand\babelhyphenation[2][\@empty]{% @@ -636,7 +762,7 @@ {\csname bbl@hyphenation@\bbl@tempa\endcsname\space}% #2}}}% \fi}} -\def\bbl@allowhyphens{\nobreak\hskip\z@skip} +\def\bbl@allowhyphens{\ifvmode\else\nobreak\hskip\z@skip\fi} \def\bbl@t@one{T1} \def\allowhyphens{\ifx\cf@encoding\bbl@t@one\else\bbl@allowhyphens\fi} \newcommand\babelnullhyphen{\char\hyphenchar\font} @@ -847,6 +973,7 @@ \@ifundefined{bbl@tolower}{% \g@addto@macro\@uclclist{% \reserved@b{\reserved@b\@gobble}% stops processing the list + \let\bbl@encoded\bbl@encoded@uclc \@ifundefined{\languagename @bbl@uclc}% and resumes it {\reserved@a}% {\csname\languagename @bbl@uclc\endcsname}% @@ -873,13 +1000,13 @@ \def\SetStringLoop##1##2{% \def\bbl@templ####1{\expandafter\noexpand\csname##1\endcsname}% \count@\z@ - \@for\bbl@tempa:=\@empty##2\do{% \@empty "undoes" \expandafter - \advance\count@\@ne - \toks@\expandafter{\bbl@tempa}% - \edef\bbl@tempb{% - \bbl@templ{\romannumeral\count@}{\the\toks@}% - \count@=\the\count@\relax}% - \expandafter\SetString\bbl@tempb}}% + \bbl@loop\bbl@tempa{##2}{% + \advance\count@\@ne + \toks@\expandafter{\bbl@tempa}% + \edef\bbl@tempb{% + \bbl@templ{\romannumeral\count@}{\the\toks@}% + \count@=\the\count@\relax}% + \expandafter\SetString\bbl@tempb}}% \newcommand\SetCase[3][]{% \bbl@patchuclc \bbl@forlang\bbl@tempa{% @@ -951,8 +1078,8 @@ \@expandtwoargs \in@{,\bbl@opt@strings,}{,\bbl@sc@label,\bbl@sc@fontenc,}}% \fi - \ifx\bbl@opt@strings\@nnil % ie, no strings -> defaults - \else\ifx\bbl@opt@strings\relax % ie, strings with no value + \ifx\bbl@opt@strings\@nnil % ie, no strings key -> defaults + \else\ifx\bbl@opt@strings\relax % ie, strings=encoded \let\AfterBabelCommands\bbl@aftercmds \let\SetString\bbl@setstring \let\bbl@stringdef\bbl@encstring @@ -1002,7 +1129,6 @@ \endgroup \endgroup \bbl@scafter} -\def\bbl@scset#1#2{\def#1{#2}} \def\bbl@setstring#1#2{% \bbl@forlang\bbl@tempa{% \edef\bbl@LC{\bbl@tempa\expandafter\@gobble\string#1}% @@ -1015,6 +1141,24 @@ \bbl@usehooks{stringprocess}{}% \expandafter\bbl@stringdef \csname\bbl@LC\expandafter\endcsname\expandafter{\BabelString}}} +\ifx\bbl@opt@strings\relax + \def\bbl@scset#1#2{\def#1{\bbl@encoded#2}} + \bbl@patchuclc +\else + \def\bbl@scset#1#2{\def#1{#2}} +\fi +\let\bbl@encoded\relax +\def\bbl@encoded@uclc#1{% + \@inmathwarn#1% + \expandafter\ifx\csname\cf@encoding\string#1\endcsname\relax + \expandafter\ifx\csname ?\string#1\endcsname\relax + \TextSymbolUnavailable#1% + \else + \csname ?\string#1\endcsname + \fi + \else + \csname\cf@encoding\string#1\endcsname + \fi} \def\SetHyphenMap#1{% \bbl@forlang\bbl@tempa{% \expandafter\bbl@stringdef @@ -1068,7 +1212,7 @@ everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,% adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,% beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,% - hyphenation=2} + hyphenation=2,initiateactive=3,afterreset=0} \ifcase\bbl@engine\or \input luababel.def \or @@ -1275,11 +1419,6 @@ \closeout15 } \@onlypreamble\substitutefontfamily -\bbl@redefine\TeX{\textlatin{\org@TeX}} -\bbl@redefine\LaTeX{\textlatin{\org@LaTeX}} -\bbl@add\nfss@catcodes{% - \@makeother\'% - \@makeother\"} \ifx\loadlocalcfg\@undefined \@ifpackagewith{babel}{noconfigs}% {\let\loadlocalcfg\@gobble}% @@ -1302,6 +1441,9 @@ \endgroup \if@nobreak\ifvmode\nobreak\fi\fi} \fi +\initiate@active@char{~} +\declare@shorthand{system}{~}{\leavevmode\nobreak\ } +\bbl@activate{~} \ifx\l@english\@undefined \chardef\l@english\z@ \fi |