From ce68c1acd66bd646f4b9464ccd172b7d18342a35 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Jul 2023 19:49:07 +0000 Subject: babel (9jul23) git-svn-id: svn://tug.org/texlive/trunk@67592 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/generic/babel/babel-transforms.lua | 31 +++++++++++++++++-- Master/texmf-dist/tex/generic/babel/babel.def | 6 ++-- Master/texmf-dist/tex/generic/babel/babel.sty | 6 ++-- Master/texmf-dist/tex/generic/babel/hyphen.cfg | 6 ++-- .../tex/generic/babel/locale/he/babel-he.ini | 26 ++++++++++++++-- .../tex/generic/babel/locale/yi/babel-yi.ini | 35 ++++++++++++++++++++-- Master/texmf-dist/tex/generic/babel/luababel.def | 34 ++++++++++++--------- Master/texmf-dist/tex/generic/babel/nil.ldf | 2 +- 8 files changed, 116 insertions(+), 30 deletions(-) (limited to 'Master/texmf-dist/tex/generic') diff --git a/Master/texmf-dist/tex/generic/babel/babel-transforms.lua b/Master/texmf-dist/tex/generic/babel/babel-transforms.lua index 2280b7ea9a3..6a44a603dfa 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-transforms.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-transforms.lua @@ -36,7 +36,6 @@ Babel.linebreaking.replacements = {} Babel.linebreaking.replacements[0] = {} -- pre Babel.linebreaking.replacements[1] = {} -- post -Babel.linebreaking.replacements[2] = {} -- post-line WIP -- Discretionaries contain strings as nodes function Babel.str_to_nodes(fn, matches, base) @@ -188,7 +187,6 @@ Babel.us_char = string.char(31) function Babel.hyphenate_replace(head, mode) local u = unicode.utf8 local lbkr = Babel.linebreaking.replacements[mode] - if mode == 2 then mode = 0 end -- WIP local word_head = head @@ -519,3 +517,32 @@ function Babel.capture_kashida(key, wt) end return 'kashida = ' .. wt end + +-- Experimental: applies prehyphenation transforms to a string (letters +-- and spaces). +function Babel.string_prehyphenation(str, locale) + local n, head, last, res + head = node.new(8, 0) -- dummy (hack just to start) + last = head + for s in string.utfvalues(str) do + if s == 20 then + n = node.new(12, 0) + else + n = node.new(29, 0) + n.char = s + end + node.set_attribute(n, Babel.attr_locale, locale) + last.next = n + last = n + end + head = Babel.hyphenate_replace(head, 0) + res = '' + for n in node.traverse(head) do + if n.id == 12 then + res = res .. ' ' + elseif n.id == 29 then + res = res .. unicode.utf8.char(n.char) + end + end + tex.print(res) +end diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index a7c6c21f5c3..eb056080a46 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -40,7 +40,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2023/06/26 v3.90 Babel common definitions] +\ProvidesFile{babel.def}[2023/07/09 v3.91 Babel common definitions] \ifx\AtBeginDocument\@undefined % TODO. change test. \def\@empty{} \def\loadlocalcfg#1{% @@ -595,8 +595,8 @@ \toks@\expandafter{\bbl@tempc#3}% \expandafter\edef\csname extras\languagename\endcsname{\the\toks@}% \fi} -\def\bbl@version{3.90} -\def\bbl@date{2023/06/26} +\def\bbl@version{3.91} +\def\bbl@date{2023/07/09} \ifx\language\@undefined \csname newcount\endcsname\language \fi diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index 2f1039ca17e..f0f04f93baa 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -34,7 +34,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2023/06/26 v3.90 The Babel package] +\ProvidesPackage{babel}[2023/07/09 v3.91 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone @@ -470,8 +470,8 @@ \expandafter\@secondoftwo \fi} \fi -\def\bbl@version{3.90} -\def\bbl@date{2023/06/26} +\def\bbl@version{3.91} +\def\bbl@date{2023/07/09} \ifx\language\@undefined \csname newcount\endcsname\language \fi diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 32a8f575635..f8273087aee 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -38,10 +38,10 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2023/06/26 v3.90 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2023/07/09 v3.91 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{3.90} -\def\bbl@date{2023/06/26} +\def\bbl@version{3.91} +\def\bbl@date{2023/07/09} \ifx\AtBeginDocument\@undefined \def\@empty{} \fi diff --git a/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini b/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini index d8c85d0ec5e..483c67f9ba5 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/he/babel-he.ini @@ -9,8 +9,8 @@ [identification] charset = utf8 -version = 1.7 -date = 2022-12-08 +version = 1.8 +date = 2023-07-08 name.local = עברית name.english = Hebrew name.babel = hebrew @@ -220,4 +220,26 @@ letters.F.19 = יט letters.3 = ק ר ש ת תק תר תש תת תתק letters.4 = א׳ ב׳ ג׳ ד׳ ה׳ ו׳ ז׳ ח׳ ט׳ +[transforms.prehyphenation] +transliteration.cj.1.0 = { ([aAE]): } +transliteration.cj.1.1 = { string = {1|aAE|ֱֲֳ} } +transliteration.cj.1.2 = { remove } +transliteration.cj.2.0 = { ([/{+}])s } +transliteration.cj.2.1 = { string = {1|/{002C}+|ששׂשׁ} } +transliteration.cj.2.2 = { remove } +transliteration.cj.3.0 = { {-}{-} } +transliteration.cj.3.1 = { string = ־ } +transliteration.cj.3.2 = { remove } +transliteration.cj.4.0 = { {.}([htsS]) } +transliteration.cj.4.1 = { remove } +transliteration.cj.4.2 = { string = {1|htsS|חטצץ} } +transliteration.cj.5.0 = { /a({a}) } +transliteration.cj.5.1 = { remove } +transliteration.cj.5.2 = { string = {1} } +transliteration.cj.5.3 = { string = ַ} +transliteration.cj.6.0 = { w([o{*}]) } +transliteration.cj.6.1 = { string = {1|o*|וֹוּ} } +transliteration.cj.7.0 = { ([aAbdeEghikKlmMnNoOpPqrstuUwyz{*}:'’`‘;]) } +transliteration.cj.7.1 = { string = {1|aAbdeEghikKlmMnNoOpPqrstuUwyz*:'’`‘;|ַָבדֵֶגהִכךלמםנןֹוֹפףקרסתֻוּויזְּאאעע׃} } + diff --git a/Master/texmf-dist/tex/generic/babel/locale/yi/babel-yi.ini b/Master/texmf-dist/tex/generic/babel/locale/yi/babel-yi.ini index 03ed5d0add3..b63b0804e5d 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/yi/babel-yi.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/yi/babel-yi.ini @@ -9,8 +9,8 @@ [identification] charset = utf8 -version = 1.5 -date = 2023-03-11 +version = 1.6 +date = 2023-07-08 name.local = ייִדיש name.english = Yiddish name.babel = yiddish @@ -176,3 +176,34 @@ plusSign = + superscriptingExponent = × [counters] +letters.1 = א ב ג ד ה ו ז ח ט +letters.2 = י כ ל מ נ ס ע פ צ +letters.F.15 = טו +letters.F.16 = טז +letters.F.17 = יז +letters.F.18 = יח +letters.F.19 = יט +letters.3 = ק ר ש ת תק תר תש תת תתק +letters.4 = א׳ ב׳ ג׳ ד׳ ה׳ ו׳ ז׳ ח׳ ט׳ + +[transforms.prehyphenation] +transliteration.cj.1.0 = { ([aAE]): } +transliteration.cj.1.1 = { string = {1|aAE|ֱֲֳ} } +transliteration.cj.1.2 = { remove } +transliteration.cj.2.0 = { ([/{+}])s } +transliteration.cj.2.1 = { string = {1|/{002C}+|ששׂשׁ} } +transliteration.cj.2.2 = { remove } +transliteration.cj.3.0 = { {-}{-} } +transliteration.cj.3.1 = { string = ־ } +transliteration.cj.3.2 = { remove } +transliteration.cj.4.0 = { {.}([htsS]) } +transliteration.cj.4.1 = { remove } +transliteration.cj.4.2 = { string = {1|htsS|חטצץ} } +transliteration.cj.5.0 = { /a({a}) } +transliteration.cj.5.1 = { remove } +transliteration.cj.5.2 = { string = {1} } +transliteration.cj.5.3 = { string = ַ} +transliteration.cj.6.0 = { w([o{*}]) } +transliteration.cj.6.1 = { string = {1|o*|וֹוּ} } +transliteration.cj.7.0 = { ([aAbdeEghikKlmMnNoOpPqrstuUwyz{*}:'’`‘;]) } +transliteration.cj.7.1 = { string = {1|aAbdeEghikKlmMnNoOpPqrstuUwyz*:'’`‘;|ַָבדֵֶגהִכךלמםנןֹוֹפףקרסתֻוּויזְּאאעע׃} } diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index befca370e79..ed8b34db77a 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -604,13 +604,8 @@ end \gdef\bbl@arabicjust{% \let\bbl@arabicjust\relax \newattribute\bblar@kashida - \newattribute\bblar@kashida@aux % 0, 1=tatweel, 2=diacritics - \directlua{% WIP - Babel.attr_kashida = luatexbase.registernumber'bblar@kashida' - Babel.attr_kashida_aux = luatexbase.registernumber'bblar@kashida@aux' - }% + \directlua{ Babel.attr_kashida = luatexbase.registernumber'bblar@kashida' }% \bblar@kashida=\z@ - \bblar@kashida@aux=\z@ \bbl@patchfont{{\bbl@parsejalt}}% \directlua{ Babel.arabic.elong_map = Babel.arabic.elong_map or {} @@ -1179,7 +1174,6 @@ end \@ifnextchar[{\bbl@settransform{0}}{\bbl@settransform{0}[]}} \gdef\babelposthyphenation{&% \@ifnextchar[{\bbl@settransform{1}}{\bbl@settransform{1}[]}} -\gdef\bbl@postlinebreak{\bbl@settransform{2}[]} &% WIP \gdef\bbl@settransform#1[#2]#3#4#5{&% \ifcase#1 \bbl@activateprehyphen @@ -1260,7 +1254,7 @@ end local lbkr = Babel.linebreaking.replacements[#1] local u = unicode.utf8 local id, attr, label - if #1 == 0 or #1 == 2 then + if #1 == 0 then id = \the\csname bbl@id@@#3\endcsname\space else id = \the\csname l@#3\endcsname\space @@ -1275,7 +1269,7 @@ end \fi &% Convert pattern: local patt = string.gsub([==[#4]==], '%s', '') - if #1 == 0 or #1 == 2 then + if #1 == 0 then patt = string.gsub(patt, '|', ' ') end if not u.find(patt, '()', nil, true) then @@ -1354,6 +1348,8 @@ end require('babel-transforms.lua') Babel.linebreaking.add_before(Babel.pre_hyphenate_replace) }} +\newcommand\localeprehyphenation[1]{% + \directlua{ Babel.string_prehyphenation([==[#1]==], \the\localeid) }} \def\bbl@activate@preotf{% \let\bbl@activate@preotf\relax % only once \directlua{ @@ -1581,10 +1577,13 @@ end \AddToHook{env/gather*/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/align/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/align*/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/alignat/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/alignat*/begin}{\bbl@ams@preset\bbl@ams@lap}% \AddToHook{env/eqnalign/begin}{\bbl@ams@preset\hbox}% % Hackish, for proper alignment. Don’t ask me why it works!: \bbl@exp{% Avoid a 'visible' conditional - \\\AddToHook{env/align*/end}{\\\\\tag*{}\}}% + \\\AddToHook{env/align*/end}{\\\\\tag*{}\}% + \\\AddToHook{env/alignat*/end}{\\\\\tag*{}\}}% \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% \AddToHook{env/split/before}{% \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% @@ -1696,7 +1695,11 @@ end \@ifpackageloaded{multicol}% {\toks@\expandafter{\multi@column@out}% \edef\multi@column@out{\bodydir\pagedir\the\toks@}}% - {}} + {}% + \@ifpackageloaded{paracol}% + {\edef\pcol@output{% + \bodydir\pagedir\unexpanded\expandafter{\pcol@output}}}% + {}}% \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifnum\bbl@bidimode>\z@ % Any bidi= @@ -1906,9 +1909,12 @@ end \BabelFootnote\mainfootnote{}{}{}} {} \IfBabelLayout{extras}% - {\let\bbl@OL@underline\underline - \bbl@sreplace\underline{$\@@underline}{\bbl@nextfake$\@@underline}% - \let\bbl@OL@LaTeX2e\LaTeX2e + {\bbl@ncarg\let\bbl@OL@underline{underline }% + \bbl@carg\bbl@sreplace{underline }% + {$\@@underline}{\bgroup\bbl@nextfake$\@@underline}% + \bbl@carg\bbl@sreplace{underline }% + {\m@th$}{\m@th$\egroup}% + \let\bbl@OL@LaTeXe\LaTeXe \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 649697de626..63867cc950c 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -33,7 +33,7 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2023/06/26 v3.90 Nil language] +\ProvidesLanguage{nil}[2023/07/09 v3.91 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil -- cgit v1.2.3