Possible Duplicate:
How to avoid splitting tables between sections
I did something like this:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{array}
\usepackage{eqparbox}
\usepackage[pdftex]{graphicx}
\pagestyle{headings}
\begin{document}
\begin{algorithm}
\begin{algorithmic}
algorithm goes here
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\begin{algorithmic}
algorithm goes here
\end{algorithmic}
\end{algorithm}
\section{test}
section contents.
\end{document}
When I render the PDF, the test section appears before the second algorithm, instead of after it. Isn't LaTeX supposed to render them in the above order?
algorithmnoralgorithmicis part of the LaTeX kernel or the standard classes. Please edit your question to add a complete example there (including the preamble), this spares us guessing the packages your are using. – Paŭlo Ebermann Nov 05 '11 at 20:41algorithmenvironment is a "floating" environment. The answers in the linked question about tables also apply to algorithms. – lockstep Nov 05 '11 at 21:27