Open T-F-S opened 1 month ago
You need to correctly "balance" the para/begin and para/end code when you stop tagging (and generally too). In your example you are suspending tagging before you start the paragraph, in vmode, but you then resume it inside the paragraph.
It compiles fine if you add a \leavevmode:
\NewDocumentCommand \dummy {}
{
\leavevmode
\UseTaggingSocket{tcb/drawing/begin}
\SuspendTagging{tcb/drawing}
Dummy
\ResumeTagging{tcb/drawing}
\UseTaggingSocket{tcb/drawing/end}
}
Or a \par
:
\NewDocumentCommand \dummy {}
{
\UseTaggingSocket{tcb/drawing/begin}
\SuspendTagging{tcb/drawing}
Dummy\par
\ResumeTagging{tcb/drawing}
\UseTaggingSocket{tcb/drawing/end}
}
I see. This seems to be true even for \clearpage
. The following code also needs \leavevmode
to work:
\NewDocumentCommand \dummy {}
{
\clearpage
\leavevmode% deletion gives an error
\UseTaggingSocket{tcb/drawing/begin}
\SuspendTagging{tcb/drawing}
Dummy
\ResumeTagging{tcb/drawing}
\UseTaggingSocket{tcb/drawing/end}
}
Testing your supposed tagging suppression in https://github.com/T-F-S/tcolorbox/issues/283#issuecomment-2202487503 I encountered a compilation error, if one suppressed code part is followed by another one.
The following code gives a MWE without tcolorbox and without tikzpicture, but with the same errors: