sigplanconf algorithm2e 缺少算法时图

sigplanconf algorithm2e 缺少算法时图

我正在重写一篇论文,偶然发现了这个问题,我的附录中缺少算法。我能够重现这个问题。

以下代码在第一页仅显示 4 个算法中的 2 个,然后显示图片,然后不显示其他内容。如果我缩短算法,则所有 4 个算法都会出现在第一页。但实际上我无法缩短我的算法。您可以找到样式文件sigplanconf.cls 在这里

它为何会消失?

\documentclass[preprint,10pt,nocopyrightspace,letter]{sigplanconf}
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{mathabx}
\usepackage[demo]{graphicx}
%\usepackage{graphicx}
\usepackage[plain,noend,noline,boxed]{algorithm2e} 
\begin{document}

\begin{algorithm}
\SetAlgoNoLine

\KwData{The data} \KwResult{The result}
\BlankLine
initialize \;
\ForEach{s $\in$ g} {
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
}
\caption{CodeGeneration}
\end{algorithm}


\begin{algorithm}
\SetAlgoNoLine
\KwData{The data} \KwResult{The result}
\BlankLine
initialize \;
\ForEach{s $\in$ g} {
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
}
\caption{Other code generation}
\end{algorithm}

\begin{algorithm}
\SetAlgoNoLine

\KwData{The data} \KwResult{The result}
\BlankLine

initialize \;
\ForEach{s $\in$ g} {
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;
   Do something \;

}
\caption{Last code generation}
\end{algorithm}

\begin{algorithm}
\SetAlgoNoLine
\caption{RuleTest}
\end{algorithm}

\begin{figure*}[ptbh]
\centering
\includegraphics[width=\textwidth,height=10cm]{a}
\caption{Additional screen shot }
\end{figure*}
\end{document}

答案1

从今天起

  • pdfTeX,版本 3.14159265-2.6-1.40.16
  • LaTeX2e <2016/02/01>
  • sigplanconf 2013/07/02 v2.8
  • 算法2e v5.1

四种算法均出现。Algorithm2e 最近已更新。

相关内容