I am rewriting a paper, and stumble over this problem where algorithms are missing in my appendix. I was able to reproduce the problem.
The following code only display 2 out of the 4 algorithms on the first page, then the figure, then nothing else. If I shorten the algorithms, all 4 appear on the first page. But I cannot in reality shorten my algorithms. You can find the style file sigplanconf.cls here.
Why does it disappear?
\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}
\renewcommand{\topfraction}{0.45}
(the class sets\topfraction
to0.9
) in the preamble solves the problem, but could have undesired side effects. Why the algorithms disappear is a mystery to me.