# Annoying space before the first item in an enumeration which starts a theorem

Consider the following example:

\documentclass{article}
\newtheorem{Theorem}{Theorem}
\begin{document}
\begin{Theorem}
On the other hand, this one has only one claim.
\end{Theorem}
\begin{Theorem}
\begin{enumerate}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\end{document}


Typesetting it results in:

Notice there is extra horizontal space before the first item in the list of the second theorem.

Is there a sensible way to get rid of that?

Ideally, the solution would work with amsthm, thmtools, enumitem.

N.B.: this is related to Is it possible to skip the first line in a theorem environment? but not quite the same.

• @Martin: the plus signs meant something different than your commas :) – Mariano Suárez-Álvarez May 5 '11 at 9:22
• Sorry, I didn't saw that. The main edit was the formatting of the package name with back-ticks . Feel free to put the +s back in. – Martin Scharrer May 5 '11 at 9:24

Two variants of a solution using the enumitem package. In the first case, two enumerate environments were used; the first one uses leftamargin=* to suppress the undesired horizontal space; the second enumerate uses resume to keep the numbering but preserves the standard value for \leftmargin; the vertical spacing between the two environments was also corrected. In the second case, the option leftmargin=* was also used, but this time only one enumerate environment was used so the horizontal space will be removed for all the items.

\documentclass{article}
\usepackage{enumitem}

\newtheorem{Theorem}{Theorem}

\begin{document}

\begin{Theorem}
On the other hand, this one has only one claim.
\end{Theorem}

\begin{Theorem}
\begin{enumerate}[leftmargin=*]
\item First claim
\end{enumerate}\vspace*{-2\partopsep}
\begin{enumerate}[resume]
\item Second claim
\end{enumerate}
\end{Theorem}

\begin{Theorem}
On the other hand, this one has only one claim.
\end{Theorem}

\begin{Theorem}
\begin{enumerate}[leftmargin=*]
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}

\end{document}


The result:

You can use a \@labels trick (as in Phil Hirschhorn's answer to “Avoiding a line break at the beginning of an enumerate”). Here's the result:

There are two ways you can use this. The first is by manually putting a \thmenumhspace after \begin{enumerate} inside a theorem:

\documentclass{article}
%\usepackage{amsthm,enumitem,thmtools}% works with or without
\newtheorem{Theorem}{Theorem}
\makeatletter
\newlength{\@thlabel@width}%
\makeatother
\begin{document}
\begin{Theorem}
1. First claim 2. Second claim.
\end{Theorem}
\begin{Theorem}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\end{document}


With a little more work, this can be automated, hopefully without any side effects (this time, you need amsthm for it to work correctly):

\documentclass{article}
\usepackage{amsthm,enumitem,thmtools}% needs amsthm
\newtheorem{Theorem}{Theorem}
\makeatletter
\let\original@item\item
\newlength{\@thlabel@width}%
\newcommand{\RedefineItem}{%
\settowidth{\@thlabel@width}{\itshape1.}%
}
\let\original@Theorem\Theorem
\def\Theorem{
\@ifnextchar[{\Theorem@Opt}
{\Theorem@NoOpt}
}
\def\Theorem@Opt[#1]{%
\@ifnextchar\begin{\RedefineItem\original@Theorem[#1]}%
{\original@Theorem[#1]}%
}
\def\Theorem@NoOpt{%
\@ifnextchar\begin{\RedefineItem\original@Theorem}%
{\original@Theorem}%
}
\makeatother
\begin{document}
\begin{Theorem}
1. First claim. 2. Second claim.
\end{Theorem}
\begin{Theorem}
\begin{enumerate}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\begin{Theorem}
This one has two claims.
\begin{enumerate}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\begin{Theorem}[Title]
\begin{enumerate}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\begin{Theorem}[Title]
This one has two claims.
\begin{enumerate}
\item First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\end{document}

• From where comes the dimension -1em? To me it is not enough. How to determine the exactly value to use to have the same output as with no enumerate? – Sigur Apr 8 '15 at 17:52
• @Sigur: I've edited the answer; it should now have the exact right amount of space whatever the settings are. – Philippe Goutet Apr 10 '15 at 16:00
• I saw that you edited only the automated code. But I'm using the simplest one since I'm using it only once. I tried the same value as \baselineskip (in my case, 1.5em) and it looks right but I'm not sure. – Sigur Apr 10 '15 at 17:35
• @Sigur: I've also adapted the manual code. The exact value cannot be 1.5em: it depends on the leftmargin, labelsep, itemindent and the size of the enumerate label. – Philippe Goutet Apr 10 '15 at 19:37
• Nice! Since I'm using the label style (i) and so on in upright font, should I use \upshape(i) instead of \itshape1.? – Sigur Apr 10 '15 at 20:03

You can hack a bit the first \item as follows:

\documentclass{article}
\newtheorem{Theorem}{Theorem}
\newcommand*\fixitem {\item[]%
\refstepcounter{enumi}\hskip-\leftmargin\labelenumi\hskip\labelsep}
\begin{document}
\begin{Theorem}
On the other hand, this one has only one claim.
\end{Theorem}
\begin{Theorem}
\begin{enumerate}
\fixitem First claim
\item Second claim
\end{enumerate}
\end{Theorem}
\end{document}


and the result is:

I found this trick that might help:

\documentclass{article}
\newtheorem{Theorem}{Theorem}
\begin{document}
\begin{Theorem}
On the other hand, this one has only one claim.
\end{Theorem}
\begin{Theorem}
\mbox{}
\begin{itemize}
\item[(i)] item one.
\item[(ii)] item two.
\item[(iii)]  item three.
\end{itemize}
\end{Theorem}
\end{document}

• That is mentioned in the question I linked to, but does not do what I want because it starts a new line. I would like the list to start right beside the Theorem 2, but without the unnecessary space. – Mariano Suárez-Álvarez May 5 '11 at 9:41
• How is it unnessary? That is the default space between items in a list, that has nothing to do with theorems. If you whant to be able to configure this, see the enumitem package – daleif May 5 '11 at 9:43
• @daleif: well, I consider it unnecessary to add extra horizontal space between the end of the Theorem 2 text and the label of the first item in the list: it is inb that way that it is unnecessary! Also «see the enumitem package» does in no way help me... I have already seen it —I have been using for years now…— and I would not be asking if I knew how to achieve the effect I want to achieve. If you read the other answers, you'll notice that it is quite not a matter of using the please-mariano option to enumitem`, too. – Mariano Suárez-Álvarez May 5 '11 at 17:01
• @mariano ahh, then I misunderstood, I was thinking vertical – daleif May 5 '11 at 22:28