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
  • 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, 2013 at 10:14
  • Related: tex.stackexchange.com/questions/36851/… and tex.stackexchange.com/questions/85059/… (so that this helps someone searching!)
    – kan
    Apr 28, 2013 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. Apr 29, 2013 at 7: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: Apr 29, 2013 at 7:07

1 Answer 1

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}
4
  • But this code seems always add a \mbox{}. Is it possible to add \mbox{} only when it is needed (such as itemize immediately after proof? Apr 29, 2013 at 7:01
  • @capsensitive: Indeeed. But in a normal case (without a par or empty line) it should work. Apr 29, 2013 at 8:03
  • I see. That really is the perfect solution for me. Thanks. Apr 29, 2013 at 8:19
  • It's not a good suggestion to manually redefine an enviornment which is often the result of complicated package work...
    – einpoklum
    Jun 14, 2017 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .