I know from this github issue opened on 16 July 2024 that the tablenotes from threeparttable is incompatible with tagpdf.
I am able to reproduce this error as well with this minimal example below:
\DocumentMetadata{lang=en-UK,
tagging=on,
pdfstandard=UA-2}
\documentclass[12pt]{article}
% --- Packages ---
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{threeparttable}
% -- Package setup -- %
\tagpdfsetup{
tabsorder = structure,
}
\hypersetup{
pdftitle={How to make PDF-UA2},
pdfauthor={Miloop Karja},
pdfkeywords={accessibility, tagging, PDF-UA2, LuaLaTeX},
}
\begin{document}
\begin{table}
\begin{threeparttable}
\caption{Recruitment in A-team.}
\begin{tabular}{l l}
Name\tnote{1} & Reason\tnote{2} \\
Miara& They can write backwards \\
Teiman & They can jump very high \\
Ruital & Can think on their feet\\
\end{tabular}
\begin{tablenotes}
\item[1] Only first name. \item[2] Deemed by the coach
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{figure}[h!]
\includegraphics[width=\textwidth]{example-image}
\end{figure}
%%FYI, verPDF still deems this document PDF-UA2 compliant even though I haven't added alt={} to the figure... ??
\end{document}
I get the error:
! Package tagpdf Error: The number of automatic begin (5) and end (4)
(tagpdf) text-unit para hooks differ!
For immediate help type H <return>.
Is a fix available, or a tag-friendly alternative approach?
Package tagpdf Warning: Alternative text for graphic is missing. Using 'example-image.pdf' instead.VeraPDF considers this sufficient. IIRC, PAC considers this suspicious, but still passes the file.Package tagpdf Warning: Alternative text for graphic is missing. Using 'example-image.pdf' instead.