3

I'm trying to have an equation as the first line of one of my items in an enumerate environment.

Example:

\begin{enumerate}
  \item \[ x \]
\end{enumerate}

misaligned equation in enumerate

I want the $x$ to have the same baseline as the 1., but it's appearing lower. How can I make the two line up properly?

lockstep
  • 250,273
Sophie Alpert
  • 15,550
  • 9
  • 37
  • 37

1 Answers1

5
\documentclass[12pt]{article}

\begin{document}

\begin{enumerate}
  \item \parbox{\linewidth}{\vspace{-\abovedisplayskip}%
                \[ x \]}
  \item \hfill $ x $ \hfill~
\end{enumerate}

\end{document}

doesn't really make sense, from my point of view.

  • This actually works perfectly if you take out the \vspace to leave just \parbox{\linewidth}{\[ ... \]}. (I'm not sure why). – Sophie Alpert Jan 20 '11 at 21:40
  • @Ben Alpert: If you think of a \parbox as a self-contained paragraph-making environment (in effect, a mini page, though not a minipage), you will see that the displayed equation need not start a new line at the top of one. – Ryan Reich Jan 20 '11 at 22:19
  • This actually turned out not to work as well as I thought it did; see http://tex.stackexchange.com/questions/9394/vertical-alignment-of-align-in-enumerate. – Sophie Alpert Jan 21 '11 at 03:44
  • I assume the hfill for the second \item was to show the horizontal placement of the x, in which case \item ~\hfill $ x $ \hfill~ is slightly better. Not a big deal, but I was initially confused as to why the two x were not horizontally aligned. – Peter Grill Feb 07 '13 at 23:05