13

How can I get an enumerate inside an align environment? I want something like this:

%...
\begin{enumerate}
\item test123
\begin{align*}
\item x^2 & \text{ bla}\\
\item x^3 & \text{ bla2}\\
\end{align*}
\end{enumerate}
%...

Is that possible?

David Carlisle
  • 757,742
Kevin
  • 131
  • 1
    Welcome to TeX.SE. Are you trying to number the equations, or enumerate individual align environments (which was just answered recently and the solution is to use aligned)? Perhaps a slightly expanded MWE would clarify things. Also, it is generally preferable to to have fully compilable examples as opposed to code snippets. – Peter Grill Feb 07 '12 at 18:13
  • I am trying to number the equations and also number some things outside the align environment. – Kevin Feb 07 '12 at 18:15
  • Note that numbering equations usually is not related to enumerated lists. For example, if there were 4 equations before this enumerated list, the equation numbering would start from 5. Is this what you want when you go into align? – Peter Grill Feb 07 '12 at 18:18
  • Have a look at the \intertext command that's part of the amsmath package (the same package that also defines the display-math environments align, gather, multline, split, aligned, and a few more). You won't be able to able to use an enumerate-style group in the argument of \intertext, but it may be what you really need. – Mico Feb 07 '12 at 18:28

2 Answers2

13

Apparently you can use an align inside an enumerate, as I discovered in this answer to a similar question. Just do something like this:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
 This is an align inside an enumerate.
 \begin{enumerate}
  \item First item.
  \begin{align*}
   f(x) &= x^2
  \intertext{\item Second item.}
   g(x) &= \int_0^\infty t^x x^{n - 1} \, dx
  \end{align*}
 \end{enumerate}
 After the list.
\end{document}

The first \item must be outside the alignment; all the others can be \intertext.

Ryan Reich
  • 37,958
  • I'll confess that I'm the one who downvoted your answer, by pure accident: I meant to upvote your answer instead! Unfortunately, I didn't notice the mistake until just now, and now the system tells me that I can't reverse my vote. Let me inquire as to what I can do to reverse this bad mistake. Please accept my apologies. – Mico Feb 07 '12 at 21:10
  • @StefanKottwitz and Ryan: thanks for these helpful hints; I've reversed my vote! Sorry for any hassles. – Mico Feb 07 '12 at 23:43
  • How can I \label item inside the \intertext command? – Qaher Feb 20 '19 at 14:16
2

you are using the unnumbered align*, the reason why it makes no real sense to use it inside an enumerate. Maybe this helps:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{enumerate}
\item test123
\item \hfill$ x^2 \text{ bla}$ \hfill\refstepcounter{equation}(\theequation)
\item \hfill$ x^3 \text{ bla2}$\hfill\refstepcounter{equation}(\theequation)
\item foo
\end{enumerate}

\end{document}

enter image description here