# Equation sublabel continuation

This is a followup to this.

Code:

\documentclass[12pt]{beamer}
\usepackage{amsmath}
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper,landscape]
%\pgfpagesuselayout{2 on 1}[a4paper]
%\usetheme{Singapore}
\usepackage{bm}
%\usefonttheme[?options?]{structuresmallcapsserif}
%\definecolor{beamer@blendedblue}{RGB}{203,140,55} % changed this
\definecolor{beamer@blendedblue}{RGB}{0,102,102} % changed this
%\definecolor{beamer@blendedblue}{RGB}{0,153,153} % changed this
\usefonttheme{professionalfonts} %To get the accents aligned correctly, albeit in Computer Modern Roman
\begin{document}
%-----------------------------------------------------------------New slide ----------------------------------------------------%
\begin{frame}{Sample}
\setcounter{equation}{10}
\begin{subequations}%\label{freeze}
Hi:
\begin{align}
a + b &= c\\
d + e &= f
\end{align}
Hi
$$a = 1$$
\end{subequations}
\end{frame}

%-----------------------------------------------------------------New slide ----------------------------------------------------%
\begin{frame}{Sample}
\begin{subequations}%\label{freeze}
Hi:
\begin{align}
a + b &= c\\
d + e &= f
\end{align}
Hi
$$a = 1$$
\end{subequations}
\end{frame}
\end{document}

Output:

Right now, the number increments and the letters start over. I want the equation labels in the second slide to be (11d), (11e), and (11f). How to do this?

• The easiest way is to stay within the same subequations group and use \intertext. – barbara beeton Jun 11 '20 at 23:59
• Hmm can you post a solution? – Superman Jun 12 '20 at 1:03

For a single set of sub-numbered equations, use a single {subequations} environment. To avoid mis-nesting of environments the subequations env must be outside the frames, but that's fine.

\documentclass[12pt]{beamer}
\usepackage{amsmath}
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper,landscape]
%\pgfpagesuselayout{2 on 1}[a4paper]
%\usetheme{Singapore}
\usepackage{bm}
%\usefonttheme[?options?]{structuresmallcapsserif}
%\definecolor{beamer@blendedblue}{RGB}{203,140,55} % changed this
\definecolor{beamer@blendedblue}{RGB}{0,102,102} % changed this
%\definecolor{beamer@blendedblue}{RGB}{0,153,153} % changed this
\usefonttheme{professionalfonts} %To get the accents aligned correctly, albeit in Computer Modern Roman
\begin{document}
%-----------------------------------------------------------------New slide ----------------------------------------------------%
\setcounter{equation}{10}
\begin{subequations}\label{freeze}
\begin{frame}{Sample}
Hi:
\begin{align}
a + b &= c\\
d + e &= f
\end{align}
Hi
$$a = 1$$
\end{frame}

%-----------------------------------------------------------------New slide ----------------------------------------------------%
\begin{frame}{Sample}
Hi:
\begin{align}
a + b &= c\\
d + e &= f
\end{align}
Hi
$$a = 1$$
The set of equations \ref{freeze} spans multiple frames.
\end{frame}
\end{subequations}
\end{document}

Note the use of \label and \ref for referring to the whole set of equations.

If another case arises where subequations must span frames but share the frame with ordinary equations, an uglier solution would involve \setcounter to carry sub-numbering across environments. Assume you put \newcounter{subeqnsave} in the preamble.

\begin{frame}{sample}
\begin{subequations}
...
\setcounter{subeqnsave}{\value{equation}}% or other...
% method of saving a counter value; (not \label though)
\end{subequations}
\end{frame}
%----------------------------------
\begin{frame}{sample}
\begin{subequations}
\setcounter{equation}{\value{subeqnsave}}
...
\end{subequations}
... another equation ...
\end{frame}

Some explanation of that: Outside subequations the equation counter is just what it says, but inside subequations it is actually the sub-number (number of letter). That's why the \addtocounter before subequations returns the main numbering to the previous, whereas the \setcounter inside subequations adjusts the letter value.

• Nice solution! On a side note, let’s suppose that I want a=1 in the second slide to be 12. How do I stop the subequations labeling mid-frame? – Superman Jun 12 '20 at 3:45
• @Superman it gets messy then. Since you can't interleave environments, you are probably stuck using two separate {subequations}, with \setcounter thrown in. Can't format it in a comment, so I'll append it to my answer. – Donald Arseneau Jun 12 '20 at 7:46

A series of subequations can be interrupted by \intertext to insert some text. In the following, a 2-line align environment is embedded within gather, so that all lines are numbered; aligned would produce only a single equation number for the group.

documentclass[12pt]{beamer}
\usepackage{amsmath}
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usepackage{bm}
\definecolor{beamer@blendedblue}{RGB}{0,102,102} % changed this
\usefonttheme{professionalfonts} %To get the accents aligned correctly, albeit in Computer Modern Roman
\newcounter{savesubeqno}
\begin{document}
%-----------------------------------------------------------------New slide----------------------------------------------------%
\begin{frame}{Sample}
\setcounter{equation}{10}
\begin{subequations}%\label{freeze}
Hi:
\begin{gather}
\begin{align}
a + b &= c\\
d + e &= f
\end{align}\\
\intertext{Hi}
a = 1
\setcounter{savesubeqno}{\arabic{equation}}
\end{gather}
\end{subequations}
\end{frame}

%-----------------------------------------------------------------New slide----------------------------------------------------%
\begin{frame}{Sample}
Hi:
\begin{subequations}
\begin{gather}
\begin{align}
a + b &= c\\
d + e &= f
\end{align}\\
\intertext{Hi}
a = 1
\end{gather}
\end{subequations}
\end{frame}
\end{document}

(It's likely that there is unnecessary code in the above. I removed only the commented material from the example in the question before recoding the subequations block.)

Update:

The first try at a response didn't continue the numbering onto the second slide, but restarted it. These changes have been made to correct it,

• A new counter, savesubeqno, is added; in amsmath, the same equation counter is used for both levels, so its value isn't retrievable after the subequations environment is closed.

• The main equation counter is decreased by 1 because it was stepped when the display was closed on the first slide.

• The counter for the subequations is increased by 1 because the starting value is what is expected at the beginning of a new display. (Cf. the setting to 10 at the beginning of the example.)

• The second slide that you posted is the same as mine. You didn’t answer my question on how to make the labels 11d, 11e, and 11f for the second slide. – Superman Jun 12 '20 at 3:41
• @Superman -- I did miss that; sorry. The answer is updated to correct it. – barbara beeton Jun 12 '20 at 18:31

This seems to be a situation where you want a frame break.

\documentclass[12pt]{beamer}
%\usepackage{amsmath}
\usepackage{bm}

\definecolor{beamer@blendedblue}{RGB}{0,102,102} % changed this
\usefonttheme{professionalfonts}

\setbeamertemplate{frametitle continuation}[from second][]

\begin{document}

\frametitle{Sample}
\setcounter{equation}{10}

\begin{subequations}
Hi
\begin{align}
a + b &= c\\
d + e &= f
\end{align}
Hi
$$a = 1$$

\pagebreak

\begin{align}
a + b &= c\\
d + e &= f
\end{align}
\end{subequations}

Hi
$$a = 1$$

\end{frame}
\end{document}