2

I work for a physics professor using revtex4 (just 4, not 4-1 or 4-2). I am using the amsmath package. I have been using

\renewcommand{\thesection}{\arabic{section}}
\numberwithin{equation}{section}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

with great success to obtain equation numbers that have the form secnum.eqnum such as 1.1, 1.2, 1.3, 2.1, 2.2, 2.3, etc. Now my professor wants to create text like this:

Here are three elements:

(1) some text
(2) some more text
(3) even more text, which now must meet the following criteria:
  (i) Descriptor
      a+b=c (sample equation, which he wants numbered like this:) (5.1a)
  (ii) Second descriptor
      d+e=f (second equation, which he wants numbered like this:) (5.1b)
  (iii) Third descriptor
      g+h=i (5.1c)
  (iv) Fourth descriptor. Followed by lots more text and then the final equation:
      j+k=l (5.1d)

This appears to be the end of what I would have created in a nested enumerate environment.
His paragraph then continues, with the next equation numbered like so:

m+n=o (5.2)

So, I have two questions:

  1. Is the right approach to do the following:
Here are three elements:
\begin{enumerate}
    \item some text
    \item some more text
    \item even more text, which now must meet the following criteria:
    \begin{enumerate}
      \item Descriptor
(some magical code here that will produce the equation I need numbered 5.1a)
      \item Second descriptor
(some more magical code that will produce the second equation numbered 5.1b)
      \item Third descriptor
(yet even more magical code that will produce the third equation numbered 5.1c)
      \item Fourth descriptor. Followed by lots more text and then the final equation:
(which will have more magical code that will produce a number of 5.1d)
    \end{enumerate}
  \end{enumerate}
Continue with text until he wants his next equation
\begin{equation}
  m+n=0 \label{eq:5.2}
\end{equation}

...or am I completely off-base already?

and my second question:

  1. What is the magical coding I need to accomplish this?

1 Answer 1

1

There is nothing magical about the output. Here are some clues:

  • Use enumitem which allows you to add an optional argument to your enumerate environment where you specify the label={(\arabic*)} for the first level and label={(\roman*)} for the second level;

  • Use the subequations environment around the inner/nested enumerate to ensure the equations have a sub-numbering style.

  • Note: declare the equation numbering to include \thesection rather than an explicit \arabic{section}, since this defines it hierarchically. If \thesection changes, it automatically changes in \theequation as well, rather than you having to change it in two places.

enter image description here

\documentclass{revtex4}

\usepackage{amsmath}
\usepackage{enumitem}

\renewcommand{\thesection}{\arabic{section}}
\numberwithin{equation}{section}
\renewcommand{\theequation}{\thesection.\arabic{equation}}

\begin{document}

\setcounter{section}{4}
\section{A section}

Here are three elements:
\begin{enumerate}[label={(\arabic*)}]
  \item some text
  \item some more text
  \item even more text, which now must meet the following criteria:
  \begin{subequations}
    \begin{enumerate}[label=(\roman*)]
      \item Descriptor
      \begin{equation}
        f(x) = ax^2 + bx + c
      \end{equation}
      \item Second descriptor
      \begin{equation}
        g(x) = ax^2 + bx + c
      \end{equation}
      \item Third descriptor
      \begin{equation}
        h(x) = ax^2 + bx + c
      \end{equation}
      \item Fourth descriptor. Followed by lots more text and then the final equation:
      \begin{equation}
        i(x) = ax^2 + bx + c
      \end{equation}
    \end{enumerate}
  \end{subequations}
\end{enumerate}
Continue with text until he wants his next equation
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}

\end{document}
3
  • Werner, thank you so very much! Your advice worked perfectly and it was easy to replicate.
    – dlceder
    Mar 6, 2021 at 2:48
  • @dlceder: If this answered your question, consider accepting it as such. See How do you accept an answer?
    – Werner
    Mar 6, 2021 at 3:38
  • My sincere apologies! I am a total newbie to this forum. But, I have to say that if they actually need a thread on How do you accept an answer, the method for doing so is far from obvious.
    – dlceder
    Mar 8, 2021 at 16:37

You must log in to answer this question.

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