The user 'egreg' recently helped me to suppress vertical space between theorem
heads and enumitem environments (such as itemize; see the link below). I now
have a similar problem: When a proof environment starts with an itemize,
there is too much vertical space. How can the proof environment be redefined
such that this space is (at least party) suppressed?
Ideally, it should be a "clean" solution, so that one can type \begin{proof} followed by \begin{itemize} and no complicated commands in-between.
By redefining the proof environment as a theorem, one could circumvent the
problem, but how can the q.e.d. symbol be nicely placed? Not sure if that's a
good approach.
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[american]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{etoolbox}
\usepackage{enumitem}
% theorems
\newif\ifstarttheorem
\newtheoremstyle{mythmstyle}%
{0.5em}%
{0.5em}%
{}%
{}%
{\sffamily\bfseries\global\starttheoremtrue}%
{}%
{\newline}%
{\thmname{#1}\ \thmnumber{#2}\ \thmnote{(#3)}}%
\theoremstyle{mythmstyle}%
% proofs
\renewcommand*\proofname{Proof}
\makeatletter% q.e.d. adjustment (posted by ???)
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont\topsep2\p@\@plus2\p@\relax
\trivlist
\item[\hskip\labelsep
\sffamily\bfseries #1]\mbox{}\hfill\\*\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother
% suppress vertical spacing (for itemize) when newtheorems start with an environment
% see http://tex.stackexchange.com/questions/60001/nested-enumerate-enumitem-interferes-with-suppressing-vertical-space-after-the
\makeatletter
\preto\itemize{%
\if@inlabel
\ifstarttheorem
\mbox{}\par\nobreak\vskip\glueexpr-\parskip-\baselineskip+0.3em\relax\hrule\@height\z@
\global\starttheoremfalse
\fi
\fi}
\preto\enditemize{\global\starttheoremfalse}
\makeatother
% document
\begin{document}
Let's prove something:
\begin{proof}
\begin{align*}
x=y,\quad y=z\quad\Rightarrow\quad x=z.
\end{align*}
\end{proof}
Here a nicer vertical spacing:
\begin{proof}
Just some text:
\begin{align*}
x=y,\quad y=z\quad\Rightarrow\quad x=z.
\end{align*}
\end{proof}
Here a version with itemize:
\begin{proof}
\begin{itemize}
\item $x=y,\quad y=z\quad\Rightarrow\quad x=z.$
\end{itemize}
\end{proof}
\end{document}

itemize, even using\qedhere. but withenumeratethere's still a big gap between the heading and the first item (and\qedhereisn't the cause). – barbara beeton Aug 11 '12 at 16:04enumerate(as foritemize) and it works – Marius Hofert Aug 11 '12 at 16:11alignenvironment, do you know how to suppress the space in this situation? – Marius Hofert Aug 11 '12 at 16:16itemizeenvironment can be adapted to analign. If possible, can you give the answer in your answer, please? [I could also file a new question for this] – Marius Hofert Aug 11 '12 at 20:18