[latex3-commits] [latex3/latex2e] array: doc updates for "array" (417c9d64)
github at latex-project.org
github at latex-project.org
Tue Dec 12 00:48:04 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : array
Link : https://github.com/latex3/latex2e/commit/417c9d64dbbeb32ecf01c381053de06f122e603a
>---------------------------------------------------------------
commit 417c9d64dbbeb32ecf01c381053de06f122e603a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Tue Dec 12 00:48:04 2023 +0100
doc updates for "array"
>---------------------------------------------------------------
417c9d64dbbeb32ecf01c381053de06f122e603a
required/tools/array.dtx | 69 +++++++++++++++++++++++++++++++++-------------
required/tools/changes.txt | 8 +++++-
2 files changed, 57 insertions(+), 20 deletions(-)
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index ff1a0634..567aaf5e 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -33,6 +33,10 @@
%<+package>\DeclareRelease{v2.5}{2023-11-01}{array-2023-11-01.sty}
%<+package>\DeclareCurrentRelease{}{2024-06-01}
%<+package>
+% \end{macrocode}
+% Current version needs a new kernel.
+% \begin{macrocode}
+%<+package>\NeedsTeXFormat{LaTeX2e}[2024/06/01]
%<+package>\ProvidesPackage{array}
%<+package> [2023/12/11 v2.6a Tabular extension package (FMi)]
%
@@ -1077,7 +1081,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
\ifnum \@lastchclass=7 5 \else
\ifnum \@lastchclass=8 \tw@ \else
- \ifnum \@lastchclass=9 \thr@@
+ \ifnum \@lastchclass=9 \thr@@@@
% \end{macrocode}
% Otherwise we will assume that the \textsf{token} belongs to the
% class $0$
@@ -1128,7 +1132,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \begin{macrocode}
10
\@chnum
- \if \@nextchar m\thr@@ \else
+ \if \@nextchar m\thr@@@@ \else
\if \@nextchar p4 \else
\if \@nextchar b5 \else
% \end{macrocode}
@@ -1456,7 +1460,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macrocode}
% If we are after the first column we have to insert a \verb=&= and
% also update the cell data.
-% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\edef\@preamble{\@preamble &
\noexpand\tbl_update_cell_data: }
@@ -1812,16 +1816,15 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\setbox\ar at mcellbox\vbox
% \end{macrocode}
% The part of the templates which is the same in all three cases
-% (\texttt{p}, \texttt{m} and \texttt{b})
-% is built by the macros =\@startpbox= and
-% =\@endpbox=. =\@startpbox= has an argument:
-% the width of the column which is stored in the current
-% \textsf{token} (i.e.\ =\@nextchar=).
-% Between these two macros we find the well known
-% =\insert at column=.
-% The strut is places after the box
+% (\texttt{p}, \texttt{m} and \texttt{b}) is built by the macros
+% =\@startpbox= and =\@endpbox=. =\@startpbox= has an argument: the
+% width of the column which is stored in the current \textsf{token}
+% (i.e.\ =\@nextchar=). Between these two macros we find the well
+% known =\insert at column= or rather the variant for tagging:
+% \cs{insert at pcolumn}. The strut is placed after the box.
% \changes{v2.4e}{2016/10/07}{Fixing SX68732}
% \changes{v2.4f}{2017/11/04}{Managing m-cells without \cs{vcenter}}
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\@startpbox{\@nextchar}\insert at pcolumn \@endpbox
\ar at align@mcell
@@ -1831,6 +1834,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% same way though we do not need the =$= characters because we use
% =\vtop= or =\vbox=.
% \changes{v2.4e}{2016/10/07}{Fixing SX68732}
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\vtop \@startpbox{\@nextchar}\insert at pcolumn \@endpbox\do at row@strut \or
\vbox \@startpbox{\@nextchar}\insert at pcolumn \@endpbox\do at row@strut
@@ -2196,6 +2200,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% determined in \cs{tbl_count_table_cols:} but this is called in
% a group, so local settings do not survive. Thus, to save away the
% outer value of \cs{g_@@_table_cols_tl} we do it before the group.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\tl_set_eq:NN \l_@@_saved_table_cols_tl \g_@@_table_cols_tl
% \end{macrocode}
@@ -2208,6 +2213,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\@mkpream{#2}%
% \end{macrocode}
% Figure out how many columns this table has:
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\tbl_count_table_cols:
% \end{macrocode}
@@ -2240,7 +2246,9 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\xdef\@preamble{
% \end{macrocode}
% \cs{ialign} in the original definition is replaced by
-% \cs{ar at ialign} defined below.
+% \cs{ar at ialign} defined below. This does what \cs{ialign} does but
+% additionally handles the tagging structure for the whole table if necessary.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\noexpand \ar at ialign
\@halignto
@@ -2250,7 +2258,8 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% that was just used. Depending on its replacement text the
% =\halign= becomes a =\halign= \texttt{to} \meta{dimen}.
%
-% Next, a tagging support socket is inserted.
+% Next, a tagging support socket is inserted adding the start row tag.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tblrow/begin}
% \end{macrocode}
@@ -2258,6 +2267,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \cs{g_@@_col_int} to \texttt{1} as we are no longer "at" but "in"
% the first column. This is done in \cs{tbl_init_cell_data_for_row:}. In
% later columns this data is updated via \cs{tbl_update_cell_data:}.
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\tbl_init_cell_data_for_row:
% \end{macrocode}
@@ -2337,15 +2347,17 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% A new command that replaces \cs{ialign} used previously. \cs{everycr} is
% also applied to the \cs{cr} ending the preamble so we have to
% program around that.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\def\ar at ialign{%
% \end{macrocode}
% Before starting a table we have to initialize the variables
-% holding row and column information for cells. We also have locally store the information related
-% to the current cell (if we are already inside a table) so that we
-% can restore it once the inner
-% table is finished.
- % \begin{macrocode}
+% holding row and column information for cells. We also have
+% locally store the information related to the current cell (if we
+% are already inside a table) so that we can restore it once the
+% inner table is finished.
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
+% \begin{macrocode}
\tbl_init_cell_data_for_table:
% \end{macrocode}
%
@@ -2413,9 +2425,17 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% Add code that figures out if the current table row is incomplete
% (not enough \verb=&=s). It can then do extra actions, such as
% inserting missing cell tags.
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\tbl_count_missing_cells:n {@arraycr}
% \end{macrocode}
+% TODO: maybe this is also the right place to add a socket that
+% could be used to actually enter missing cells instead of just
+% adding tagging structures for them later. This would be optional
+% but in many cases it would be the right thing to do (for example
+% if tables contain vertical lines or similar visual structures
+% that require fully specified rows.
+%
%
% We then start a special brace which I have directly
% copied from the original definition. It is
@@ -2539,6 +2559,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% the result column and the actual column entry.
% \changes{v2.3j}{1998/01/29}{Command made \cs{long} to match
% kernel change for pr/2180}
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\long\def\multicolumn#1#2#3{%
% \end{macrocode}
@@ -2554,6 +2575,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% a suitable ColSpan attribute. We do this in the next macro
% (which in turn calls the \texttt{tblrow/begin} socket, if
% necessary).
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\tbl_update_multicolumn_cell_data:n {#1}
% \end{macrocode}
@@ -2585,6 +2607,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \end{macrocode}
% Now we update the colspan attribute. This needs setting after
% the group as it is hidden inside the plug in \cs{insert at column}.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tbl/colspan}{#1}%
% \end{macrocode}
@@ -2710,7 +2733,9 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \begin{macrocode}
\leavevmode
% \end{macrocode}
-%
+% Now that we know we are in hmode we can add the start tag for the
+% whole table.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tblhmode/begin}%
% \end{macrocode}
@@ -2742,6 +2767,10 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% =\@array=. To save \textsf{token} space we then redefine
% =\@preamble=
% because its replacement text isn't longer needed.
+%
+% To handle cell indexes, we do not use \cs{crcr} but a variant
+% that also handles missing cells as necessary.
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\def\endarray {
\tbl_crcr:n{endarray} \egroup
@@ -2758,6 +2787,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
%
% \cs{endtabular} and \cs{endtabular*} inherit from \cs{endarray}
% so we only need to change that. \texttt{tabularx} uses a similar method.
+% \changes{v2.6a}{2023/12/11}{Managing cell indexes}
% \begin{macrocode}
\tbl_restore_outer_cell_data:
% \end{macrocode}
@@ -2783,6 +2813,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\def\endtabular{\endarray\m at th $\egroup
% \end{macrocode}
%
+% \changes{v2.6a}{2023/12/11}{Support for tagged PDF}
% \begin{macrocode}
\UseTaggingSocket{tblhmode/end}%
}
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 15d66157..6c5bdfdb 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,9 +5,15 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================
+2023-12-12 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * array.dtx:
+ Support for tagged PDF
+ Manage and provide cell indexes
+
2023-12-11 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
- * tabularx.dtx (section{The Macros}):
+ * tabularx.dtx:
Require newer LaTeX kernel (that supports tagging)
Suspend any tagging while doing trial typesetting
More information about the latex3-commits
mailing list.