zauguin / luamml

Automatically generate MathML equivalents for math expressions in LuaLaTeX
5 stars 1 forks source link

luamml overwrites \endarray from array and breaks table tagging #1

Open u-fischer opened 3 weeks ago

u-fischer commented 3 weeks ago

The \endarray definition from luamml misses the tagging socket and the command to restore table data and so in the following document (which with lualatex-dev loads luamml) the table the table header is not tagged as TH.

The patch to \@classz is wrong too: with tagging \@startpbox should use \insert@pcolumn and not `\insert@column

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase={phase-III,math,table},
    uncompress,
  }

\documentclass{article}

%\ExplSyntaxOn
%\makeatletter
%\cs_set:Npn \endarray {
%  \tbl_crcr:n{endarray}
%  \__luamml_array_save_array:
%  \egroup
%  \UseTaggingSocket{tbl/finalize}
%  \tbl_restore_outer_cell_data: 
%  \egroup
%  \mode_if_math:T { \__luamml_array_finalize_array: }
%  \@arrayright
%  \gdef \@preamble {}
%}
%
%\ExplSyntaxOff

\begin{document}
\tagpdfsetup{table/header-rows=1}
\begin{tabular}{lll}
\textbf{Apple} & \textbf{Banana} \\\hline
   red         & yellow    \\
\end{tabular}

\end{document}
zauguin commented 2 weeks ago

this should be fixed with 92d3b9bd5bd62054f6a4d404ae277df661dc25ae. It's still doing a lot of patching and I looked if it could be replaced though usage of the sockets, but currently this seems tricky since we need to run code inside of the table. Maybe it makes sense to add an additional socket there.

u-fischer commented 2 weeks ago

I added similar patches already to latex-lab-math so there is works again and it is not urgent. But if sockets are missing we should add them as soon as possible: other table related packages can not adapt to tagging if there is still some low-level luamml code in use. If you have a suggestion about good sockets here ...