# Why does LaTeX mix up the order of my algorithms and other output? [duplicate]

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}

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

-

## migrated from stackoverflow.comNov 5 '11 at 21:09

This question came from our site for professional and enthusiast programmers.