2

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}
\usetheme{Boadilla}
\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
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\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
            \begin{equation}
            a = 1
            \end{equation}
        \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
            \begin{equation}
            a = 1
            \end{equation}
        \end{subequations}
    \end{frame}
\end{document}

Output:

enter image description here

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?

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

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}
\usetheme{Boadilla}
\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
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\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
            \begin{equation}
            a = 1
            \end{equation}
    \end{frame}
    
    %-----------------------------------------------------------------New slide ----------------------------------------------------%
    \begin{frame}{Sample}
            Hi:
            \begin{align}
            a + b &= c\\
            d + e &= f
            \end{align}
            Hi
            \begin{equation}
            a = 1
            \end{equation}
            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}
  \addtocounter{equation}{-1}
  \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.

| improve this answer | |
  • 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 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 at 7:46
3

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]
\usetheme{Boadilla}
\usepackage{bm}
\definecolor{beamer@blendedblue}{RGB}{0,102,102} % changed this                 
\usefonttheme{professionalfonts} %To get the accents aligned correctly, albeit in Computer Modern Roman                                                        
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\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:
        \addtocounter{equation}{-1}
        \addtocounter{savesubeqno}{1}
        \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}

output of example code, slide 1 output of example code, slide 2

(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.)

| improve this answer | |
  • 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 at 3:41
  • 1
    @Superman -- I did miss that; sorry. The answer is updated to correct it. – barbara beeton Jun 12 at 18:31
1

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

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

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

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{frametitle continuation}[from second][]

\begin{document}

\begin{frame}[allowframebreaks,noframenumbering]
\frametitle{Sample}
\setcounter{equation}{10}

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

\pagebreak

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

Hi
\begin{equation}
  a = 1
\end{equation}

\end{frame}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.