[latex3-commits] [latex3/latex2e] array: starting with L3 layer in array (WIP) (69ee8153)

github at latex-project.org github at latex-project.org
Wed Dec 6 11:41:10 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : array
Link       : https://github.com/latex3/latex2e/commit/69ee815310d8c5d01b99bde2c63d0419a5ee6eb4

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

commit 69ee815310d8c5d01b99bde2c63d0419a5ee6eb4
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Dec 6 11:41:10 2023 +0100

    starting with L3 layer in array (WIP)


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

69ee815310d8c5d01b99bde2c63d0419a5ee6eb4
 required/latex-lab/latex-lab-table.dtx             |  57 +------
 .../latex-lab/testfiles-table-luatex/table-000.tlg |   4 +-
 .../latex-lab/testfiles-table-luatex/table-002.tlg |   4 -
 .../testfiles-table-luatex/table-007-longtable.tlg |   2 -
 .../testfiles-table-luatex/table-008-multi.tlg     |   2 -
 .../latex-lab/testfiles-table-luatex/table-009.tlg |   1 -
 .../latex-lab/testfiles-table-luatex/table-015.tlg |   2 -
 .../latex-lab/testfiles-table-luatex/table-016.tlg |   1 -
 .../latex-lab/testfiles-table-pdftex/table-000.tlg |   4 +-
 .../latex-lab/testfiles-table-pdftex/table-002.tlg |   4 -
 .../testfiles-table-pdftex/table-007-longtable.tlg |   2 -
 .../testfiles-table-pdftex/table-008-multi.tlg     |   2 -
 .../latex-lab/testfiles-table-pdftex/table-009.tlg |   1 -
 .../latex-lab/testfiles-table-pdftex/table-015.tlg |   2 -
 .../latex-lab/testfiles-table-pdftex/table-016.tlg |   1 -
 required/tools/array.dtx                           | 163 +++++++++++++++++----
 16 files changed, 142 insertions(+), 110 deletions(-)

diff --git a/required/latex-lab/latex-lab-table.dtx b/required/latex-lab/latex-lab-table.dtx
index 7f15d5d4..50b290f8 100644
--- a/required/latex-lab/latex-lab-table.dtx
+++ b/required/latex-lab/latex-lab-table.dtx
@@ -308,7 +308,7 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsection{Sockets}
+% \subsection{Tagging support sockets}
 %
 %
 % This are the standard plugs for tagging of cells and rows.
@@ -947,9 +947,9 @@
   }
 %    \end{macrocode}
 %
-% \subsection{Changes to \pkg{array} commands}
 %
 %
+% \subsection{Changes to \pkg{array} commands}
 %
 %  \begin{macro}{\@@_show_curr_cell_data:}
 %    Show the row/column index and span count for current table cell
@@ -1257,59 +1257,6 @@
 %
 %
 %
-%  \begin{macro}{
-%     \g_@@_col_int,
-%     \g_@@_row_int,
-%     \g_@@_span_tl,
-%     \g_@@_table_cols_tl}
-%    \cs{g_@@_row_int} holds the current row number in the table. The value
-%    \texttt{0} means we haven't yet processed the table preamble. It
-%    is incremented by every \cs{cr} including the one ending the
-%    table preamble.
-%
-%    \cs{g_@@_col_int} holds the current column number. The value
-%    \texttt{0} means we have not yet started the table or just finished a table row
-%    (with \verb=\\= typically); any other positive value means we
-%    are currently typesetting a cell in that column in some row
-%    (denoted by the \cs{g_@@_row_int}.
-%
-%    In a \cs{multicolumn} it holds the column number of the first
-%    spanned column and \cs{g_@@_span_tl} the info how many cells are
-%    spanned.
-%
-%    \cs{g_@@_span_tl} is normally \texttt{1} except in a
-%    \cs{multicolumn} cell.
-%    \begin{macrocode}
-\int_new:N \g_@@_col_int
-\int_new:N \g_@@_row_int
-\tl_new:N  \g_@@_span_tl
-\tl_new:N  \g_@@_table_cols_tl
-
-\tl_gset:Nn \g_@@_span_tl {1}
-\tl_gset:Nn \g_@@_table_cols_tl {0}  % indicates outer level
-%    \end{macrocode}
-%  \end{macro}
-%
-%
-%  \begin{macro}{\l_@@_saved_col_tl,\l_@@_saved_row_tl,
-%                \l_@@_saved_span_tl,\l_@@_saved_table_cols_tl}
-%
-%    Saving the outer values if we are nesting tables is necessary (as
-%    the above variables are globally altered. For this we use always
-%    token lists because they don't change and we do not need to blow
-%    additional integer registers.
-%    \begin{macrocode}
-\tl_new:N \l_@@_saved_col_tl
-\tl_new:N \l_@@_saved_row_tl
-\tl_new:N \l_@@_saved_span_tl
-\tl_new:N \l_@@_saved_table_cols_tl
-
-\tl_set:Nn \l_@@_saved_col_tl{0}
-\tl_set:Nn \l_@@_saved_row_tl{0}
-\tl_set:Nn \l_@@_saved_span_tl{1}
-\tl_set:Nn \l_@@_saved_table_cols_tl{0}  % indicates outer level
-%    \end{macrocode}
-%  \end{macro}
 %
 % \begin{macro}
 %   {
diff --git a/required/latex-lab/testfiles-table-luatex/table-000.tlg b/required/latex-lab/testfiles-table-luatex/table-000.tlg
index 614faec4..dcecb6bd 100644
--- a/required/latex-lab/testfiles-table-luatex/table-000.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-000.tlg
@@ -36,6 +36,8 @@ File: table-latex-lab-testphase.ltx ....-..-.. v... latex-lab wrapper table
 Package: latex-lab-testphase-table ....-..-.. v... Code related to the tagging of tables
 (array.sty
 Package: array ....-..-.. v... Tabular extension package (FMi)
+\g__tbl_col_int=\count...
+\g__tbl_row_int=\count...
 \col at sep=\dimen...
 \ar at mcellbox=\box...
 \extrarowheight=\dimen...
@@ -45,8 +47,6 @@ Package: array ....-..-.. v... Tabular extension package (FMi)
 \ar at cellbox=\box...
 )
 \g__tbl_missing_cells_int=\count...
-\g__tbl_col_int=\count...
-\g__tbl_row_int=\count...
 )) (../pdfmanagement-firstaid.sty
 Package: pdfmanagement-firstaid ....-..-.. v... LaTeX PDF management testphase bundle / firstaid-patches
 Package pdfmanagement Info: loading pdfmanagement firstaid code for pgf
diff --git a/required/latex-lab/testfiles-table-luatex/table-002.tlg b/required/latex-lab/testfiles-table-luatex/table-002.tlg
index 93c5c3d8..80a36a37 100644
--- a/required/latex-lab/testfiles-table-luatex/table-002.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-002.tlg
@@ -26,7 +26,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 1: 8,9,12
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -94,7 +93,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 6,1,1
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 6,2,2
@@ -103,7 +101,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> (@arraycr) This row needs 0 additional cell(s)
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 6: 31,32,-32
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -113,7 +110,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> (@arraycr) This row needs 0 additional cell(s)
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 7: 34,-34,-34
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-luatex/table-007-longtable.tlg b/required/latex-lab/testfiles-table-luatex/table-007-longtable.tlg
index d2e7c3f3..7e31c51d 100644
--- a/required/latex-lab/testfiles-table-luatex/table-007-longtable.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-007-longtable.tlg
@@ -906,7 +906,6 @@ braces):
 >  {{Table}{Table}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 Package tagpdf Info: Parent-Child 'Table' --> 'TR'.
 (tagpdf)             Relation is 1 (='0..n')
@@ -1136,7 +1135,6 @@ braces):
 >  {{Table}{Table}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 10,2,2
diff --git a/required/latex-lab/testfiles-table-luatex/table-008-multi.tlg b/required/latex-lab/testfiles-table-luatex/table-008-multi.tlg
index b036a48e..508a3809 100644
--- a/required/latex-lab/testfiles-table-luatex/table-008-multi.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-008-multi.tlg
@@ -9,7 +9,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -59,7 +58,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> current cell data: 1,1,1
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
 ==> stucture stored for row 1: 18,19,20
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-luatex/table-009.tlg b/required/latex-lab/testfiles-table-luatex/table-009.tlg
index 6ce86551..b59e53b7 100644
--- a/required/latex-lab/testfiles-table-luatex/table-009.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-009.tlg
@@ -168,7 +168,6 @@ braces):
 >  {{text-unit}{Part}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 Package tagpdf Info: Parent-Child 'Table' --> 'TR'.
 (tagpdf)             Relation is 1 (='0..n')
diff --git a/required/latex-lab/testfiles-table-luatex/table-015.tlg b/required/latex-lab/testfiles-table-luatex/table-015.tlg
index 3301e4a9..6a0eca10 100644
--- a/required/latex-lab/testfiles-table-luatex/table-015.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-015.tlg
@@ -9,7 +9,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -43,7 +42,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-luatex/table-016.tlg b/required/latex-lab/testfiles-table-luatex/table-016.tlg
index 1f16989b..6b06f760 100644
--- a/required/latex-lab/testfiles-table-luatex/table-016.tlg
+++ b/required/latex-lab/testfiles-table-luatex/table-016.tlg
@@ -4,7 +4,6 @@ Don't change this file in any respect.
 [Sockets] ==> Socket 'tbl/celldata/colcount' containing plug 'code' used.
 ==> Table has 3 columns
 --longtable--> chunk row: 0 row: 0 column: 0
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tbl/celldata/missingcount' containing plug 'code' used.
 ==> (@arraycr) This row needs 0 additional cell(s)
 --longtable--> chunk row: 1 row: 1 column: 1
diff --git a/required/latex-lab/testfiles-table-pdftex/table-000.tlg b/required/latex-lab/testfiles-table-pdftex/table-000.tlg
index ec593a69..8c0f9597 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-000.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-000.tlg
@@ -34,6 +34,8 @@ File: table-latex-lab-testphase.ltx ....-..-.. v... latex-lab wrapper table
 Package: latex-lab-testphase-table ....-..-.. v... Code related to the tagging of tables
 (array.sty
 Package: array ....-..-.. v... Tabular extension package (FMi)
+\g__tbl_col_int=\count...
+\g__tbl_row_int=\count...
 \col at sep=\dimen...
 \ar at mcellbox=\box...
 \extrarowheight=\dimen...
@@ -43,8 +45,6 @@ Package: array ....-..-.. v... Tabular extension package (FMi)
 \ar at cellbox=\box...
 )
 \g__tbl_missing_cells_int=\count...
-\g__tbl_col_int=\count...
-\g__tbl_row_int=\count...
 )) (../pdfmanagement-firstaid.sty
 Package: pdfmanagement-firstaid ....-..-.. v... LaTeX PDF management testphase bundle / firstaid-patches
 Package pdfmanagement Info: loading pdfmanagement firstaid code for pgf
diff --git a/required/latex-lab/testfiles-table-pdftex/table-002.tlg b/required/latex-lab/testfiles-table-pdftex/table-002.tlg
index d6f91d0f..6a5022ed 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-002.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-002.tlg
@@ -26,7 +26,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 1: 8,9,12
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -94,7 +93,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 6,1,1
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 6,2,2
@@ -103,7 +101,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> (@arraycr) This row needs 0 additional cell(s)
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 6: 31,32,-32
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -113,7 +110,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> (@arraycr) This row needs 0 additional cell(s)
 [Sockets] ==> Socket 'tagsupport/tblrow/end' containing plug 'TR' used.
 ==> stucture stored for row 7: 34,-34,-34
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-pdftex/table-007-longtable.tlg b/required/latex-lab/testfiles-table-pdftex/table-007-longtable.tlg
index d6b0ec13..db649ac0 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-007-longtable.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-007-longtable.tlg
@@ -955,7 +955,6 @@ braces):
 >  {{Table}{Table}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 Package tagpdf Info: Parent-Child 'Table' --> 'TR'.
 (tagpdf)             Relation is 1 (='0..n')
@@ -1197,7 +1196,6 @@ braces):
 >  {{Table}{Table}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
 ==> current cell data: 10,2,2
diff --git a/required/latex-lab/testfiles-table-pdftex/table-008-multi.tlg b/required/latex-lab/testfiles-table-pdftex/table-008-multi.tlg
index 6ca5f779..4d8eb594 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-008-multi.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-008-multi.tlg
@@ -9,7 +9,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -59,7 +58,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> current cell data: 1,1,1
 [Sockets] ==> Socket 'tagsupport/tblcell/end' containing plug 'TD' used.
 ==> stucture stored for row 1: 18,19,20
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-pdftex/table-009.tlg b/required/latex-lab/testfiles-table-pdftex/table-009.tlg
index 07add966..0e03f450 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-009.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-009.tlg
@@ -176,7 +176,6 @@ braces):
 >  {{text-unit}{Part}}
 >  {{Document}{Document}}
 >  {{Root}{StructTreeRoot}}.
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 Package tagpdf Info: Parent-Child 'Table' --> 'TR'.
 (tagpdf)             Relation is 1 (='0..n')
diff --git a/required/latex-lab/testfiles-table-pdftex/table-015.tlg b/required/latex-lab/testfiles-table-pdftex/table-015.tlg
index 3301e4a9..6a0eca10 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-015.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-015.tlg
@@ -9,7 +9,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
@@ -43,7 +42,6 @@ LaTeX Font Info:    External font `cmex10' loaded for size
 ==> Table has 3 columns
 [Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
 ==> saved cell data: 0,0,1 (outer level)
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblrow/begin' containing plug 'TR' used.
 [Sockets] ==> Socket 'tagsupport/tbl/colspan' containing plug 'code' used.
 [Sockets] ==> Socket 'tagsupport/tblcell/begin' containing plug 'TD' used.
diff --git a/required/latex-lab/testfiles-table-pdftex/table-016.tlg b/required/latex-lab/testfiles-table-pdftex/table-016.tlg
index b263312b..590d0523 100644
--- a/required/latex-lab/testfiles-table-pdftex/table-016.tlg
+++ b/required/latex-lab/testfiles-table-pdftex/table-016.tlg
@@ -4,7 +4,6 @@ Don't change this file in any respect.
 [Sockets] ==> Socket 'tbl/celldata/colcount' containing plug 'code' used.
 ==> Table has 3 columns
 --longtable--> chunk row: 0 row: 0 column: 0
-[Sockets] ==> Socket 'tbl/celldata/multicolumn' containing plug 'code' used.
 [Sockets] ==> Socket 'tbl/celldata/missingcount' containing plug 'code' used.
 ==> (@arraycr) This row needs 0 additional cell(s)
 --longtable--> chunk row: 1 row: 1 column: 1
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index ae868cf4..5814ceee 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -832,6 +832,86 @@
 %    \end{macrocode}
 %
 %
+% \section{A note on the updates done December 2023}
+%
+% We introduced support for tagged PDf and at the same time we added
+% code to determine row and column numbers for each cell in
+% preparation for supporting  formatting or type specifications for individual
+% cells (or group of cells) from the outside, e.g., \enquote{rows 1,
+% 2, and 10 are header rows} (syntax to be decided).
+%
+% This code is already written with L3 programming layer conventions
+% while more of the legay code is still as it is. This make the code
+% currently somewhat clattered, unfortunately. Eventually this will all move to L3
+% programming layer.
+%
+%
+% \subsection{Variables for row, column and span counting}
+%
+%    \begin{macrocode}
+%<@@=tbl>
+\ExplSyntaxOn
+%    \end{macrocode}
+%
+%  \begin{macro}{
+%     \g_@@_col_int,
+%     \g_@@_row_int,
+%     \g_@@_span_tl,
+%     \g_@@_table_cols_tl}
+%    \cs{g_@@_row_int} holds the current row number in the table. The value
+%    \texttt{0} means we haven't yet processed the table preamble. It
+%    is incremented by every \cs{cr} including the one ending the
+%    table preamble.
+%
+%    \cs{g_@@_col_int} holds the current column number. The value
+%    \texttt{0} means we have not yet started the table or just finished a table row
+%    (with \verb=\\= typically); any other positive value means we
+%    are currently typesetting a cell in that column in some row
+%    (denoted by the \cs{g_@@_row_int}.
+%
+%    In a \cs{multicolumn} it holds the column number of the first
+%    spanned column and \cs{g_@@_span_tl} the info how many cells are
+%    spanned.
+%
+%    \cs{g_@@_span_tl} is normally \texttt{1} except in a
+%    \cs{multicolumn} cell.
+%    \begin{macrocode}
+\int_new:N \g_@@_col_int
+\int_new:N \g_@@_row_int
+\tl_new:N  \g_@@_span_tl
+\tl_new:N  \g_@@_table_cols_tl
+
+\tl_gset:Nn \g_@@_span_tl {1}
+\tl_gset:Nn \g_@@_table_cols_tl {0}  % indicates outer level
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%  \begin{macro}{\l_@@_saved_col_tl,\l_@@_saved_row_tl,
+%                \l_@@_saved_span_tl,\l_@@_saved_table_cols_tl}
+%
+%    Saving the outer values if we are nesting tables is necessary (as
+%    the above variables are globally altered. For this we use always
+%    token lists because they don't change and we do not need to blow
+%    additional integer registers.
+%    \begin{macrocode}
+\tl_new:N \l_@@_saved_col_tl
+\tl_new:N \l_@@_saved_row_tl
+\tl_new:N \l_@@_saved_span_tl
+\tl_new:N \l_@@_saved_table_cols_tl
+
+\tl_set:Nn \l_@@_saved_col_tl{0}
+\tl_set:Nn \l_@@_saved_row_tl{0}
+\tl_set:Nn \l_@@_saved_span_tl{1}
+\tl_set:Nn \l_@@_saved_table_cols_tl{0}  % indicates outer level
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%
+%
+%
+%
 % \section{The construction of the preamble}
 %
 % \DeleteShortVerb{\"}
@@ -987,6 +1067,7 @@
 %    =\@chclass= and =\@chnum=.
 % \changes{v2.0f}{1992/02/29}{Argument removed since implicitly known}
 %    \begin{macrocode}
+\ExplSyntaxOff
 \def\@testpach{\@chclass
 %    \end{macrocode}
 %    First we deal with the cases in which the \textsf{token}
@@ -996,7 +1077,7 @@
  \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
   \ifnum \@lastchclass=7 5 \else
    \ifnum \@lastchclass=8 \tw@ \else
-    \ifnum \@lastchclass=9 \thr@@
+    \ifnum \@lastchclass=9 3
 %    \end{macrocode}
 %    Otherwise we will assume that the \textsf{token} belongs to the
 %    class $0$
@@ -1047,7 +1128,7 @@
 %    \begin{macrocode}
   10
   \@chnum
-  \if \@nextchar m\thr@@\else
+  \if \@nextchar m3 \else
    \if \@nextchar p4 \else
     \if \@nextchar b5 \else
 %    \end{macrocode}
@@ -1057,6 +1138,7 @@
 %    \begin{macrocode}
    \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
    \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
+\ExplSyntaxOn
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1077,10 +1159,10 @@
 %    they are in explicit braces, as in =@{*}=.
 %
 %    This macro is called via
-%    =\@xexpast=\meta{preamble}=*0x\@@=.
+%    =\@xexpast=\meta{preamble}=*0x\@@@@=.
 %    The $*$--expression =*0x= is being used to terminate the
 %    recursion,
-%    as we shall see later, and =\@@= serves as an argument
+%    as we shall see later, and =\@@@@= serves as an argument
 %    delimiter. =\@xexpast= has four arguments. The first
 %    one is the part of the
 %    user preamble before the first $*$--expression while the second
@@ -1089,7 +1171,7 @@
 %    above).
 %    The fourth argument is the rest of the preamble.
 %    \begin{macrocode}
-\def\@xexpast#1*#2#3#4\@@{%
+\def\@xexpast#1*#2#3#4\@@@@{%
 %    \end{macrocode}
 %    The number of copies of \textit{String} (=#2=) that are to be
 %    produced will be saved in a \textsf{count} register.
@@ -1126,7 +1208,7 @@
 %    \end{macrocode}
 %    If \textit{N\/} was greater than zero we prepare for another call
 %    of =\@xexpast=. Otherwise we assume we have reached the end of
-%    the user preamble, because we had appended =*0x\@@= when we first
+%    the user preamble, because we had appended =*0x\@@@@= when we first
 %    called =\@xexpast=.  In other words: if the user inserts
 %    =*{0}{..}= in his preamble, \LaTeX\ ignores the rest of it.
 %    \begin{macrocode}
@@ -1148,7 +1230,7 @@
 %    $*$--expression is handled, or to the macro =\@xexnoop=,
 %    which only ends the recursion by deleting its argument.
 %    \begin{macrocode}
-   \expandafter \@tempb \@tempa #4\@@}
+   \expandafter \@tempb \@tempa #4\@@@@}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -1157,10 +1239,10 @@
 % \begin{macro}{\@xexnoop}
 %    So the first big problem is solved. Now it is easy to
 %    specify =\@xexnoop=.
-%    Its argument is delimited by =\@@= and it simply expands to
+%    Its argument is delimited by =\@@@@= and it simply expands to
 %    nothing.
 %    \begin{macrocode}
-%  \def\@xexnoop#1\@@{}
+%  \def\@xexnoop#1\@@@@{}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -1432,7 +1514,7 @@
 %    command =\@xexpast=.  As we already know, this command saves
 %    its result in the macro =\@tempa=.
 %    \begin{macrocode}
-%   \@xexpast #1*0x\@@
+%   \@xexpast #1*0x\@@@@
 %    \end{macrocode}
 %    Afterwards we initialize all registers and macros, that we need
 %    for the build-up of the preamble.
@@ -1516,7 +1598,7 @@
 %    \texttt{r}, \texttt{p},\texttt{m} or \texttt{b}. We report an
 %    error and ignore the declaration given by ={..}=.
 %    \begin{macrocode}
-%   \@preamerr \thr@@ \or
+%   \@preamerr 3 \or
 %    \end{macrocode}
 %    If =\@lastchclass= is $4$ the user preamble has been empty.
 %    To continue, we insert a =#= in the preamble.
@@ -1822,8 +1904,8 @@
 %    So the declarations defined by the first  =>{...}=
 %    are ignored.
 %    \begin{macrocode}
-%\def\@classix{\ifnum \@lastchclass = \thr@@
-%       \@preamerr \thr@@ \fi
+%\def\@classix{\ifnum \@lastchclass = 3~
+%       \@preamerr 3 \fi
 %    \end{macrocode}
 %    Furthermore, we call up =\@class10= because afterwards always a
 %    new column is started by \texttt{c}, \texttt{l}, \texttt{r},
@@ -1875,14 +1957,14 @@
 %    We only check if the last \textsf{token} was of class $3$ which is
 %    forbidden.
 %    \begin{macrocode}
-\def\@classvii{\ifnum \@lastchclass = \thr@@
+\def\@classvii{\ifnum \@lastchclass = 3
 %    \end{macrocode}
 %    If this is true we output an error message and
 %    ignore the declarations stored
 %    by the last  =>{...}=, because these are overwritten
 %    by the argument of \texttt{@}.
 %    \begin{macrocode}
-   \@preamerr \thr@@ \fi}
+   \@preamerr 3 \fi}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2356,7 +2438,29 @@
 %    (which in turn calls the \texttt{tblrow/begin} socket, if
 %    necessary).
 %    \begin{macrocode}
-   \UseSocket{tbl/celldata/multicolumn}{#1}%
+%   \UseSocket{tbl/celldata/multicolumn}{#1}%
+%    \end{macrocode}
+%    We insert row begin socket for tagging only if this multicolumn
+%    replaces the preamble of the first column. In that case we also have
+%    to set \cs{g_@@_col_int} to 1 since this is no longer done in the
+%    preamble for the cell.
+%    \begin{macrocode}
+   \int_compare:nNnTF \g_@@_col_int = 0
+       {
+         \UseTaggingSocket{tblrow/begin}
+         \int_gset:Nn \g_@@_col_int {1}
+       }
+%    \end{macrocode}
+%    If we are in a later column we use \cs{g_@@_span_tl} from the
+%    previous column to update.
+%    \begin{macrocode}
+       {
+         \int_gadd:Nn \g_@@_col_int { \g_@@_span_tl }
+       }
+%    \end{macrocode}
+%    Then we set the span value so that it can be use in the next column.
+%    \begin{macrocode}
+   \tl_gset:Nn \g_@@_span_tl {#1}
 %    \end{macrocode}
 %    Since a =\multicolumn= should only describe the format of a
 %    result column, we redefine =\@addamp= in such a way that one gets
@@ -2580,7 +2684,7 @@
 \let\@arrayclassiv=\relax   \let\@arrayclassz=\relax
 \let\@tabclassiv=\relax     \let\@tabclassz=\relax
 \let\@arrayacol=\relax      \let\@tabacol=\relax
-\let\@tabularcr=\relax      \let\@@endpbox=\relax
+\let\@tabularcr=\relax      \let\@@@@endpbox=\relax
 \let\@argtabularcr=\relax   \let\@xtabularcr=\relax
 %    \end{macrocode}
 %
@@ -2638,6 +2742,7 @@
 % to define letters, to be used in the same way as the primitive
 % column specifiers, `c' `p' etc.
 %    \begin{macrocode}
+\ExplSyntaxOff  % this is really oldstyle using \@tfor :=
 \def\newcolumntype#1{%
 %    \end{macrocode}
 % "\NC at char" was added in V2.01 so that active characters, like "@" in
@@ -2677,6 +2782,7 @@
 % If an optional argument was not given, give a default argument of 0.
 %    \begin{macrocode}
   \@ifnextchar[{\newcol@{\NC at char}}{\newcol@{\NC at char}[0]}}
+\ExplSyntaxOn
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\newcol@}
@@ -2773,15 +2879,15 @@
 %    \begin{macrocode}
 \def\NC at show#1{%
   \typeout{Column #1\expandafter\expandafter\expandafter\NC at strip
-  \expandafter\meaning\csname NC at rewrite@#1\endcsname\@@}}
+  \expandafter\meaning\csname NC at rewrite@#1\endcsname\@@@@}}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\NC at strip}
 % Delimit the arguments to "\NC at strip" with `\texttt{:}', `\texttt{->}',
-% a space, and "\@@" to pull out the required parts of the output from
+% a space, and "\@@@@" to pull out the required parts of the output from
 % "\meaning".
 %    \begin{macrocode}
-\def\NC at strip#1:#2->#3 #4\@@{#2 -> #4}
+\def\NC at strip#1:#2->#3 #4\@@@@{#2 -> #4}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\NC at list}
@@ -2869,6 +2975,7 @@
 % \changes{v2.4e}{2016/10/07}{Fixing SX68732}
 % \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}}
 %    \begin{macrocode}
+\ExplSyntaxOff % really oldstyle using \@tfor :=
 \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
    \let\@sharp\relax
 %    \end{macrocode}
@@ -2931,11 +3038,12 @@
    \@acol \or
    \or
    \@acol \or
-   \@preamerr \thr@@ \or
+   \@preamerr 3 \or
    \@preamerr \tw@ \@addtopreamble\@sharp \or
    \or
    \else  \@preamerr \@ne \fi
    \def\the at toks{\the\toks}}
+\ExplSyntaxOn
 %    \end{macrocode}
 % \end{macro}
 %
@@ -2970,7 +3078,7 @@
 % \texttt{array.sty} 2.0h.
 %    \begin{macrocode}
 \def\@classv{\save at decl
-   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@
+   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@@@@
    \@addtopreamble{\d at llarbegin\the at toks\the\count@\relax\d at llarend}%
    \prepnext at tok}
 %    \end{macrocode}
@@ -2982,7 +3090,7 @@
 % second "\extracolsep", there is no point in the user entering two of
 % these commands anyway, so this is not really a restriction.
 %    \begin{macrocode}
-\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
+\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@@@@{\def\@tempa{#2}%
   \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
 %</ncols>
 %    \end{macrocode}
@@ -2998,18 +3106,18 @@
 %
 % \begin{macro}{\@tabarray}
 %    This macro tests for an optional bracket and then calls up
-%    "\@@array" or "\@@array[c]" (as default).
+%    "\@@@@array" or "\@@@@array[c]" (as default).
 %    \begin{macrocode}
 %<*package>
-\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
+\def\@tabarray{\@ifnextchar[{\@@@@array}{\@@@@array[c]}}
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\@@array}
+% \begin{macro}{\@@@@array}
 %    This macro tests could then test an optional delimiter before the
 %    left brace of the main preamble argument. Here in the main package
 %    it simply is let to be "\@array".
 %    \begin{macrocode}
-\let\@@array\@array
+\let\@@@@array\@array
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3248,6 +3356,7 @@
 %
 %
 %    \begin{macrocode}
+\ExplSyntaxOff
 %    \end{macrocode}
 %
 %





More information about the latex3-commits mailing list.