Open jfbu opened 10 months ago
Well lots of problems with boxes in boxes are not solved yet ;-(.
The easiest here would be to use \mbox
instead of \hbox
(or \leavevmode
). Another option is to disable the locally the sockets (but depending on the content of the minipage one perhaps need to reenable them inside the minipage again):
\DocumentMetadata{
uncompress,
pdfversion=1.7,
lang=en-US,
testphase=phase-III
}
\documentclass{book}
\begin{document}
%\leavevmode
\hbox{%
\AssignSocketPlug{tagsupport/minipage/before}{noop}%
\AssignSocketPlug{tagsupport/minipage/after}{noop}%
\begin{minipage}{\linewidth}
Hello\par
\end{minipage}%
}
\end{document}
Thanks @u-fischer! I will no doubt hit other problems, but all warnings from the test file of jfbu/etoc#4 were gone after incorporating your code. I don't know what is policy here so not closing this issue from my own initiative as anyhow you may consider this is something to address in other ways, like docs etc... but feel free to close of course.
To provide additional background the \hbox
and \vbox
nesting are used by etoc
framed style to ... frame the contents. The \hbox
and \vbox
use \bgroup
, \egroup
to in effect work as in first and second argument of an environment. The minipage
is inserted for some forgotten reason which may have to do with using multicols
inside it.
@u-fischer sorry to be back but I have now re-activated the minipage sockets inside the surrounding minipage. It is not tested but does it look like the way to do it if it were to stay?
In particular, the \end{minipage}
is immediately followed by the \egroup
, so I guess my socket reactivation right before \egroup
can be dropped altogether? or do they do global things?
\end{minipage}% started in the \hbox
\ifEtoc@tagactive
\AssignSocketPlug{tagsupport/minipage/before}{tag/dflt}%
\AssignSocketPlug{tagsupport/minipage/after}{tag/dflt}%
\fi
\egroup % end of \hbox wrapper around minipage (inside \vbox)
assignment to sockets are local (you get the documentation with texdoc ltsockets).
Ok. This part of the sockets documentations looks outdated:
% In contrast to template code, there is no standard configuration
% method through parameters for hooks, i.e., the code added to a hook
% \enquote{is} the configuration. If it wants to provide for
% configuration through parameters it has to also provide its own
% method to set such parameters in some way. However, in that case it
% is likely that using a hook is not the right approach and the
% developer better calls a template instance instead which then offers
% configuration through a key/value interface.
HMM, maybe I should have read further
% There are also hooks that take arguments (typically portions of
% document data) and in that case the hook code can access these
% arguments through \verb=#1=, \verb=#2=, etc.
but then I find it all quite confusing what is meant in the end.
Update: exact same problem with \parbox
with similar work-around.
DocumentMetadata{
uncompress,
pdfversion=1.7,
lang=en-US,
testphase=phase-III
}
\documentclass{article}
\begin{document}
\hbox{%
%\AssignSocketPlug{tagsupport/parbox/before}{noop}% THIS IS A FIX
%\AssignSocketPlug{tagsupport/parbox/after}{noop}% THIS IS A FIX
\parbox{1cm}{foo}%
}
\end{document}
So, \sbox0{\parbox{1cm}{foo}}
is enough to trigger the problem. It does not have to be a box typeset on the page.
Surely not unexpected, but it appears one can not use minipage inside
\hbox
without some adaptations:other_tagging_minipage_in_hbox.log
The
etoc
package provides user an\etocframedstyle
command to configure\tableofcontents
to use a framed rendering of TOC. Legacy code (which is currently awfully badly indented inetoc.pdf
due to some Emacs accident probably years ago) has an\vbox
around an\hbox
around aminipage
around amulticols
(or not if only 1 column) to support its (optional) "framed" style.Wha should I do for the transition to tagging-compatible implementation?
This would be first step in handling jfbu/etoc#4.