2

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}
  • 1
    In the concrete code from the MWE, adding \renewcommand{\topfraction}{0.45} (the class sets \topfraction to 0.9) in the preamble solves the problem, but could have undesired side effects. Why the algorithms disappear is a mystery to me. – Gonzalo Medina Jul 3 '13 at 2:56
  • This post can help:tex.stackexchange.com/questions/48790/… – user33333 Jul 7 '13 at 10:30
  • 4
    I'm voting to close this question as off-topic because the problem can no longer be reproduced. A package update fixed any issues related to this question. – Werner Jul 2 '16 at 4:01
0

As of today with

  • pdfTeX, Version 3.14159265-2.6-1.40.16
  • LaTeX2e <2016/02/01>
  • sigplanconf 2013/07/02 v2.8
  • algorithm2e v5.1

all four algorithms appear. Algorithm2e was updated recently.

Not the answer you're looking for? Browse other questions tagged or ask your own question.