2

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}
2
  • Did you try with \usepackage{mathtools} and \SwapAboveDisplaySkip ?
    – GowriSaro
    Nov 17, 2022 at 4:40
  • No, I haven't try. How would you adapt the code to use it? I've never heard of that command
    – Peluche
    Nov 17, 2022 at 4:49

1 Answer 1

2

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}
1
  • 1
    Great! Thank you!!
    – Peluche
    Nov 17, 2022 at 14:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .