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.
Asked
Active
Viewed 8,566 times
13
Sigur
- 37,330
1 Answers
10
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.
egreg
- 1,121,712
\topsepused only by this macro? May I change only its value? – Sigur Dec 03 '12 at 22:24\topsepis the parameter normally used by list environments (enumerate,itemizeanddescription); I would change neither the spacing around theorems nor\topsep, for what it's worth. :) – egreg Dec 03 '12 at 22:25\topsepis a rubber length. It's default value in the standard classes is 8pt plus 2pt minus 4pt (at 10pt size) or 10pt plus 4pt minus 6pt (at 12pt size). I believe it's a good compromise: not larger than the baseline skip (at least in its natural length), but flexible enough. Theorems already have a header that, together with the spacing, makes them prominent enough. – egreg Dec 03 '12 at 22:32\begingroup\setlength{\topsep}{100pt}\begin{thm}...\end{thm}\endgroup– egreg May 30 '16 at 10:26\topsep? – Argyll May 30 '16 at 10:36proofenvironment. The global solution forproofwas addressed by you in http://tex.stackexchange.com/questions/49801/how-can-i-eliminate-the-vertical-extra-space-before-and-after-the-proof-environm – Argyll May 30 '16 at 10:38