GeneralFixed position for an algorithm

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ninca
Posts: 1
Joined: Fri Aug 21, 2009 12:14 pm

Fixed position for an algorithm

Post by ninca »

Is there a possibility to specify a fixed position for an algorithm using the packages algorithmic and algorithm?


For example I have some text and want to place the algorithm directly below this text:

Code: Select all

\begin{algorithm}
\caption{xyz} \label{xyz}
\begin{algorithmic} [1]
\STATE do something
\end{algorithmic}
\end{algorithm}

The algorithm should also appear right above the next paragraph which refers to the algorithm.

Is there a possibility to specify the placement 'right here' instead of floating in the code?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Fixed position for an algorithm

Post by sommerfee »

Since the algorithm package uses the float package, the following should be possible:

Code: Select all

\begin{algorithm}[H] % [H] = place here!
\caption{xyz} \label{xyz}
\begin{algorithmic} [1]
\STATE do something
\end{algorithmic}
\end{algorithm}
Post Reply