Skip to content

Commit

Permalink
Extend table tagging / handle tagging issues (#1428)
Browse files Browse the repository at this point in the history
* add support for row headers

* Declare variable

* update testfiles (braces)

* handle negative row header values

* add testfiles

* extend documentation

* add multirow code

* remove stray plug

* guard variant, update testfiles

* multirow testfile

* handle missing fields for multirow

* issue #432

* add changes, update date

* update luatex testfiles

* handle issue #444

* correct test, default structure

* version update and changes entry for lttagging

* provide sockets if they do not exist

* start ltnews entry

* corrections from review

* s + commas
  • Loading branch information
u-fischer authored Aug 7, 2024
1 parent ca48ab6 commit 8662371
Show file tree
Hide file tree
Showing 46 changed files with 6,573 additions and 451 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2024-07-27 Ulrike Fischer <[email protected]>
* lttagging.dtx: (subsection{Tagging support for table/tabular packages}):
Two sockets added to store and restore cell data when nesting tables to keep track
of multirow settings.

2024-07-27 Ulrike Fischer <[email protected]>
* lttagging.dtx: (subsection{Paragraph sockets}): A socket and plug to restore paragraph
setting added.
Expand Down
8 changes: 8 additions & 0 deletions base/doc/ltnews40.tex
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ \section{Introduction}

% To write

\section{News from the \enquote{\LaTeX{} Tagged PDF} project}

The tagging of tabulars has been extended: it is now possible to tag
also row headers and to create cells that span more than one row.

\emph{write more details ...}


\section{Handling paragraph continuation}

Already \LaTeX~2.09 offered some automatism to detect whether or not
Expand Down
24 changes: 22 additions & 2 deletions base/lttagging.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{lttagging.dtx}
[2024/07/27 v1.0e LaTeX Kernel (tagging support)]
[2024/08/07 v1.0f LaTeX Kernel (tagging support)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{lttagging.dtx}
Expand Down Expand Up @@ -324,6 +324,14 @@
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/tbl/init/celldata}
% This socket is used in \cs{tbl_init_cell_data_for_table}, the command
% that stores and initialize cell data to handle nested tables.
% It can be used to restore similar tagging related values
% \begin{macrocode}
\NewSocket{tagsupport/tbl/init/celldata}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{socketdecl}{tagsupport/tbl/finalize}
% To fine tune the structure (change cells to header cells, remove
Expand All @@ -337,7 +345,14 @@
% \end{macrocode}
% \end{socketdecl}
%

% \begin{socketdecl}{tagsupport/tbl/restore/celldata}
% This socket is used in \cs{tbl_restore_outer_cell_data:}, the command
% that restores cell data when quitting a nested table. It can be used to restore
% similar tagging related values
% \begin{macrocode}
\NewSocket{tagsupport/tbl/restore/celldata}{0}
% \end{macrocode}
% \end{socketdecl}

% \begin{socketdecl}{tagsupport/tbl/colspan}
% This socket is used to manage spanning cells, e.g., a
Expand Down Expand Up @@ -633,6 +648,10 @@
)
}
% \end{macrocode}
% Tagging has to initialize cell data too.
% \begin{macrocode}
\UseTaggingSocket{tbl/init/celldata}
% \end{macrocode}
% These are the initial values when starting a table:
% \begin{macrocode}
\int_gzero:N \g_@@_row_int
Expand Down Expand Up @@ -732,6 +751,7 @@
\int_gset:Nn \g_@@_row_int { \l_@@_saved_row_tl }
\tl_gset_eq:NN \g_@@_span_tl \l_@@_saved_span_tl
\tl_gset_eq:NN \g_@@_table_cols_tl \l_@@_saved_table_cols_tl
\UseTaggingSocket{tbl/restore/celldata}
\@@_trace:n { ==>~ restored~cell~data:~
\int_use:N \g_@@_row_int,
\int_use:N \g_@@_col_int,
Expand Down
6 changes: 6 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2024-08-06 Ulrike Fischer <[email protected]>
* latex-lab-table.dtx: add support for header-columns
* latex-lab-table.dtx: add support for multirows
* latex-lab-table.dtx: handle issue #432
* latex-lab-marginpar.dtx: handle issue #444

2024-07-11 Ulrike Fischer <[email protected]>
* latex-lab-footnote.dtx: restore paragraph defaults at the begin of the footnote
tagging-project#262
Expand Down
33 changes: 29 additions & 4 deletions required/latex-lab/latex-lab-marginpar.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
%
% for those people who are interested or want to report an issue.
%
\def\ltlabmarginpardate{2024-07-05}
\def\ltlabmarginparversion{0.85b}
\def\ltlabmarginpardate{2024-08-06}
\def\ltlabmarginparversion{0.85c}

%<*driver>
\documentclass[kernel]{l3doc}
Expand Down Expand Up @@ -153,13 +153,38 @@
\socket_new:nn {tagsupport/marginpar/end}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{macro}{\@@_get_marginpar_parent:N,\@@_get_marginpar_parent_aux:nn}
% In a paragraph we must retrieve
% the structure number of the surrounding Part structure
% TODO: if this is needed in more places this should
% go into tagpdf.
% \begin{macrocode}
\cs_new_protected:Npn\@@_get_marginpar_parent_aux:nn #1 #2
{
\str_if_eq:eeT{\use_ii:nn #1}{Part}{\seq_put_right:Nn\l_@@_tmpa_seq {#2}}
}
\cs_new_protected:Npn \@@_get_marginpar_parent:N #1
{
\seq_clear:N\l_@@_tmpa_seq
\seq_map_pairwise_function:NNN
\g_@@_struct_tag_stack_seq
\g_@@_struct_stack_seq
\@@_get_marginpar_parent_aux:nn
\seq_put_right:Nn\l_@@_tmpa_seq {2}
\seq_get_left:NN \l_@@_tmpa_seq #1
}
\cs_generate_variant:Nn \tag_struct_begin:n {e}
% \end{macrocode}
% \end{macro}
% \begin{plugdecl}{tagsupport/marginpar/begin,tagsupport/marginpar/end}
% \begin{macrocode}
\socket_new_plug:nnn {tagsupport/marginpar/begin}{default}
{
\if_mode_horizontal:
\tag_mc_end:
\tag_struct_begin:n{tag=Aside,parent=\g__tag_para_main_struct_tl}%
\tag_mc_end:
\@@_get_marginpar_parent:N \l_@@_tmpa_tl
\tag_struct_begin:e{tag=Aside,parent=\l_@@_tmpa_tl}%
\else:
\tag_struct_begin:n{tag=Aside}%
\fi:
Expand Down
Loading

0 comments on commit 8662371

Please sign in to comment.