diff options
author | Karl Berry <karl@freefriends.org> | 2019-06-03 21:35:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-06-03 21:35:43 +0000 |
commit | 401c20d6a00afd1b7454fb25a283c88feff3ebfb (patch) | |
tree | 79600a79f1e126e48cc2fab056dbb3accd132d8d /Master/texmf-dist/tex | |
parent | 2303aa63c28269972f5897573075238b9d80d5b2 (diff) |
babel (3jun19)
git-svn-id: svn://tug.org/texlive/trunk@51309 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.def | 42 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel.sty | 30 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/hyphen.cfg | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/luababel.def | 85 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/nil.ldf | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/switch.def | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/txtbabel.def | 141 |
7 files changed, 163 insertions, 153 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index ba2a930334f..2500bdb4a0c 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/05/04 3.31 Babel common definitions] +\ProvidesFile{babel.def}[2019/06/03 3.32 Babel common definitions] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -187,6 +187,22 @@ \fi}% \expandafter\bbl@replace@aux#1#2\bbl@nil#2% \edef#1{\the\toks@}} +\expandafter\def\expandafter\bbl@parsedef\detokenize{macro:}#1->#2\relax{% + \def\bbl@tempa{#1}% + \def\bbl@tempb{#2}} +\def\bbl@sreplace#1#2#3{% + \begingroup + \expandafter\bbl@parsedef\meaning#1\relax + \def\bbl@tempc{#2}% + \edef\bbl@tempc{\expandafter\strip@prefix\meaning\bbl@tempc}% + \def\bbl@tempd{#3}% + \edef\bbl@tempd{\expandafter\strip@prefix\meaning\bbl@tempd}% + \bbl@exp{\\\bbl@replace\\\bbl@tempb{\bbl@tempc}{\bbl@tempd}}% + \bbl@exp{% + \endgroup + \\\makeatletter % "internal" macros with @ are assumed + \\\scantokens{\def\\#1\bbl@tempa{\bbl@tempb}}% + \catcode64=\the\catcode64\relax}} % Restore @ \def\bbl@exp#1{% \begingroup \let\\\noexpand @@ -296,6 +312,10 @@ \def\<bbl@e@#2>{\the\toks@{\bbl@ens@fontenc}}}} \def\bbl@ensure#1#2#3{% 1: include 2: exclude 3: fontenc \def\bbl@tempb##1{% elt for (excluding) \bbl@captionslist list + \ifx##1\@undefined % 3.32 - Don't assume the macros exists + \edef##1{\noexpand\bbl@nocaption + {\bbl@stripslash##1}{\languagename\bbl@stripslash##1}}% + \fi \ifx##1\@empty\else \in@{##1}{#2}% \ifin@\else @@ -1402,11 +1422,14 @@ \fi \bbl@exp{\\\bbl@add\\\bbl@mapselect{\\\bbl@mapdir{\languagename}}}% \fi - % For Southeast Asian, if interspace in ini -- TODO: as hook + % For East Asian, Southeast Asian, if interspace in ini - TODO: as hook? + \ifx\bbl@KVP@intraspace\@nil\else % We may override the ini + \bbl@csarg\edef{intsp@#2}{\bbl@KVP@intraspace}% + \fi \ifcase\bbl@engine\or \bbl@ifunset{bbl@intsp@\languagename}{}% {\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else - \bbl@xin@{\bbl@cs{sbcp@\languagename}}{Hant,Hans,Jpan,Kore}% + \bbl@xin@{\bbl@cs{sbcp@\languagename}}{Hant,Hans,Jpan,Kore,Kana}% \ifin@ \bbl@cjkintraspace \directlua{ @@ -1414,19 +1437,13 @@ Babel.locale_props = Babel.locale_props or {} Babel.locale_props[\the\localeid].linebreak = 'c' }% - \ifx\bbl@KVP@intraspace\@nil - \bbl@exp{% - \\\bbl@intraspace\bbl@cs{intsp@\languagename}\\\@@}% - \fi + \bbl@exp{\\\bbl@intraspace\bbl@cs{intsp@\languagename}\\\@@}% \ifx\bbl@KVP@intrapenalty\@nil \bbl@intrapenalty0\@@ \fi \else \bbl@seaintraspace - \ifx\bbl@KVP@intraspace\@nil - \bbl@exp{% - \\\bbl@intraspace\bbl@cs{intsp@\languagename}\\\@@}% - \fi + \bbl@exp{\\\bbl@intraspace\bbl@cs{intsp@\languagename}\\\@@}% \directlua{ Babel = Babel or {} Babel.sea_ranges = Babel.sea_ranges or {} @@ -1438,9 +1455,6 @@ \fi \fi \fi - \ifx\bbl@KVP@intraspace\@nil\else % We may override the ini - \expandafter\bbl@intraspace\bbl@KVP@intraspace\@@ - \fi \ifx\bbl@KVP@intrapenalty\@nil\else \expandafter\bbl@intrapenalty\bbl@KVP@intrapenalty\@@ \fi}% diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index bc61531bafb..b4d8860a7a4 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -33,7 +33,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2019/05/04 3.31 The Babel package] +\ProvidesPackage{babel}[2019/06/03 3.32 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone} @@ -138,6 +138,22 @@ \fi}% \expandafter\bbl@replace@aux#1#2\bbl@nil#2% \edef#1{\the\toks@}} +\expandafter\def\expandafter\bbl@parsedef\detokenize{macro:}#1->#2\relax{% + \def\bbl@tempa{#1}% + \def\bbl@tempb{#2}} +\def\bbl@sreplace#1#2#3{% + \begingroup + \expandafter\bbl@parsedef\meaning#1\relax + \def\bbl@tempc{#2}% + \edef\bbl@tempc{\expandafter\strip@prefix\meaning\bbl@tempc}% + \def\bbl@tempd{#3}% + \edef\bbl@tempd{\expandafter\strip@prefix\meaning\bbl@tempd}% + \bbl@exp{\\\bbl@replace\\\bbl@tempb{\bbl@tempc}{\bbl@tempd}}% + \bbl@exp{% + \endgroup + \\\makeatletter % "internal" macros with @ are assumed + \\\scantokens{\def\\#1\bbl@tempa{\bbl@tempb}}% + \catcode64=\the\catcode64\relax}} % Restore @ \def\bbl@exp#1{% \begingroup \let\\\noexpand @@ -187,6 +203,8 @@ \bbl@languages \fi \ifodd\bbl@engine + % Harftex is evolving, so the callback is not harcoded, just in case + \def\bbl@harfpreline{Harf pre_linebreak_filter callback}% \def\bbl@activate@preotf{% \let\bbl@activate@preotf\relax % only once \directlua{ @@ -219,13 +237,19 @@ Babel.pre_otfload_v, 'Babel.pre_otfload_v', luatexbase.priority_in_callback('pre_linebreak_filter', - 'luaotfload.node_processor') or nil) + '\bbl@harfpreline') + or luatexbase.priority_in_callback('pre_linebreak_filter', + 'luaotfload.node_processor') + or nil) % luatexbase.add_to_callback('hpack_filter', Babel.pre_otfload_h, 'Babel.pre_otfload_h', luatexbase.priority_in_callback('hpack_filter', - 'luaotfload.node_processor') or nil) + '\bbl@harfpreline') + or luatexbase.priority_in_callback('hpack_filter', + 'luaotfload.node_processor') + or nil) }} \let\bbl@tempa\relax \@ifpackagewith{babel}{bidi=basic}% diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index f866ec5d6e2..60086951039 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -37,7 +37,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2019/05/04 3.31 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2019/06/03 3.32 Babel hyphens] \xdef\bbl@format{\jobname} \ifx\AtBeginDocument\@undefined \def\@empty{} diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index a2fbb24b845..69f0adfe3aa 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -392,13 +392,15 @@ local last_char = nil local quad = 655360 % 10 pt = 655360 = 10 * 65536 local last_class = nil + local last_lang = nil for item in node.traverse(head) do if item.id == GLYPH then + local lang = item.lang + local LOCALE = node.get_attribute(item, luatexbase.registernumber'bbl@attr@locale') - local props = Babel.locale_props[LOCALE] class = Babel.cjk_class[item.char].c @@ -412,7 +414,9 @@ br = 0 end - if br == 1 and props.linebreak == 'c' then + if br == 1 and props.linebreak == 'c' and + lang ~= \the\l@nohyphenation\space and + last_lang ~= \the\l@nohyphenation then local intrapenalty = props.intrapenalty if intrapenalty ~= 0 then local n = node.new(14, 0) % penalty @@ -429,6 +433,7 @@ quad = font.getfont(item.font).size last_class = class + last_lang = lang else % if penalty, glue or anything else last_class = nil end @@ -643,6 +648,45 @@ end }} \AtBeginDocument{\bbl@luafixboxdir} +\newcommand\babelcharproperty[1]{% + \count@=#1\relax + \ifvmode + \expandafter\bbl@chprop + \else + \bbl@error{\string\babelcharproperty\space can be used only in\\% + vertical mode (preamble or between paragraphs)}% + {See the manual for futher info}% + \fi} +\newcommand\bbl@chprop[3][\the\count@]{% + \@tempcnta=#1\relax + \bbl@ifunset{bbl@chprop@#2}% + {\bbl@error{No property named '#2'. Allowed values are\\% + direction (bc), mirror (bmg), and linebreak (lb)}% + {See the manual for futher info}}% + {}% + \loop + \@nameuse{bbl@chprop@#2}{#3}% + \ifnum\count@<\@tempcnta + \advance\count@\@ne + \repeat} +\def\bbl@chprop@direction#1{% + \directlua{ + Babel.characters[\the\count@] = Babel.characters[\the\count@] or {} + Babel.characters[\the\count@]['d'] = '#1' + }} +\let\bbl@chprop@bc\bbl@chprop@direction +\def\bbl@chprop@mirror#1{% + \directlua{ + Babel.characters[\the\count@] = Babel.characters[\the\count@] or {} + Babel.characters[\the\count@]['m'] = '\number#1' + }} +\let\bbl@chprop@bmg\bbl@chprop@mirror +\def\bbl@chprop@linebreak#1{% + \directlua{ + Babel.Babel.cjk_characters[\the\count@] = Babel.Babel.cjk_characters[\the\count@] or {} + Babel.Babel.cjk_characters[\the\count@]['c'] = '#1' + }} +\let\bbl@chprop@lb\bbl@chprop@linebreak \bbl@trace{Redefinitions for bidi layout} \ifx\@eqnnum\@undefined\else \ifx\bbl@attr@dir\@undefined\else @@ -686,22 +730,38 @@ \ifx\bbl@tabular\@tabular\else \bbl@replace\@tabular{$}{\bbl@nextfake$}% \fi}} - {} + {} \IfBabelLayout{lists} - {\expandafter\def\expandafter\bbl@toreplace\expandafter{\list{##1}{##2}}% - \bbl@replace\bbl@toreplace{\parshape}{\bbl@listparshape}% - \bbl@exp{\def\\\list##1##2{\the\toks@}}% \toks@ <- implicit result + {\bbl@sreplace\list{\parshape}{\bbl@listparshape}% \def\bbl@listparshape#1#2#3{% \parshape #1 #2 #3 % \ifnum\bbl@getluadir{page}=\bbl@getluadir{par}\else \shapemode\tw@ \fi}} {} +\IfBabelLayout{graphics} + {\let\bbl@pictresetdir\relax + \def\bbl@pictsetdir{% + \ifcase\bbl@thetextdir + \let\bbl@pictresetdir\relax + \else + \textdir TLT\relax + \def\bbl@pictresetdir{\textdir TRT\relax}% + \fi}% + \bbl@sreplace\@picture{\hskip-}{\bbl@pictsetdir\hskip-}% + \def\put(#1,#2)#3{% Not easy to patch. Better redefine. + \@killglue + \raise#2\unitlength + \hb@xt@\z@{\kern#1\unitlength{\bbl@pictresetdir#3}\hss}}% + \AtBeginDocument + {\ifx\tikz@atbegin@node\@undefined\else + \bbl@sreplace\pgfpicture{\pgfpicturetrue}{\bbl@pictsetdir\pgfpicturetrue}% + \bbl@add\pgfsys@beginpicture{\bbl@pictsetdir}% + \bbl@add\tikz@atbegin@node{\bbl@pictresetdir}% + \fi}} + {} \IfBabelLayout{counters}% - {\def\@textsuperscript#1{{% lua has separate settings for math - \m@th - \mathdir\pagedir % required with basic-r; ok with default, too - \ensuremath{^{\mbox {\fontsize \sf@size \z@ #1}}}}}% + {\bbl@sreplace\@textsuperscript{\m@th}{\m@th\mathdir\pagedir}% \let\bbl@latinarabic=\@arabic \def\@arabic#1{\babelsublr{\bbl@latinarabic#1}}% \@ifpackagewith{babel}{bidi=default}% @@ -762,10 +822,7 @@ \BabelFootnote\mainfootnote{}{}{}} {} \IfBabelLayout{extras}% - {\def\underline#1{% - \relax - \ifmmode\@@underline{#1}% - \else\bbl@nextfake$\@@underline{\hbox{#1}}\m@th$\relax\fi}% + {\bbl@sreplace\underline{$\@@underline}{\bbl@nextfake$\@@underline}% \DeclareRobustCommand{\LaTeXe}{\mbox{\m@th \if b\expandafter\@car\f@series\@nil\boldmath\fi \babelsublr{% diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index 96b40f18e8c..773a8f4c078 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -32,13 +32,11 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2019/05/04 3.31 Nil language] +\ProvidesLanguage{nil}[2019/06/03 3.32 Nil language] \LdfInit{nil}{datenil} -\ifx\l@nohyphenation\@undefined - \@nopatterns{nil} - \adddialect\l@nil0 -\else - \let\l@nil\l@nohyphenation +\ifx\l@nil\@undefined + \newlanguage\l@nil + \@namedef{bbl@hyphendata@\the\l@nil}{{}{}}% Remove warning \fi \providehyphenmins{\CurrentOption}{\m@ne\m@ne} \let\captionsnil\@empty diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def index f079f6184d2..010ac0f13fa 100644 --- a/Master/texmf-dist/tex/generic/babel/switch.def +++ b/Master/texmf-dist/tex/generic/babel/switch.def @@ -37,7 +37,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{switch.def}[2019/05/04 3.31 Babel switching mechanism] +\ProvidesFile{switch.def}[2019/06/03 3.32 Babel switching mechanism] \ifx\AtBeginDocument\@undefined \input plain.def\relax \fi @@ -58,8 +58,8 @@ \countdef\last@language=19 \def\addlanguage{\alloc@9\language\chardef\@cclvi} \fi -\def\bbl@version{3.31} -\def\bbl@date{2019/05/04} +\def\bbl@version{3.32} +\def\bbl@date{2019/06/03} \def\adddialect#1#2{% \global\chardef#1#2\relax \bbl@usehooks{adddialect}{{#1}{#2}}% diff --git a/Master/texmf-dist/tex/generic/babel/txtbabel.def b/Master/texmf-dist/tex/generic/babel/txtbabel.def index 86e5a95d83d..a11bf27df31 100644 --- a/Master/texmf-dist/tex/generic/babel/txtbabel.def +++ b/Master/texmf-dist/tex/generic/babel/txtbabel.def @@ -58,122 +58,39 @@ \parfillskip\bbl@endskip} \fi \IfBabelLayout{lists} - {\def\list#1#2{% - \ifnum \@listdepth >5\relax - \@toodeep - \else - \global\advance\@listdepth\@ne - \fi - \rightmargin\z@ - \listparindent\z@ - \itemindent\z@ - \csname @list\romannumeral\the\@listdepth\endcsname - \def\@itemlabel{#1}% - \let\makelabel\@mklab - \@nmbrlistfalse - #2\relax - \@trivlist - \parskip\parsep - \parindent\listparindent - \advance\linewidth-\rightmargin - \advance\linewidth-\leftmargin - \advance\@totalleftmargin - \ifcase\bbl@thepardir\leftmargin\else\rightmargin\fi - \parshape\@ne\@totalleftmargin\linewidth - \ignorespaces}% - \ifcase\bbl@engine - \def\labelenumii{)\theenumii(}% - \def\p@enumiii{\p@enumii)\theenumii(}% - \fi - \def\@verbatim{% - \trivlist \item\relax - \if@minipage\else\vskip\parskip\fi - \bbl@startskip\textwidth - \advance\bbl@startskip-\linewidth - \bbl@endskip\z@skip - \parindent\z@ - \parfillskip\@flushglue - \parskip\z@skip - \@@par - \language\l@nohyphenation - \@tempswafalse - \def\par{% - \if@tempswa - \leavevmode\null - \@@par\penalty\interlinepenalty - \else - \@tempswatrue - \ifhmode\@@par\penalty\interlinepenalty\fi - \fi}% - \let\do\@makeother \dospecials - \obeylines \verbatim@font \@noligs - \everypar\expandafter{\the\everypar\unpenalty}}} + {\bbl@sreplace\list + {\@totalleftmargin\leftmargin}{\@totalleftmargin\bbl@listleftmargin}% + \def\bbl@listleftmargin{% + \ifcase\bbl@thepardir\leftmargin\else\rightmargin\fi}% + \ifcase\bbl@engine + \def\labelenumii{)\theenumii(}% pdftex doesn't reverse () + \def\p@enumiii{\p@enumii)\theenumii(}% + \fi + \bbl@sreplace\@verbatim + {\leftskip\@totalleftmargin}% + {\bbl@startskip\textwidth + \advance\bbl@startskip-\linewidth}% + \bbl@sreplace\@verbatim + {\rightskip\z@skip}% + {\bbl@endskip\z@skip}}% {} \IfBabelLayout{contents} - {\def\@dottedtocline#1#2#3#4#5{% - \ifnum#1>\c@tocdepth\else - \vskip \z@ \@plus.2\p@ - {\bbl@startskip#2\relax - \bbl@endskip\@tocrmarg - \parfillskip-\bbl@endskip - \parindent#2\relax - \@afterindenttrue - \interlinepenalty\@M - \leavevmode - \@tempdima#3\relax - \advance\bbl@startskip\@tempdima - \null\nobreak\hskip-\bbl@startskip - {#4}\nobreak - \leaders\hbox{% - $\m@th\mkern\@dotsep mu\hbox{.}\mkern\@dotsep mu$}% - \hfill\nobreak - \hb@xt@\@pnumwidth{\hfil\normalfont\normalcolor#5}% - \par}% - \fi}} + {\bbl@sreplace\@dottedtocline{\leftskip}{\bbl@startskip}% + \bbl@sreplace\@dottedtocline{\rightskip}{\bbl@endskip}} {} \IfBabelLayout{columns} - {\def\@outputdblcol{% - \if@firstcolumn - \global\@firstcolumnfalse - \global\setbox\@leftcolumn\copy\@outputbox - \splitmaxdepth\maxdimen - \vbadness\maxdimen - \setbox\@outputbox\vbox{\unvbox\@outputbox\unskip}% - \setbox\@outputbox\vsplit\@outputbox to\maxdimen - \toks@\expandafter{\topmark}% - \xdef\@firstcoltopmark{\the\toks@}% - \toks@\expandafter{\splitfirstmark}% - \xdef\@firstcolfirstmark{\the\toks@}% - \ifx\@firstcolfirstmark\@empty - \global\let\@setmarks\relax - \else - \gdef\@setmarks{% - \let\firstmark\@firstcolfirstmark - \let\topmark\@firstcoltopmark}% - \fi - \else - \global\@firstcolumntrue - \setbox\@outputbox\vbox{% - \hb@xt@\textwidth{% - \hskip\columnwidth - \hfil - {\normalcolor\vrule \@width\columnseprule}% - \hfil - \hb@xt@\columnwidth{\box\@leftcolumn \hss}% - \hskip-\textwidth - \hb@xt@\columnwidth{\box\@outputbox \hss}% - \hskip\columnsep - \hskip\columnwidth}}% - \@combinedblfloats - \@setmarks - \@outputpage - \begingroup - \@dblfloatplacement - \@startdblcolumn - \@whilesw\if@fcolmade \fi{\@outputpage - \@startdblcolumn}% - \endgroup - \fi}}% + {\bbl@sreplace\@outputdblcol{\hb@xt@\textwidth}{\bbl@outputhbox}% + \def\bbl@outputhbox#1{% + \hb@xt@\textwidth{% + \hskip\columnwidth + \hfil + {\normalcolor\vrule \@width\columnseprule}% + \hfil + \hb@xt@\columnwidth{\box\@leftcolumn \hss}% + \hskip-\textwidth + \hb@xt@\columnwidth{\box\@outputbox \hss}% + \hskip\columnsep + \hskip\columnwidth}}}% {} \bbl@trace{Bidi footnotes} \ifx\bbl@beforeforeign\leavevmode |