latex3 / tagging-project

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

faulty para tagging with center/minipage/center nesting #544

Open u-fischer opened 1 month ago

u-fischer commented 1 month ago

The newest minipage code resets \l__tag_para_flattened_bool and this leads to errors if there are inside and outside flattened block environments:

\DocumentMetadata{testphase={phase-III}}
\documentclass{article}
\begin{document}
\begin{center}
\begin{minipage}{.45\columnwidth}
\ExplSyntaxOn
\bool_set_false:N\l__tag_para_flattened_bool % now done by minipage
%\int_zero:N\l__block_flattened_level_int
\ExplSyntaxOff
\begin{center}
abc
\end{center}
\end{minipage}%
\end{center}

\end{document}

This right fix seems to be to reset the counter, but it is not quite clear where this should be done. Perhaps in the para/restore tagging socket? @FrankMittelbach

FrankMittelbach commented 1 month ago

Well, yes. In a new context one needs to reset l__tag_para_flattened_bool as well is the \l__block_flattened_level_int. Should probably be documented as such next to the boolean declaration.

An so yes, it should be done when the new context is established, ie in the socket (which I still think has the wrong name, but no longer so sure what it should be, so leave that alone until we have proper handling of context)

John02139 commented 1 month ago

Perhaps related: https://github.com/latex3/tagging-project/issues/119#issue-2404020416