重置 beamer 类中每一帧的脚注计数器

重置 beamer 类中每一帧的脚注计数器

我想将 beamer 类中每帧的脚注计数器重置(即更新)为 0(或 1)。这样脚注计数器在每个帧的开头都从 1 开始。

这是我的代码;

\documentclass{beamer}
\usetheme{Copenhagen}
\usecolortheme{beaver}

\usepackage[utf8]{inputenc}

%%% Footnotes
\makeatletter
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or
*\or **\or ***\or
\star\or\star\star\or\star\star\star\or
\dagger\or\dagger\dagger\or\dagger\dagger\dagger
\else\@ctrerr\fi}}

\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\makeatother
%\counterwithin*{footnote}{frame}

\begin{document}
%
\begin{frame}
\frametitle{A frame}
Today's digital economy is built on intricate chians of basic algorithms.
And I want to put a footnote here\footnote{This is a description of the word `here'} and there\footnote{This is another description. Note that the footnotemark is not the standard one. I altered it in preamble.}
\end{frame}

%
\begin{frame}
\frametitle{Another frame}
This is another frame.
And I want to put another footnote here\footnote{This is the third footnote of the entire document, but the first of this frame. So I want to denote the footnotemark as the first one instead of third one.}.
\end{frame}
\end{document}

我尝试过 \counterwithin*{footnote}{frame} 但没有成功,出现以下错误信息

! LaTeX Error: No counter 'frame' defined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.17 \counterwithin*{footnote}{frame}

? 

\makeatletter
\@addtoreset{footnote}{frame}
\makeatother

也不起作用。

你能帮助我吗?提前谢谢您。

答案1

有了它\AtBeginEnvironment,它就可以工作了,因此只需添加以下两行:

\AtBeginEnvironment{frame}{\setcounter{footnote}{0}}

在此处输入图片描述

相关内容