summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/tools/tabularx.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/tools/tabularx.dtx')
-rw-r--r--macros/latex-dev/required/tools/tabularx.dtx51
1 files changed, 47 insertions, 4 deletions
diff --git a/macros/latex-dev/required/tools/tabularx.dtx b/macros/latex-dev/required/tools/tabularx.dtx
index 6d59ca4c22..52ee62cad9 100644
--- a/macros/latex-dev/required/tools/tabularx.dtx
+++ b/macros/latex-dev/required/tools/tabularx.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2023
+% Copyright (C) 1993-2024
%
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
@@ -31,7 +31,7 @@
%<driver> \ProvidesFile{tabularx.drv}
% \fi
% \ProvidesFile{tabularx.dtx}
- [2023/07/08 v2.11c `tabularx' package (DPC)]
+ [2023/12/11 v2.12a `tabularx' package (DPC)]
% \iffalse
%<*driver>
\documentclass{ltxdoc}
@@ -261,6 +261,25 @@
% This behaviour of the package can be customised slightly
% as noted in the documentation of the code section.
%
+% \section{Support for tagged PDF}
+%
+% With version 2.12a the package is made tagging aware, which means that
+% it will automatically produce tagged tables (necessary, for example, for
+% accessibility) if tagging is requested via \cs{DocumentMetadata}.
+%
+% More granular control, e.g., explicitly deciding which cells are
+% header cells, etc., is currently under development, but syntax for
+% this will not appear in this package. Instead it will become
+% available across all tabular-generating packages and then
+% automatically apply here as well.
+%
+% Enabling \LaTeX{} to automatically produce tagged PDF is a long-term
+% project and this is a tiny step in this puzzle. For more information
+% on the project and already available functionality, see
+% \url{https://latex-project.org/publications/indexbytopic/pdf} and
+% \url{https://github.com/latex3/tagging-project}.
+%
+%
% \MaybeStop{}
%
% \section{The Macros}
@@ -269,6 +288,14 @@
%<*package>
% \end{macrocode}
%
+% We only need two changes for tagging support, but they require
+% that a recent \LaTeX{} kernel is used (which should be no problem
+% if \texttt{tools} is distributed in parallel with the kernel.
+% \changes{v2.12a}{2023/12/11}{Require newer LaTeX kernel}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2024/06/01]
+% \end{macrocode}
+%
% \changes{v2.00}{1994/02/07}
% {New Option Handling}
% \begin{macrocode}
@@ -506,7 +533,15 @@
% \begin{macrocode}
\TX@typeout@
{\@spaces Table Width\@spaces Column Width\@spaces X Columns}%
-% \end{macrocode}%
+% \end{macrocode}
+%
+% While we do trial typesetting we suspend any tagging if that is
+% active:
+% \changes{v2.12a}{2023/12/11}
+% {Suspend any tagging while doing trial typesetting}
+% \begin{macrocode}
+ \SuspendTagging {tabularx}%
+% \end{macrocode}
% First attempt. Modify the {\ttfamily X} definition to count {\ttfamily
% X} columns.
% \begin{macrocode}
@@ -523,6 +558,12 @@
\TX@trial{}%
\repeat
% \end{macrocode}
+%
+% And here we restart it again:
+% \begin{macrocode}
+ \ResumeTagging {tabularx}%
+% \end{macrocode}
+%
% One last time, with warnings back on (see appendix D)
% use {\ttfamily tabular*} to put it in a box of the right size, in case
% the algorithm failed to find the correct size.
@@ -737,8 +778,9 @@
% Make the table, and finish the hbox.
% Since v1.06, "\toks@" contains the preamble specification,
% and possible optional argument, as well as the table body.
+%
% \begin{macrocode}
- \expandafter\tabular\the\toks@
+ \expandafter\tabular\the\toks@
\endtabular}%
% \end{macrocode}
% Since v1.05 reset all \LaTeX\ counters, by executing "\TX@ckpt".
@@ -961,6 +1003,7 @@
% \end{macrocode}
% \end{macro}
%
+%
% \begin{macrocode}
%</package>
% \end{macrocode}