# Space before proof

I am trying to make LaTeX put no additional space between theorem and proof. Here is my code:

\newtheorem*{pr3}{Theorem}
\begin{pr3}
foo
\end{pr3}
\begin{proof}[Proof:]
bar
\end{proof}


Is there a way to do that only with amsthm/amsmath and how? I wanted to renewenvironment proof, however I couldn't find what is the best way to do that. So it would be great if someone can tell me where I can find such information (that could also be considered answer to the first question).

-

## migrated from stackoverflow.comJun 13 '12 at 21:14

This question came from our site for professional and enthusiast programmers.

You probably don't want to remove the space after the proof, so the way should be

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\vspace{-\topsep}% remove the space after the theorem
\pushQED{\qed}%
\normalfont
\topsep0pt \partopsep0pt % no space before
\trivlist
\item[\hskip\labelsep
\itshape
}{%
\popQED\endtrivlist\@endpefalse
\addvspace{6pt plus 6pt} % some space after
}
\makeatother


However a proof environment not preceded by a theorem will be typeset wrongly.

-
I didn't want to use negative vspace however as it is not constant like in the other answer, I think that this will do. Thanks. –  Ivaylo Petrov Aug 14 '12 at 12:44

You could put a negative vertical space between theorem and proof, like so:

\newtheorem*{pr3}{Theorem}
\begin{pr3}
foo
\end{pr3}
\vspace{-1.5em}
\begin{proof}[Proof:]
bar
\end{proof}


and you could wrap all into a new command \theoremproof{theorem body}{proof body}.

-