[Tex/LaTex] How to change space around theorem environments

amsthmspacing

Is there a way to change the vertical space before/after theorem environments, without defining a new theorem style? I'm using amsthm package to define my new theorem environments.

Best Answer

Without defining new theorem styles, you can modify the macro that's used by default, which is \thm@space@setup

\documentclass{article}
\usepackage{amsthm,lipsum}
\makeatletter
\def\thm@space@setup{%
  \thm@preskip=5cm plus 1cm minus 2cm
  \thm@postskip=\thm@preskip % or whatever, if you don't want them to be equal
}
\makeatother

\newtheorem{thm}{Theorem}

\begin{document}
\lipsum[2]

\begin{thm}
$1+1=2$
\end{thm}

\lipsum[2]

\end{document}

The default value is \topsep. You don't need to have the same space above and below the theorem.