8

I am wondering how to split an algorithm across multiple beamer slides. The algorithm is created using package psuedocode. I tried using [allowframebreaks] but all that did was push my algorithm to the second slide. Here is my code:

\begin{frame}[allowframebreaks] 
    \frametitle{Online: Drost \etal}
    \begin{algorithm}[H]
        \begin{algorithmic}[1]
        \State Create a discrete pose space
        \State $S_r \gets$ randomly selected set of reference points
        \ForEach {$s_r \in S_R$}
            \State select $s_i$ at discrete distance and angle intervals
            \ForEach {$(s_r,s_i)$}
                \State compute $PPF(s_r,s_i)$
                \State Map to corresponding model pairs in hash table
                \State Compute poses between $(s_r,s_i)$ and all corresponding model pairs
                \State Increment poses in discrete pose space
            \EndFor
            \State $T \gets$ all poses with high votes
        \EndFor
        \State Cluster poses in $T$
        \State Compute a score for each cluster
        \State $C \gets$ all clusters with high score
        \ForEach $c_i \in C$
            \State Return average pose of all poses in $c$
        \EndFor     
    \end{algorithmic}
\end{algorithm}
7

You don't need to pack it in an algorithm environment, otherwise your idea works:

Frame 1

Frame 2

\documentclass{beamer}

\usepackage{algpseudocode}


\begin{document}
\begin{frame}[allowframebreaks] 
    \frametitle{Online: Drost}
    \begin{algorithmic}[1]
      \State Create a discrete pose space
      \State $S_r \gets$ randomly selected set of reference points
        \ForAll {$s_r \in S_R$}
            \State select $s_i$ at discrete distance and angle intervals
            \ForAll {$(s_r,s_i)$}
                \State compute $PPF(s_r,s_i)$
                \State Map to corresponding model pairs in hash table
                \State Compute poses between $(s_r,s_i)$ and all corresponding model pairs
                \State Increment poses in discrete pose space
            \EndFor
            \State $T \gets$ all poses with high votes
        \EndFor
        \State Cluster poses in $T$
        \State Compute a score for each cluster
        \State $C \gets$ all clusters with high score
        \ForAll $c_i \in C$
            \State Return average pose of all poses in $c$
        \EndFor     
    \end{algorithmic}
  \end{frame}

\end{document}
| 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.