在 Beamer 中保持几帧的子部分计数器相同

在 Beamer 中保持几帧的子部分计数器相同

我有几个帧在背景中显示相同的图片,但每帧都会在其上添加更多图片。在每个新帧,子部分计数器都会增加一个点。是否可以保留与前一帧相同的“点”?也就是说,几乎忽略计数器中的新帧?

我已尝试过\addtocounter{subsection}{-1}但这只是删除了开口圆的总数。

任何帮助都将不胜感激。谢谢。

\documentclass[xcolor=dvipsnames]{beamer} 
\usetheme{Darmstadt}
\usepackage{helvet}
\usecolortheme{dove}

\setbeamertemplate{items}[default] 
\setbeamertemplate{blocks}[rounded][shadow=true] 
\setbeamertemplate{frametitle}{% 
  \nointerlineskip% 
  \large\bfseries
  \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=0.75ex,left]{frametitle}% 
  \centering\insertframetitle% 
  \end{beamercolorbox}}

\usepackage{amsthm,amsmath,amsfonts} % AMSLaTeX packages
\usepackage{graphicx} % we want to use images

 % remove navigation control
\usenavigationsymbolstemplate{}
\setbeamertemplate{footline} {%
  \leavevmode%
  \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshortinstitute \hfill \insertframenumber/\inserttotalframenumber
  \end{beamercolorbox}}%
  \vskip0pt%
}


\usepackage{tree-dvips,graphicx,color,qtree,apacite,algorithm,algorithmic,multirow,tipa,vowel}

\newcommand{\subscript}[1]{{\textnormal{\scriptsize{#1}}}}  % for writing subscript text

\usepackage{textcomp}
\usepackage{setspace}
\usepackage{natbib}

%\renewcommand{\bibfont}{\tiny}


% TITLE
\title{ASDF}
\date{\today}

% BODY
\begin{document}

\begin{frame}
\setcounter{framenumber}{0}
\titlepage
\end{frame}

\section{Introduction}
\setcounter{subsection}{1}
\begin{frame}
\frametitle{SLIDE 1}
\end{frame}

** COMMENT: here is were I would like both frames below to show the same closed circle in the header denoting the same subsection. the problem is that a new frame fills a new circle denoting subsection.

\begin{frame}
\frametitle{SLIDE 2}
\hspace*{-0.45cm}\includegraphics[scale=0.46]{A.PDF}
\end{frame}

\begin{frame}[noframenumbering]
\frametitle{SLIDE 2}
\hspace*{-0.45cm}\includegraphics[scale=0.46]{B.pdf}
\end{frame}

\end{document}

答案1

根据描述,您可能对叠加层感兴趣,因此,您将拥有一个带有两张幻灯片的框架,而不是两个单独的框架:每张幻灯片包含其中一张图片;内容如下:

\begin{frame}
\frametitle{SLIDE 2}
\only<1>{\hspace*{-0.45cm}\includegraphics[scale=0.46]{example-image-a}}
\only<2>{\hspace*{-0.45cm}\includegraphics[scale=0.46]{example-image-b}}
\end{frame}

完整的例子(我删除了原始代码中与问题无关的部分):

\documentclass[xcolor=dvipsnames]{beamer} 
\usetheme{Darmstadt}
\usecolortheme{dove}

\setbeamertemplate{items}[default] 
\setbeamertemplate{blocks}[rounded][shadow=true] 
\setbeamertemplate{frametitle}{% 
  \nointerlineskip% 
  \large\bfseries
  \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,dp=0.75ex,left]{frametitle}% 
  \centering\insertframetitle% 
  \end{beamercolorbox}}


 % remove navigation control
\usenavigationsymbolstemplate{}
\setbeamertemplate{footline} {%
  \leavevmode%
  \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshortinstitute \hfill \insertframenumber/\inserttotalframenumber
  \end{beamercolorbox}}%
  \vskip0pt%
}

\begin{document}

\section{Introduction}
\setcounter{subsection}{1}

\begin{frame}
\frametitle{SLIDE 1}
\end{frame}

\begin{frame}
\frametitle{SLIDE 2}
\only<1>{\hspace*{-0.45cm}\includegraphics[scale=0.46]{example-image-a}}
\only<2>{\hspace*{-0.45cm}\includegraphics[scale=0.46]{example-image-b}}
\end{frame}

\end{document}

结果:

在此处输入图片描述

相关内容