5

I use amsmath to provide the proof environment. However, if a itemize (or tikzpicture) environment immediately follows the proof environment, xelatex will produce a messy result:

\begin{proof}
\begin{itemize}
\item 1
\item 2
\end{itemize}
\end{proof}

Will produce something like this:

Proof. * 1

  • 2

So I have to manually add a \mbox after the proof env. Is it possible to make proof automatically add a newline in these situations?

  • 4
    In my opinion it's better not to format a proof as an itemized or enumerated list. Just add at the beginning of the paragraph a marker (for instance the number of the substatement, or a symbol such as ($\Rightarrow$)). Having a long (or even short) proof with a shifted margin makes for bad pages. – egreg Apr 28 '13 at 10:14
  • Related: http://tex.stackexchange.com/questions/36851/skipping-line-after-proof-in-proof-environment and http://tex.stackexchange.com/questions/85059/proof-environment-line-break-after-the-proof (so that this helps someone searching!) – kan Apr 28 '13 at 10:22
  • 1
    These two questions asked for a newline without any condition. I want to have a 'smart' proof: only add a new line when the first 'thing' inside the proof is itemize, enumerate, description, tikzpicture, or something like these environments. Seems I did not make it clear in the first place. Sorry about that. – capsensitive Apr 29 '13 at 07:04
  • @egreg That is a good advice. But sometimes I need to start proof with a tikzpicture, and without \mbox{}, the tikzpicture will float at the top of the proof environment: – capsensitive Apr 29 '13 at 07:07

1 Answers1

3

You can redefine the proof environment and add a \mbox:

\documentclass[a5paper]{article}
\usepackage{amsmath,amsthm}
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{.}]\mbox{}\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother
\begin{document}
\begin{proof}
\begin{itemize}
\item 1
\item 2
\end{itemize}
\end{proof}
\end{document}
Marco Daniel
  • 95,681