You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the restatable environment.
\documentclass{article}
\usepackage{amsthm,thmtools}
\declaretheorem{theorem}
\addtotheorempreheadhook{PREHEAD}
\addtotheorempostheadhook{POSTHEAD}
\addtotheoremprefoothook{PREFOOT}
\addtotheorempostfoothook{POSTFOOT}
\begin{document}
\begin{theorem}
body text
\end{theorem}
\begin{theorem}[restate=foo]
body text
\end{theorem}
\begin{restatable}{theorem}{blub}
body text
\end{restatable}
\end{document}
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: