Numbered equation inside enumerate environment aligned with its item label

#enumeratealignmentamsmathmath-modevertical alignment

This is what I have:

enter image description here

and this is what I need (ignore the difference related to horizontal space in this picture):
enter image description here

That is, a numbered equation inside an enumerate environment and aligned with it's item label.

Some of my code is this:

\documentclass[11pt, oneside]{book}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\begin{document}

\begin{enumerate}
        \item \begin{gather}
            f^{(n)}(z_0) = \frac{n!}{2\pi i} \oint_C 
            \frac{f(z)dz}{(z - z_0)^{(n+1)}}
        \end{gather} 
    \end{enumerate}

\end{document}

Best Answer

I suggest you (a) use inline math mode instead of a displayed equation environment and (b) place the equation number "by hand" at the right hand edge of the text block. If you need to typeset a multi-row equation in this manner, encase it either in \begin{aligned}[t] and \end{aligned} or in \begin{gathered} and \end{gathered}`.

The resulting equation can be cross-referenced using the usual \label-\ref (or \eqref) mechanism.

enter image description here

Remark: The frame lines at the edges of the text block are drawn because the showframe package is loaded.

\documentclass[11pt]{book}

\usepackage{amsmath}
\usepackage{showframe}  % place framebox around textblock
\newcommand\puteqnum{%    handy shortcut macro
  \refstepcounter{equation}\textup{(\theequation)}}

\begin{document}
\setcounter{chapter}{2} % just for this example
\setcounter{equation}{7}

\null
\begin{enumerate}
\item \hfill % center the following material horizontally
      $\displaystyle    % <-- don't forget \displaystyle
            f^{(n)}(z_0) = \frac{n!}{2\pi i} \oint_C 
            \frac{f(z)\,dz}{(z - z_0)^{(n+1)}} $
      \hfill 
      \puteqnum \label{eq:oint} % place \label *after* \puteqnum
\end{enumerate}

A cross-reference to equation \eqref{eq:oint}.
\end{document}