[latex3-commits] [git/LaTeX3-latex3-babel] main: Undo changes for tabular - ya dead end. (7207bfc)

Javier email at dante.de
Mon Jan 30 19:26:59 CET 2023


Repository : https://github.com/latex3/babel
On branch  : main
Link       : https://github.com/latex3/babel/commit/7207bfc2491ffd72c90fa32bcbb6cdb12123f6e4

>---------------------------------------------------------------

commit 7207bfc2491ffd72c90fa32bcbb6cdb12123f6e4
Author: Javier <email at localhost>
Date:   Mon Jan 30 19:26:59 2023 +0100

    Undo changes for tabular - ya dead end.


>---------------------------------------------------------------

7207bfc2491ffd72c90fa32bcbb6cdb12123f6e4
 README.md    |   6 +--
 babel.dtx    | 125 +++++++++++++++++++----------------------------------------
 babel.ins    |   2 +-
 babel.pdf    | Bin 920333 -> 918355 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 43 insertions(+), 92 deletions(-)

diff --git a/README.md b/README.md
index 0c6ef62..aa84a05 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.85.2997
+## Babel 3.85.2998
 
 (Draft)
 
@@ -48,10 +48,6 @@ respective authors.
 
 ### Summary of latest changes
 ```
-3.86  (dev)
-      * Revised `tabular` with ‘mixed’ directions. New option
-        `layout=notabular`.
-
 3.85  2023-01-23
       * A high-level interface to enable and disable transforms (lua).
       * Font-dependent transforms (lua).
diff --git a/babel.dtx b/babel.dtx
index 0e72ad9..d73127c 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2023/01/29 v3.85.2997 The Babel package]
+\ProvidesFile{babel.dtx}[2023/01/30 v3.85.2998 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -2579,7 +2579,7 @@ languages.
   Polytonic Greek with but with some sections in Italian. Then, the
   first attempt should be:
 \begin{verbatim}
-\usepackage[italian, greek.polutonic]{babel}
+\usepackage[italian, greek.polutonico]{babel}
 \end{verbatim}
   But if, say, accents in Greek are not shown correctly, you can try
 \begin{verbatim}
@@ -5286,8 +5286,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.85.2997>>
-%<<date=2023/01/29>>
+%<<version=3.85.2998>>
+%<<date=2023/01/30>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -14859,8 +14859,8 @@ end
 %
 % The basic setup. The output is modified at a very low level to set
 % the |\bodydir| to the |\pagedir|. Sadly, we have to deal with boxes
-% in math with |basic|, so hacks must be activated always with the
-% package option |bidi=|.
+% in math with basic, so the |\bbl at mathboxdir| hack is activated every
+% math with the package option bidi=.
 %
 %    \begin{macrocode}
 \ifnum\bbl at bidimode>\@ne % Excludes default=1
@@ -14911,58 +14911,46 @@ end
 \def\bbl at bodydir{\bbl at setluadir{body}\bodydir}%   Used once
 \def\bbl at pagedir{\bbl at setluadir{page}\pagedir}%   Unused
 \def\bbl at dirparastext{\pardir\the\textdir\relax}% Used once
-%    \end{macrocode}
-%
-% In some cases, direction in |\hbox|es are set at the `lua` level,
-% namely, in math mode and in |\halign|. The latter is particularly
-% difficult to deal with in a general way if the direction of columns
-% is diferent to the text one, because they both are governed by
-% |\textdir|. Since \babel{} stores the direction in a macro and at each
-% node, we can recover and apply it. (Note an explicit direction at the
-% beginning of |\halign| applies only to the first column.)
-% |Babel.hlist_dir| is executed before the bidi algorithm, so that
-% the inserted ‘dir’ nodes look much like an explicit |\textdir|.
 %
-%    \begin{macrocode}
-\ifnum\bbl at bidimode>\z@ % Includes default=1
-  \let\bbl at parabefore\relax
-  \AddToHook{para/before}{\bbl at parabefore}%
-  \global\let\bbl at thenextmath\relax
+\ifnum\bbl at bidimode>\z@
   \def\bbl at insidemath{0}%
+  \def\bbl at mathboxdir{%
+    \ifcase\bbl at thetextdir\relax
+      \everyhbox{\bbl at mathboxdir@aux L}%
+    \else
+      \everyhbox{\bbl at mathboxdir@aux R}%
+     \fi}
+  \def\bbl at mathboxdir@aux#1{%
+    \@ifnextchar\egroup{}{\textdir T#1T\relax}}
   \def\bbl at everymath{%
-    \def\bbl at insidemath{1}%
-    \bbl at thenextmath}
-  \def\bbl at everydisplay{\def\bbl at insidemath{2}}
+    \bbl at mathboxdir
+    \def\bbl at insidemath{1}}
+  \def\bbl at everydisplay{%
+    \bbl at mathboxdir
+    \def\bbl at everymath{\bbl at mathboxdir}%
+    \def\bbl at insidemath{2}}
   \frozen at everymath\expandafter{%
     \expandafter\bbl at everymath\the\frozen at everymath}
   \frozen at everydisplay\expandafter{%
     \expandafter\bbl at everydisplay\the\frozen at everydisplay}
   \AtBeginDocument{
     \directlua{
-      function Babel.hlist_dir(head)
-        local hlistmode = token.get_macro('bbl at insidemath')
-        if hlistmode == '0' then
-          return head
-        elseif hlistmode == '1' or hlistmode == '2' then % 1=math, 2=display
+      function Babel.math_box_dir(head)
+        if not (token.get_macro('bbl at insidemath') == '0') then
           if Babel.hlist_has_bidi(head) then
             local d = node.new(node.id'dir')
             d.dir = '+TRT'
-            head = node.insert_before(head, head, d)
-          end
-        else % \halign with lr columns. Ignore tabskip boxes.
-          if head and not (head.id==12 and head.subtype==12) then
-            if node.get_attribute(head, Babel.attr_dir) & 0x3
-                \string~= 0 then % ie, 1 2 4 5 7 8
-              local d = node.new(node.id'dir')
-              d.dir = '+TRT'
-              head = node.insert_before(head, head, d)
+            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 at thedir'))
             end
           end
         end
         return head
       end
-      luatexbase.add_to_callback("hpack_filter", Babel.hlist_dir,
-        "Babel.hlist_dir", 0)
+      luatexbase.add_to_callback("hpack_filter", Babel.math_box_dir,
+        "Babel.math_box_dir", 0)
   }}%
 \fi
 %    \end{macrocode}
@@ -15031,6 +15019,7 @@ end
     \ifx\maketag@@@\@undefined % Normal equation, eqnarray
       \AddToHook{env/equation/begin}{%
         \ifnum\bbl at thetextdir>\z@
+          \def\bbl at mathboxdir{\def\bbl at insidemath{1}}%
           \let\@eqnnum\bbl at eqnum
           \edef\bbl at eqnodir{\noexpand\bbl at textdir{\the\bbl at thetextdir}}%
           \chardef\bbl at thetextdir\z@
@@ -15046,6 +15035,7 @@ end
       \fi
       \AddToHook{env/eqnarray/begin}{%
         \ifnum\bbl at thetextdir>\z@
+          \def\bbl at mathboxdir{\def\bbl at insidemath{1}}%
           \edef\bbl at eqnodir{\noexpand\bbl at textdir{\the\bbl at thetextdir}}%
           \chardef\bbl at thetextdir\z@
           \bbl at add\normalfont{\bbl at eqnodir}%
@@ -15180,44 +15170,6 @@ end
     \csname bbl at inidata@\languagename\endcsname
     \bbl at release@transforms\relax % \relax closes the last item.
   \fi}
-%    \end{macrocode}
-%
-% The following comes before the test for the existence of |layout|,
-% because the default behavior is modified, too. Note |notabular|
-% (below) modifies |\bbl at nextfake@lr|.
-%
-%    \begin{macrocode}
-\IfBabelLayout{tabular}
-  {\let\bbl at OL@@tabular\@tabular
-   \bbl at replace\@tabular{$}{\bbl at nextfake$}%
-   \let\bbl at NL@@tabular\@tabular
-   \AtBeginDocument{%
-     \ifx\bbl at NL@@tabular\@tabular\else
-       \bbl at replace\@tabular{$}{\bbl at nextfake$}%
-       \let\bbl at NL@@tabular\@tabular
-     \fi}}
-  {}
-\ifx\bbl at OL@@tabular\@undefined % Default
-  \ifx\@tabular\@undefined\else
-    \def\bbl at nextfake@lr#1{%
-      #1% 
-      \ifnum\bbl at thetextdir>\z@
-        \edef\bbl at insidemath{3}% 
-        \def\bbl at parabefore{\bodydir TRT \pardir TRT \textdir TRT}%
-      \else
-        \edef\bbl at insidemath{0}%
-        \let\bbl at parabefore\relax
-      \fi}%
-    \let\bbl at OL@@tabular\@tabular
-    \bbl at replace\@tabular{$}{\bbl at nextfake@lr$}%
-    \let\bbl at NL@@tabular\@tabular
-    \AtBeginDocument{%
-      \ifx\bbl at NL@@tabular\@tabular\else
-        \bbl at replace\@tabular{$}{\bbl at nextfake@lr$}%
-        \let\bbl at NL@@tabular\@tabular
-      \fi}
-  \fi
-\fi
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % if no layout
 %    \end{macrocode}
 %
@@ -15257,13 +15209,16 @@ end
     \fi
     \noindent\box\@tempboxa}
 \fi
-\IfBabelLayout{notabular}
-  {\def\bbl at nextfake@lr#1{%
-     #1% 
-     \ifnum\bbl at thetextdir>\z@
-       \edef\bbl at insidemath{0}%
+\IfBabelLayout{tabular}
+  {\let\bbl at OL@@tabular\@tabular
+   \bbl at replace\@tabular{$}{\bbl at nextfake$}%
+   \let\bbl at NL@@tabular\@tabular
+   \AtBeginDocument{%
+     \ifx\bbl at NL@@tabular\@tabular\else
+       \bbl at replace\@tabular{$}{\bbl at nextfake$}%
+       \let\bbl at NL@@tabular\@tabular
      \fi}}
-  {}
+   {}
 \IfBabelLayout{lists}
   {\let\bbl at OL@list\list
    \bbl at sreplace\list{\parshape}{\bbl at listparshape}%
diff --git a/babel.ins b/babel.ins
index a7c4f81..7d1f083 100644
--- a/babel.ins
+++ b/babel.ins
@@ -26,7 +26,7 @@
 %% and covered by LPPL is defined by the unpacking scripts (with
 %% extension .ins) which are part of the distribution.
 %%
-\def\filedate{2023/01/29}
+\def\filedate{2023/01/30}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 5754e90..5c9b5f3 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index aa5ecdf..36d1af0 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/01/29 v3.85.2997]
+\ProvidesFile{bbcompat.dtx}[2023/01/30 v3.85.2998]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.