[latex3-commits] [git/LaTeX3-latex3-babel] main: Patch tabular internals (wip). (a7127bb)

Javier email at dante.de
Tue Feb 7 17:33:34 CET 2023


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

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

commit a7127bb1ca338cc0ced199839bbc30125819428f
Author: Javier <email at localhost>
Date:   Tue Feb 7 17:33:34 2023 +0100

    Patch tabular internals (wip).


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

a7127bb1ca338cc0ced199839bbc30125819428f
 README.md    |   2 +-
 babel.dtx    |  48 +++++++++++++++++++++++++++++++++++++++++++++---
 babel.ins    |   2 +-
 babel.pdf    | Bin 917817 -> 919934 bytes
 bbcompat.dtx |   2 +-
 5 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 6e39bb3..8a0d90d 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-## Babel 3.85.03581
+## Babel 3.85.03869
 
 (Draft)
 
diff --git a/babel.dtx b/babel.dtx
index 2781ce4..953ecf4 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -32,7 +32,7 @@
 %
 % \iffalse
 %<*filedriver>
-\ProvidesFile{babel.dtx}[2023/02/04 v3.85.03581 The Babel package]
+\ProvidesFile{babel.dtx}[2023/02/07 v3.85.03869 The Babel package]
 \documentclass{ltxdoc}
 \GetFileInfo{babel.dtx}
 \usepackage{fontspec}
@@ -5286,8 +5286,8 @@ help from Bernd Raichle, for which I am grateful.
 % \section{Tools}
 %
 %    \begin{macrocode}
-%<<version=3.85.03581>>
-%<<date=2023/02/04>>
+%<<version=3.85.03869>>
+%<<date=2023/02/07>>
 %    \end{macrocode}
 %
 % \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -14911,7 +14911,13 @@ 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}
+%
+% RTL text inside math needs special attention. It affects not only to
+% actual math stuff, but also to `tabular`, which is based on a fake
+% math.
 %
+%    \begin{macrocode}
 \ifnum\bbl at bidimode>\z@
   \def\bbl at insidemath{0}%
   \def\bbl at everymath{\def\bbl at insidemath{1}}
@@ -15163,6 +15169,42 @@ end
     \csname bbl at inidata@\languagename\endcsname
     \bbl at release@transforms\relax % \relax closes the last item.
   \fi}
+% Start tabular here: WIP
+\def\babelrestoredirs{%
+  \ifcase\bbl at thetextdir
+    \ifnum\textdirection=\z@\else\textdir TLT\fi
+  \else
+    \ifnum\textdirection=\@ne\else\textdir TRT\fi
+  \fi
+  \ifcase\bbl at thepardir
+    \ifnum\pardirection=\z@\else\pardir TLT\bodydir TLT\fi
+  \else
+    \ifnum\pardirection=\@ne\else\pardir TRT\bodydir TRT\fi
+  \fi}
+\IfBabelLayout{tabular}%
+  {\chardef\bbl at tabular@mode\tw@}% All RTL
+  {\IfBabelLayout{notabular}%
+    {\chardef\bbl at tabular@mode\z@}%
+    {\chardef\bbl at tabular@mode\@ne}}% Mixed, with LTR cols
+\ifnum\bbl at tabular@mode=\@ne
+  \let\bbl at parabefore\relax
+  \ifx\AddToHook\@undefined\else
+    \AddToHook{para/before}{\bbl at parabefore}%
+  \fi
+  \global\let\bbl at thenextmath\relax
+  \ifx\@tabular\@undefined\else
+    \bbl at replace\@tabular{$}{$%
+      \def\bbl at insidemath{0}%
+      \def\bbl at parabefore{\babelrestoredirs}%
+      \everyhbox{\def\bbl at insidemath{0}}%
+      \everyvbox{\def\bbl at insidemath{0}}}%
+    \bbl at ifunset{@tabclassz}{}{%
+      \bbl at sreplace\@tabclassz
+        {\ifcase\@chnum}{\bgroup\babelrestoredirs\ifcase\@chnum}%
+      \bbl at sreplace\@tabclassz
+        {\@sharp\unskip\fi}{\@sharp\unskip\fi\egroup}}
+    \fi
+  \fi
 \ifx\bbl at opt@layout\@nnil\endinput\fi  % if no layout
 %    \end{macrocode}
 %
diff --git a/babel.ins b/babel.ins
index 156f055..d2d131c 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/02/04}
+\def\filedate{2023/02/07}
 \def\batchfile{babel.ins}
 \input docstrip.tex
 
diff --git a/babel.pdf b/babel.pdf
index 2cdb1e3..aa34c80 100644
Binary files a/babel.pdf and b/babel.pdf differ
diff --git a/bbcompat.dtx b/bbcompat.dtx
index 5dd5d02..3ac3431 100644
--- a/bbcompat.dtx
+++ b/bbcompat.dtx
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/02/04 v3.85.03581]
+\ProvidesFile{bbcompat.dtx}[2023/02/07 v3.85.03869]
 %</dtx>
 %
 %% File 'bbcompat.dtx'





More information about the latex3-commits mailing list.