[Tex/LaTex] Prevent line break before equation environment in enumerated list item

#enumerateequationsieeetran

Suppose I have something like

\begin{enumerate}
  \item 
    \begin{equation*} 
      some eq 
    \end{equation*}
  \item 
    \begin{IEEEeqnarray*}{l} 
      eq 1 \\ 
      eq 2 \\ 
      ... 
      eq n 
    \end{IEEEeqnarray*}
\end{enumerate}

how would one go about removing the resulting line break that occurs when the equation starts, for both single line and multi-lined equations, so that the equation and the item numbering are aligned together? I thought this would be a relatively common issue but I can't find another post related to it – preventing the line break when beginning an item in an enumerated list with a new environment.

Best Answer

Here are some alternative options for you:

enter image description here

\documentclass{IEEEtran}% http://ctan.org/pkg/ieeetran
\begin{document}
\begin{enumerate}
  \item First item
  \item
    \[
      f(x) = ax^2 + bx + c
    \]
  \item
    \begin{IEEEeqnarray*}{l} 
      f(x) \\ 
      ax^2 \\ 
      bx \\
      c
    \end{IEEEeqnarray*}
  \item Last item
\end{enumerate}
\begin{enumerate}
  \item First item
  \item $f(x) = ax^2 + bx + c$
  \item \hfill $f(x) = ax^2 + bx + c$ \hfill\mbox{}
  \item
    $\begin{array}[t]{@{}l@{}}
      f(x) \\ 
      ax^2 \\ 
      bx \\
      c
    \end{array}$
  \item \null\hfill
    $\begin{array}[t]{@{}l@{}}
      f(x) \\ 
      ax^2 \\ 
      bx \\
      c
    \end{array}$
    \hfill\null
  \item Last item
\end{enumerate}
\end{document}

If you wish to stretch the contents of the array, modify \arraystretch as discussed in Column padding in tables.