11

Let's assume we want to create one subequation including four aligned single equations. The first two single equations should be numbered as 1a and 1b while the third and fourth one should continue the numbering of the previous one, but with new equation number as 2a and 2b.


Minimum Working Example (MWE):

\documentclass{article}
\usepackage{amsmath}

\begin{document}
    \begin{subequations}
        \begin{align}
            1   &=  1\\
            2   &=  2\\
            3   &=  3\\% from here a new equation number should begin
            4   &=  4
        \end{align}
    \end{subequations}
\end{document}

Screenshot of the result:

Screenshot of the result


Questions:

  1. How can I automatically continue numbering of the previous equation numbers without cheating around by manually assigning numbers/tags?
  2. Would it be possible to increase the vertical space between the equation 1-pair and the equation 2-pair?
Dave
  • 3,758

1 Answers1

11

I could not find the duplicate, so here is my attempt:

\documentclass{article}
\usepackage{amsmath}
\newcommand\StepSubequations{
  \stepcounter{parentequation}
  \gdef\theparentequation{\arabic{parentequation}}
  \setcounter{equation}{0}
}
\begin{document}
    \begin{subequations}
        \begin{align}
            1   &=  1\\
            2   &=  2\\
            \StepSubequations
            3   &=  3\\% from here a new equation number should begin
            4   &=  4
        \end{align}
      \end{subequations}

      \begin{equation}
        \label{eq:1}
        a=b
      \end{equation}

\end{document}
daleif
  • 54,450
  • 1
    Approved your code. :-) – Sebastiano Apr 01 '19 at 12:29
  • 1
    Note that in egregs duplicated answer, \xdef is used, where I here use \gdef, so look out for differences. – daleif Apr 01 '19 at 12:33
  • @daleif: I think there is some little issue when using \documentclass{scrbook}: In scrbook all equation numbers will follow the format chapternumber.equationnumber, but your example does not include the chapternumber before equationnumber. Is there an option to fix that? – Dave Apr 01 '19 at 14:27
  • @Dave see if you can guess what to change in the definition of \StepSubequations, it is not that hard. Hint, you may want to add \thechapter somewhere. – daleif Apr 01 '19 at 14:39
  • @daleif: Unfortunately I don't get it. :-( I am very sorry for my bad coding skills. Maybe you can have a look at this one here: https://tex.stackexchange.com/questions/482595/subequations-how-to-continue-numbering-within-subequation-while-considering-scr – Dave Apr 01 '19 at 14:46