From 24041c1e41a3999c280f7b0139c5ab5117d71330 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 13 Feb 2022 21:27:08 +0000 Subject: babel (13feb22) git-svn-id: svn://tug.org/texlive/trunk@62007 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/generic/babel/babel.def | 6 +- Master/texmf-dist/tex/generic/babel/babel.sty | 54 +++--- Master/texmf-dist/tex/generic/babel/hyphen.cfg | 6 +- .../tex/generic/babel/locale/sa/babel-sa-Deva.ini | 102 +++++++++- .../tex/generic/babel/locale/sa/babel-sa.ini | 100 +++++++++- Master/texmf-dist/tex/generic/babel/luababel.def | 207 ++++++++++++--------- Master/texmf-dist/tex/generic/babel/nil.ldf | 2 +- 7 files changed, 355 insertions(+), 122 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index a426500edd5..b60ad25a125 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}[2022/01/26 3.70 Babel common definitions] +\ProvidesFile{babel.def}[2022/02/13 3.71 Babel common definitions] \ifx\AtBeginDocument\@undefined % TODO. change test. \def\@empty{} \def\loadlocalcfg#1{% @@ -406,8 +406,8 @@ \expandafter\newif\csname ifbbl@single\endcsname \chardef\bbl@bidimode\z@ \fi -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \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 26de1e5a34a..47e17405b35 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}[2022/01/26 3.70 The Babel package] +\ProvidesPackage{babel}[2022/02/13 3.71 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone @@ -453,8 +453,8 @@ \expandafter\@secondoftwo \fi} \fi -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \ifx\language\@undefined \csname newcount\endcsname\language \fi @@ -4219,34 +4219,34 @@ \bbl@foreach\bbl@language@opts{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \DeclareOption{#1}{\bbl@load@language{#1}}% - \else % + * (other = ini) - \DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}% + \else % + * (other = ini) + \DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}% + \fi \fi} \bbl@foreach\@classoptionslist{% \def\bbl@tempa{#1}% \ifx\bbl@tempa\bbl@opt@main\else - \bbl@ifunset{ds@#1}% - {\ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) - \IfFileExists{#1.ldf}% - {\DeclareOption{#1}{\bbl@load@language{#1}}}% - {}% - \else % + * (other = ini) - \IfFileExists{babel-#1.tex}% - {\DeclareOption{#1}{% - \bbl@ldfinit - \babelprovide[import]{#1}% - \bbl@afterldf{}}}% - {}% - \fi}% - {}% + \ifnum\bbl@iniflag<\tw@ % 0 ø (other = ldf) + \bbl@ifunset{ds@#1}% + {\IfFileExists{#1.ldf}% + {\DeclareOption{#1}{\bbl@load@language{#1}}}% + {}}% + {}% + \else % + * (other = ini) + \IfFileExists{babel-#1.tex}% + {\DeclareOption{#1}{% + \bbl@ldfinit + \babelprovide[import]{#1}% + \bbl@afterldf{}}}% + {}% + \fi \fi} \def\AfterBabelLanguage#1{% \bbl@ifsamestring\CurrentOption{#1}{\global\bbl@add\bbl@afterlang}{}} diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 0bb128d4577..542b6546e5d 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}[2022/01/26 3.70 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2022/02/13 3.71 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{3.70} -\def\bbl@date{2022/01/26} +\def\bbl@version{3.71} +\def\bbl@date{2022/02/13} \ifx\AtBeginDocument\@undefined \def\@empty{} \fi diff --git a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini index 6305b963ead..af9b9fb2f6d 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa-Deva.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 0.11 -date = 2021-04-24 +version = 0.12 +date = 2022-02-06 name.local = संस्कृत name.english = Sanskrit name.babel = sanskrit @@ -159,4 +159,100 @@ transliteration.hk.10.2 = { string = ^^^^094d{1} } ; Inherent a transliteration.hk.11.0 = { [{0915}-{0939}]{0905} } transliteration.hk.11.1 = {} -transliteration.hk.11.2 = { remove } \ No newline at end of file +transliteration.hk.11.2 = { remove } +; == IAST == +; Contributed by Maximilian Mehner +; uppercase to lowercase +transliteration.iast.1.0 = { ([AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH]) } +transliteration.iast.1.1 = { string = {1|AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH|aiuṛṝḷḹeoṃḥkgṅcjñṭḍṇtdnpbmyrlvśṣsh} } +; whitespace +transliteration.iast.2.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])|([aiuṛṝḷḹeokgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.2.1 = { string = {1} } +transliteration.iast.2.2 = { remove } +transliteration.iast.2.3 = { string = {2} } +; special strings +transliteration.iast.3.0 = { oṃ } +transliteration.iast.3.1 = { string = ॐ } +; aspirata with vowels +transliteration.iast.4.0 = { ([kgcjṭḍtdpb])[h][a]([iu]) } +transliteration.iast.4.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.4.2 = { remove } +transliteration.iast.4.3 = { remove } +transliteration.iast.4.4 = { string = {2|iu|ैौ} } +; +transliteration.iast.5.0 = { ([kgcjṭḍtdpb])[h][a] } +transliteration.iast.5.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.5.2 = { remove } +transliteration.iast.5.3 = { remove } +; +transliteration.iast.6.0 = { ([kgcjṭḍtdpb])[h]([āiīuūṛṝḷḹeo]) } +transliteration.iast.6.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.6.2 = { remove } +transliteration.iast.6.3 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; aspirata without vowels +transliteration.iast.7.0 = { ([kgcjṭḍtdpb])[h] } +transliteration.iast.7.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ}् } +transliteration.iast.7.2 = { remove } +; tenues with vowels +transliteration.iast.8.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a]([iu]) } +transliteration.iast.8.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.8.2 = { remove } +transliteration.iast.8.3 = { string = {2|iu|ैौ} } +; +transliteration.iast.9.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a] } +transliteration.iast.9.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.9.2 = { remove } +; +transliteration.iast.10.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])([āiīuūṛṝḷḹeo]) } +transliteration.iast.10.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.10.2 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; tenues without vowels +transliteration.iast.11.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.11.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह}् } +; vowels +; initial vowels +transliteration.iast.12.0 = { ai } +transliteration.iast.12.1 = { string = ऐ } +transliteration.iast.13.0 = { au } +transliteration.iast.13.1 = { string = औ } +transliteration.iast.14.0 = { a } +transliteration.iast.14.1 = { string = अ } +transliteration.iast.15.0 = { ā } +transliteration.iast.15.1 = { string = आ } +transliteration.iast.16.0 = { i } +transliteration.iast.16.1 = { string = इ } +transliteration.iast.17.0 = { ī } +transliteration.iast.17.1 = { string = ई } +transliteration.iast.18.0 = { u } +transliteration.iast.18.1 = { string = उ } +transliteration.iast.19.0 = { ū } +transliteration.iast.19.1 = { string = ऊ } +transliteration.iast.20.0 = { ṛ } +transliteration.iast.20.1 = { string = ऋ } +transliteration.iast.21.0 = { ṝ } +transliteration.iast.21.1 = { string = ॠ } +transliteration.iast.22.0 = { ḷ } +transliteration.iast.22.1 = { string = लृ } +transliteration.iast.23.0 = { ḹ } +transliteration.iast.23.1 = { string = लॄ } +transliteration.iast.24.0 = { e } +transliteration.iast.24.1 = { string = ए } +transliteration.iast.25.0 = { o } +transliteration.iast.25.1 = { string = ओ }} +; special characters +transliteration.iast.26.0 = { ' } +transliteration.iast.26.1 = { string = ऽ } +transliteration.iast.27.0 = { ṃ } +transliteration.iast.27.1 = { string = ं } +transliteration.iast.28.0 = { ḥ } +transliteration.iast.28.1 = { string = ः } +; numbers +transliteration.iast.29.0 = { ([0123456789]) } +transliteration.iast.29.1 = { string = {1|0123456789|०१२३४५६७८९} } +; punctuation +transliteration.iast.30.0 = { [./][./] } +transliteration.iast.30.1 = { string = ॥ } +transliteration.iast.31.0 = { [./] } +transliteration.iast.31.1 = { string = । } +transliteration.iast.32.0 = { [:] } +transliteration.iast.32.1 = { string = – } \ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini index 681cb49eb30..c3bb64df1b3 100644 --- a/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini +++ b/Master/texmf-dist/tex/generic/babel/locale/sa/babel-sa.ini @@ -11,8 +11,8 @@ [identification] charset = utf8 -version = 0.11 -date = 2021-04-2430 +version = 0.12 +date = 2022-02-05 name.english = Sanskrit name.babel = sanskrit name.polyglossia = sanskrit @@ -145,3 +145,99 @@ transliteration.hk.10.2 = { string = ^^^^094d{1} } transliteration.hk.11.0 = { [{0915}-{0939}]{0905} } transliteration.hk.11.1 = {} transliteration.hk.11.2 = { remove } +; == IAST == +; Contributed by Maximilian Mehner +; uppercase to lowercase +transliteration.iast.1.0 = { ([AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH]) } +transliteration.iast.1.1 = { string = {1|AIUṚṜḶḸEOṂḤKGṄCJÑṬḌṆTDNPBMYRLVŚṢSH|aiuṛṝḷḹeoṃḥkgṅcjñṭḍṇtdnpbmyrlvśṣsh} } +; whitespace +transliteration.iast.2.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])|([aiuṛṝḷḹeokgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.2.1 = { string = {1} } +transliteration.iast.2.2 = { remove } +transliteration.iast.2.3 = { string = {2} } +; special strings +transliteration.iast.3.0 = { oṃ } +transliteration.iast.3.1 = { string = ॐ } +; aspirata with vowels +transliteration.iast.4.0 = { ([kgcjṭḍtdpb])[h][a]([iu]) } +transliteration.iast.4.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.4.2 = { remove } +transliteration.iast.4.3 = { remove } +transliteration.iast.4.4 = { string = {2|iu|ैौ} } +; +transliteration.iast.5.0 = { ([kgcjṭḍtdpb])[h][a] } +transliteration.iast.5.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.5.2 = { remove } +transliteration.iast.5.3 = { remove } +; +transliteration.iast.6.0 = { ([kgcjṭḍtdpb])[h]([āiīuūṛṝḷḹeo]) } +transliteration.iast.6.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ} } +transliteration.iast.6.2 = { remove } +transliteration.iast.6.3 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; aspirata without vowels +transliteration.iast.7.0 = { ([kgcjṭḍtdpb])[h] } +transliteration.iast.7.1 = { string = {1|kgcjṭḍtdpb|खघछझठढथधफभ}् } +transliteration.iast.7.2 = { remove } +; tenues with vowels +transliteration.iast.8.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a]([iu]) } +transliteration.iast.8.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.8.2 = { remove } +transliteration.iast.8.3 = { string = {2|iu|ैौ} } +; +transliteration.iast.9.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])[a] } +transliteration.iast.9.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.9.2 = { remove } +; +transliteration.iast.10.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh])([āiīuūṛṝḷḹeo]) } +transliteration.iast.10.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह} } +transliteration.iast.10.2 = { string = {2|āiīuūṛṝḷḹeo|ािीुूृॄॢॣेो} } +; tenues without vowels +transliteration.iast.11.0 = { ([kgṅcjñṭḍṇtdnpbmyrlvśṣsh]) } +transliteration.iast.11.1 = { string = {1|kgṅcjñṭḍṇtdnpbmyrlvśṣsh|कगङचजञटडणतदनपबमयरलवशषसह}् } +; vowels +; initial vowels +transliteration.iast.12.0 = { ai } +transliteration.iast.12.1 = { string = ऐ } +transliteration.iast.13.0 = { au } +transliteration.iast.13.1 = { string = औ } +transliteration.iast.14.0 = { a } +transliteration.iast.14.1 = { string = अ } +transliteration.iast.15.0 = { ā } +transliteration.iast.15.1 = { string = आ } +transliteration.iast.16.0 = { i } +transliteration.iast.16.1 = { string = इ } +transliteration.iast.17.0 = { ī } +transliteration.iast.17.1 = { string = ई } +transliteration.iast.18.0 = { u } +transliteration.iast.18.1 = { string = उ } +transliteration.iast.19.0 = { ū } +transliteration.iast.19.1 = { string = ऊ } +transliteration.iast.20.0 = { ṛ } +transliteration.iast.20.1 = { string = ऋ } +transliteration.iast.21.0 = { ṝ } +transliteration.iast.21.1 = { string = ॠ } +transliteration.iast.22.0 = { ḷ } +transliteration.iast.22.1 = { string = लृ } +transliteration.iast.23.0 = { ḹ } +transliteration.iast.23.1 = { string = लॄ } +transliteration.iast.24.0 = { e } +transliteration.iast.24.1 = { string = ए } +transliteration.iast.25.0 = { o } +transliteration.iast.25.1 = { string = ओ }} +; special characters +transliteration.iast.26.0 = { ' } +transliteration.iast.26.1 = { string = ऽ } +transliteration.iast.27.0 = { ṃ } +transliteration.iast.27.1 = { string = ं } +transliteration.iast.28.0 = { ḥ } +transliteration.iast.28.1 = { string = ः } +; numbers +transliteration.iast.29.0 = { ([0123456789]) } +transliteration.iast.29.1 = { string = {1|0123456789|०१२३४५६७८९} } +; punctuation +transliteration.iast.30.0 = { [./][./] } +transliteration.iast.30.1 = { string = ॥ } +transliteration.iast.31.0 = { [./] } +transliteration.iast.31.1 = { string = । } +transliteration.iast.32.0 = { [:] } +transliteration.iast.32.1 = { string = – } diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 41137096197..1405e5710ba 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -248,6 +248,30 @@ end lang.patterns(lg, pats) end + function Babel.hlist_has_bidi(head) + local has_bidi = false + for item in node.traverse(head) do + if item.id == node.id'glyph' then + local itemchar = item.char + local chardata = Babel.characters[itemchar] + local dir = chardata and chardata.d or nil + if not dir then + for nn, et in ipairs(Babel.ranges) do + if itemchar < et[1] then + break + elseif itemchar <= et[2] then + dir = et[3] + break + end + end + end + if dir and (dir == 'al' or dir == 'r') then + has_bidi = true + end + end + end + return has_bidi + end } \endgroup \ifx\newattribute\@undefined\else @@ -1310,9 +1334,11 @@ end #2 TRT\relax \fi \fi} +\def\bbl@thedir{0} \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% \chardef\bbl@thetextdir#1\relax + \edef\bbl@thedir{\the\numexpr\bbl@thepardir*3+#1}% \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} \def\bbl@pardir#1{% \bbl@setluadir{par}\pardir{#1}% @@ -1321,6 +1347,7 @@ end \def\bbl@pagedir{\bbl@setluadir{page}\pagedir} \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% \ifnum\bbl@bidimode>\z@ + \def\bbl@insidemath{0}% \def\bbl@mathboxdir{% \ifcase\bbl@thetextdir\relax \everyhbox{\bbl@mathboxdir@aux L}% @@ -1329,16 +1356,37 @@ end \fi} \def\bbl@mathboxdir@aux#1{% \@ifnextchar\egroup{}{\textdir T#1T\relax}} + \def\bbl@everymath{\def\bbl@insidemath{1}} + \def\bbl@everydisplay{% + \bbl@mathboxdir + \def\bbl@everymath{\bbl@mathboxdir}% + \def\bbl@insidemath{2}} \frozen@everymath\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everymath} + \expandafter\bbl@everymath\the\frozen@everymath} \frozen@everydisplay\expandafter{% - \expandafter\bbl@mathboxdir\the\frozen@everydisplay} + \expandafter\bbl@everydisplay\the\frozen@everydisplay} + \AtBeginDocument{ + \directlua{ + function Babel.math_box_dir(head) + if not (token.get_macro('bbl@insidemath') == '0') then + if Babel.hlist_has_bidi(head) then + local d = node.new(node.id'dir') + d.dir = '+TRT' + node.insert_before(head, node.has_glyph(head), d) + for item in node.traverse(head) do + node.set_attribute(item, + Babel.attr_dir, token.get_macro('bbl@thedir')) + end + end + end + return head + end + luatexbase.add_to_callback("hpack_filter", Babel.math_box_dir, + "Babel.math_box_dir", 0) + }}% \fi -\def\bbl@truellap{%s - \ifcase\bbl@attr@dir\expandafter\llap\else\expandafter\rlap\fi} -\def\bbl@truerlap{% - \ifcase\bbl@attr@dir\expandafter\rlap\else\expandafter\llap\fi} \bbl@trace{Redefinitions for bidi layout} +\def\BabelNoAMSMath{\let\bbl@noamsmath\relax} \ifnum\bbl@bidimode>\z@ \let\bbl@eqnodir\relax \AtBeginDocument{% @@ -1359,71 +1407,81 @@ end \bbl@xin@{,leqno,}{,\@classoptionslist,}% \ifin@ \def\@eqnnum{% - \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% - \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% + \setbox\z@\hbox{\normalfont\normalcolor(\theequation)}% + \hbox to0.01pt{\hss\hbox to\displaywidth{\box\z@\hss}}}% \fi \else % amstex - \bbl@sreplace\intertext@{\normalbaselines}% - {\normalbaselines - \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@textdir\@ne\fi} - \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{% - \ifx\bbl@ams@lap\hbox - \hss\hbox to\displaywidth{\box\z@\hss}% - \else - \hbox to\displaywidth{\hss\box\z@}\hss - \fi}} - \def\bbl@ams@preset#1{% - \ifnum\bbl@thetextdir>\z@ - \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% - \chardef\bbl@thetextdir\z@ - \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% - \fi} - \@ifpackagewith{amsmath}{leqno}% - {\let\bbl@ams@lap\hbox}% = leqno - {\let\bbl@ams@lap\llap}% = default - % Not required?: split, alignat - \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% - \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% - \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}% - % Hackish, for proper alignment-don’t ask me why it works! :-) - \bbl@exp{% - \\\AddToHook{env/align*/end}{\\\\\tag*{}\}}% - \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% - \AddToHook{env/split/before}{% - \def\bbl@tempa{equation}% - \ifx\@currenvir\bbl@tempa - \def\bbl@ams@eqtagbox#1{% - \setbox\z@\hbox{\bbl@eqnodir#1}% - \hbox to\wd\z@{\box\z@}}% - \fi} - \AddToHook{env/equation/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% - \AddToHook{env/equation*/begin}{% - \bbl@add\ignorespacesafterend{\hrule\@height\z@}% - \ifnum\bbl@thetextdir>\z@ - \def\bbl@eqnodir{\bbl@textdir\@ne}% - \bbl@textdir\z@ - \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% - \fi}% + \ifx\bbl@noamsmath\@undefined + \edef\bbl@tempa{% + \catcode58=\the\catcode58\relax + \catcode95=\the\catcode95\relax}% + \catcode58=11 + \catcode95=11 + \bbl@sreplace\intertext@{\normalbaselines}% + {\normalbaselines + \ifx\bbl@eqnodir\relax\else\bbl@pardir\@ne\bbl@eqnodir\fi}% + \bbl@tempa + \def\bbl@ams@tagbox#1#2{#1{\bbl@eqnodir#2}}% #1=\hbox|ams@lap + \def\bbl@ams@eqtagbox#1{% + \setbox\z@\hbox{\bbl@eqnodir#1}% + \hbox to 0.01pt{% + \ifx\bbl@ams@lap\hbox + \hbox to\displaywidth{\hss\box\z@}\hss + \else + \hss\hbox to\displaywidth{\box\z@\hss}% + \fi}} + \def\bbl@ams@preset#1{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \chardef\bbl@thetextdir\z@ + \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@tagbox#1}% + \fi} + \@ifpackagewith{amsmath}{leqno}% + {\let\bbl@ams@lap\hbox}% = leqno + {\let\bbl@ams@lap\llap}% = default + % + \AddToHook{env/cases/begin}{\bbl@ams@preset\bbl@ams@lap}% + \AddToHook{env/multline/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/gather/begin}{\bbl@ams@preset\bbl@ams@lap}% + \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}% + % Hackish, for proper alignment-don’t ask me why it works! :-) + \bbl@exp{% + \\\AddToHook{env/align*/end}{\\\\\tag*{}\}}% + \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% + \AddToHook{env/split/before}{% + \ifnum\bbl@thetextdir>\z@ + \def\bbl@tempa{equation}% + \ifx\@currenvir\bbl@tempa + \def\bbl@ams@eqtagbox#1{% + \ifx\bbl@ams@lap\hbox + \hbox to0.01pt{\hss\bbl@eqnodir#1}% leqno + \else + \hbox to0.01pt{\bbl@eqnodir#1\hss}% eqno + \fi} + \fi + \fi} + \AddToHook{env/equation/begin}{% + \ifnum\bbl@thetextdir>\z@ + \ifx\bbl@ams@lap\llap\hrule\@height\z@\fi + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \AddToHook{env/equation*/begin}{% + \ifnum\bbl@thetextdir>\z@ + \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% + \bbl@sreplace\maketag@@@{\hbox}{\bbl@ams@eqtagbox}% + \fi}% + \fi \fi} \fi \ifx\bbl@opt@layout\@nnil\endinput\fi % if no layout \ifnum\bbl@bidimode>\z@ \def\bbl@nextfake#1{% non-local changes, use always inside a group! \bbl@exp{% + \def\\\bbl@insidemath{0}% \mathdir\the\bodydir #1% Once entered in math, set boxes to restore values \% @@ -1486,28 +1544,11 @@ end \directlua{ Babel.get_picture_dir = true Babel.picture_has_bidi = 0 + % function Babel.picture_dir (head) if not Babel.get_picture_dir then return head end - for item in node.traverse(head) do - if item.id == node.id'glyph' then - local itemchar = item.char - % TODO. Copypaste pattern from Babel.bidi (-r) - local chardata = Babel.characters[itemchar] - local dir = chardata and chardata.d or nil - if not dir then - for nn, et in ipairs(Babel.ranges) do - if itemchar < et[1] then - break - elseif itemchar <= et[2] then - dir = et[3] - break - end - end - end - if dir and (dir == 'al' or dir == 'r') then - Babel.picture_has_bidi = 1 - end - end + if Babel.hlist_has_bidi(head) then + Babel.picture_has_bidi = 1 end return head end diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index 78e6c9d5f46..937d1f50a8b 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}[2022/01/26 3.70 Nil language] +\ProvidesLanguage{nil}[2022/02/13 3.71 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil -- cgit v1.2.3