As the title states I would like to interrupt and resume a block of equations that is inside a subequations
regime. My problem arises when the interrupting stuff shall contain equations on its own:
\documentclass{article}
\usepackage{amsmath}
\usepackage[colorlinks]{hyperref}
\begin{document}
\begin{subequations}\label{eq:master}%
\begin{align}%
a & = b \label{eq:master:ab}\\
c & = d \label{eq:master:cd}
\end{align}%
\end{subequations}%
%
Some stuff in between
\begin{equation}%
A = B\label{eq:helper}
\end{equation}
%
Resume here the subequations, i.e., continue with 1c:
\begin{subequations}%
\begin{align}%
e & = f \label{eq:master:ef}\\
g & = h \label{eq:master:gh}
\end{align}%
\end{subequations}%
Master~\eqref{eq:master}, consisting of~\eqref{eq:master:ab}, \eqref{eq:master:cd}, \eqref{eq:master:ef}, \eqref{eq:master:gh},
and helper~\eqref{eq:helper}.
\end{document}
I know how to manually fiddle with the counters, but that is not The LaTeX Way. I have seen something like that for enumerations utilizing the enumitem
package. How would an elegant solution look like, that let me write
\begin{subequations}[resume]%
\begin{align}%
e & = f \label{eq:master:ef}\\
g & = h \label{eq:master:gh}
\end{align}%
\end{subequations}%
Best Answer
Here is another method.
I explain: the
subequations
now admit an optional argument. The expected values areresume
,intermezzo
, or nothing. As soon as neitherresume
norintermezzo
is encountered, a new potential thread is initialized: continuation goes withresume
, putting stuff in-between can be anything and if it is again asubequations
block it has to be flaggedintermezzo
.The code takes into account that
hyperref
patchessubequations
.One caveat:
subequations
block playing in the rĂ´le of intermezzi can not be globally labeled: only the actual sub-equations may be.