2

When writing proofs, I frequently find it helpful to outline how I will go about proving before I actually prove it. Currently, I do so as shown in this MWE:

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
    Every square is a rectangle, but not all rectangles are squares.
\end{theorem}
\begin{proof}
\hfill
\begin{enumerate}[{We prove:}]
\item
\begin{enumerate}
\item
    all squares are rectangles and
\item
    not all rectangles are squares.
\end{enumerate}
\end{enumerate}
Proof here.
\end{proof}
\end{document}

Which gives the output:

MWE Output

Which is more or less what I want the result to look like. However, this has the problem of ``eating'' two of my four list nestings, meaning I can only nest this twice (for long, involved proofs I have had to nest three outlines in the past, and I do not see it as out of the question that one day I shall desire to use four).

I have attempted to get around this with tabular but you cannot put the enumerate environment inside of tabular (to my knowledge), and I'm not really sure how else to go about it. Any suggestions?

Edit: the main problem I have with my current ``solution" is that the code is incredibly ugly in my opinion, in addition to the problem of nesting limitations. For this reason, I would like a solution that avoids nesting lists, although if that's the only workaround, I will certainly make do.

7
  • There is an putlines package, but it only goes 4 levels. Commented Feb 17, 2015 at 4:23
  • Why do you nest them in the first place? Why not just bring the Proof here bit out of the list environment?
    – cfr
    Commented Feb 17, 2015 at 13:51
  • not necessarily relevant to the question, but recommended with amsthm: to go to a new line when proof starts with a list, use \leavevmode'; to place the qed box at the end of the last line (and avoid the possibility that it can be pushed over to a new page, all by itself), insert \qedhere` before \end{enumerate}. Commented Feb 17, 2015 at 15:16
  • @cfr, That was a mistake, I brought the proof here bit out, but that doesn't change the problem with nesting lists when I'm making my outline. @barbarabeeton: I know about \qedhere, but as it is an MWE I decided to omit it. I am not familiar with leavevmode though, what advantage does that provide over \hfill? Commented Feb 17, 2015 at 19:03
  • @AbeSchulte -- actually, almost anything that causes tex to enter horizontal mode will (usually) work. the tricky cases are when a theorem has a long optional heading and it's just long enough to reach the right margin. there may not be room for more space to be added, so an extra blank line, or an improvident break in the heading might occur. \leavevmode doesn't add anything to the line that will change the current position. it just changes the mode so that \begin{<list>} will be able to make the desired transition. Commented Feb 17, 2015 at 20:37

2 Answers 2

2

enumitem allows you to create enumerated environments with greater depth (up to 10 at least, I think):

5 levels

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\newlist{myenum}{enumerate}{5}
\setlist[myenum]{label=\arabic*}
\begin{document}
  \begin{myenum}
    \item level 1
    \begin{myenum}
      \item level 2
      \begin{myenum}
        \item level 3
        \begin{myenum}
          \item level 4
          \begin{myenum}
            \item level 5
          \end{myenum}
        \end{myenum}
      \end{myenum}
    \end{myenum}
  \end{myenum}
\end{document}
1
  • Please see my edit (this is why I upvoted your answer but did not accept it). Commented Feb 17, 2015 at 7:40
0

If you just want to have some nicer looking code, define a new environment:

\documentclass{article}
\usepackage[shortlabels]{enumitem}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newenvironment{proofoutline}[1]
{\begin{enumerate}[{#1}]\item\begin{enumerate}}
{\end{enumerate}\end{enumerate}\par\noindent}

\begin{document}
\begin{theorem}
  Every square is a rectangle, but not all rectangles are squares.
\end{theorem}
\begin{proof}
  \hfill
    \begin{proofoutline}{We prove:}  
      \item
        all squares are rectangles and
      \item
        not all rectangles are squares.
    \end{proofoutline}
  Proof goes here
  \end{proof}
\end{document}
2
  • I currently am doing that, however, I still feel that this being LaTeX, there must be a more elegant solution than that. That being said, I (obviously) don't have such a solution available. Commented Feb 17, 2015 at 19:04
  • What do you mean with not elegant? Using enumerate to indent the listing and to set the short phrase? Commented Feb 18, 2015 at 0:09

You must log in to answer this question.

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