跨多张幻灯片的分割算法

跨多张幻灯片的分割算法

我想知道如何将算法拆分到多个投影仪幻灯片中。该算法是使用 psuedocode 包创建的。我尝试使用 [allowframebreaks],但这样做只会将我的算法推送到第二张幻灯片。这是我的代码:

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

答案1

您不需要将其打包在algorithm环境中,否则您的想法是可行的:

第 1 帧

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

相关内容