Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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.

share|improve this answer
    
Ha! Perfect!! Thanks so much. Just one question: is \topsep used only by this macro? May I change only its value? –  Sigur Dec 3 '12 at 22:24
1  
@Sigur \topsep is the parameter normally used by list environments (enumerate, itemize and description); I would change neither the spacing around theorems nor \topsep, for what it's worth. :) –  egreg Dec 3 '12 at 22:25
    
@egreg, neither around theorems! Why? Should I use rubber length? –  Sigur Dec 3 '12 at 22:27
1  
@Sigur \topsep is 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 3 '12 at 22:32
    
OK. I see. You added the rubber space on the answer. Thanks. I'll accept it. –  Sigur Dec 3 '12 at 22:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.