latex3 / tagpdf

Tagging support code for LaTeX
59 stars 7 forks source link

copying with \leaders confuses mcid count #87

Open u-fischer opened 9 months ago

u-fischer commented 9 months ago

Copying a box with leaders avoids multiple labels (which is good) but gives the wrong mcids with pdflatex

\DocumentMetadata{uncompress,testphase=phase-II}
\documentclass{article}

\begin{document}
\setbox0=\vbox{some text\par}%
\setbox2=\hbox{\leaders\copy0\hskip\wd0} 

\copy0 \copy2 \copy2

more text
\end{document}

The two copies are marked as MCID 1 and MCID 2. The structures point to MCID 0 and 3 (ok), but the parenttree contains only one structure

<< /Nums [0 [ 11 0 R ]
]

It would be better if the copies where marked as artifact.

Should be research together with box saving/restoring.