Spacing before and after with \newtheoremstyle
if you're using amsthm
, there is already a \theoremstyle{definition}
that is exactly the same as the plain
theorem style except that the text is set in roman. there is also \theoremstyle{remark}
that's the same as definition
except that it doesn't add extra space above and below. using these three styles, you can keep everything numbered consecutively without having to define anything new:
\theoremstyle{plain} % default
\newtheorem{theorem}{Theorem}[section]
\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
why so many people don't seem to know about the different styles is beyond me. it's right there on p.3 of the amsthm
documentation (try texdoc amsthm
), including a list of the types of objects usually associated with each style.
update: the amsthm
documentation has been thoroughly overhauled, and
the description of the three styles provided by default is now on p.7.
the new manual is packaged with tex live 2015, and is also available
from ctan.
The default spacing above and below the plain
theorem style (used in your thm
theorem) is \topsep
, which is larger than 3pt
. Use \topsep
in your examp
theorem environment to achieve a similar spacing to that of thm
.
\documentclass{book}
\usepackage{amsthm}% http://ctan.org/pkg/amsthm
\newtheorem{thm}{Theorem}[chapter]
\newtheoremstyle{exampstyle}
{\topsep} % Space above
{\topsep} % Space below
{} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{exampstyle} \newtheorem{examp}[thm]{Example}
\begin{document}
Here is some text that is placed above the theorem.
\begin{thm} This is a theorem. \end{thm}
Here is some text that is placed below the theorem.
Here is some text that is placed above the example.
\begin{examp} This is an example. \end{examp}
Here is some text that is placed below the example.
\end{document}
\topsep
is defined as the length 8.0pt plus 2.0pt minus 4.0pt
which is 8pt
plus/minus some stretchability (could be anything from 4pt
to 10pt
), depending on the placement within the context of the page. Of course, you can change this (currently set at 3pt
in your code) to whatever, to modify the separation from other document elements.