latex3 / tagging-project

Issues related to the tagging project
https://latex3.github.io/tagging-project/
LaTeX Project Public License v1.3c
23 stars 5 forks source link

colortbl breaks header tagging in tables #80

Closed u-fischer closed 2 days ago

u-fischer commented 1 month ago
\DocumentMetadata{
  testphase={phase-III,table}
  }
\documentclass{article}
\usepackage{colortbl}

\begin{document}
\tagpdfsetup{table/header-rows={1}} % set header
\begin{tabular}{ll}
a & b\\
b & c
\end{tabular}
\end{document}

Without colortbl the first row of the table is tagged as TH, with colortbl all cells are TD. The problem is that colortbl overwrites the \endarray definition with the finalizing code. This seems to work:

\DocumentMetadata{
  testphase={phase-III,table}
  }
\documentclass{article}
\usepackage{colortbl}
\makeatletter
\ExplSyntaxOn
% \endarray definition from new array sty.
\def\endarray {
  \tbl_crcr:n{endarray} \egroup
  \UseTaggingSocket{tbl/finalize}
  \tbl_restore_outer_cell_data:
  \egroup
  \@arrayright \gdef\@preamble{}%
  \CT@end %added
}
\ExplSyntaxOff

\begin{document}
\tagpdfsetup{table/header-rows={1}} % set header
\begin{tabular}{ll}
a & b\\
b & c
\end{tabular}
\end{document}
davidcarlisle commented 1 month ago

colortbl has been submitted to ctan