# Remove vertical space around theorems

I'm very new to LaTeX (a couple of days ago I didn't know how to use \newtheorem) and was hoping someone could help me with the following problem.

If I'm using \usepackage{amsthm}, how do I obtain control over the vertical gap between Theorems, Propositions etc and their respective proofs? In particular, I am looking for the proof to follow on like a normal line. This is the best I have come up with so far:

\usepackage{amthm}

\newtheoremstyle{newstyle}
{} %Aboveskip
{-.25pt} %Below skip
{\mdseries} %Body font e.g.\mdseries,\bfseries,\scshape,\itshape
{} %Indent
{ } %Space after theorem header

\theoremstyle{newstyle}
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}{Proposition}[thm]
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}

\newenvironment{pf}
{\n\textit{Proof.}\begin{mdseries}}
{\end{mdseries}}\


However, I have two main problems with it. Firstly, the %Below skip doesn't seem to give me much control - there's a pretty substantial jump between {} and when I type any negative value in. Secondly, the numbering is mucked up e.g. if I was to type \begin{thm}...\end{thm} and then \begin{prop}...\end{prop} (in section 1 say) I would get as my out put:

Theorem 1.1
Proposition 1.1.1

Thanks for any help.

• Your code sample is truncated, can you supply the rest? – Andrew Swann Aug 23 '12 at 10:45
• Have you considered using the proof environment provided by the amsthm package? Among other things, it does a very nice job of placing and end-of-proof ("qed") symbol at the end of the environment. – Mico Aug 23 '12 at 11:02

Firstly, below skip should be positive, negative values are ignored. You can clear the spacing provided as standard by writing

\makeatletter
\def\thm@space@setup{\thm@preskip=0pt
\thm@postskip=0pt}
\makeatother


before your \newtheoremstyle. You can adjust this by changing the values 0pt or using the parameters in the \newtheoremstyle.

Try

\newenvironment{pf}{\noindent\textit{Proof.}\begin{mdseries}}{\end{mdseries}}


for your proof environment. If this is too simplistic, e.g. if you wish to have the \qed features of the AMS environment, then you can use the following adaption of the AMS proof code

\makeatletter
\newenvironment{pf}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep0\p@\relax
\trivlist
\item[\hskip\labelsep\itshape
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother


The important point is setting the value of \topsep to zero.

Lastly, the proposition number is wrong because you have asked it to be numbered within thms! You should write

\newtheorem{prop}[thm]{Proposition}


with [thm] placed between the other arugments not at the end.

Here is this all put in to one sample document.

\documentclass{article}

\usepackage{amsthm}

\makeatletter
\def\thm@space@setup{\thm@preskip=0pt
\thm@postskip=0pt}
\makeatother
\newtheoremstyle{newstyle}
{} %Aboveskip
{} %Below skip
{\mdseries} %Body font e.g.\mdseries,\bfseries,\scshape,\itshape
{} %Indent
{ } %Space after theorem header

\theoremstyle{newstyle}
\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}[thm]{Proposition}
\newtheorem{lem}{Lemma}
\newtheorem{cor}{Corollary}

\makeatletter
\newenvironment{pf}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep0\p@\relax
\trivlist
\item[\hskip\labelsep\itshape
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother

\begin{document}
Some text to indicate the spacing.

\begin{thm}
First theorem, with sufficiently long text so that it spills on to a
second line.
\end{thm}

Some text to indicate the spacing.  Fill-up text make this spill on to
an extra line.  Fill-up text make this spill on to an extra line.

More text.

\begin{prop}
A proposition, with sufficiently long text so that it spills on to a
second line.
\end{prop}

\begin{pf}
Proof of the proposition with \verb+pf+ environment and sufficiently
long text so that it spills on to a second line.
\end{pf}

\begin{prop}
Another proposition, with sufficiently long text so that it spills
on to a second line.
\end{prop}

\begin{proof}
The original proof environment and sufficiently long text so that it
spills on to a second line.
\end{proof}

\end{document}


• Hi Andrew, thanks your answer. You've certainly cleared up 2, but as I'm looking for the proof to follow on like a normal line, I'm still stick on 1! – user32259 Aug 23 '12 at 11:00
• @AndrewSwann -- the text for the theorem consists only of short paragraphs, nothing that goes to a second line. this gives the impression that the theorem text is always indented, which it wouldn't be under ordinary circumstances. maybe break the text into lines with \ (which shouldn't be done normally!), or just add enough text after "first theorem" to fill the first line and start to a second. – barbara beeton Aug 23 '12 at 12:16
• @barbarabeeton You are right. I have updated the sample document. – Andrew Swann Aug 23 '12 at 12:25
• @user32259 I have addressed this now. – Andrew Swann Aug 23 '12 at 12:43
• Thanks Andrew. This is EXACTLY what I was looking for. Just one last thing... how would you make a proof environment in a similar way to the theorems where you can change the space before and after? I tried using your code for \makeletter and substituting thm for pf but it didn't work. – user32259 Aug 23 '12 at 13:57