I am preparing a manuscript for a conference that offers a class file and a package of macros. In the style file, they have
\newtheorem{thm}{Theorem}[section]
and similar lines, and in the macro package, they have
\newcommand{\thmvspace}{.4pc plus .2pc minus .1pc}
\newenvironment{theorem}{\vspace{-\lastskip}\par\addvspace{\thmvspace}\begin{thm}}{\end{thm}\par\addvspace{\thmvspace}}
Authors are supposed to use the environment theorem
in their manuscript. I am guessing that the macro in the package adjusts spaces before and after theorems, but I don't know how it exactly works.
Now, because I have proofs in the appendix, I want to restate theorems there by using thmtools
and thm-restate
. I end up loading these after the class file does \newtheorem
, which is itself a problem. Since the conference has authors prepare camera-ready PDF files and does not care about the LaTeX source, I need only produce something very close to what they intended. So I thought I could declare a theorem-type environment mythm
of my own and define an environment like the one in the package provided by the conference. So my minimal (non-)working example is as follows:
\documentclass{article}
\usepackage{thmtools, thm-restate}
\declaretheorem{mythm}
\newcommand{\thmvspace}{.4pc plus .2pc minus .1pc}
\newenvironment{theorem-restatable}[2][]{\vspace{-\lastskip}\par\addvspace{\thmvspace}\begin{restatable}[#1]{mythm}{#2}}{\end{mythm}\par\addvspace{\thmvspace}}
\begin{document}
\begin{theorem-restatable}[Tarski]{tarski}
Truth is undefinable.
\end{theorem-restatable}
\tarski*
\end{document}
But this produces the error:
File ended while scanning use of \thmt@collect@body.
This may be something related to fragile macros and lack of \protect
, but I can't figure out what's wrong. How can I define an environment like the one defined in the macro package but with restatable
?