Related (but not the same):
Align number from enumerate with equation
Displaying an equation in a list
Earlier today I asked a question about aligning equations in an enumerate
environment and got an answer that seemed to work for the example I gave, but it turns out I wasn't really specific enough for my problem.
I'm using align*
environments, often as the only part of a list item. (If you're wondering why I'm not using more words to introduce the align*
, these are mostly homework solutions where most of the work is algebra, etc.)
Here's my code and what it makes (above the middle line):
\begin{enumerate}
\item \begin{align*}
x^2 + y^2 &= x^2 + (iy)^2 \\
&= (x + iy) (x - iy)
\end{align*}
\item \begin{align*}
\frac{1}{n^2-4} &= \frac14 \frac{4}{(n-2)(n+2)} \\
&= \frac14 \left( \frac{1}{n-2}-\frac{1}{n+2} \right)
\end{align*}
\end{enumerate}
I'm trying to make the baseline of the first line of the align*
environment the same as the number's baseline—I want the first line of the align*
to have the same vertical position (centered horizontally in the same way) relative to its number as in the second half of my picture. (Side question: why is there so much space before the align*
starts?)
Best Answer
I had been using Philippe Goutet's solution posted here, but have fairly recently found a simpler solution of using the
aligned
environment with the optional[t]
alignment:which yields:
Notes:
showframe
package was used to show the page margins.Code:
If you want them horizontally centered as is the default with the
align
environment you could add an\hfill
on either side:Code: