# Environments nested in Lists

I have a list with several items consisting solely of an align environment:

\begin{enumerate}
\item
\begin{align}
e^{\pi i} + 1 &= 0\\
1 + 1 &= 2
\end{align}
\end{enumerate}


By default, the environment begins on the line after the numbering. Other list environments with nested environments also prepend a line break automatically:

\begin{itemize}
\item
$e^{\pi i} + 1 = 0$
\end{itemize}


What is the best method to start the environment on the same line as the numbering?

-
Take a look at tex.stackexchange.com/q/9394 and the linked questions there. –  Philippe Goutet Feb 4 '12 at 21:35
Can you explain why you need the enumerate list without text but with aligned equations in each om them? I have a feeling you're looking for the wrong hammer to nail your problem. If the previous sentence doesn't make sense, can you give a real example of what the first two items in your output would look like. –  Marc van Dongen Feb 5 '12 at 1:41
@MarcvanDongen I purposefully kept the question general in case others have the same problem, but here: imgur.com/gwVj0. In this case, I'm writing "one-line" solutions to a math test, where each step is self-explanatory. It seems from Philippe's comment that I'm not the only one with this need. –  Allen Z. Feb 5 '12 at 2:13
@AllenZ. Thanks. That explains it. –  Marc van Dongen Feb 5 '12 at 2:16

## 3 Answers

If you don't need to number the equations (and this wouldn't make much sense anyway), then aligned is what you're looking for:

\begin{enumerate}
\item
\begin{aligned}[t] e^{\pi i} + 1 &= 0\\ 1 + 1 &= 2 \end{aligned}
\end{enumerate}


The environments aligned, alignedat and gathered can take an optional argument telling LaTeX what vertical alignment we want with respect to the context; it can be [t] or [b] (default is center alignment), similarly to tabular, array and minipage.

-
Neat. I didn't know about the [t] option for aligned. –  Ian Thompson Feb 4 '12 at 23:09
This is what I wanted, thanks. (tex.stackexchange.com/a/9640/11452 lists solutions that work with align and so allow numbering and \displaybreak, but it was too much effort in this case.) –  Allen Z. Feb 5 '12 at 1:53

I think you do not want really to put an equation into enumerate. What you want is to put equation number on left. Here is how:

\documentclass[leqno]{article}
\begin{document}
$$e^{\pi i} + 1 = 0$$
\end{document}


However, if you really, really want to use enumerate, try this:

\begin{enumerate}
\item\leavevmode\par\vspace*{-25pt}%
$e^{\pi i} + 1 = 0$
\end{enumerate}


-
I think the OP wants to be able to use an align to align multiple equations, so each group would be numbered. –  Peter Grill Feb 4 '12 at 20:32
Then he needs amsmath with leqno option. Anyway, using enumerate for numbering formulas is a bad idea: the spacing will be completely wrong. –  Boris Feb 4 '12 at 20:39
Sorry, that is not what I want; I oversimplified my question. I have multiple groups of equations, in this case solutions to numbered math problems. I actually don't care about numbering formulas, since I rarely reference previous ones. –  Allen Z. Feb 4 '12 at 21:41
ok, see the update –  Boris Feb 4 '12 at 22:59
Upvoted for the nice use of \leavevmode to keep it single-line. However, this technique was simply too fragile - I had to make adjustments since it was thrown off by adjusting the font size and even by merely loading the amsmath package (?!). It can be made slightly more robust by using em instead pt. –  Allen Z. Feb 5 '12 at 2:02

A simple method is to use an in-text equation, with \displaystyle if necessary.

\documentclass{article}
\begin{document}
\begin{itemize}
\item This item contains text.
\item $$\displaystyle \sum_{j=0}^\infty \frac{1}{j^2} = \frac{\pi^2}{6}.$$
\end{itemize}
\end{document}

-
I think the OP wants to be able to use an align to align multiple equations, not just one. –  Peter Grill Feb 4 '12 at 20:31
I took "One item in the enumerate environment consists solely of an equation environment" to imply that the other items contain text. –  Ian Thompson Feb 4 '12 at 20:35
Sorry for being unclear - I am typing a list of solutions to a math test. Several items are multi-line and use align. There are also several one-line items, but I still prefer [...] since \displaystyle clogs up the source. –  Allen Z. Feb 4 '12 at 21:18
*That should be $...$. –  Allen Z. Feb 4 '12 at 21:42