[latex3-commits] [latex3/latex2e] tagging-134: added tagging support for \cline (66970ded0)

github at latex-project.org github at latex-project.org
Sat Jul 13 18:14:16 CEST 2024


Repository : https://github.com/latex3/latex2e
On branch  : tagging-134
Link       : https://github.com/latex3/latex2e/commit/66970ded0c8ac5635f1546947ddce937fe1c311f

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

commit 66970ded0c8ac5635f1546947ddce937fe1c311f
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sat Jul 13 18:14:16 2024 +0200

    added tagging support for \cline


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

66970ded0c8ac5635f1546947ddce937fe1c311f
 base/changes.txt                                   |  5 ++
 base/doc/ltnews40.tex                              | 45 +++++++++++++--
 base/lttagging.dtx                                 | 27 ++++++---
 required/latex-lab/changes.txt                     |  5 ++
 required/latex-lab/latex-lab-table.dtx             | 31 +++++++++-
 .../testfiles-table-pdftex/table-022-cline.lvt     | 34 +++++++++++
 .../testfiles-table-pdftex/table-022-cline.tlg     | 67 ++++++++++++++++++++++
 required/latex-lab/update-table.sh                 |  3 +-
 required/tools/array.dtx                           | 41 ++++++++++++-
 required/tools/changes.txt                         |  5 ++
 10 files changed, 247 insertions(+), 16 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4a5df5b53..ff13f80aa 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
 not part of the distribution.
 ================================================================================
 
+2024-07-13  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* lttagging.dtx (subsection{Tagging support for table/tabular packages}):
+	Sockets for \cs{cline} leaders added (tagging/134)
+
 2024-07-06  Yukai Chou  <muzimuzhi at gmail.com>
 
 	* ltcmd.dtx (subsection{User functions}):
diff --git a/base/doc/ltnews40.tex b/base/doc/ltnews40.tex
index 19bb9fbf4..f979703d3 100644
--- a/base/doc/ltnews40.tex
+++ b/base/doc/ltnews40.tex
@@ -73,10 +73,22 @@
           	    {github issue#1 #2}%
            )}%
      \par\smallskip}
+
+
+% same for issues in the tagging repository:
+
+\providecommand\taggingissue[2][]{\ifhmode\unskip\fi
+     \quad\penalty500\strut\nobreak\hfill
+     \mbox{\small\slshape(%
+       \href{https://github.com/latex3/tagging-project/issues/\getfirstgithubissue#2 \relax}%
+          	    {github tagging issue#1 #2}%
+           )}%
+     \par\smallskip}
+
 %% But Chris has to mostly disable \href for his TEXPAD app:
 %% \def\href #1#2{#2} % Only For Chris' deficient TeX engine
 
-% simple solution right now (just link to the first issue if there are more)
+% simple solution right now (just link to the first issue if there are several)
 \def\getfirstgithubissue#1 #2\relax{#1}
 
 \providecommand\sxissue[1]{\ifhmode\unskip
@@ -96,6 +108,8 @@
            )}%
      \par}
 
+
+
 \let\cls\pkg
 \providecommand\env[1]{\texttt{#1}}
 \providecommand\acro[1]{\textsc{#1}}
@@ -225,10 +239,12 @@ When \LaTeX{} is rolled back to date \meta{date1} and a class or
 package with minimum date requirement \meta{date2} is to be loaded, a
 rollback warning is raised if \meta{date2} is later than \meta{date1}:
 \begin{verbatim}
-LaTeX Warning: Suspicious rollback/min-date date given
-               A minimal date of YYYY-MM-DD has been specified for package
-               '<pkgname>'.
-               But this is in conflict with a rollback request to YYYY-MM-DD.
+LaTeX Warning: Suspicious rollback/min-date
+               date given.
+  A minimal date of YYYY-MM-DD has been
+  specified for package '<pkgname>'.
+  But this is in conflict with a rollback
+  request to YYYY-MM-DD.
 \end{verbatim}
 
 In some cases this message showed a wrong file type, i.e.,
@@ -278,6 +294,25 @@ corrected and the warnings are suppressed.
 %\section{Changes to packages in the \pkg{graphics} category}
 
 \section{Changes to packages in the \pkg{tools} category}
+
+
+\subsection{\pkg{array}: Tagging support for \cs{cline}}
+
+In the last release we added tagging support for \pkg{array},
+\pkg{longtable} and other tabular packages, but we overlooked that the
+kernel definition for \cs{cline} also needs modification because the
+rule generated by the command needs to be tagged as an
+artifact. Furthermore, the processing of a \cs{cline} looks to the
+algorithm as if another row is added (which is technically what
+happens), thus it was also necessary to decrement the internal row
+counter to get a correct row count. This has now been corrected in
+\pkg{array} which is automatically loaded for tagging, so that all
+these packages are no fully compatible with the tagging code if it is
+turned on.
+%
+\taggingissue{134}
+
+
 \subsection{\pkg{longtable}: Extend caption type}
 
 The \pkg{longtable} has been extended and now provides the command \cs{LTcaptype}
diff --git a/base/lttagging.dtx b/base/lttagging.dtx
index da7318c84..3595e2326 100644
--- a/base/lttagging.dtx
+++ b/base/lttagging.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{lttagging.dtx}
-             [2024/07/12 v1.0b LaTeX Kernel (tagging support)]
+             [2024/07/13 v1.0c LaTeX Kernel (tagging support)]
 % \iffalse
 \documentclass{l3doc}
 \GetFileInfo{lttagging.dtx}
@@ -61,11 +61,6 @@
 % \ProvideDocElement[printtype=\textit{plug},idxtype=plug,idxgroup=Plugs]{Plug}{plugdecl}
 %
 %
-% \section{}
-%
-%
-%
-% \MaybeStop{}
 %
 %    \begin{macrocode}
 %<*2ekernel|latexrelease>
@@ -142,6 +137,12 @@
 %  of the CamelCase command.
 %                
 %
+% \MaybeStop{}
+%
+%
+% \section{Implementation}
+%
+%
 %
 %  \begin{macro}{\SuspendTagging,\ResumeTagging}
 %    
@@ -335,6 +336,18 @@
 % \end{socketdecl}
 %
 %
+% \begin{socketdecl}{tagsupport/tbl/leaders/begin,
+%                    tagsupport/tbl/leaders/end}
+%    Sockets around leaders such as rules or dotted lines, that should
+%    be tagged as artifacts, used, for example, in \cs{cline}.
+% \changes{v1.0c}{2024/07/13}{Sockets for \cs{cline} leaders added (tagging/134)}
+%    \begin{macrocode}
+\NewSocket{tagsupport/tbl/leaders/begin}{0}
+\NewSocket{tagsupport/tbl/leaders/end}{0}
+%    \end{macrocode}
+% \end{socketdecl}
+%
+%
 %
 %
 %
@@ -729,7 +742,7 @@
 %    \end{macrocode}
 %    Even if we are at the start of a row we my have to do a \cs{cr},
 %    so we do a \cs{crcr} always at the end.
-% \changes{v1.ob}{2024/06/10}
+% \changes{v1.0b}{2024/06/10}
 %         {Always issue a \cs{crcr} even if we are at the start of a
 %          row to avoid problems with tabulary and similar code}
 %    \begin{macrocode}
diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index cd53086b2..236dcfe64 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,3 +1,8 @@
+2024-07-13  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* latex-lab-table.dtx (subsection{Tagging support sockets}):
+	add plugs for tbl/leaders/begin and /end
+
 2024-05-25 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 	* latex-lab-table.dtx: disable table headers in presentation tables.
 
diff --git a/required/latex-lab/latex-lab-table.dtx b/required/latex-lab/latex-lab-table.dtx
index bbf8a4c8c..947d95e9d 100644
--- a/required/latex-lab/latex-lab-table.dtx
+++ b/required/latex-lab/latex-lab-table.dtx
@@ -16,8 +16,8 @@
 %
 % for those people who are interested or want to report an issue.
 %
-\def\ltlabtbldate{2024-07-05}
-\def\ltlabtblversion{0.85i}
+\def\ltlabtbldate{2024-07-13}
+\def\ltlabtblversion{0.85j}
 %<*driver>
 \documentclass{l3doc}
 \EnableCrossrefs
@@ -792,6 +792,29 @@
 %
 %
 %
+%
+% \begin{plugdecl}{code}
+%    The sockets will be in lttagging.dtx, but that may only happen in
+%    the next main release, so for now we test if they are in the
+%    format and if not define them now.
+%    \begin{macrocode}
+\str_if_exist:cF { l__socket_tagsupport/tbl/leaders/end_plug_str }
+    {
+      \NewSocket{tagsupport/tbl/leaders/begin}{0}
+      \NewSocket{tagsupport/tbl/leaders/end}{0}
+    }
+%    \end{macrocode}
+%  
+%    \begin{macrocode}
+\NewSocketPlug{tagsupport/tbl/leaders/begin}{code}
+  { \tag_mc_begin:n{artifact} }
+\NewSocketPlug{tagsupport/tbl/leaders/end}{code}
+  { \tag_mc_end: }
+%    \end{macrocode}
+% \end{plugdecl}
+%
+%
+%
 %\subsection{Environments}
 %
 % Currently we support only tabular, tabular*, tabularx and longtable
@@ -839,6 +862,8 @@
    \AssignSocketPlug{tagsupport/tbl/vmode/begin}{noop}
    \AssignSocketPlug{tagsupport/tbl/vmode/end}{noop}
    \AssignSocketPlug{tagsupport/tbl/colspan}{noop}
+   \AssignSocketPlug{tagsupport/tbl/leaders/begin}{noop}
+   \AssignSocketPlug{tagsupport/tbl/leaders/end}{noop}
  }
 %    \end{macrocode}
 %  \end{macro}
@@ -866,6 +891,8 @@
    \AssignSocketPlug{tagsupport/tbl/vmode/begin}{Table}
    \AssignSocketPlug{tagsupport/tbl/vmode/end}{Table}
    \AssignSocketPlug{tagsupport/tbl/colspan}{code}
+   \AssignSocketPlug{tagsupport/tbl/leaders/begin}{code}
+   \AssignSocketPlug{tagsupport/tbl/leaders/end}{code}
  }
 %    \end{macrocode}
 %  \end{macro}
diff --git a/required/latex-lab/testfiles-table-pdftex/table-022-cline.lvt b/required/latex-lab/testfiles-table-pdftex/table-022-cline.lvt
new file mode 100644
index 000000000..75d67bd6a
--- /dev/null
+++ b/required/latex-lab/testfiles-table-pdftex/table-022-cline.lvt
@@ -0,0 +1,34 @@
+\DocumentMetadata
+  {
+    lang=en-US,
+    pdfversion=2.0,
+    pdfstandard=ua-2,
+    testphase={phase-III,math,title,table,firstaid},
+    uncompress
+  }
+
+
+\documentclass{article}
+
+\input{regression-test}
+
+
+\DebugSocketsOn
+\DebugTablesOn
+
+\begin{document}
+
+\START
+
+\begin{tabular}{crl}
+A & B & D \\ \cline{1-2}
+E & F & G
+\end{tabular}
+
+\typeout{^^J^^J====== Second Table ==========}
+
+\typeout{^^J^^J====== Third Table ==========}
+
+
+\end{document} 
+
diff --git a/required/latex-lab/testfiles-table-pdftex/table-022-cline.tlg b/required/latex-lab/testfiles-table-pdftex/table-022-cline.tlg
new file mode 100644
index 000000000..6b5fe0470
--- /dev/null
+++ b/required/latex-lab/testfiles-table-pdftex/table-022-cline.tlg
@@ -0,0 +1,67 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+[Sockets] ==> Socket 'tagsupport/para/begin' containing plug 'block' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/hmode/begin' containing plug 'Table' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+==> Table has 3 columns
+[Sockets] ==> Socket 'tagsupport/tbl/init' containing plug 'Table' used.
+==> saved cell data: 0,0,1 (outer level)
+[Sockets] ==> Socket 'tagsupport/tbl/row/begin' containing plug 'TR' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 1,1,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 1,2,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 1,3,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+==> (@arraycr) This row needs 0 additional cell(s)
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/row/end' containing plug 'TR' used.
+==> structure stored for row 1: 9,10,11
+[Sockets] ==> Socket 'tagsupport/tbl/leaders/begin' containing plug 'code' used.
+[Sockets] ==> Socket 'tagsupport/tbl/leaders/end' containing plug 'code' used.
+[Sockets] ==> Socket 'tagsupport/tbl/row/begin' containing plug 'TR' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 2,1,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 2,2,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/cell/begin' containing plug 'TD' used.
+==> current cell data: 2,3,1
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+==> (endarray) This row needs 0 additional cell(s)
+[Sockets] ==> Socket 'tagsupport/tbl/cell/end' containing plug 'TD' used.
+[Sockets] ==> Socket 'tagsupport/tbl/row/end' containing plug 'TR' used.
+==> structure stored for row 2: 13,14,15
+[Sockets] ==> Socket 'tagsupport/tbl/finalize' containing plug 'Table' used.
+==> restored cell data: 0,0,1 (outer level)
+[Sockets] ==> Socket 'tagsupport/tbl/hmode/end' containing plug 'Table' used.
+[Sockets] ==> Socket 'tag/struct/tag' containing plug 'latex-tags' used.
+[Sockets] ==> Socket 'tagsupport/para/end' containing plug 'plain' used.
+====== Second Table ==========
+====== Third Table ==========
+[Sockets] ==> Socket '@makecol/outputbox' containing plug 'footnotes-floats' used.
+[1
+] (table-022-cline.aux)
+Package tagpdf Info: Finalizing the tagging structure:
+(tagpdf)             Writing out ~16 structure objects
+(tagpdf)             with ~11 'MC' leaf nodes.
+(tagpdf)             Be patient if there are lots of objects!
+Package tagpdf Info: writing ParentTree
+Package tagpdf Info: writing IDTree
+Package tagpdf Info: writing RoleMap
+Package tagpdf Info: writing ClassMap
+Package tagpdf Info: writing NameSpaces
+Package tagpdf Info: writing StructElems
+Package tagpdf Info: writing Root
diff --git a/required/latex-lab/update-table.sh b/required/latex-lab/update-table.sh
index 68c0f5820..0636cd2ae 100644
--- a/required/latex-lab/update-table.sh
+++ b/required/latex-lab/update-table.sh
@@ -25,7 +25,8 @@ l3build save -cconfig-table-pdftex \
 	table-018 \
 	table-019 \
 	table-020 \
-	table-021-longtable
+	table-021-longtable \
+	table-022-cline
 
 l3build save -cconfig-table-luatex \
 	table-000 \
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index fb0be5f79..d2a3897ad 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -39,7 +39,7 @@
 %    \begin{macrocode}
 %<+package>\NeedsTeXFormat{LaTeX2e}[2024/06/01]
 %<+package>\ProvidesPackage{array}
-%<+package>         [2024/07/01 v2.6d Tabular extension package (FMi)]
+%<+package>         [2024/07/13 v2.6e Tabular extension package (FMi)]
 %
 % \fi
 %
@@ -3517,7 +3517,46 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 %  \end{macro}
 %
 %
+% \subsection{Handling \cs{cline}}
 %
+% In the past \pkg{array} did not have to concern itself with
+% \cs{cline} but simply used the definition already provided in the
+% kernel. However, for tagged PDF output this definition is
+% insufficient, because it causes incorrect row counting and the rules
+% it generates would need to be marked as artifacts.
+% We therefore update it  here.  
+%
+%
+%  \begin{macro}{\@cline}
+%    Tagging support for \cs{cline}
+%  \changes{v2.6e}{2024/07/13}{Support for tagging \cs{cline} (tagging/134)}
+%    \begin{macrocode}
+\ExplSyntaxOn
+\def\@cline#1-#2\@nil{
+  \omit
+  \@multicnt#1
+  \advance\@multispan\m at ne
+  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
+  \@multicnt#2
+  \advance\@multicnt-#1
+  \advance\@multispan\@ne
+%    \end{macrocode}
+%    The rule needs artifact tagging in tagged PDF.
+%    \begin{macrocode}
+  \UseSocket{tagsupport/tbl/leaders/begin}
+  \leaders\hrule\@height\arrayrulewidth\hfill
+  \UseSocket{tagsupport/tbl/leaders/end}
+%    \end{macrocode}
+%    To the row counting the above appears like an extra row, so we
+%    have to correct the count.
+%    \begin{macrocode}
+  \tbl_gdecr_row_count:
+  \cr
+  \noalign{\vskip-\arrayrulewidth}
+}
+\ExplSyntaxOff
+%    \end{macrocode}
+%  \end{macro}
 %
 %
 %    \begin{macrocode}
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 9c488fc57..bcc153292 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -1,3 +1,8 @@
+2024-07-13  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* array.dtx (subsection{Handling \cs{cline}}):
+	Support for tagging \cline (tagging/134)
+
 =======================================================================
 This file lists changes to the LaTeX2e files in reverse chronological order.
 It is provided for convenience only.  It therefore makes no claims to





More information about the latex3-commits mailing list.