diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic')
22 files changed, 247 insertions, 149 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua index 6897cea2c37..b9a8104c602 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `basic-r') -- -- --- Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua index d5b57487b9b..760b79bd49e 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `basic') -- -- --- Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. @@ -211,6 +211,7 @@ function Babel.bidi(head, ispar, hdir) elseif item.id == DIR then d = nil + -- new_d = true if head ~= item then new_d = true end elseif item.id == node.id'glue' and item.subtype == 13 then diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-buddhist.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-buddhist.tex index 1c304078aa6..d0b4f8ebabb 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-buddhist.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-buddhist.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-buddhist') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-coptic.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-coptic.tex index c91a914011b..8ad2995fcb0 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-coptic.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-coptic.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-coptic') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-ethiopic.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-ethiopic.tex index d9fc6a90726..865ade76899 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-ethiopic.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-ethiopic.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-ethiopic') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-hebrew.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-hebrew.tex index def8ed50ff3..1e4a5507ecd 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-hebrew.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-hebrew.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-hebrew') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-islamic.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-islamic.tex index 97e71288383..79b80927b42 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-islamic.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-islamic.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-islamic') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-ca-persian.tex b/Master/texmf-dist/tex/generic/babel/babel-ca-persian.tex index c447a9526d9..9a5551349e1 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-ca-persian.tex +++ b/Master/texmf-dist/tex/generic/babel/babel-ca-persian.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `ca-persian') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-data-bidi.lua b/Master/texmf-dist/tex/generic/babel/babel-data-bidi.lua index 124fc6979d4..37af39379b8 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-data-bidi.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-data-bidi.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `bididata') -- -- --- Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-data-cjk.lua b/Master/texmf-dist/tex/generic/babel/babel-data-cjk.lua index 09ae4066554..2d605ee1177 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-data-cjk.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-data-cjk.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `cjkdata') -- -- --- Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel-transforms.lua b/Master/texmf-dist/tex/generic/babel/babel-transforms.lua index ead16c6332a..057287c1550 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-transforms.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-transforms.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `transforms') -- -- --- Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/babel.def b/Master/texmf-dist/tex/generic/babel/babel.def index 2d8cf023050..97657795971 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.def +++ b/Master/texmf-dist/tex/generic/babel/babel.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `core') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -40,7 +40,7 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{babel.def}[2022/12/26 3.84 Babel common definitions] +\ProvidesFile{babel.def}[2022/01/23 3.85 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.84} -\def\bbl@date{2022/12/26} +\def\bbl@version{3.85} +\def\bbl@date{2022/01/23} \ifx\language\@undefined \csname newcount\endcsname\language \fi @@ -1901,25 +1901,6 @@ {\bbl@tolower\@empty}{\bbl@toupper\@empty}}% \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}% \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}} -\def\BabelRestoreCase{% - \DeclareRobustCommand{\MakeUppercase}[1]{{% - \def\reserved@a####1####2{\let####1####2\reserved@a}% - \def\i{I}\def\j{J}% - \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% - \let\UTF@two@octets@noexpand\@empty - \let\UTF@three@octets@noexpand\@empty - \let\UTF@four@octets@noexpand\@empty - \protected@edef\reserved@a{\uppercase{##1}}% - \reserved@a - }}% - \DeclareRobustCommand{\MakeLowercase}[1]{{% - \def\reserved@a####1####2{\let####2####1\reserved@a}% - \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% - \let\UTF@two@octets@noexpand\@empty - \let\UTF@three@octets@noexpand\@empty - \let\UTF@four@octets@noexpand\@empty - \protected@edef\reserved@a{\lowercase{##1}}% - \reserved@a}}} \@onlypreamble\StartBabelCommands \def\StartBabelCommands{% \begingroup @@ -2454,7 +2435,7 @@ % \ifx\bbl@KVP@date\@nnil\else % \fi % == - \let\bbl@lbkflag\relax % \@empty = do setup linebreak + \let\bbl@lbkflag\relax % \@empty = do setup linebreak, only in 3 cases: \ifcase\bbl@howloaded \let\bbl@lbkflag\@empty % new \else @@ -2479,6 +2460,7 @@ {}% \let\bbl@KVP@date\@empty \fi + \let\bbl@KVP@captions@@\bbl@KVP@captions % TODO. A dirty hack \ifx\bbl@KVP@captions\@nnil \let\bbl@KVP@captions\bbl@KVP@import \fi @@ -2543,7 +2525,7 @@ \directlua{ if Babel.locale_mapped == nil then Babel.locale_mapped = true - Babel.linebreaking.add_before(Babel.locale_map) + Babel.linebreaking.add_before(Babel.locale_map, 1) Babel.loc_to_scr = {} Babel.chr_to_loc = Babel.chr_to_loc or {} end @@ -2865,44 +2847,43 @@ \endgroup}% {}} \def\bbl@provide@hyphens#1{% - \let\bbl@tempa\relax + \@tempcnta\m@ne % a flag \ifx\bbl@KVP@hyphenrules\@nnil\else \bbl@replace\bbl@KVP@hyphenrules{ }{,}% \bbl@foreach\bbl@KVP@hyphenrules{% - \ifx\bbl@tempa\relax % if not yet found + \ifnum\@tempcnta=\m@ne % if not yet found \bbl@ifsamestring{##1}{+}% - {{\bbl@exp{\\\addlanguage\<l@##1>}}}% + {\bbl@carg\addlanguage{l@##1}}% {}% - \bbl@ifunset{l@##1}% + \bbl@ifunset{l@##1}% After a possible + {}% - {\bbl@exp{\let\bbl@tempa\<l@##1>}}% + {\@tempcnta\@nameuse{l@##1}}% \fi}% - \ifx\bbl@tempa\relax + \ifnum\@tempcnta=\m@ne \bbl@warning{% Requested 'hyphenrules=' for '\languagename' not found.\\% Using the default value. Reported}% \fi \fi - \ifx\bbl@tempa\relax % if no opt or no language in opt found - \ifx\bbl@KVP@import\@nnil - \ifx\bbl@initoload\relax\else - \bbl@exp{% and hyphenrules is not empty - \\\bbl@ifblank{\bbl@cs{hyphr@#1}}% - {}% - {\let\\\bbl@tempa\<l@\bbl@cl{hyphr}>}}% - \fi - \else % if importing - \bbl@exp{% and hyphenrules is not empty - \\\bbl@ifblank{\bbl@cs{hyphr@#1}}% - {}% - {\let\\\bbl@tempa\<l@\bbl@cl{hyphr}>}}% + \ifnum\@tempcnta=\m@ne % if no opt or no language in opt found + \ifx\bbl@KVP@captions@@\@nnil % TODO. Hackish. See above. + \bbl@ifunset{bbl@hyphr@#1}{}% use value in ini, if exists + {\bbl@exp{\\\bbl@ifblank{\bbl@cs{hyphr@#1}}}% + {}% + {\bbl@ifunset{l@\bbl@cl{hyphr}}% + {}% if hyphenrules found: + {\@tempcnta\@nameuse{l@\bbl@cl{hyphr}}}}}% \fi \fi - \bbl@ifunset{bbl@tempa}% ie, relax or undefined - {\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@ifunset{l@#1}% + {\ifnum\@tempcnta=\m@ne + \bbl@carg\adddialect{l@#1}\language + \else + \bbl@carg\adddialect{l@#1}\@tempcnta + \fi}% + {\ifnum\@tempcnta=\m@ne\else + \global\bbl@carg\chardef{l@#1}\@tempcnta + \fi}} \def\bbl@input@texini#1{% \bbl@bsphack \bbl@exp{% @@ -3438,27 +3419,44 @@ \directlua{ local str = [==[#2]==] str = str:gsub('%.%d+%.%d+$', '') - tex.print([[\def\string\babeltempa{]] .. str .. [[}]]) + token.set_macro('babeltempa', str) }&% + \def\babeltempc{}&% \bbl@xin@{,\babeltempa,}{,\bbl@KVP@transforms,}&% + \ifin@\else + \bbl@xin@{:\babeltempa,}{,\bbl@KVP@transforms,}&% + \fi \ifin@ + \bbl@foreach\bbl@KVP@transforms{&% + \bbl@xin@{:\babeltempa,}{,##1,}&% + \ifin@ &% font:font:transform syntax + \directlua{ + local t = {} + for m in string.gmatch('##1'..':', '(.-):') do + table.insert(t, m) + end + table.remove(t) + token.set_macro('babeltempc', ',fonts=' .. table.concat(t, ' ')) + }&% + \fi}&% \in@{.0$}{#2$}&% \ifin@ \directlua{&% (\attribute) syntax local str = string.match([[\bbl@KVP@transforms]], '%(([^%(]-)%)[^%)]-\babeltempa') if str == nil then - tex.print([[\def\string\babeltempb{}]]) + token.set_macro('babeltempb', '') else - tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]]) + token.set_macro('babeltempb', ',attribute=' .. str) end - } + }&% \toks@{#3}&% \bbl@exp{&% \\\g@addto@macro\\\bbl@release@transforms{&% \relax &% Closes previous \bbl@transforms@aux \\\bbl@transforms@aux - \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&% + \\#1{label=\babeltempa\babeltempb\babeltempc}&% + {\languagename}{\the\toks@}}}&% \else \g@addto@macro\bbl@release@transforms{, {#3}}&% \fi diff --git a/Master/texmf-dist/tex/generic/babel/babel.sty b/Master/texmf-dist/tex/generic/babel/babel.sty index 5086adda397..bd34305775b 100644 --- a/Master/texmf-dist/tex/generic/babel/babel.sty +++ b/Master/texmf-dist/tex/generic/babel/babel.sty @@ -7,7 +7,7 @@ %% babel.dtx (with options: `package') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -34,7 +34,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] -\ProvidesPackage{babel}[2022/12/26 3.84 The Babel package] +\ProvidesPackage{babel}[2022/01/23 3.85 The Babel package] \@ifpackagewith{babel}{debug} {\providecommand\bbl@trace[1]{\message{^^J[ #1 ]}}% \let\bbl@debug\@firstofone @@ -449,6 +449,12 @@ \ifx\bbl@opt@layout\@nnil \newcommand\IfBabelLayout[3]{#3}% \else + \bbl@exp{\\\bbl@forkv{\@nameuse{@raw@opt@babel.sty}}}{% + \in@{,layout,}{,#1,}% + \ifin@ + \def\bbl@opt@layout{#2}% + \bbl@replace\bbl@opt@layout{ }{.}% + \fi} \newcommand\IfBabelLayout[1]{% \@expandtwoargs\in@{.#1.}{.\bbl@opt@layout.}% \ifin@ @@ -457,8 +463,8 @@ \expandafter\@secondoftwo \fi} \fi -\def\bbl@version{3.84} -\def\bbl@date{2022/12/26} +\def\bbl@version{3.85} +\def\bbl@date{2022/01/23} \ifx\language\@undefined \csname newcount\endcsname\language \fi @@ -1952,25 +1958,6 @@ {\bbl@tolower\@empty}{\bbl@toupper\@empty}}% \gdef\bbl@tolower{\csname\languagename @bbl@lc\endcsname}% \gdef\bbl@toupper{\csname\languagename @bbl@uc\endcsname}}} -\def\BabelRestoreCase{% - \DeclareRobustCommand{\MakeUppercase}[1]{{% - \def\reserved@a####1####2{\let####1####2\reserved@a}% - \def\i{I}\def\j{J}% - \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% - \let\UTF@two@octets@noexpand\@empty - \let\UTF@three@octets@noexpand\@empty - \let\UTF@four@octets@noexpand\@empty - \protected@edef\reserved@a{\uppercase{##1}}% - \reserved@a - }}% - \DeclareRobustCommand{\MakeLowercase}[1]{{% - \def\reserved@a####1####2{\let####2####1\reserved@a}% - \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% - \let\UTF@two@octets@noexpand\@empty - \let\UTF@three@octets@noexpand\@empty - \let\UTF@four@octets@noexpand\@empty - \protected@edef\reserved@a{\lowercase{##1}}% - \reserved@a}}} \@onlypreamble\StartBabelCommands \def\StartBabelCommands{% \begingroup @@ -2505,7 +2492,7 @@ % \ifx\bbl@KVP@date\@nnil\else % \fi % == - \let\bbl@lbkflag\relax % \@empty = do setup linebreak + \let\bbl@lbkflag\relax % \@empty = do setup linebreak, only in 3 cases: \ifcase\bbl@howloaded \let\bbl@lbkflag\@empty % new \else @@ -2530,6 +2517,7 @@ {}% \let\bbl@KVP@date\@empty \fi + \let\bbl@KVP@captions@@\bbl@KVP@captions % TODO. A dirty hack \ifx\bbl@KVP@captions\@nnil \let\bbl@KVP@captions\bbl@KVP@import \fi @@ -2594,7 +2582,7 @@ \directlua{ if Babel.locale_mapped == nil then Babel.locale_mapped = true - Babel.linebreaking.add_before(Babel.locale_map) + Babel.linebreaking.add_before(Babel.locale_map, 1) Babel.loc_to_scr = {} Babel.chr_to_loc = Babel.chr_to_loc or {} end @@ -2916,44 +2904,43 @@ \endgroup}% {}} \def\bbl@provide@hyphens#1{% - \let\bbl@tempa\relax + \@tempcnta\m@ne % a flag \ifx\bbl@KVP@hyphenrules\@nnil\else \bbl@replace\bbl@KVP@hyphenrules{ }{,}% \bbl@foreach\bbl@KVP@hyphenrules{% - \ifx\bbl@tempa\relax % if not yet found + \ifnum\@tempcnta=\m@ne % if not yet found \bbl@ifsamestring{##1}{+}% - {{\bbl@exp{\\\addlanguage\<l@##1>}}}% + {\bbl@carg\addlanguage{l@##1}}% {}% - \bbl@ifunset{l@##1}% + \bbl@ifunset{l@##1}% After a possible + {}% - {\bbl@exp{\let\bbl@tempa\<l@##1>}}% + {\@tempcnta\@nameuse{l@##1}}% \fi}% - \ifx\bbl@tempa\relax + \ifnum\@tempcnta=\m@ne \bbl@warning{% Requested 'hyphenrules=' for '\languagename' not found.\\% Using the default value. Reported}% \fi \fi - \ifx\bbl@tempa\relax % if no opt or no language in opt found - \ifx\bbl@KVP@import\@nnil - \ifx\bbl@initoload\relax\else - \bbl@exp{% and hyphenrules is not empty - \\\bbl@ifblank{\bbl@cs{hyphr@#1}}% - {}% - {\let\\\bbl@tempa\<l@\bbl@cl{hyphr}>}}% - \fi - \else % if importing - \bbl@exp{% and hyphenrules is not empty - \\\bbl@ifblank{\bbl@cs{hyphr@#1}}% - {}% - {\let\\\bbl@tempa\<l@\bbl@cl{hyphr}>}}% + \ifnum\@tempcnta=\m@ne % if no opt or no language in opt found + \ifx\bbl@KVP@captions@@\@nnil % TODO. Hackish. See above. + \bbl@ifunset{bbl@hyphr@#1}{}% use value in ini, if exists + {\bbl@exp{\\\bbl@ifblank{\bbl@cs{hyphr@#1}}}% + {}% + {\bbl@ifunset{l@\bbl@cl{hyphr}}% + {}% if hyphenrules found: + {\@tempcnta\@nameuse{l@\bbl@cl{hyphr}}}}}% \fi \fi - \bbl@ifunset{bbl@tempa}% ie, relax or undefined - {\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@ifunset{l@#1}% + {\ifnum\@tempcnta=\m@ne + \bbl@carg\adddialect{l@#1}\language + \else + \bbl@carg\adddialect{l@#1}\@tempcnta + \fi}% + {\ifnum\@tempcnta=\m@ne\else + \global\bbl@carg\chardef{l@#1}\@tempcnta + \fi}} \def\bbl@input@texini#1{% \bbl@bsphack \bbl@exp{% @@ -3489,27 +3476,44 @@ \directlua{ local str = [==[#2]==] str = str:gsub('%.%d+%.%d+$', '') - tex.print([[\def\string\babeltempa{]] .. str .. [[}]]) + token.set_macro('babeltempa', str) }&% + \def\babeltempc{}&% \bbl@xin@{,\babeltempa,}{,\bbl@KVP@transforms,}&% + \ifin@\else + \bbl@xin@{:\babeltempa,}{,\bbl@KVP@transforms,}&% + \fi \ifin@ + \bbl@foreach\bbl@KVP@transforms{&% + \bbl@xin@{:\babeltempa,}{,##1,}&% + \ifin@ &% font:font:transform syntax + \directlua{ + local t = {} + for m in string.gmatch('##1'..':', '(.-):') do + table.insert(t, m) + end + table.remove(t) + token.set_macro('babeltempc', ',fonts=' .. table.concat(t, ' ')) + }&% + \fi}&% \in@{.0$}{#2$}&% \ifin@ \directlua{&% (\attribute) syntax local str = string.match([[\bbl@KVP@transforms]], '%(([^%(]-)%)[^%)]-\babeltempa') if str == nil then - tex.print([[\def\string\babeltempb{}]]) + token.set_macro('babeltempb', '') else - tex.print([[\def\string\babeltempb{,attribute=]] .. str .. [[}]]) + token.set_macro('babeltempb', ',attribute=' .. str) end - } + }&% \toks@{#3}&% \bbl@exp{&% \\\g@addto@macro\\\bbl@release@transforms{&% \relax &% Closes previous \bbl@transforms@aux \\\bbl@transforms@aux - \\#1{label=\babeltempa\babeltempb}{\languagename}{\the\toks@}}}&% + \\#1{label=\babeltempa\babeltempb\babeltempc}&% + {\languagename}{\the\toks@}}}&% \else \g@addto@macro\bbl@release@transforms{, {#3}}&% \fi @@ -4121,8 +4125,8 @@ \def\bbl@alscripts{,Arabic,Syriac,Thaana,} \def\bbl@rscripts{% TODO. Base on codes ?? ,Imperial Aramaic,Avestan,Cypriot,Hatran,Hebrew,% - Old Hungarian,Old Hungarian,Lydian,Mandaean,Manichaean,% - Manichaean,Meroitic Cursive,Meroitic,Old North Arabian,% + Old Hungarian,Lydian,Mandaean,Manichaean,% + Meroitic Cursive,Meroitic,Old North Arabian,% Nabataean,N'Ko,Orkhon,Palmyrene,Inscriptional Pahlavi,% Psalter Pahlavi,Phoenician,Inscriptional Parthian,Samaritan,% Old South Arabian,}% diff --git a/Master/texmf-dist/tex/generic/babel/blplain.tex b/Master/texmf-dist/tex/generic/babel/blplain.tex index de6c9c90e8d..dfc3b6f9aca 100644 --- a/Master/texmf-dist/tex/generic/babel/blplain.tex +++ b/Master/texmf-dist/tex/generic/babel/blplain.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `blplain') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/bplain.tex b/Master/texmf-dist/tex/generic/babel/bplain.tex index 8804967480a..50895735315 100644 --- a/Master/texmf-dist/tex/generic/babel/bplain.tex +++ b/Master/texmf-dist/tex/generic/babel/bplain.tex @@ -7,7 +7,7 @@ %% babel.dtx (with options: `bplain') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/hyphen.cfg b/Master/texmf-dist/tex/generic/babel/hyphen.cfg index 340cd8fd97f..2ae6e036eb4 100644 --- a/Master/texmf-dist/tex/generic/babel/hyphen.cfg +++ b/Master/texmf-dist/tex/generic/babel/hyphen.cfg @@ -7,7 +7,7 @@ %% babel.dtx (with options: `patterns') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -38,10 +38,10 @@ \wlog{File: #1 #4 #3 <#2>}% \let\ProvidesFile\@undefined} \fi -\ProvidesFile{hyphen.cfg}[2022/12/26 3.84 Babel hyphens] +\ProvidesFile{hyphen.cfg}[2022/01/23 3.85 Babel hyphens] \xdef\bbl@format{\jobname} -\def\bbl@version{3.84} -\def\bbl@date{2022/12/26} +\def\bbl@version{3.85} +\def\bbl@date{2022/01/23} \ifx\AtBeginDocument\@undefined \def\@empty{} \fi diff --git a/Master/texmf-dist/tex/generic/babel/luababel.def b/Master/texmf-dist/tex/generic/babel/luababel.def index 30f8c2000db..73804ad768d 100644 --- a/Master/texmf-dist/tex/generic/babel/luababel.def +++ b/Master/texmf-dist/tex/generic/babel/luababel.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `luatex') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -379,9 +379,13 @@ end Babel.linebreaking.before = {} Babel.linebreaking.after = {} Babel.locale = {} % Free to use, indexed by \localeid - function Babel.linebreaking.add_before(func) + function Babel.linebreaking.add_before(func, pos) tex.print([[\noexpand\csname bbl@luahyphenate\endcsname]]) - table.insert(Babel.linebreaking.before, func) + if pos == nil then + table.insert(Babel.linebreaking.before, func) + else + table.insert(Babel.linebreaking.before, pos, func) + end end function Babel.linebreaking.add_after(func) tex.print([[\noexpand\csname bbl@luahyphenate\endcsname]]) @@ -896,7 +900,7 @@ end \global\let\<bbl@##1dflt@\languagename>% \<bbl@##1dflt@*\bbl@tempa>}}}% {}}% 1=T - language, already defined - \def\bbl@tempa{\bbl@nostdfont{}}% + \def\bbl@tempa{\bbl@nostdfont{}}% TODO. Don't use \bbl@tempa \bbl@foreach\bbl@font@fams{% don't gather with prev for \bbl@ifunset{bbl@##1dflt@\languagename}% {\bbl@cs{famrst@##1}% @@ -1196,8 +1200,36 @@ end \fi}}&% \let\bbl@kv@attribute\relax \let\bbl@kv@label\relax + \let\bbl@kv@fonts\@empty \bbl@forkv{#2}{\bbl@csarg\edef{kv@##1}{##2}}&% - \ifx\bbl@kv@attribute\relax\else + \ifx\bbl@kv@fonts\@empty\else\bbl@settransfont\fi + \ifx\bbl@kv@attribute\relax + \ifx\bbl@kv@label\relax\else + \bbl@exp{\\\bbl@trim@def\\\bbl@kv@fonts{\bbl@kv@fonts}}&% + \bbl@replace\bbl@kv@fonts{ }{,}&% + \edef\bbl@kv@attribute{bbl@ATR@\bbl@kv@label @#3@\bbl@kv@fonts}&% + \count@\z@ + \def\bbl@elt##1##2##3{&% + \bbl@ifsamestring{#3,\bbl@kv@label}{##1,##2}&% + {\bbl@ifsamestring{\bbl@kv@fonts}{##3}&% + {\count@\@ne}&% + {\bbl@error + {Transforms cannot be re-assigned to different\\&% + fonts. The conflict is in '\bbl@kv@label'.\\&% + Apply the same fonts or use a different label}&% + {See the manual for further details.}}}&% + {}}&% + \bbl@transfont@list + \ifnum\count@=\z@ + \bbl@exp{\global\\\bbl@add\\\bbl@transfont@list + {\\\bbl@elt{#3}{\bbl@kv@label}{\bbl@kv@fonts}}}&% + \fi + \bbl@ifunset{\bbl@kv@attribute}&% + {\global\bbl@carg\newattribute{\bbl@kv@attribute}}&% + {}&% + \global\bbl@carg\setattribute{\bbl@kv@attribute}\@ne + \fi + \else \edef\bbl@kv@attribute{\expandafter\bbl@stripslash\bbl@kv@attribute}&% \fi \directlua{ @@ -1243,6 +1275,49 @@ end }&% \endgroup} \endgroup +\let\bbl@transfont@list\@empty +\def\bbl@settransfont{% + \global\let\bbl@settransfont\relax % Execute only once + \gdef\bbl@transfont{% + \def\bbl@elt####1####2####3{% + \bbl@ifblank{####3}% + {\count@\tw@}% Do nothing if no fonts + {\count@\z@ + \bbl@vforeach{####3}{% + \def\bbl@tempd{########1}% + \edef\bbl@tempe{\bbl@transfam/\f@series/\f@shape}% + \ifx\bbl@tempd\bbl@tempe + \count@\@ne + \else\ifx\bbl@tempd\bbl@transfam + \count@\@ne + \fi\fi}% + \ifcase\count@ + \bbl@csarg\unsetattribute{ATR@####2@####1@####3}% + \or + \bbl@csarg\setattribute{ATR@####2@####1@####3}\@ne + \fi}}% + \bbl@transfont@list}% + \AddToHook{selectfont}{\bbl@transfont}% Hooks are global. + \gdef\bbl@transfam{-unknown-}% + \bbl@foreach\bbl@font@fams{% + \AddToHook{##1family}{\def\bbl@transfam{##1}}% + \bbl@ifsamestring{\@nameuse{##1default}}\familydefault + {\xdef\bbl@transfam{##1}}% + {}}} +\DeclareRobustCommand\enablelocaletransform[1]{% + \bbl@ifunset{bbl@ATR@#1@\languagename @}% + {\bbl@error + {'#1' for '\languagename' cannot be enabled.\\% + Maybe there is a typo or it’s a font-dependent transform}% + {See the manual for further details.}}% + {\bbl@csarg\setattribute{ATR@#1@\languagename @}\@ne}} +\DeclareRobustCommand\disablelocaletransform[1]{% + \bbl@ifunset{bbl@ATR@#1@\languagename @}% + {\bbl@error + {'#1' for '\languagename' cannot be disabled.\\% + Maybe there is a typo or it’s a font-dependent transform}% + {See the manual for further details.}}% + {\bbl@csarg\unsetattribute{ATR@#1@\languagename @}}} \def\bbl@activateposthyphen{% \let\bbl@activateposthyphen\relax \directlua{ @@ -1334,6 +1409,7 @@ end \def\bbl@textdir#1{% \bbl@setluadir{text}\textdir{#1}% \chardef\bbl@thetextdir#1\relax + % par/text 0..8 = l/l l/r l/al r/l r/r r/al al/l al/r al/al \edef\bbl@thedir{\the\numexpr\bbl@thepardir*3+#1}% \setattribute\bbl@attr@dir{\numexpr\bbl@thepardir*3+#1}} \def\bbl@pardir#1{% @@ -1344,23 +1420,36 @@ end \def\bbl@dirparastext{\pardir\the\textdir\relax}% %%%% \ifnum\bbl@bidimode>\z@ \def\bbl@insidemath{0}% - \def\bbl@everymath{\def\bbl@insidemath{1}} - \def\bbl@everydisplay{\def\bbl@insidemath{2}} + \def\bbl@mathboxdir{% + \ifcase\bbl@thetextdir\relax + \everyhbox{\bbl@mathboxdir@aux L}% + \else + \everyhbox{\bbl@mathboxdir@aux R}% + \fi} + \def\bbl@mathboxdir@aux#1{% + \@ifnextchar\egroup{}{\textdir T#1T\relax}} + \def\bbl@everymath{\bbl@mathboxdir} + \def\bbl@everydisplay{% + \bbl@mathboxdir + \def\bbl@everymath{\bbl@mathboxdir}} \frozen@everymath\expandafter{% \expandafter\bbl@everymath\the\frozen@everymath} \frozen@everydisplay\expandafter{% \expandafter\bbl@everydisplay\the\frozen@everydisplay} \AtBeginDocument{ \directlua{ + Babel.use_math_box_dir = true 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')) + if Babel.use_math_box_dir then + 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 end @@ -1403,6 +1492,7 @@ end \ifx\maketag@@@\@undefined % Normal equation, eqnarray \AddToHook{env/equation/begin}{% \ifnum\bbl@thetextdir>\z@ + \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% \let\@eqnnum\bbl@eqnum \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% \chardef\bbl@thetextdir\z@ @@ -1418,6 +1508,8 @@ end \fi \AddToHook{env/eqnarray/begin}{% \ifnum\bbl@thetextdir>\z@ + \def\bbl@mathboxdir{\def\bbl@insidemath{1}} + \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% \chardef\bbl@thetextdir\z@ \bbl@add\normalfont{\bbl@eqnodir}% @@ -1455,6 +1547,7 @@ end \hbox to 0.01pt{\hbox to\displaywidth{\hss{#1}}\hss}}% \fi \def\bbl@ams@preset#1{% + \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% \ifnum\bbl@thetextdir>\z@ \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% \bbl@sreplace\textdef@{\hbox}{\bbl@ams@tagbox\hbox}% @@ -1462,6 +1555,7 @@ end \fi}% \ifnum\bbl@eqnpos=\tw@\else \def\bbl@ams@equation{% + \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% \ifnum\bbl@thetextdir>\z@ \edef\bbl@eqnodir{\noexpand\bbl@textdir{\the\bbl@thetextdir}}% \chardef\bbl@thetextdir\z@ @@ -1487,6 +1581,7 @@ end \\\AddToHook{env/align*/end}{\<iftag@>\<else>\\\tag*{}\<fi>}}% \AddToHook{env/flalign/begin}{\bbl@ams@preset\hbox}% \AddToHook{env/split/before}{% + \def\bbl@mathboxdir{\def\bbl@insidemath{1}}% \ifnum\bbl@thetextdir>\z@ \bbl@ifsamestring\@currenvir{equation}% {\ifx\bbl@ams@lap\hbox % leqno diff --git a/Master/texmf-dist/tex/generic/babel/nil.ldf b/Master/texmf-dist/tex/generic/babel/nil.ldf index 64fc65b5a74..c92f25e599a 100644 --- a/Master/texmf-dist/tex/generic/babel/nil.ldf +++ b/Master/texmf-dist/tex/generic/babel/nil.ldf @@ -7,7 +7,7 @@ %% babel.dtx (with options: `nil') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -33,7 +33,7 @@ %% extension |.ins|) which are part of the distribution. %% -\ProvidesLanguage{nil}[2022/12/26 3.84 Nil language] +\ProvidesLanguage{nil}[2022/01/23 3.85 Nil language] \LdfInit{nil}{datenil} \ifx\l@nil\@undefined \newlanguage\l@nil diff --git a/Master/texmf-dist/tex/generic/babel/plain.def b/Master/texmf-dist/tex/generic/babel/plain.def index f11a944416f..e0b436221a2 100644 --- a/Master/texmf-dist/tex/generic/babel/plain.def +++ b/Master/texmf-dist/tex/generic/babel/plain.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `plain') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def index 20749c65387..03179a9e5bc 100644 --- a/Master/texmf-dist/tex/generic/babel/switch.def +++ b/Master/texmf-dist/tex/generic/babel/switch.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `kernel') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/txtbabel.def b/Master/texmf-dist/tex/generic/babel/txtbabel.def index cb34d09338a..318e37fb3cc 100644 --- a/Master/texmf-dist/tex/generic/babel/txtbabel.def +++ b/Master/texmf-dist/tex/generic/babel/txtbabel.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `texxet') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. diff --git a/Master/texmf-dist/tex/generic/babel/xebabel.def b/Master/texmf-dist/tex/generic/babel/xebabel.def index 83bbc23de04..1df90a64f56 100644 --- a/Master/texmf-dist/tex/generic/babel/xebabel.def +++ b/Master/texmf-dist/tex/generic/babel/xebabel.def @@ -7,7 +7,7 @@ %% babel.dtx (with options: `xetex') %% %% -%% Copyright (C) 2012-2022 Javier Bezos and Johannes L. Braams. +%% Copyright (C) 2012-2023 Javier Bezos and Johannes L. Braams. %% Copyright (C) 1989-2012 Johannes L. Braams and %% any individual authors listed elsewhere in this file. %% All rights reserved. @@ -176,7 +176,7 @@ \global\let\<bbl@##1dflt@\languagename>% \<bbl@##1dflt@*\bbl@tempa>}}}% {}}% 1=T - language, already defined - \def\bbl@tempa{\bbl@nostdfont{}}% + \def\bbl@tempa{\bbl@nostdfont{}}% TODO. Don't use \bbl@tempa \bbl@foreach\bbl@font@fams{% don't gather with prev for \bbl@ifunset{bbl@##1dflt@\languagename}% {\bbl@cs{famrst@##1}% |