latex3 / tagging-project

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

tagging longtable with endhead + endfirsthead #553

Open u-fischer opened 4 weeks ago

u-fischer commented 4 weeks ago

If a longtable uses both \endfirsthead and \endhead additional (empty with luatex, with wrong content with pdftex) row structures are produce and the row count is wrong:

\DocumentMetadata{testphase={phase-III,table,firstaid}}
\documentclass{article}
\usepackage{longtable}
\tagpdfsetup{table/header-rows=2}
\begin{document}
\begin{longtable}{ll}
  head & head \\
  \endfirsthead
  head cont & head cont \\
  \endhead
  text & text\\
\end{longtable}
\end{document}

image

We need a way to suppress the tagging of the \endhead and suppress its row count if there is \endfirsthead.

davidcarlisle commented 4 weeks ago

I suppose we need to decide whether to support \endfirsthead coming later (by which time the \endhead rows have already been boxed). You could pick this up on a later run, or make that an error and specify that \endfirsthead has to come first if tagging enabled,

u-fischer commented 4 weeks ago

Don't we need a label anyway? I mean when the first row of the \endhead is seen the code can not know if that is a normal row which should be tagged or a \endhead row that should be ignored. The alternative would be to stash all row structures until the end of chunk and then to decide if one use them or drop them but I would have to test that first.

davidcarlisle commented 4 weeks ago

hmm ok so fix up on second run... In the v5 experiments there is an option planned not to store the headers in boxes but (like supertabular) as macros, people often want marks or column sums etc, and forcing a fixed box has issues even without tagging.

u-fischer commented 4 weeks ago

well actually there is already code to handle this. It only didn't work because of https://github.com/latex3/tagging-project/issues/554