# subequations: How to continue numbering while considering scrbook numbering scheme?

The user daleif has posted a nice approach on how to increase equation numbers when using subequations.

Minimum Working Example (MWE):

\documentclass{scrbook}
\usepackage{amsmath}
\newcommand\StepSubequations{
\stepcounter{parentequation}
\gdef\theparentequation{\arabic{parentequation}}
\setcounter{equation}{0}
}

\begin{document}

First, some normal equation:

$$content...$$

And in following the subequations:

\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}

$$\label{eq:1} a=b$$

\end{document}


Screenshot of the result:

Description of the issue:

As you can see, scrbook uses a custom numbering scheme like chapternumber.equationnumber. With the counter modification from daleif this does not work unfortunately.

Is there an option available to consider the common scrbook numbering scheme in subequations as well?

In the upper example the subequation numbers should appear like:

0.2a, 0.2b, 0.3a and 0.3b to match the numbering scheme of scrbook.

You can always add \thechapter to the representation:

\documentclass{scrbook}
\usepackage{amsmath}

\newcommand\StepSubequations{
\stepcounter{parentequation}
\gdef\theparentequation{\thechapter.\arabic{parentequation}}
\setcounter{equation}{0}
}

\begin{document}

First, some normal equation:

$$content...$$

And in following the subequations:

\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}

$$\label{eq:1} a=b$$

\end{document}


As a comment to Ulrikes answer,

We can simply copy the normal formatting of the equation number and patch it to use parentequation

\documentclass{scrbook}
\usepackage{amsmath}

\usepackage{etoolbox}
\let\sillymacro\theequation % copy definition, then patch,
% \ERROR does not exist, so doc will not compile if patch fails
\patchcmd\sillymacro{equation}{parentequation}{\typeout{patched ok}}{\ERROR}

\newcommand\StepSubequations{
\stepcounter{parentequation}
% \gdef\theparentequation{\arabic{parentequation}}
\gdef\theparentequation{\sillymacro}%
\setcounter{equation}{0}
}

\begin{document}
...

• Thanks a lot for your hint! But what does this approach improve in detail? – Dave Apr 1 '19 at 19:16
• Say you are using a strange numbering, say it is not a dot as a separator, you do not have to remember how to format this strange formatting. Only requirement is that the copy needs to me made after the initial definition of theequation. – daleif Apr 1 '19 at 19:20