Open mbertucci47 opened 8 months ago
I think I see the issue but I don't know how to fix it. In the definition of the restate
key there is
\protected@edef\tmp@a{%
\@nx\thmt@thisistheonetrue
\@nx\def\@nx\@currenvir{\thmt@envname}%
\@nx\@xa\@nx\thmt@restatable\@nx\@xa[\@nx\thmt@storedoptargs]%
{\thmt@envname}{\thmt@storename}%
}%
\@xa\g@addto@macro\@xa\thmt@local@postheadhook\@xa{%
\tmp@a
}%
so I believe the prefoot and postfoot hooks are being collected along with the theorem body, then since \endtheorem
is defined with
\@xa\def\csname end#1\endcsname{%
% these need to be in opposite order of headhooks.
\csname thmt@generic@prefoothook\endcsname
\csname thmt@#1@prefoothook\endcsname
\csname thmt@local@prefoothook\endcsname
\csname thmt@original@end#1\endcsname
\csname thmt@generic@postfoothook\endcsname
\csname thmt@#1@postfoothook\endcsname
\csname thmt@local@postfoothook\endcsname
}%
in thm-patch.sty, the prefoot and postfoot hooks are executed once again. This can perhaps be fixed with a redefinition of \endtheorem
in the restate key, but I don't yet see how to stop \thmt@collect@body
from collecting the hooks.
When a theorem is called with the
restate
key, the prefoot and postfoot hooks are called twice. It only occurs with the key version, not therestatable
environment.The hooks are also not duplicated in the restated theorem, so here
\foo*
.As a side observation, the
restatable
environment adds an extra space between the posthead and body.