diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 2500bdb4a0c..02e3a8c8f6d 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -41,7 +41,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2019/06/03 3.32 Babel common definitions] +\ProvidesFile{babel.def}[2019/07/19 3.33 Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -265,22 +265,25 @@ \@namedef{\bbl@tempa\space}} \@onlypreamble\bbl@redefinerobust \bbl@trace{Hooks} -\def\AddBabelHook#1#2{% - \bbl@ifunset{bbl@hk@#1}{\EnableBabelHook{#1}}{}% - \def\bbl@tempa##1,#2=##2,##3\@empty{\def\bbl@tempb{##2}}% - \expandafter\bbl@tempa\bbl@evargs,#2=,\@empty - \bbl@ifunset{bbl@ev@#1@#2}% - {\bbl@csarg\bbl@add{ev@#2}{\bbl@elt{#1}}% - \bbl@csarg\newcommand}% - {\bbl@csarg\let{ev@#1@#2}\relax - \bbl@csarg\newcommand}% - {ev@#1@#2}[\bbl@tempb]} -\def\EnableBabelHook#1{\bbl@csarg\let{hk@#1}\@firstofone} -\def\DisableBabelHook#1{\bbl@csarg\let{hk@#1}\@gobble} +\newcommand\AddBabelHook[3][]{% + \bbl@ifunset{bbl@hk@#2}{\EnableBabelHook{#2}}{}% + \def\bbl@tempa##1,#3=##2,##3\@empty{\def\bbl@tempb{##2}}% + \expandafter\bbl@tempa\bbl@evargs,#3=,\@empty + \bbl@ifunset{bbl@ev@#2@#3@#1}% + {\bbl@csarg\bbl@add{ev@#3@#1}{\bbl@elt{#2}}}% + {\bbl@csarg\let{ev@#2@#3@#1}\relax}% + \bbl@csarg\newcommand{ev@#2@#3@#1}[\bbl@tempb]} +\newcommand\EnableBabelHook[1]{\bbl@csarg\let{hk@#1}\@firstofone} +\newcommand\DisableBabelHook[1]{\bbl@csarg\let{hk@#1}\@gobble} \def\bbl@usehooks#1#2{% \def\bbl@elt##1{% - \@nameuse{bbl@hk@##1}{\@nameuse{bbl@ev@##1@#1}#2}}% - \@nameuse{bbl@ev@#1}} + \@nameuse{bbl@hk@##1}{\@nameuse{bbl@ev@##1@#1@}#2}}% + \@nameuse{bbl@ev@#1@}% + \ifx\languagename\@undefined\else % Test required for Plain (?) + \def\bbl@elt##1{% + \@nameuse{bbl@hk@##1}{\@nameuse{bbl@ev@##1@#1@\languagename}#2}}% + \@nameuse{bbl@ev@#1@\languagename}% + \fi} \def\bbl@evargs{,% <- don't delete this comma everylanguage=1,loadkernel=1,loadpatterns=1,loadexceptions=1,% adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,% @@ -1213,7 +1216,7 @@ \ProvideTextCommandDefault{\glq}{% \textormath{\quotesinglbase}{\mbox{\quotesinglbase}}} \ProvideTextCommand{\grq}{T1}{% - \textormath{\textquoteleft}{\mbox{\textquoteleft}}} + \textormath{\kern\z@\textquoteleft}{\mbox{\textquoteleft}}} \ProvideTextCommand{\grq}{TU}{% \textormath{\textquoteleft}{\mbox{\textquoteleft}}} \ProvideTextCommand{\grq}{OT1}{% @@ -1641,8 +1644,8 @@ {{\bbl@exp{\\\addlanguage\<l@##1>}}}% {}% \bbl@ifunset{l@##1}% - {}% - {\bbl@exp{\let\bbl@tempa\<l@##1>}}% + {}% + {\bbl@exp{\let\bbl@tempa\<l@##1>}}% \fi}% \fi \ifx\bbl@tempa\relax % if no opt or no language in opt found @@ -1657,7 +1660,15 @@ {\bbl@ifunset{l@#1}% no hyphenrules found - fallback {\bbl@exp{\\\adddialect\<l@#1>\language}}% {}}% so, l@<lang> is ok - nothing to do - {\bbl@exp{\\\adddialect\<l@#1>\bbl@tempa}}}% found in opt list or ini + {\bbl@exp{\\\adddialect\<l@#1>\bbl@tempa}}% found in opt list or ini + \bbl@ifunset{bbl@prehc@\languagename}% + {}% TODO - XeTeX, based on \babelfont and HyphenChar? + {\ifodd\bbl@engine\bbl@exp{% + \\\bbl@ifblank{\@nameuse{bbl@prehc@#1}}% + {}% + {\\\AddBabelHook[\languagename]{babel-prehc-\languagename}{patterns}% + {\prehyphenchar=\@nameuse{bbl@prehc@\languagename}\relax}}}% + \fi}} \def\bbl@read@ini#1{% \openin1=babel-#1.ini % FIXME - number must not be hardcoded \ifeof1 @@ -1719,6 +1730,7 @@ \def\bbl@after@ini{% \bbl@exportkey{lfthm}{typography.lefthyphenmin}{2}% \bbl@exportkey{rgthm}{typography.righthyphenmin}{3}% + \bbl@exportkey{prehc}{typography.prehyphenchar}{}% \bbl@exportkey{hyphr}{typography.hyphenrules}{}% \bbl@exportkey{intsp}{typography.intraspace}{}% \bbl@exportkey{jstfy}{typography.justify}{w}% |