diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 165 |
1 files changed, 140 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 815dedaecb6..3a3c0248835 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}[2017/05/19 v3.10 The Babel package] +%%\ProvidesFile{babel.dtx}[2017/06/26 v3.11 The Babel package] %% Babel package for LaTeX2e. %% Copyright (C) 1989-2008 by Johannes Braams, %% TeXniek @@ -56,7 +56,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2017/05/19 3.10 Babel common definitions] +\ProvidesFile{babel.def}[2017/06/26 3.11 Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -67,10 +67,7 @@ \let\bbl@afterlang\relax \let\bbl@language@opts\@empty \fi -\def\bbl@tempa{3.10}% -\ifx\bbl@version\bbl@tempa\else - \input switch.def\relax -\fi +\input switch.def\relax \ifx\bbl@languages\@undefined \ifx\directlua\@undefined \openin1 = language.def @@ -265,7 +262,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,initiateactive=3,afterreset=0} + hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0} \newcommand\babelensure[2][]{% TODO - revise test files \AddBabelHook{babel-ensure}{afterextras}{% \ifcase\bbl@select@type @@ -1286,8 +1283,7 @@ {If you want to modify `#2' you must tell how in\\% the optional argument. Currently there are two\\% options: captions=lang-tag, hyphenrules=lang-list}% - {Use this macro as documented} -}% + {Use this macro as documented}}% {\bbl@provide@renew{#2}}}% \babelensure{#2}% \let\languagename\bbl@savelangname} @@ -1419,6 +1415,34 @@ \bbl@exportkey{sname}{script.name}{#1}{#2}% \bbl@exportkey{sbcp}{script.tag.bcp47}{#1}{#2}% \bbl@exportkey{sotf}{script.tag.opentype}{#1}{#2}} +\newcommand\BabelDateSpace{\nobreakspace{}} +\newcommand\BabelDateDot{.\@} +\newcommand\BabelDated[1]{{\number#1}} +\newcommand\BabelDatedd[1]{{\ifnum#1<10 0\fi\number#1}} +\newcommand\BabelDateM[1]{{\number#1}} +\newcommand\BabelDateMM[1]{{\ifnum#1<10 0\fi\number#1}} +\newcommand\BabelDateMMMM[1]{{% + \csname month\romannumeral\month name\endcsname}}% +\newcommand\BabelDatey[1]{{\number#1}}% +\newcommand\BabelDateyy[1]{{% + \ifnum#1<10 0\number#1 % + \else\ifnum#1<100 \number#1 % + \else\ifnum#1<1000 \expandafter\@gobble\number#1 % + \else\ifnum#1<10000 \expandafter\@gobbletwo\number#1 % + \else\ERRORd % TODO - real error + \fi\fi\fi\fi}} +\newcommand\BabelDateyyyy[1]{{\number#1}} +\def\bbl@TG@@date{% + \bbl@replace\bbl@toreplace{[ ]}{\BabelDateSpace{}}% + \bbl@replace\bbl@toreplace{[.]}{\BabelDateDot{}}% + \bbl@replace\bbl@toreplace{[d]}{\BabelDated{####3}}% + \bbl@replace\bbl@toreplace{[dd]}{\BabelDatedd{####3}}% + \bbl@replace\bbl@toreplace{[M]}{\BabelDateM{####2}}% + \bbl@replace\bbl@toreplace{[MM]}{\BabelDateMM{####2}}% + \bbl@replace\bbl@toreplace{[MMMM]}{\BabelDateMMMM{####2}}% + \bbl@replace\bbl@toreplace{[y]}{\BabelDatey{####1}}% + \bbl@replace\bbl@toreplace{[yy]}{\BabelDateyy{####1}}% + \bbl@replace\bbl@toreplace{[yyyy]}{\BabelDateyyyy{####1}}} \ifx\bbl@opt@safe\@empty\else \def\@newl@bel#1#2#3{% {\@safe@activestrue @@ -1647,6 +1671,113 @@ \else \DeclareTextFontCommand{\textlatin}{\latintext} \fi +\def\bbl@trtscripts{% + ,Arabic,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,% + Old Hungarian,Old Hungarian,Lydian,Mandaean,Manichaean,% + Manichaean,Meroitic Cursive,Meroitic,Old North Arabian,% + Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,% + Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,% + Old South Arabian,Syriac,Thaana,}% +\def\bbl@ensuredir{% + \@expandtwoargs + \in@{\csname bbl@script@\languagename\endcsname}{\bbl@trtscripts}% + \ifin@ + \bbl@setdirs\@ne + \else + \bbl@setdirs\z@ + \fi} +\def\bbl@setdirs#1{% TODO - math + \ifcase\bbl@select@type % TODO - strictly, not the right test + \bbl@pagedir{#1}% + \bbl@bodydir{#1}% + \bbl@pardir{#1}% + \fi + \bbl@textdir{#1}} +\ifcase\bbl@engine +\or + \AddBabelHook{babel-bidi}{afterextras}{\bbl@ensuredir} + \DisableBabelHook{babel-bidi} + \def\bbl@getluadir#1{% + \directlua{ + if tex.#1dir == 'TLT' then + tex.sprint('0') + elseif tex.#1dir == 'TRT' then + tex.sprint('1') + end}} + \def\bbl@setdir#1#2#3{% 1=text/par.. 2=\textdir.. 3=0 lr/1 rl + \ifcase#3\relax + \ifcase\bbl@getluadir{#1}\relax\else + #2 TLT\relax + \fi + \else + \ifcase\bbl@getluadir{#1}\relax + #2 TRT\relax + \fi + \fi} + \def\bbl@textdir{\bbl@setdir{text}\textdir}% TODO - ?\linedir + \def\bbl@pardir{\bbl@setdir{par}\pardir} + \def\bbl@bodydir{\bbl@setdir{body}\bodydir} + \def\bbl@pagedir{\bbl@setdir{page}\pagedir} + \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% +\or + \AddBabelHook{babel-bidi}{afterextras}{\bbl@ensuredir} + \DisableBabelHook{babel-bidi} + \newcount\bbl@dirlevel + \chardef\bbl@thetextdir\z@ + \chardef\bbl@thepardir\z@ + \def\bbl@textdir#1{% + \ifcase#1\relax + \chardef\bbl@thetextdir\z@ + \bbl@textdir@i\beginL\endL + \else + \chardef\bbl@thetextdir\@ne + \bbl@textdir@i\beginR\endR + \fi} + \def\bbl@textdir@i#1#2{% + \ifhmode + \ifnum\currentgrouplevel>\z@ + \ifnum\currentgrouplevel=\bbl@dirlevel + \bbl@error{Multiple bidi settings inside a group}% + {I'll insert a new group, but expect wrong results.}% + \bgroup\aftergroup#2\aftergroup\egroup + \else + \ifcase\currentgrouptype\or % 0 bottom + \aftergroup#2% 1 simple {} + \or + \bgroup\aftergroup#2\aftergroup\egroup % 2 hbox + \or + \bgroup\aftergroup#2\aftergroup\egroup % 3 adj hbox + \or\or\or % vbox vtop align + \or + \bgroup\aftergroup#2\aftergroup\egroup % 7 noalign + \or\or\or\or\or\or % output math disc insert vcent mathchoice + \or + \aftergroup#2% 14 \begingroup + \else + \bgroup\aftergroup#2\aftergroup\egroup % 15 adj + \fi + \fi + \bbl@dirlevel\currentgrouplevel + \fi + #1% + \fi} + \def\bbl@pardir#1{\chardef\bbl@thepardir#1\relax} + \let\bbl@bodydir\@gobble + \let\bbl@pagedir\@gobble + \def\bbl@dirparastext{\chardef\bbl@thepardir\bbl@thetextdir} + \def\bbl@xebidipar{% + \let\bbl@xebidipar\relax + \TeXXeTstate\@ne + \def\bbl@xeeverypar{% + \ifcase\bbl@thepardir\else + {\setbox\z@\lastbox\beginR\box\z@}% + \fi + \ifcase\bbl@thetextdir\else\beginR\fi}% + \let\bbl@severypar\everypar + \newtoks\everypar + \everypar=\bbl@severypar + \bbl@severypar{\bbl@xeeverypar\the\everypar}} +\fi \ifx\loadlocalcfg\@undefined \@ifpackagewith{babel}{noconfigs}% {\let\loadlocalcfg\@gobble}% @@ -1669,22 +1800,6 @@ \endgroup \if@nobreak\ifvmode\nobreak\fi\fi} \fi -%% -%% \CharacterTable -%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} \endinput %% %% End of file `babel.def'. |