0

I have a theorem written using restatable. However, in one part of the text I am using a two-column format requiring a linebreak in the theorem. When I restate the theorem in the single column part I would like the theorem to no longer use these unnecessary line breaks anymore (see example below). Is this possible?

\documentclass{article}
\usepackage{amsmath}
\usepackage{thm-restate}

\newtheorem{theorem}{Theorem}[section]

\begin{document}

% the original theorem
\begin{restatable}[My Theorem]{theorem}{labelname}
\begin{multline*}
    \text{some equation too long for one part} \\ \text{overflow stuff}
\end{multline*}
\end{restatable}

% the restated theorem where I no longer want line breaks
\labelname*

\end{document}

1 Answer 1

3

You can make a new command \IfRestatedTF{<true code>}{<false code>} using the thmtools conditional \ifthmt@thisistheone.

\documentclass{article}
\usepackage{amsmath}
\usepackage{thm-restate}

\newtheorem{theorem}{Theorem}[section]

\makeatletter
\newcommand{\IfRestatedTF}[2]{\ifthmt@thisistheone #2\else #1\fi}
\makeatother

\begin{document}

% the original theorem
\begin{restatable}[My Theorem]{theorem}{labelname}
\begin{multline*}
    \text{some equation too long for one part} \IfRestatedTF{}{\\} \text{overflow stuff}
\end{multline*}
\end{restatable}

% the restated theorem where I no longer want line breaks
\labelname*

\end{document}
1
  • 1
    This is a great solution, thanks!
    – Seraf Fej
    Jan 30 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .