Document ClassesCaption numbering of Algorithm in beamer

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
theprinceway
Posts: 2
Joined: Mon May 02, 2011 7:30 pm

Caption numbering of Algorithm in beamer

Post by theprinceway »

Hello. I am using

\usepackage[section]{algorithm}
\usepackage{algorithmic}

\begin{frame}[fragile]
\begin{algorithm}[H]
\begin{algorithmic}[1]
\uncover<1->{\STATE $A \gets B$}
\uncover<2->{\STATE $C \gets D$}
\uncover<3->{\STATE $E \gets E$}
\end{algorithmic}
\end{algorithm}

\end{frame}


for the above simple algorithm in beamer presentation, on scrolling through each step of algorithm the algorithm caption number also changes eg. In my case it changes as

Algorithm 4.1 at step 1
Algorithm 4.2 at step 2
Algorithm 4.3 at step 3 of algorithm.

How to disable such numbering while uncovering the steps in algorithm.

Thanking you,
Prince George

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

theprinceway
Posts: 2
Joined: Mon May 02, 2011 7:30 pm

Re: Caption numbering of Algorithm in beamer

Post by theprinceway »

put the following in the preamble

\resetcounteronoverlays{algorithm}
Post Reply