方程子标签延续

方程子标签延续

这是

代码:

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

输出:

在此处输入图片描述

现在,数字递增,字母重新开始。我希望第二张幻灯片中的公式标签为 (11d)、(11e) 和 (11f)。如何实现?

答案1

对于一组子编号方程,使用单个{subequations}环境。为了避免环境错误嵌套,子方程 env 必须位于框架之外,但这没问题。

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

请注意使用\label\ref来引用整个方程组。

如果出现另一种情况,其中子方程必须跨框架但与普通方程共享框架,更丑陋的解决方案将涉及\setcounter跨环境进行子编号。假设你把\newcounter{subeqnsave}序言放进去。

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

对此的一些解释:柜台外面subequations就是equation它所说的,但是里面 subequations它实际上是子编号(字母编号)。这就是为什么前面\addtocountersubequations将主编号返回到上一个,而\setcounter里面的subequations调整字母值。

答案2

可以通过 来中断一系列子方程式,以\intertext插入一些文本。在下文中,align内嵌入了一个 2 行环境gather,因此所有行都已编号;aligned只会为该组生成一个方程式编号。

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}

示例代码的输出,幻灯片 1 示例代码的输出,幻灯片 2

(上面可能存在不必要的代码。在重新编码该subequations块之前,我只从问题的示例中删除了注释的材料。)

更新:

第一次尝试回答时,没有继续将编号添加到第二张幻灯片,而是重新开始。已进行以下更改以更正此问题,

  • savesubeqno添加了一个新的计数器;在中amsmath,两个级别使用相同的计数器,因此在环境关闭equation后无法检索其值。subequations

  • equation计数器减少了 1,因为它在第一张幻灯片上关闭显示屏时被步进。

  • 子方程的计数器是增加 1,因为起始值是新显示开始时的预期值。(参见示例开头设置为 10。)

答案3

这似乎是想要中断帧的情况。

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

在此处输入图片描述

相关内容