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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
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