[latex3-commits] [latex3/latex2e] testmergearray: move \@tabular patch into math code (7ad0dc26)

github at latex-project.org github at latex-project.org
Sun Dec 24 20:49:06 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : testmergearray
Link       : https://github.com/latex3/latex2e/commit/7ad0dc26fc64d2a850576f5f80e8befbacceb60b

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

commit 7ad0dc26fc64d2a850576f5f80e8befbacceb60b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Dec 24 20:49:06 2023 +0100

    move \@tabular patch into math code


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

7ad0dc26fc64d2a850576f5f80e8befbacceb60b
 required/latex-lab/latex-lab-math.dtx | 31 ++++++++++++++-----------------
 required/tools/array.dtx              |  9 +--------
 2 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 97a8b51b..38df150f 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -1333,25 +1333,22 @@
 \math_register_env:n { eqnarray* }
 %    \end{macrocode}
 %
-% Places where math mode is (ab)used.
+% Tabulars currently contain a \$ that shouldn't trigger math
+% tagging.  
 %    \begin{macrocode}
-\clist_map_inline:nn
-  { tabular , tabular* }
-  {
-    \AddToHook{ env / #1 / begin }
-      { \bool_set_true:N \l_@@_collected_bool }
-  }
-%    \end{macrocode}
-% if latex-lab-testphase-table is loaded (and so also the new
-% array) it will handle the fakemath, so we can undo the hooks again:
-%    \begin{macrocode}
-\AddToHook{package/latex-lab-testphase-table/after}
+\RequirePackage{array}
+\tl_if_in:NnT\@tabular{$}
  {
-   \clist_map_inline:nn
-  { tabular , tabular* }
-  {
-    \RemoveFromHook{ env / #1 / begin }[latex-lab-testphase-math]
-  }
+   \def\@tabular{%
+   \leavevmode
+   \UseTaggingSocket{tbl/hmode/begin}%
+   \hbox \bgroup
+   \bool_set_true:N \l_@@_collected_bool 
+   $
+   \bool_set_false:N \l_@@_collected_bool
+   \col at sep\tabcolsep \let\d at llarbegin\begingroup
+                                    \let\d at llarend\endgroup
+   \@tabarray}
  }
 %    \end{macrocode}
 %
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index c24d25b5..f4f2f09a 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -2728,8 +2728,6 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 % \begin{macro}{\@tabular}
 %    The rest of the job is carried out by the =\@tabular= macro:
 %    \begin{macrocode}
-\providecommand\FakeMathStart{}
-\providecommand\FakeMathStop{}
 \def\@tabular{%
 %    \end{macrocode}
 %    First of all we have to make sure that we start out in
@@ -2750,12 +2748,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 %    =\d at llar...=.
 % \changes{v2.0d}{1990/08/20}{`d at llar local to preamble.}
 %    \begin{macrocode}
-  \hbox \bgroup 
-%    \end{macrocode}
-% The dollar should not start math grabbing. 
-%    \begin{macrocode}
-  \FakeMathStart$\FakeMathStop  
-  \col at sep\tabcolsep \let\d at llarbegin\begingroup
+  \hbox \bgroup $\col at sep\tabcolsep \let\d at llarbegin\begingroup
                                     \let\d at llarend\endgroup
 %    \end{macrocode}
 %    Now everything \textsf{tabular} specific is done and we are able to





More information about the latex3-commits mailing list.